From 3339277fcdcf9920d53f641ce367677c11f43032 Mon Sep 17 00:00:00 2001 From: Orual Date: Fri, 31 Oct 2025 12:49:30 -0400 Subject: [PATCH] brought the lexicons back in for generation --- Cargo.lock | 46 +- Cargo.toml | 2 +- crates/weaver-api/Cargo.toml | 35 + .../lexicons/app_bsky_actor_defs.json | 886 + .../app_bsky_actor_getPreferences.json | 29 + .../lexicons/app_bsky_actor_getProfile.json | 30 + .../lexicons/app_bsky_actor_getProfiles.json | 44 + .../app_bsky_actor_getSuggestions.json | 49 + .../lexicons/app_bsky_actor_profile.json | 74 + .../app_bsky_actor_putPreferences.json | 25 + .../lexicons/app_bsky_actor_searchActors.json | 53 + .../app_bsky_actor_searchActorsTypeahead.json | 47 + .../lexicons/app_bsky_actor_status.json | 47 + .../app_bsky_bookmark_createBookmark.json | 36 + .../lexicons/app_bsky_bookmark_defs.json | 46 + .../app_bsky_bookmark_deleteBookmark.json | 31 + .../app_bsky_bookmark_getBookmarks.json | 45 + .../lexicons/app_bsky_embed_defs.json | 24 + .../lexicons/app_bsky_embed_external.json | 82 + .../lexicons/app_bsky_embed_images.json | 91 + .../lexicons/app_bsky_embed_record.json | 160 + .../app_bsky_embed_recordWithMedia.json | 49 + .../lexicons/app_bsky_embed_video.json | 91 + .../lexicons/app_bsky_feed_defs.json | 543 + .../app_bsky_feed_describeFeedGenerator.json | 60 + .../lexicons/app_bsky_feed_generator.json | 72 + .../lexicons/app_bsky_feed_getActorFeeds.json | 52 + .../lexicons/app_bsky_feed_getActorLikes.json | 60 + .../lexicons/app_bsky_feed_getAuthorFeed.json | 76 + .../lexicons/app_bsky_feed_getFeed.json | 57 + .../app_bsky_feed_getFeedGenerator.json | 48 + .../app_bsky_feed_getFeedGenerators.json | 43 + .../app_bsky_feed_getFeedSkeleton.json | 63 + .../lexicons/app_bsky_feed_getLikes.json | 89 + .../lexicons/app_bsky_feed_getListFeed.json | 58 + .../lexicons/app_bsky_feed_getPostThread.json | 65 + .../lexicons/app_bsky_feed_getPosts.json | 45 + .../lexicons/app_bsky_feed_getQuotes.json | 67 + .../lexicons/app_bsky_feed_getRepostedBy.json | 67 + .../app_bsky_feed_getSuggestedFeeds.json | 45 + .../lexicons/app_bsky_feed_getTimeline.json | 49 + .../lexicons/app_bsky_feed_like.json | 32 + .../lexicons/app_bsky_feed_post.json | 144 + .../lexicons/app_bsky_feed_postgate.json | 54 + .../lexicons/app_bsky_feed_repost.json | 32 + .../lexicons/app_bsky_feed_searchPosts.json | 112 + .../app_bsky_feed_sendInteractions.json | 35 + .../lexicons/app_bsky_feed_threadgate.json | 80 + .../lexicons/app_bsky_graph_block.json | 29 + .../lexicons/app_bsky_graph_defs.json | 332 + .../lexicons/app_bsky_graph_follow.json | 32 + .../app_bsky_graph_getActorStarterPacks.json | 52 + .../lexicons/app_bsky_graph_getBlocks.json | 45 + .../lexicons/app_bsky_graph_getFollowers.json | 57 + .../lexicons/app_bsky_graph_getFollows.json | 57 + .../app_bsky_graph_getKnownFollowers.json | 57 + .../lexicons/app_bsky_graph_getList.json | 58 + .../app_bsky_graph_getListBlocks.json | 45 + .../lexicons/app_bsky_graph_getListMutes.json | 45 + .../lexicons/app_bsky_graph_getLists.json | 64 + ...app_bsky_graph_getListsWithMembership.json | 81 + .../lexicons/app_bsky_graph_getMutes.json | 45 + .../app_bsky_graph_getRelationships.json | 63 + .../app_bsky_graph_getStarterPack.json | 38 + .../app_bsky_graph_getStarterPacks.json | 44 + ...y_graph_getStarterPacksWithMembership.json | 70 + ...bsky_graph_getSuggestedFollowsByActor.json | 49 + .../lexicons/app_bsky_graph_list.json | 62 + .../lexicons/app_bsky_graph_listblock.json | 29 + .../lexicons/app_bsky_graph_listitem.json | 35 + .../lexicons/app_bsky_graph_muteActor.json | 25 + .../app_bsky_graph_muteActorList.json | 25 + .../lexicons/app_bsky_graph_muteThread.json | 25 + .../app_bsky_graph_searchStarterPacks.json | 52 + .../lexicons/app_bsky_graph_starterpack.json | 69 + .../lexicons/app_bsky_graph_unmuteActor.json | 25 + .../app_bsky_graph_unmuteActorList.json | 25 + .../lexicons/app_bsky_graph_unmuteThread.json | 25 + .../lexicons/app_bsky_graph_verification.json | 41 + .../lexicons/app_bsky_labeler_defs.json | 152 + .../app_bsky_labeler_getServices.json | 50 + .../lexicons/app_bsky_labeler_service.json | 58 + .../app_bsky_notification_declaration.json | 28 + .../lexicons/app_bsky_notification_defs.json | 172 + .../app_bsky_notification_getPreferences.json | 29 + .../app_bsky_notification_getUnreadCount.json | 36 + ...otification_listActivitySubscriptions.json | 45 + ...p_bsky_notification_listNotifications.json | 132 + ..._notification_putActivitySubscription.json | 49 + .../app_bsky_notification_putPreferences.json | 24 + ...pp_bsky_notification_putPreferencesV2.json | 85 + .../app_bsky_notification_registerPush.json | 46 + .../app_bsky_notification_unregisterPush.json | 42 + .../app_bsky_notification_updateSeen.json | 25 + .../lexicons/app_bsky_richtext_facet.json | 89 + .../lexicons/app_bsky_unspecced_defs.json | 283 + ...p_bsky_unspecced_getAgeAssuranceState.json | 17 + .../app_bsky_unspecced_getConfig.json | 48 + ...ed_getOnboardingSuggestedStarterPacks.json | 39 + ...boardingSuggestedStarterPacksSkeleton.json | 44 + ...ky_unspecced_getPopularFeedGenerators.json | 48 + ...p_bsky_unspecced_getPostThreadOtherV2.json | 71 + .../app_bsky_unspecced_getPostThreadV2.json | 112 + .../app_bsky_unspecced_getSuggestedFeeds.json | 39 + ...y_unspecced_getSuggestedFeedsSkeleton.json | 44 + ...ky_unspecced_getSuggestedStarterPacks.json | 39 + ...cced_getSuggestedStarterPacksSkeleton.json | 44 + .../app_bsky_unspecced_getSuggestedUsers.json | 43 + ...y_unspecced_getSuggestedUsersSkeleton.json | 48 + ...bsky_unspecced_getSuggestionsSkeleton.json | 64 + ...p_bsky_unspecced_getTaggedSuggestions.json | 56 + .../app_bsky_unspecced_getTrendingTopics.json | 52 + .../app_bsky_unspecced_getTrends.json | 39 + .../app_bsky_unspecced_getTrendsSkeleton.json | 44 + .../app_bsky_unspecced_initAgeAssurance.json | 53 + ...p_bsky_unspecced_searchActorsSkeleton.json | 71 + ...pp_bsky_unspecced_searchPostsSkeleton.json | 117 + ..._unspecced_searchStarterPacksSkeleton.json | 67 + .../lexicons/app_bsky_video_defs.json | 46 + .../lexicons/app_bsky_video_getJobStatus.json | 36 + .../app_bsky_video_getUploadLimits.json | 36 + .../lexicons/app_bsky_video_uploadVideo.json | 28 + .../lexicons/chat_bsky_actor_declaration.json | 27 + .../lexicons/chat_bsky_actor_defs.json | 55 + .../chat_bsky_actor_deleteAccount.json | 16 + .../chat_bsky_actor_exportAccountData.json | 12 + .../lexicons/chat_bsky_convo_acceptConvo.json | 35 + .../lexicons/chat_bsky_convo_addReaction.json | 65 + .../lexicons/chat_bsky_convo_defs.json | 444 + .../chat_bsky_convo_deleteMessageForSelf.json | 34 + .../lexicons/chat_bsky_convo_getConvo.json | 35 + .../chat_bsky_convo_getConvoAvailability.json | 45 + .../chat_bsky_convo_getConvoForMembers.json | 41 + .../lexicons/chat_bsky_convo_getLog.json | 50 + .../lexicons/chat_bsky_convo_getMessages.json | 53 + .../lexicons/chat_bsky_convo_leaveConvo.json | 41 + .../lexicons/chat_bsky_convo_listConvos.json | 57 + .../lexicons/chat_bsky_convo_muteConvo.json | 38 + .../chat_bsky_convo_removeReaction.json | 61 + .../lexicons/chat_bsky_convo_sendMessage.json | 35 + .../chat_bsky_convo_sendMessageBatch.json | 62 + .../lexicons/chat_bsky_convo_unmuteConvo.json | 38 + .../chat_bsky_convo_updateAllRead.json | 39 + .../lexicons/chat_bsky_convo_updateRead.json | 41 + ...chat_bsky_moderation_getActorMetadata.json | 69 + ...hat_bsky_moderation_getMessageContext.json | 53 + ...hat_bsky_moderation_updateActorAccess.json | 31 + .../lexicons/com_atproto_admin_defs.json | 131 + .../com_atproto_admin_deleteAccount.json | 25 + ...m_atproto_admin_disableAccountInvites.json | 29 + .../com_atproto_admin_disableInviteCodes.json | 30 + ...om_atproto_admin_enableAccountInvites.json | 29 + .../com_atproto_admin_getAccountInfo.json | 29 + .../com_atproto_admin_getAccountInfos.json | 43 + .../com_atproto_admin_getInviteCodes.json | 53 + .../com_atproto_admin_getSubjectStatus.json | 54 + .../com_atproto_admin_searchAccounts.json | 48 + .../lexicons/com_atproto_admin_sendEmail.json | 55 + .../com_atproto_admin_updateAccountEmail.json | 30 + ...com_atproto_admin_updateAccountHandle.json | 30 + ...m_atproto_admin_updateAccountPassword.json | 29 + ...atproto_admin_updateAccountSigningKey.json | 31 + ...com_atproto_admin_updateSubjectStatus.json | 60 + .../lexicons/com_atproto_identity_defs.json | 29 + ...identity_getRecommendedDidCredentials.json | 37 + .../com_atproto_identity_refreshIdentity.json | 46 + ...identity_requestPlcOperationSignature.json | 10 + .../com_atproto_identity_resolveDid.json | 48 + .../com_atproto_identity_resolveHandle.json | 44 + .../com_atproto_identity_resolveIdentity.json | 44 + ...com_atproto_identity_signPlcOperation.json | 55 + ...m_atproto_identity_submitPlcOperation.json | 24 + .../com_atproto_identity_updateHandle.json | 26 + .../lexicons/com_atproto_label_defs.json | 192 + .../com_atproto_label_queryLabels.json | 63 + .../com_atproto_label_subscribeLabels.json | 69 + .../lexicons/com_atproto_lexicon_schema.json | 23 + .../com_atproto_moderation_createReport.json | 103 + .../lexicons/com_atproto_moderation_defs.json | 95 + .../com_atproto_repo_applyWrites.json | 195 + .../com_atproto_repo_createRecord.json | 89 + .../lexicons/com_atproto_repo_defs.json | 23 + .../com_atproto_repo_deleteRecord.json | 65 + .../com_atproto_repo_describeRepo.json | 62 + .../lexicons/com_atproto_repo_getRecord.json | 68 + .../lexicons/com_atproto_repo_importRepo.json | 13 + .../com_atproto_repo_listMissingBlobs.json | 62 + .../com_atproto_repo_listRecords.json | 85 + .../lexicons/com_atproto_repo_putRecord.json | 97 + .../lexicons/com_atproto_repo_strongRef.json | 24 + .../lexicons/com_atproto_repo_uploadBlob.json | 27 + .../com_atproto_server_activateAccount.json | 10 + ...com_atproto_server_checkAccountStatus.json | 57 + .../com_atproto_server_confirmEmail.json | 42 + .../com_atproto_server_createAccount.json | 112 + .../com_atproto_server_createAppPassword.json | 64 + .../com_atproto_server_createInviteCode.json | 42 + .../com_atproto_server_createInviteCodes.json | 72 + .../com_atproto_server_createSession.json | 96 + .../com_atproto_server_deactivateAccount.json | 23 + .../lexicons/com_atproto_server_defs.json | 63 + .../com_atproto_server_deleteAccount.json | 41 + .../com_atproto_server_deleteSession.json | 10 + .../com_atproto_server_describeServer.json | 72 + ..._atproto_server_getAccountInviteCodes.json | 47 + .../com_atproto_server_getServiceAuth.json | 52 + .../com_atproto_server_getSession.json | 54 + .../com_atproto_server_listAppPasswords.json | 52 + .../com_atproto_server_refreshSession.json | 58 + ...m_atproto_server_requestAccountDelete.json | 10 + ...proto_server_requestEmailConfirmation.json | 10 + ...com_atproto_server_requestEmailUpdate.json | 24 + ...m_atproto_server_requestPasswordReset.json | 24 + .../com_atproto_server_reserveSigningKey.json | 38 + .../com_atproto_server_resetPassword.json | 36 + .../com_atproto_server_revokeAppPassword.json | 24 + .../com_atproto_server_updateEmail.json | 42 + .../lexicons/com_atproto_sync_defs.json | 16 + .../lexicons/com_atproto_sync_getBlob.json | 49 + .../lexicons/com_atproto_sync_getBlocks.json | 51 + .../com_atproto_sync_getCheckout.json | 26 + .../lexicons/com_atproto_sync_getHead.json | 43 + .../com_atproto_sync_getHostStatus.json | 53 + .../com_atproto_sync_getLatestCommit.json | 57 + .../lexicons/com_atproto_sync_getRecord.json | 54 + .../lexicons/com_atproto_sync_getRepo.json | 45 + .../com_atproto_sync_getRepoStatus.json | 64 + .../lexicons/com_atproto_sync_listBlobs.json | 72 + .../lexicons/com_atproto_sync_listHosts.json | 69 + .../lexicons/com_atproto_sync_listRepos.json | 83 + ...om_atproto_sync_listReposByCollection.json | 65 + .../com_atproto_sync_notifyOfUpdate.json | 25 + .../com_atproto_sync_requestCrawl.json | 30 + .../com_atproto_sync_subscribeRepos.json | 275 + .../com_atproto_temp_addReservedHandle.json | 31 + ..._atproto_temp_checkHandleAvailability.json | 101 + .../com_atproto_temp_checkSignupQueue.json | 30 + .../com_atproto_temp_dereferenceScope.json | 43 + .../com_atproto_temp_fetchLabels.json | 42 + ...atproto_temp_requestPhoneVerification.json | 24 + ...atproto_temp_revokeAccountCredentials.json | 25 + .../lexicons/sh_weaver_actor_defs.json | 286 + .../lexicons/sh_weaver_actor_getProfile.json | 30 + .../lexicons/sh_weaver_actor_profile.json | 94 + .../lexicons/sh_weaver_edit_cursor.json | 129 + .../lexicons/sh_weaver_edit_defs.json | 45 + .../lexicons/sh_weaver_edit_diff.json | 36 + .../lexicons/sh_weaver_edit_root.json | 41 + .../lexicons/sh_weaver_embed_defs.json | 38 + .../lexicons/sh_weaver_embed_external.json | 90 + .../lexicons/sh_weaver_embed_images.json | 112 + .../sh_weaver_embed_recordWithMedia.json | 61 + .../lexicons/sh_weaver_embed_records.json | 200 + .../lexicons/sh_weaver_embed_video.json | 106 + .../lexicons/sh_weaver_notebook_authors.json | 49 + .../lexicons/sh_weaver_notebook_book.json | 47 + .../lexicons/sh_weaver_notebook_chapter.json | 46 + .../lexicons/sh_weaver_notebook_defs.json | 202 + .../lexicons/sh_weaver_notebook_entry.json | 68 + .../lexicons/sh_weaver_publish_blob.json | 27 + .../lexicons/sh_weaver_publish_defs.json | 5 + ...ls_ozone_communication_createTemplate.json | 57 + .../tools_ozone_communication_defs.json | 56 + ...ls_ozone_communication_deleteTemplate.json | 24 + ...ols_ozone_communication_listTemplates.json | 28 + ...ls_ozone_communication_updateTemplate.json | 62 + ...tools_ozone_hosting_getAccountHistory.json | 144 + ...one_moderation_cancelScheduledActions.json | 85 + .../lexicons/tools_ozone_moderation_defs.json | 1520 ++ .../tools_ozone_moderation_emitEvent.json | 94 + ...s_ozone_moderation_getAccountTimeline.json | 121 + .../tools_ozone_moderation_getEvent.json | 28 + .../tools_ozone_moderation_getRecord.json | 38 + .../tools_ozone_moderation_getRecords.json | 47 + .../tools_ozone_moderation_getRepo.json | 34 + ...ols_ozone_moderation_getReporterStats.json | 44 + .../tools_ozone_moderation_getRepos.json | 47 + .../tools_ozone_moderation_getSubjects.json | 44 + ...ozone_moderation_listScheduledActions.json | 87 + .../tools_ozone_moderation_queryEvents.json | 176 + .../tools_ozone_moderation_queryStatuses.json | 233 + ...tools_ozone_moderation_scheduleAction.json | 147 + .../tools_ozone_moderation_searchRepos.json | 52 + .../lexicons/tools_ozone_report_defs.json | 211 + .../tools_ozone_safelink_addRule.json | 66 + .../lexicons/tools_ozone_safelink_defs.json | 141 + .../tools_ozone_safelink_queryEvents.json | 71 + .../tools_ozone_safelink_queryRules.json | 87 + .../tools_ozone_safelink_removeRule.json | 52 + .../tools_ozone_safelink_updateRule.json | 62 + .../tools_ozone_server_getConfig.json | 66 + .../lexicons/tools_ozone_set_addValues.json | 35 + .../lexicons/tools_ozone_set_defs.json | 56 + .../lexicons/tools_ozone_set_deleteSet.json | 38 + .../tools_ozone_set_deleteValues.json | 40 + .../lexicons/tools_ozone_set_getValues.json | 61 + .../lexicons/tools_ozone_set_querySets.json | 66 + .../lexicons/tools_ozone_set_upsertSet.json | 24 + .../lexicons/tools_ozone_setting_defs.json | 67 + .../tools_ozone_setting_listOptions.json | 66 + .../tools_ozone_setting_removeOptions.json | 45 + .../tools_ozone_setting_upsertOption.json | 65 + .../lexicons/tools_ozone_signature_defs.json | 21 + ...tools_ozone_signature_findCorrelation.json | 43 + ...s_ozone_signature_findRelatedAccounts.json | 71 + .../tools_ozone_signature_searchAccounts.json | 54 + .../lexicons/tools_ozone_team_addMember.json | 48 + .../lexicons/tools_ozone_team_defs.json | 62 + .../tools_ozone_team_deleteMember.json | 35 + .../tools_ozone_team_listMembers.json | 57 + .../tools_ozone_team_updateMember.json | 50 + .../tools_ozone_verification_defs.json | 85 + ...ozone_verification_grantVerifications.json | 104 + ..._ozone_verification_listVerifications.json | 88 + ...zone_verification_revokeVerifications.json | 83 + crates/weaver-api/src/app_bsky.rs | 15 + crates/weaver-api/src/app_bsky/actor.rs | 7715 +++++++++ .../src/app_bsky/actor/get_preferences.rs | 59 + .../src/app_bsky/actor/get_profile.rs | 155 + .../src/app_bsky/actor/get_profiles.rs | 154 + .../src/app_bsky/actor/get_suggestions.rs | 162 + .../weaver-api/src/app_bsky/actor/profile.rs | 705 + .../src/app_bsky/actor/put_preferences.rs | 157 + .../src/app_bsky/actor/search_actors.rs | 198 + .../app_bsky/actor/search_actors_typeahead.rs | 177 + .../weaver-api/src/app_bsky/actor/status.rs | 429 + crates/weaver-api/src/app_bsky/bookmark.rs | 472 + .../src/app_bsky/bookmark/create_bookmark.rs | 229 + .../src/app_bsky/bookmark/delete_bookmark.rs | 192 + .../src/app_bsky/bookmark/get_bookmarks.rs | 159 + crates/weaver-api/src/app_bsky/embed.rs | 266 + .../weaver-api/src/app_bsky/embed/external.rs | 991 ++ .../weaver-api/src/app_bsky/embed/images.rs | 967 ++ .../weaver-api/src/app_bsky/embed/record.rs | 1710 ++ .../src/app_bsky/embed/record_with_media.rs | 491 + crates/weaver-api/src/app_bsky/embed/video.rs | 925 ++ crates/weaver-api/src/app_bsky/feed.rs | 4994 ++++++ .../app_bsky/feed/describe_feed_generator.rs | 346 + .../weaver-api/src/app_bsky/feed/generator.rs | 673 + .../src/app_bsky/feed/get_actor_feeds.rs | 196 + .../src/app_bsky/feed/get_actor_likes.rs | 239 + .../src/app_bsky/feed/get_author_feed.rs | 279 + .../weaver-api/src/app_bsky/feed/get_feed.rs | 230 + .../src/app_bsky/feed/get_feed_generator.rs | 158 + .../src/app_bsky/feed/get_feed_generators.rs | 154 + .../src/app_bsky/feed/get_feed_skeleton.rs | 234 + .../weaver-api/src/app_bsky/feed/get_likes.rs | 609 + .../src/app_bsky/feed/get_list_feed.rs | 230 + .../src/app_bsky/feed/get_post_thread.rs | 248 + .../weaver-api/src/app_bsky/feed/get_posts.rs | 154 + .../src/app_bsky/feed/get_quotes.rs | 225 + .../src/app_bsky/feed/get_reposted_by.rs | 225 + .../src/app_bsky/feed/get_suggested_feeds.rs | 159 + .../src/app_bsky/feed/get_timeline.rs | 183 + crates/weaver-api/src/app_bsky/feed/like.rs | 343 + crates/weaver-api/src/app_bsky/feed/post.rs | 1440 ++ .../weaver-api/src/app_bsky/feed/postgate.rs | 497 + crates/weaver-api/src/app_bsky/feed/repost.rs | 345 + .../src/app_bsky/feed/search_posts.rs | 447 + .../src/app_bsky/feed/send_interactions.rs | 170 + .../src/app_bsky/feed/threadgate.rs | 789 + crates/weaver-api/src/app_bsky/graph.rs | 3563 ++++ crates/weaver-api/src/app_bsky/graph/block.rs | 324 + .../weaver-api/src/app_bsky/graph/follow.rs | 353 + .../app_bsky/graph/get_actor_starter_packs.rs | 199 + .../src/app_bsky/graph/get_blocks.rs | 159 + .../src/app_bsky/graph/get_followers.rs | 198 + .../src/app_bsky/graph/get_follows.rs | 198 + .../src/app_bsky/graph/get_known_followers.rs | 198 + .../weaver-api/src/app_bsky/graph/get_list.rs | 198 + .../src/app_bsky/graph/get_list_blocks.rs | 159 + .../src/app_bsky/graph/get_list_mutes.rs | 159 + .../src/app_bsky/graph/get_lists.rs | 220 + .../graph/get_lists_with_membership.rs | 547 + .../src/app_bsky/graph/get_mutes.rs | 159 + .../src/app_bsky/graph/get_relationships.rs | 237 + .../src/app_bsky/graph/get_starter_pack.rs | 154 + .../src/app_bsky/graph/get_starter_packs.rs | 154 + .../get_starter_packs_with_membership.rs | 528 + .../graph/get_suggested_follows_by_actor.rs | 171 + crates/weaver-api/src/app_bsky/graph/list.rs | 579 + .../src/app_bsky/graph/listblock.rs | 324 + .../weaver-api/src/app_bsky/graph/listitem.rs | 386 + .../src/app_bsky/graph/mute_actor.rs | 157 + .../src/app_bsky/graph/mute_actor_list.rs | 157 + .../src/app_bsky/graph/mute_thread.rs | 157 + .../app_bsky/graph/search_starter_packs.rs | 196 + .../src/app_bsky/graph/starterpack.rs | 761 + .../src/app_bsky/graph/unmute_actor.rs | 157 + .../src/app_bsky/graph/unmute_actor_list.rs | 157 + .../src/app_bsky/graph/unmute_thread.rs | 157 + .../src/app_bsky/graph/verification.rs | 455 + crates/weaver-api/src/app_bsky/labeler.rs | 1428 ++ .../src/app_bsky/labeler/get_services.rs | 191 + .../src/app_bsky/labeler/service.rs | 494 + .../weaver-api/src/app_bsky/notification.rs | 2079 +++ .../src/app_bsky/notification/declaration.rs | 266 + .../app_bsky/notification/get_preferences.rs | 59 + .../app_bsky/notification/get_unread_count.rs | 154 + .../list_activity_subscriptions.rs | 171 + .../notification/list_notifications.rs | 942 ++ .../notification/put_activity_subscription.rs | 227 + .../app_bsky/notification/put_preferences.rs | 154 + .../notification/put_preferences_v2.rs | 126 + .../app_bsky/notification/register_push.rs | 293 + .../app_bsky/notification/unregister_push.rs | 274 + .../src/app_bsky/notification/update_seen.rs | 156 + crates/weaver-api/src/app_bsky/richtext.rs | 6 + .../weaver-api/src/app_bsky/richtext/facet.rs | 956 ++ crates/weaver-api/src/app_bsky/unspecced.rs | 3057 ++++ .../unspecced/get_age_assurance_state.rs | 61 + .../src/app_bsky/unspecced/get_config.rs | 320 + .../get_onboarding_suggested_starter_packs.rs | 139 + ...arding_suggested_starter_packs_skeleton.rs | 179 + .../unspecced/get_popular_feed_generators.rs | 195 + .../unspecced/get_post_thread_other_v2.rs | 520 + .../app_bsky/unspecced/get_post_thread_v2.rs | 673 + .../app_bsky/unspecced/get_suggested_feeds.rs | 131 + .../unspecced/get_suggested_feeds_skeleton.rs | 173 + .../unspecced/get_suggested_starter_packs.rs | 133 + .../get_suggested_starter_packs_skeleton.rs | 176 + .../app_bsky/unspecced/get_suggested_users.rs | 156 + .../unspecced/get_suggested_users_skeleton.rs | 197 + .../unspecced/get_suggestions_skeleton.rs | 217 + .../unspecced/get_tagged_suggestions.rs | 379 + .../app_bsky/unspecced/get_trending_topics.rs | 161 + .../src/app_bsky/unspecced/get_trends.rs | 131 + .../app_bsky/unspecced/get_trends_skeleton.rs | 159 + .../app_bsky/unspecced/init_age_assurance.rs | 129 + .../unspecced/search_actors_skeleton.rs | 277 + .../unspecced/search_posts_skeleton.rs | 472 + .../search_starter_packs_skeleton.rs | 277 + crates/weaver-api/src/app_bsky/video.rs | 469 + .../src/app_bsky/video/get_job_status.rs | 152 + .../src/app_bsky/video/get_upload_limits.rs | 69 + .../src/app_bsky/video/upload_video.rs | 81 + crates/weaver-api/src/builder_types.rs | 43 + crates/weaver-api/src/chat_bsky.rs | 8 + crates/weaver-api/src/chat_bsky/actor.rs | 550 + .../src/chat_bsky/actor/declaration.rs | 261 + .../src/chat_bsky/actor/delete_account.rs | 61 + .../chat_bsky/actor/export_account_data.rs | 73 + crates/weaver-api/src/chat_bsky/convo.rs | 4663 ++++++ .../src/chat_bsky/convo/accept_convo.rs | 72 + .../src/chat_bsky/convo/add_reaction.rs | 128 + .../convo/delete_message_for_self.rs | 72 + .../src/chat_bsky/convo/get_convo.rs | 152 + .../chat_bsky/convo/get_convo_availability.rs | 159 + .../chat_bsky/convo/get_convo_for_members.rs | 154 + .../weaver-api/src/chat_bsky/convo/get_log.rs | 174 + .../src/chat_bsky/convo/get_messages.rs | 215 + .../src/chat_bsky/convo/leave_convo.rs | 72 + .../src/chat_bsky/convo/list_convos.rs | 204 + .../src/chat_bsky/convo/mute_convo.rs | 69 + .../src/chat_bsky/convo/remove_reaction.rs | 118 + .../src/chat_bsky/convo/send_message.rs | 211 + .../src/chat_bsky/convo/send_message_batch.rs | 450 + .../src/chat_bsky/convo/unmute_convo.rs | 69 + .../src/chat_bsky/convo/update_all_read.rs | 70 + .../src/chat_bsky/convo/update_read.rs | 72 + crates/weaver-api/src/chat_bsky/moderation.rs | 8 + .../moderation/get_actor_metadata.rs | 536 + .../moderation/get_message_context.rs | 230 + .../moderation/update_actor_access.rs | 215 + crates/weaver-api/src/com_atproto.rs | 14 + crates/weaver-api/src/com_atproto/admin.rs | 1404 ++ .../src/com_atproto/admin/delete_account.rs | 157 + .../admin/disable_account_invites.rs | 183 + .../com_atproto/admin/disable_invite_codes.rs | 57 + .../admin/enable_account_invites.rs | 183 + .../src/com_atproto/admin/get_account_info.rs | 155 + .../com_atproto/admin/get_account_infos.rs | 154 + .../src/com_atproto/admin/get_invite_codes.rs | 181 + .../com_atproto/admin/get_subject_status.rs | 216 + .../src/com_atproto/admin/search_accounts.rs | 180 + .../src/com_atproto/admin/send_email.rs | 293 + .../com_atproto/admin/update_account_email.rs | 195 + .../admin/update_account_handle.rs | 194 + .../admin/update_account_password.rs | 200 + .../admin/update_account_signing_key.rs | 207 + .../admin/update_subject_status.rs | 268 + crates/weaver-api/src/com_atproto/identity.rs | 310 + .../get_recommended_did_credentials.rs | 74 + .../com_atproto/identity/refresh_identity.rs | 229 + .../request_plc_operation_signature.rs | 48 + .../src/com_atproto/identity/resolve_did.rs | 200 + .../com_atproto/identity/resolve_handle.rs | 189 + .../com_atproto/identity/resolve_identity.rs | 210 + .../identity/sign_plc_operation.rs | 86 + .../identity/submit_plc_operation.rs | 157 + .../src/com_atproto/identity/update_handle.rs | 158 + crates/weaver-api/src/com_atproto/label.rs | 1853 +++ .../src/com_atproto/label/query_labels.rs | 220 + .../src/com_atproto/label/subscribe_labels.rs | 541 + crates/weaver-api/src/com_atproto/lexicon.rs | 6 + .../src/com_atproto/lexicon/schema.rs | 255 + .../weaver-api/src/com_atproto/moderation.rs | 893 + .../com_atproto/moderation/create_report.rs | 489 + crates/weaver-api/src/com_atproto/repo.rs | 259 + .../src/com_atproto/repo/apply_writes.rs | 1869 +++ .../src/com_atproto/repo/create_record.rs | 384 + .../src/com_atproto/repo/delete_record.rs | 350 + .../src/com_atproto/repo/describe_repo.rs | 164 + .../src/com_atproto/repo/get_record.rs | 301 + .../src/com_atproto/repo/import_repo.rs | 65 + .../com_atproto/repo/list_missing_blobs.rs | 448 + .../src/com_atproto/repo/list_records.rs | 639 + .../src/com_atproto/repo/put_record.rs | 417 + .../src/com_atproto/repo/strong_ref.rs | 248 + .../src/com_atproto/repo/upload_blob.rs | 81 + crates/weaver-api/src/com_atproto/server.rs | 786 + .../com_atproto/server/activate_account.rs | 48 + .../server/check_account_status.rs | 69 + .../src/com_atproto/server/confirm_email.rs | 116 + .../src/com_atproto/server/create_account.rs | 481 + .../com_atproto/server/create_app_password.rs | 494 + .../com_atproto/server/create_invite_code.rs | 198 + .../com_atproto/server/create_invite_codes.rs | 560 + .../src/com_atproto/server/create_session.rs | 143 + .../com_atproto/server/deactivate_account.rs | 54 + .../src/com_atproto/server/delete_account.rs | 276 + .../src/com_atproto/server/delete_session.rs | 48 + .../src/com_atproto/server/describe_server.rs | 257 + .../server/get_account_invite_codes.rs | 182 + .../com_atproto/server/get_service_auth.rs | 231 + .../src/com_atproto/server/get_session.rs | 78 + .../com_atproto/server/list_app_passwords.rs | 372 + .../src/com_atproto/server/refresh_session.rs | 113 + .../server/request_account_delete.rs | 48 + .../server/request_email_confirmation.rs | 48 + .../server/request_email_update.rs | 63 + .../server/request_password_reset.rs | 53 + .../com_atproto/server/reserve_signing_key.rs | 73 + .../src/com_atproto/server/reset_password.rs | 98 + .../com_atproto/server/revoke_app_password.rs | 53 + .../src/com_atproto/server/update_email.rs | 111 + crates/weaver-api/src/com_atproto/sync.rs | 116 + .../src/com_atproto/sync/get_blob.rs | 273 + .../src/com_atproto/sync/get_blocks.rs | 273 + .../src/com_atproto/sync/get_checkout.rs | 167 + .../src/com_atproto/sync/get_head.rs | 188 + .../src/com_atproto/sync/get_host_status.rs | 196 + .../src/com_atproto/sync/get_latest_commit.rs | 216 + .../src/com_atproto/sync/get_record.rs | 321 + .../src/com_atproto/sync/get_repo.rs | 251 + .../src/com_atproto/sync/get_repo_status.rs | 196 + .../src/com_atproto/sync/list_blobs.rs | 280 + .../src/com_atproto/sync/list_hosts.rs | 332 + .../src/com_atproto/sync/list_repos.rs | 575 + .../sync/list_repos_by_collection.rs | 457 + .../src/com_atproto/sync/notify_of_update.rs | 54 + .../src/com_atproto/sync/request_crawl.rs | 88 + .../src/com_atproto/sync/subscribe_repos.rs | 2606 +++ crates/weaver-api/src/com_atproto/temp.rs | 12 + .../com_atproto/temp/add_reserved_handle.rs | 66 + .../temp/check_handle_availability.rs | 840 + .../com_atproto/temp/check_signup_queue.rs | 63 + .../src/com_atproto/temp/dereference_scope.rs | 189 + .../src/com_atproto/temp/fetch_labels.rs | 147 + .../temp/request_phone_verification.rs | 53 + .../temp/revoke_account_credentials.rs | 166 + crates/weaver-api/src/lib.rs | 20 + crates/weaver-api/src/sh_weaver.rs | 10 + crates/weaver-api/src/sh_weaver/actor.rs | 2742 ++++ .../src/sh_weaver/actor/get_profile.rs | 155 + .../weaver-api/src/sh_weaver/actor/profile.rs | 822 + crates/weaver-api/src/sh_weaver/edit.rs | 534 + .../weaver-api/src/sh_weaver/edit/cursor.rs | 1238 ++ crates/weaver-api/src/sh_weaver/edit/diff.rs | 352 + crates/weaver-api/src/sh_weaver/edit/root.rs | 419 + crates/weaver-api/src/sh_weaver/embed.rs | 457 + .../src/sh_weaver/embed/external.rs | 1024 ++ .../weaver-api/src/sh_weaver/embed/images.rs | 1158 ++ .../src/sh_weaver/embed/record_with_media.rs | 551 + .../weaver-api/src/sh_weaver/embed/records.rs | 2171 +++ .../weaver-api/src/sh_weaver/embed/video.rs | 1090 ++ crates/weaver-api/src/sh_weaver/notebook.rs | 2017 +++ .../src/sh_weaver/notebook/authors.rs | 524 + .../weaver-api/src/sh_weaver/notebook/book.rs | 430 + .../src/sh_weaver/notebook/chapter.rs | 444 + .../src/sh_weaver/notebook/entry.rs | 562 + crates/weaver-api/src/sh_weaver/publish.rs | 6 + .../weaver-api/src/sh_weaver/publish/blob.rs | 255 + crates/weaver-api/src/tools_ozone.rs | 16 + .../src/tools_ozone/communication.rs | 659 + .../communication/create_template.rs | 118 + .../communication/delete_template.rs | 53 + .../communication/list_templates.rs | 62 + .../communication/update_template.rs | 126 + crates/weaver-api/src/tools_ozone/hosting.rs | 6 + .../hosting/get_account_history.rs | 1064 ++ .../weaver-api/src/tools_ozone/moderation.rs | 13685 ++++++++++++++++ .../moderation/cancel_scheduled_actions.rs | 821 + .../src/tools_ozone/moderation/emit_event.rs | 468 + .../moderation/get_account_timeline.rs | 763 + .../src/tools_ozone/moderation/get_event.rs | 149 + .../src/tools_ozone/moderation/get_record.rs | 213 + .../src/tools_ozone/moderation/get_records.rs | 173 + .../src/tools_ozone/moderation/get_repo.rs | 189 + .../moderation/get_reporter_stats.rs | 154 + .../src/tools_ozone/moderation/get_repos.rs | 173 + .../tools_ozone/moderation/get_subjects.rs | 152 + .../moderation/list_scheduled_actions.rs | 299 + .../tools_ozone/moderation/query_events.rs | 660 + .../tools_ozone/moderation/query_statuses.rs | 931 ++ .../tools_ozone/moderation/schedule_action.rs | 1234 ++ .../tools_ozone/moderation/search_repos.rs | 198 + crates/weaver-api/src/tools_ozone/report.rs | 1312 ++ crates/weaver-api/src/tools_ozone/safelink.rs | 1605 ++ .../src/tools_ozone/safelink/add_rule.rs | 386 + .../src/tools_ozone/safelink/query_events.rs | 90 + .../src/tools_ozone/safelink/query_rules.rs | 102 + .../src/tools_ozone/safelink/remove_rule.rs | 296 + .../src/tools_ozone/safelink/update_rule.rs | 376 + crates/weaver-api/src/tools_ozone/server.rs | 6 + .../src/tools_ozone/server/get_config.rs | 240 + crates/weaver-api/src/tools_ozone/set.rs | 602 + .../src/tools_ozone/set/add_values.rs | 196 + .../src/tools_ozone/set/delete_set.rs | 102 + .../src/tools_ozone/set/delete_values.rs | 231 + .../src/tools_ozone/set/get_values.rs | 233 + .../src/tools_ozone/set/query_sets.rs | 230 + .../src/tools_ozone/set/upsert_set.rs | 70 + crates/weaver-api/src/tools_ozone/setting.rs | 694 + .../src/tools_ozone/setting/list_options.rs | 226 + .../src/tools_ozone/setting/remove_options.rs | 207 + .../src/tools_ozone/setting/upsert_option.rs | 299 + .../weaver-api/src/tools_ozone/signature.rs | 109 + .../tools_ozone/signature/find_correlation.rs | 154 + .../signature/find_related_accounts.rs | 484 + .../tools_ozone/signature/search_accounts.rs | 196 + crates/weaver-api/src/tools_ozone/team.rs | 535 + .../src/tools_ozone/team/add_member.rs | 246 + .../src/tools_ozone/team/delete_member.rs | 202 + .../src/tools_ozone/team/list_members.rs | 218 + .../src/tools_ozone/team/update_member.rs | 249 + .../src/tools_ozone/verification.rs | 870 + .../verification/grant_verifications.rs | 847 + .../verification/list_verifications.rs | 295 + .../verification/revoke_verifications.rs | 545 + crates/weaver-workspace-hack/Cargo.toml | 34 +- lexicons.kdl | 16 + lexicons/sh/weaver/embed/external.json | 9 +- lexicons/sh/weaver/embed/recordWithMedia.json | 12 +- lexicons/sh/weaver/embed/records.json | 4 +- lexicons/sh/weaver/embed/video.json | 12 + lexicons/sh/weaver/notebook/entry.json | 32 +- 647 files changed, 169928 insertions(+), 47 deletions(-) create mode 100644 crates/weaver-api/Cargo.toml create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_getPreferences.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_getProfile.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_getProfiles.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_getSuggestions.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_profile.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_putPreferences.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_searchActors.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_searchActorsTypeahead.json create mode 100644 crates/weaver-api/lexicons/app_bsky_actor_status.json create mode 100644 crates/weaver-api/lexicons/app_bsky_bookmark_createBookmark.json create mode 100644 crates/weaver-api/lexicons/app_bsky_bookmark_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_bookmark_deleteBookmark.json create mode 100644 crates/weaver-api/lexicons/app_bsky_bookmark_getBookmarks.json create mode 100644 crates/weaver-api/lexicons/app_bsky_embed_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_embed_external.json create mode 100644 crates/weaver-api/lexicons/app_bsky_embed_images.json create mode 100644 crates/weaver-api/lexicons/app_bsky_embed_record.json create mode 100644 crates/weaver-api/lexicons/app_bsky_embed_recordWithMedia.json create mode 100644 crates/weaver-api/lexicons/app_bsky_embed_video.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_describeFeedGenerator.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_generator.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getActorFeeds.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getActorLikes.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getAuthorFeed.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getFeed.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getFeedGenerator.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getFeedGenerators.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getFeedSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getLikes.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getListFeed.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getPostThread.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getPosts.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getQuotes.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getRepostedBy.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getSuggestedFeeds.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_getTimeline.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_like.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_post.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_postgate.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_repost.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_searchPosts.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_sendInteractions.json create mode 100644 crates/weaver-api/lexicons/app_bsky_feed_threadgate.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_block.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_follow.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getActorStarterPacks.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getBlocks.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getFollowers.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getFollows.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getKnownFollowers.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getList.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getListBlocks.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getListMutes.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getLists.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getListsWithMembership.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getMutes.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getRelationships.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getStarterPack.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getStarterPacks.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getStarterPacksWithMembership.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_getSuggestedFollowsByActor.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_list.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_listblock.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_listitem.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_muteActor.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_muteActorList.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_muteThread.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_searchStarterPacks.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_starterpack.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_unmuteActor.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_unmuteActorList.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_unmuteThread.json create mode 100644 crates/weaver-api/lexicons/app_bsky_graph_verification.json create mode 100644 crates/weaver-api/lexicons/app_bsky_labeler_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_labeler_getServices.json create mode 100644 crates/weaver-api/lexicons/app_bsky_labeler_service.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_declaration.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_getPreferences.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_getUnreadCount.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_listActivitySubscriptions.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_listNotifications.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_putActivitySubscription.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_putPreferences.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_putPreferencesV2.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_registerPush.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_unregisterPush.json create mode 100644 crates/weaver-api/lexicons/app_bsky_notification_updateSeen.json create mode 100644 crates/weaver-api/lexicons/app_bsky_richtext_facet.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getAgeAssuranceState.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getConfig.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacks.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacksSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getPopularFeedGenerators.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadOtherV2.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadV2.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedFeeds.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedFeedsSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedStarterPacks.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedStarterPacksSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedUsers.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedUsersSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestionsSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getTaggedSuggestions.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getTrendingTopics.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getTrends.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_getTrendsSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_initAgeAssurance.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_searchActorsSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_searchPostsSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_unspecced_searchStarterPacksSkeleton.json create mode 100644 crates/weaver-api/lexicons/app_bsky_video_defs.json create mode 100644 crates/weaver-api/lexicons/app_bsky_video_getJobStatus.json create mode 100644 crates/weaver-api/lexicons/app_bsky_video_getUploadLimits.json create mode 100644 crates/weaver-api/lexicons/app_bsky_video_uploadVideo.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_actor_declaration.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_actor_defs.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_actor_deleteAccount.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_actor_exportAccountData.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_acceptConvo.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_addReaction.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_defs.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_deleteMessageForSelf.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_getConvo.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_getConvoAvailability.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_getConvoForMembers.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_getLog.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_getMessages.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_leaveConvo.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_listConvos.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_muteConvo.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_removeReaction.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_sendMessage.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_sendMessageBatch.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_unmuteConvo.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_updateAllRead.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_convo_updateRead.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_moderation_getActorMetadata.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_moderation_getMessageContext.json create mode 100644 crates/weaver-api/lexicons/chat_bsky_moderation_updateActorAccess.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_defs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_deleteAccount.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_disableAccountInvites.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_disableInviteCodes.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_enableAccountInvites.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_getAccountInfo.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_getAccountInfos.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_getInviteCodes.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_getSubjectStatus.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_searchAccounts.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_sendEmail.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_updateAccountEmail.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_updateAccountHandle.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_updateAccountPassword.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_updateAccountSigningKey.json create mode 100644 crates/weaver-api/lexicons/com_atproto_admin_updateSubjectStatus.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_defs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_getRecommendedDidCredentials.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_refreshIdentity.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_requestPlcOperationSignature.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_resolveDid.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_resolveHandle.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_resolveIdentity.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_signPlcOperation.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_submitPlcOperation.json create mode 100644 crates/weaver-api/lexicons/com_atproto_identity_updateHandle.json create mode 100644 crates/weaver-api/lexicons/com_atproto_label_defs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_label_queryLabels.json create mode 100644 crates/weaver-api/lexicons/com_atproto_label_subscribeLabels.json create mode 100644 crates/weaver-api/lexicons/com_atproto_lexicon_schema.json create mode 100644 crates/weaver-api/lexicons/com_atproto_moderation_createReport.json create mode 100644 crates/weaver-api/lexicons/com_atproto_moderation_defs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_applyWrites.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_createRecord.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_defs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_deleteRecord.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_describeRepo.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_getRecord.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_importRepo.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_listMissingBlobs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_listRecords.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_putRecord.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_strongRef.json create mode 100644 crates/weaver-api/lexicons/com_atproto_repo_uploadBlob.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_activateAccount.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_checkAccountStatus.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_confirmEmail.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_createAccount.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_createAppPassword.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_createInviteCode.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_createInviteCodes.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_createSession.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_deactivateAccount.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_defs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_deleteAccount.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_deleteSession.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_describeServer.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_getAccountInviteCodes.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_getServiceAuth.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_getSession.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_listAppPasswords.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_refreshSession.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_requestAccountDelete.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_requestEmailConfirmation.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_requestEmailUpdate.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_requestPasswordReset.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_reserveSigningKey.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_resetPassword.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_revokeAppPassword.json create mode 100644 crates/weaver-api/lexicons/com_atproto_server_updateEmail.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_defs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getBlob.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getBlocks.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getCheckout.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getHead.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getHostStatus.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getLatestCommit.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getRecord.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getRepo.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_getRepoStatus.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_listBlobs.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_listHosts.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_listRepos.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_listReposByCollection.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_notifyOfUpdate.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_requestCrawl.json create mode 100644 crates/weaver-api/lexicons/com_atproto_sync_subscribeRepos.json create mode 100644 crates/weaver-api/lexicons/com_atproto_temp_addReservedHandle.json create mode 100644 crates/weaver-api/lexicons/com_atproto_temp_checkHandleAvailability.json create mode 100644 crates/weaver-api/lexicons/com_atproto_temp_checkSignupQueue.json create mode 100644 crates/weaver-api/lexicons/com_atproto_temp_dereferenceScope.json create mode 100644 crates/weaver-api/lexicons/com_atproto_temp_fetchLabels.json create mode 100644 crates/weaver-api/lexicons/com_atproto_temp_requestPhoneVerification.json create mode 100644 crates/weaver-api/lexicons/com_atproto_temp_revokeAccountCredentials.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_actor_defs.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_actor_getProfile.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_actor_profile.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_edit_cursor.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_edit_defs.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_edit_diff.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_edit_root.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_embed_defs.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_embed_external.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_embed_images.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_embed_recordWithMedia.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_embed_records.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_embed_video.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_notebook_authors.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_notebook_book.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_notebook_chapter.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_notebook_defs.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_notebook_entry.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_publish_blob.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_publish_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_communication_createTemplate.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_communication_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_communication_deleteTemplate.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_communication_listTemplates.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_communication_updateTemplate.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_hosting_getAccountHistory.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_cancelScheduledActions.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_emitEvent.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_getAccountTimeline.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_getEvent.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_getRecord.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_getRecords.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_getRepo.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_getReporterStats.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_getRepos.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_getSubjects.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_listScheduledActions.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_queryEvents.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_queryStatuses.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_scheduleAction.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_moderation_searchRepos.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_report_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_safelink_addRule.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_safelink_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_safelink_queryEvents.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_safelink_queryRules.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_safelink_removeRule.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_safelink_updateRule.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_server_getConfig.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_set_addValues.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_set_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_set_deleteSet.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_set_deleteValues.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_set_getValues.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_set_querySets.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_set_upsertSet.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_setting_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_setting_listOptions.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_setting_removeOptions.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_setting_upsertOption.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_signature_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_signature_findCorrelation.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_signature_findRelatedAccounts.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_signature_searchAccounts.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_team_addMember.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_team_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_team_deleteMember.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_team_listMembers.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_team_updateMember.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_verification_defs.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_verification_grantVerifications.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_verification_listVerifications.json create mode 100644 crates/weaver-api/lexicons/tools_ozone_verification_revokeVerifications.json create mode 100644 crates/weaver-api/src/app_bsky.rs create mode 100644 crates/weaver-api/src/app_bsky/actor.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/get_preferences.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/get_profile.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/get_profiles.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/get_suggestions.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/profile.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/put_preferences.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/search_actors.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/search_actors_typeahead.rs create mode 100644 crates/weaver-api/src/app_bsky/actor/status.rs create mode 100644 crates/weaver-api/src/app_bsky/bookmark.rs create mode 100644 crates/weaver-api/src/app_bsky/bookmark/create_bookmark.rs create mode 100644 crates/weaver-api/src/app_bsky/bookmark/delete_bookmark.rs create mode 100644 crates/weaver-api/src/app_bsky/bookmark/get_bookmarks.rs create mode 100644 crates/weaver-api/src/app_bsky/embed.rs create mode 100644 crates/weaver-api/src/app_bsky/embed/external.rs create mode 100644 crates/weaver-api/src/app_bsky/embed/images.rs create mode 100644 crates/weaver-api/src/app_bsky/embed/record.rs create mode 100644 crates/weaver-api/src/app_bsky/embed/record_with_media.rs create mode 100644 crates/weaver-api/src/app_bsky/embed/video.rs create mode 100644 crates/weaver-api/src/app_bsky/feed.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/describe_feed_generator.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/generator.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_actor_feeds.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_actor_likes.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_author_feed.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_feed.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_feed_generator.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_feed_generators.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_feed_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_likes.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_list_feed.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_post_thread.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_posts.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_quotes.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_reposted_by.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_suggested_feeds.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/get_timeline.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/like.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/post.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/postgate.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/repost.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/search_posts.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/send_interactions.rs create mode 100644 crates/weaver-api/src/app_bsky/feed/threadgate.rs create mode 100644 crates/weaver-api/src/app_bsky/graph.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/block.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/follow.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_actor_starter_packs.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_blocks.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_followers.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_follows.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_known_followers.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_list.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_list_blocks.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_list_mutes.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_lists.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_lists_with_membership.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_mutes.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_relationships.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_starter_pack.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_starter_packs.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_starter_packs_with_membership.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/get_suggested_follows_by_actor.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/list.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/listblock.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/listitem.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/mute_actor.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/mute_actor_list.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/mute_thread.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/search_starter_packs.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/starterpack.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/unmute_actor.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/unmute_actor_list.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/unmute_thread.rs create mode 100644 crates/weaver-api/src/app_bsky/graph/verification.rs create mode 100644 crates/weaver-api/src/app_bsky/labeler.rs create mode 100644 crates/weaver-api/src/app_bsky/labeler/get_services.rs create mode 100644 crates/weaver-api/src/app_bsky/labeler/service.rs create mode 100644 crates/weaver-api/src/app_bsky/notification.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/declaration.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/get_preferences.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/get_unread_count.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/list_activity_subscriptions.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/list_notifications.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/put_preferences.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/put_preferences_v2.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/register_push.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/unregister_push.rs create mode 100644 crates/weaver-api/src/app_bsky/notification/update_seen.rs create mode 100644 crates/weaver-api/src/app_bsky/richtext.rs create mode 100644 crates/weaver-api/src/app_bsky/richtext/facet.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_age_assurance_state.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_config.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_popular_feed_generators.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_suggested_feeds.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_suggested_feeds_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_suggested_starter_packs.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_suggested_starter_packs_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_suggested_users.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_suggested_users_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_suggestions_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_trending_topics.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_trends.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/get_trends_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/init_age_assurance.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/search_actors_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/search_posts_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/unspecced/search_starter_packs_skeleton.rs create mode 100644 crates/weaver-api/src/app_bsky/video.rs create mode 100644 crates/weaver-api/src/app_bsky/video/get_job_status.rs create mode 100644 crates/weaver-api/src/app_bsky/video/get_upload_limits.rs create mode 100644 crates/weaver-api/src/app_bsky/video/upload_video.rs create mode 100644 crates/weaver-api/src/builder_types.rs create mode 100644 crates/weaver-api/src/chat_bsky.rs create mode 100644 crates/weaver-api/src/chat_bsky/actor.rs create mode 100644 crates/weaver-api/src/chat_bsky/actor/declaration.rs create mode 100644 crates/weaver-api/src/chat_bsky/actor/delete_account.rs create mode 100644 crates/weaver-api/src/chat_bsky/actor/export_account_data.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/accept_convo.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/add_reaction.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/delete_message_for_self.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/get_convo.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/get_convo_availability.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/get_convo_for_members.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/get_log.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/get_messages.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/leave_convo.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/list_convos.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/mute_convo.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/remove_reaction.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/send_message.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/send_message_batch.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/unmute_convo.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/update_all_read.rs create mode 100644 crates/weaver-api/src/chat_bsky/convo/update_read.rs create mode 100644 crates/weaver-api/src/chat_bsky/moderation.rs create mode 100644 crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs create mode 100644 crates/weaver-api/src/chat_bsky/moderation/get_message_context.rs create mode 100644 crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs create mode 100644 crates/weaver-api/src/com_atproto.rs create mode 100644 crates/weaver-api/src/com_atproto/admin.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/delete_account.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/disable_account_invites.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/disable_invite_codes.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/enable_account_invites.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/get_account_info.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/get_account_infos.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/get_invite_codes.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/get_subject_status.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/search_accounts.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/send_email.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/update_account_email.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/update_account_handle.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/update_account_password.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs create mode 100644 crates/weaver-api/src/com_atproto/admin/update_subject_status.rs create mode 100644 crates/weaver-api/src/com_atproto/identity.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/get_recommended_did_credentials.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/refresh_identity.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/request_plc_operation_signature.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/resolve_did.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/resolve_handle.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/resolve_identity.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/sign_plc_operation.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/submit_plc_operation.rs create mode 100644 crates/weaver-api/src/com_atproto/identity/update_handle.rs create mode 100644 crates/weaver-api/src/com_atproto/label.rs create mode 100644 crates/weaver-api/src/com_atproto/label/query_labels.rs create mode 100644 crates/weaver-api/src/com_atproto/label/subscribe_labels.rs create mode 100644 crates/weaver-api/src/com_atproto/lexicon.rs create mode 100644 crates/weaver-api/src/com_atproto/lexicon/schema.rs create mode 100644 crates/weaver-api/src/com_atproto/moderation.rs create mode 100644 crates/weaver-api/src/com_atproto/moderation/create_report.rs create mode 100644 crates/weaver-api/src/com_atproto/repo.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/apply_writes.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/create_record.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/delete_record.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/describe_repo.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/get_record.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/import_repo.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/list_missing_blobs.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/list_records.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/put_record.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/strong_ref.rs create mode 100644 crates/weaver-api/src/com_atproto/repo/upload_blob.rs create mode 100644 crates/weaver-api/src/com_atproto/server.rs create mode 100644 crates/weaver-api/src/com_atproto/server/activate_account.rs create mode 100644 crates/weaver-api/src/com_atproto/server/check_account_status.rs create mode 100644 crates/weaver-api/src/com_atproto/server/confirm_email.rs create mode 100644 crates/weaver-api/src/com_atproto/server/create_account.rs create mode 100644 crates/weaver-api/src/com_atproto/server/create_app_password.rs create mode 100644 crates/weaver-api/src/com_atproto/server/create_invite_code.rs create mode 100644 crates/weaver-api/src/com_atproto/server/create_invite_codes.rs create mode 100644 crates/weaver-api/src/com_atproto/server/create_session.rs create mode 100644 crates/weaver-api/src/com_atproto/server/deactivate_account.rs create mode 100644 crates/weaver-api/src/com_atproto/server/delete_account.rs create mode 100644 crates/weaver-api/src/com_atproto/server/delete_session.rs create mode 100644 crates/weaver-api/src/com_atproto/server/describe_server.rs create mode 100644 crates/weaver-api/src/com_atproto/server/get_account_invite_codes.rs create mode 100644 crates/weaver-api/src/com_atproto/server/get_service_auth.rs create mode 100644 crates/weaver-api/src/com_atproto/server/get_session.rs create mode 100644 crates/weaver-api/src/com_atproto/server/list_app_passwords.rs create mode 100644 crates/weaver-api/src/com_atproto/server/refresh_session.rs create mode 100644 crates/weaver-api/src/com_atproto/server/request_account_delete.rs create mode 100644 crates/weaver-api/src/com_atproto/server/request_email_confirmation.rs create mode 100644 crates/weaver-api/src/com_atproto/server/request_email_update.rs create mode 100644 crates/weaver-api/src/com_atproto/server/request_password_reset.rs create mode 100644 crates/weaver-api/src/com_atproto/server/reserve_signing_key.rs create mode 100644 crates/weaver-api/src/com_atproto/server/reset_password.rs create mode 100644 crates/weaver-api/src/com_atproto/server/revoke_app_password.rs create mode 100644 crates/weaver-api/src/com_atproto/server/update_email.rs create mode 100644 crates/weaver-api/src/com_atproto/sync.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_blob.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_blocks.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_checkout.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_head.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_host_status.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_latest_commit.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_record.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_repo.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/get_repo_status.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/list_blobs.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/list_hosts.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/list_repos.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/list_repos_by_collection.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/notify_of_update.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/request_crawl.rs create mode 100644 crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs create mode 100644 crates/weaver-api/src/com_atproto/temp.rs create mode 100644 crates/weaver-api/src/com_atproto/temp/add_reserved_handle.rs create mode 100644 crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs create mode 100644 crates/weaver-api/src/com_atproto/temp/check_signup_queue.rs create mode 100644 crates/weaver-api/src/com_atproto/temp/dereference_scope.rs create mode 100644 crates/weaver-api/src/com_atproto/temp/fetch_labels.rs create mode 100644 crates/weaver-api/src/com_atproto/temp/request_phone_verification.rs create mode 100644 crates/weaver-api/src/com_atproto/temp/revoke_account_credentials.rs create mode 100644 crates/weaver-api/src/lib.rs create mode 100644 crates/weaver-api/src/sh_weaver.rs create mode 100644 crates/weaver-api/src/sh_weaver/actor.rs create mode 100644 crates/weaver-api/src/sh_weaver/actor/get_profile.rs create mode 100644 crates/weaver-api/src/sh_weaver/actor/profile.rs create mode 100644 crates/weaver-api/src/sh_weaver/edit.rs create mode 100644 crates/weaver-api/src/sh_weaver/edit/cursor.rs create mode 100644 crates/weaver-api/src/sh_weaver/edit/diff.rs create mode 100644 crates/weaver-api/src/sh_weaver/edit/root.rs create mode 100644 crates/weaver-api/src/sh_weaver/embed.rs create mode 100644 crates/weaver-api/src/sh_weaver/embed/external.rs create mode 100644 crates/weaver-api/src/sh_weaver/embed/images.rs create mode 100644 crates/weaver-api/src/sh_weaver/embed/record_with_media.rs create mode 100644 crates/weaver-api/src/sh_weaver/embed/records.rs create mode 100644 crates/weaver-api/src/sh_weaver/embed/video.rs create mode 100644 crates/weaver-api/src/sh_weaver/notebook.rs create mode 100644 crates/weaver-api/src/sh_weaver/notebook/authors.rs create mode 100644 crates/weaver-api/src/sh_weaver/notebook/book.rs create mode 100644 crates/weaver-api/src/sh_weaver/notebook/chapter.rs create mode 100644 crates/weaver-api/src/sh_weaver/notebook/entry.rs create mode 100644 crates/weaver-api/src/sh_weaver/publish.rs create mode 100644 crates/weaver-api/src/sh_weaver/publish/blob.rs create mode 100644 crates/weaver-api/src/tools_ozone.rs create mode 100644 crates/weaver-api/src/tools_ozone/communication.rs create mode 100644 crates/weaver-api/src/tools_ozone/communication/create_template.rs create mode 100644 crates/weaver-api/src/tools_ozone/communication/delete_template.rs create mode 100644 crates/weaver-api/src/tools_ozone/communication/list_templates.rs create mode 100644 crates/weaver-api/src/tools_ozone/communication/update_template.rs create mode 100644 crates/weaver-api/src/tools_ozone/hosting.rs create mode 100644 crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/emit_event.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/get_event.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/get_record.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/get_records.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/get_repo.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/get_reporter_stats.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/get_repos.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/get_subjects.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/list_scheduled_actions.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/query_events.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/query_statuses.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs create mode 100644 crates/weaver-api/src/tools_ozone/moderation/search_repos.rs create mode 100644 crates/weaver-api/src/tools_ozone/report.rs create mode 100644 crates/weaver-api/src/tools_ozone/safelink.rs create mode 100644 crates/weaver-api/src/tools_ozone/safelink/add_rule.rs create mode 100644 crates/weaver-api/src/tools_ozone/safelink/query_events.rs create mode 100644 crates/weaver-api/src/tools_ozone/safelink/query_rules.rs create mode 100644 crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs create mode 100644 crates/weaver-api/src/tools_ozone/safelink/update_rule.rs create mode 100644 crates/weaver-api/src/tools_ozone/server.rs create mode 100644 crates/weaver-api/src/tools_ozone/server/get_config.rs create mode 100644 crates/weaver-api/src/tools_ozone/set.rs create mode 100644 crates/weaver-api/src/tools_ozone/set/add_values.rs create mode 100644 crates/weaver-api/src/tools_ozone/set/delete_set.rs create mode 100644 crates/weaver-api/src/tools_ozone/set/delete_values.rs create mode 100644 crates/weaver-api/src/tools_ozone/set/get_values.rs create mode 100644 crates/weaver-api/src/tools_ozone/set/query_sets.rs create mode 100644 crates/weaver-api/src/tools_ozone/set/upsert_set.rs create mode 100644 crates/weaver-api/src/tools_ozone/setting.rs create mode 100644 crates/weaver-api/src/tools_ozone/setting/list_options.rs create mode 100644 crates/weaver-api/src/tools_ozone/setting/remove_options.rs create mode 100644 crates/weaver-api/src/tools_ozone/setting/upsert_option.rs create mode 100644 crates/weaver-api/src/tools_ozone/signature.rs create mode 100644 crates/weaver-api/src/tools_ozone/signature/find_correlation.rs create mode 100644 crates/weaver-api/src/tools_ozone/signature/find_related_accounts.rs create mode 100644 crates/weaver-api/src/tools_ozone/signature/search_accounts.rs create mode 100644 crates/weaver-api/src/tools_ozone/team.rs create mode 100644 crates/weaver-api/src/tools_ozone/team/add_member.rs create mode 100644 crates/weaver-api/src/tools_ozone/team/delete_member.rs create mode 100644 crates/weaver-api/src/tools_ozone/team/list_members.rs create mode 100644 crates/weaver-api/src/tools_ozone/team/update_member.rs create mode 100644 crates/weaver-api/src/tools_ozone/verification.rs create mode 100644 crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs create mode 100644 crates/weaver-api/src/tools_ozone/verification/list_verifications.rs create mode 100644 crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs create mode 100644 lexicons.kdl diff --git a/Cargo.lock b/Cargo.lock index d6d2a4a..2bedf02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -494,9 +494,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.43" +version = "1.2.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739eb0f94557554b3ca9a86d2d37bebd49c5e6d0c1d2bda35ba5bdac830befc2" +checksum = "37521ac7aabe3d13122dc382493e20c9416f299d2ccd5b3a5340a2570cdeb0f3" dependencies = [ "find-msvc-tools", "jobserver", @@ -2290,7 +2290,7 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jacquard" version = "0.8.0" -source = "git+https://tangled.org/@nonbinary.computer/jacquard#e806ffd7630aee98b94149686061a6cf1741aecf" +source = "git+https://tangled.org/@nonbinary.computer/jacquard#ece153be8332f8f222163257b910ba03d50951c8" dependencies = [ "bytes", "getrandom 0.2.16", @@ -2319,7 +2319,7 @@ dependencies = [ [[package]] name = "jacquard-api" version = "0.8.0" -source = "git+https://tangled.org/@nonbinary.computer/jacquard#e806ffd7630aee98b94149686061a6cf1741aecf" +source = "git+https://tangled.org/@nonbinary.computer/jacquard#ece153be8332f8f222163257b910ba03d50951c8" dependencies = [ "bon", "bytes", @@ -2337,7 +2337,7 @@ dependencies = [ [[package]] name = "jacquard-axum" version = "0.8.0" -source = "git+https://tangled.org/@nonbinary.computer/jacquard#e806ffd7630aee98b94149686061a6cf1741aecf" +source = "git+https://tangled.org/@nonbinary.computer/jacquard#ece153be8332f8f222163257b910ba03d50951c8" dependencies = [ "axum", "bytes", @@ -2359,7 +2359,7 @@ dependencies = [ [[package]] name = "jacquard-common" version = "0.8.0" -source = "git+https://tangled.org/@nonbinary.computer/jacquard#e806ffd7630aee98b94149686061a6cf1741aecf" +source = "git+https://tangled.org/@nonbinary.computer/jacquard#ece153be8332f8f222163257b910ba03d50951c8" dependencies = [ "base64 0.22.1", "bon", @@ -2402,7 +2402,7 @@ dependencies = [ [[package]] name = "jacquard-derive" version = "0.8.0" -source = "git+https://tangled.org/@nonbinary.computer/jacquard#e806ffd7630aee98b94149686061a6cf1741aecf" +source = "git+https://tangled.org/@nonbinary.computer/jacquard#ece153be8332f8f222163257b910ba03d50951c8" dependencies = [ "heck 0.5.0", "jacquard-lexicon", @@ -2414,7 +2414,7 @@ dependencies = [ [[package]] name = "jacquard-identity" version = "0.8.0" -source = "git+https://tangled.org/@nonbinary.computer/jacquard#e806ffd7630aee98b94149686061a6cf1741aecf" +source = "git+https://tangled.org/@nonbinary.computer/jacquard#ece153be8332f8f222163257b910ba03d50951c8" dependencies = [ "bon", "bytes", @@ -2441,7 +2441,7 @@ dependencies = [ [[package]] name = "jacquard-lexicon" version = "0.8.0" -source = "git+https://tangled.org/@nonbinary.computer/jacquard#e806ffd7630aee98b94149686061a6cf1741aecf" +source = "git+https://tangled.org/@nonbinary.computer/jacquard#ece153be8332f8f222163257b910ba03d50951c8" dependencies = [ "cid", "dashmap", @@ -2467,7 +2467,7 @@ dependencies = [ [[package]] name = "jacquard-oauth" version = "0.8.0" -source = "git+https://tangled.org/@nonbinary.computer/jacquard#e806ffd7630aee98b94149686061a6cf1741aecf" +source = "git+https://tangled.org/@nonbinary.computer/jacquard#ece153be8332f8f222163257b910ba03d50951c8" dependencies = [ "base64 0.22.1", "bytes", @@ -5676,6 +5676,22 @@ dependencies = [ "web-sys", ] +[[package]] +name = "weaver-api" +version = "0.8.0" +dependencies = [ + "bytes", + "jacquard-common", + "jacquard-derive", + "jacquard-lexicon", + "miette 7.6.0", + "rustversion", + "serde", + "serde_ipld_dagcbor", + "thiserror 2.0.17", + "unicode-segmentation", +] + [[package]] name = "weaver-appview" version = "0.1.0" @@ -5820,14 +5836,11 @@ dependencies = [ "aho-corasick", "byteorder", "bytes", - "cc", - "chrono", "data-encoding", "diesel", "diesel-async", "diesel_derives", "elliptic-curve", - "fastrand", "futures-channel", "futures-core", "futures-task", @@ -5844,8 +5857,9 @@ dependencies = [ "log", "memchr", "miette 7.6.0", - "mime_guess", "minijinja", + "minimal-lexical", + "nom", "num-traits", "p384", "percent-encoding", @@ -5853,11 +5867,9 @@ dependencies = [ "regex-automata", "reqwest", "sec1", - "serde_core", "serde_json", "sha2", "smallvec", - "spin 0.9.8", "subtle", "syn 2.0.108", "syntect", @@ -5869,6 +5881,8 @@ dependencies = [ "tracing", "tracing-core", "uuid", + "winnow", + "zerocopy", "zeroize", ] diff --git a/Cargo.toml b/Cargo.toml index 3dc9afa..f867ec3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ name = "weaver-workspace" [workspace.dependencies] serde = { version = "1.0", features = ["derive"] } - +bytes = "1.10" minijinja = { version = "2.9.0", default-features = false } minijinja-contrib = { version = "2.9.0", default-features = false } miette = { version = "7.6" } diff --git a/crates/weaver-api/Cargo.toml b/crates/weaver-api/Cargo.toml new file mode 100644 index 0000000..faffbd6 --- /dev/null +++ b/crates/weaver-api/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "weaver-api" +description = "Generated AT Protocol API bindings for Weaver" +edition.workspace = true +version = "0.8.0" +authors.workspace = true + +[dependencies] +bytes = { workspace = true, features = ["serde"] } +jacquard-common = { git = "https://tangled.org/@nonbinary.computer/jacquard" } +jacquard-derive = { git = "https://tangled.org/@nonbinary.computer/jacquard" } +jacquard-lexicon = { git = "https://tangled.org/@nonbinary.computer/jacquard", default-features = false } +miette.workspace = true +rustversion = "1.0" +serde.workspace = true +serde_ipld_dagcbor = "0.6" +thiserror.workspace = true +unicode-segmentation = "1.12" + + +[lints.rust] +# just so that my rust-analyzer shuts up about the module name for 2048.blue's namespace +non_snake_case = "allow" + +[features] +default = ["sh_weaver", "com_atproto"] +streaming = ["jacquard-common/websocket"] + +# --- generated --- +# Generated namespace features +app_bsky = [] +chat_bsky = [] +com_atproto = [] +sh_weaver = ["app_bsky"] +tools_ozone = ["chat_bsky", "com_atproto"] diff --git a/crates/weaver-api/lexicons/app_bsky_actor_defs.json b/crates/weaver-api/lexicons/app_bsky_actor_defs.json new file mode 100644 index 0000000..9019b30 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_defs.json @@ -0,0 +1,886 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.defs", + "defs": { + "adultContentPref": { + "type": "object", + "required": [ + "enabled" + ], + "properties": { + "enabled": { + "type": "boolean", + "default": false + } + } + }, + "bskyAppProgressGuide": { + "type": "object", + "description": "If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.", + "required": [ + "guide" + ], + "properties": { + "guide": { + "type": "string", + "maxLength": 100 + } + } + }, + "bskyAppStatePref": { + "type": "object", + "description": "A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.", + "properties": { + "activeProgressGuide": { + "type": "ref", + "ref": "#bskyAppProgressGuide" + }, + "nuxs": { + "type": "array", + "description": "Storage for NUXs the user has encountered.", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#nux" + }, + "maxLength": 100 + }, + "queuedNudges": { + "type": "array", + "description": "An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.", + "items": { + "type": "string", + "maxLength": 100 + }, + "maxLength": 1000 + } + } + }, + "contentLabelPref": { + "type": "object", + "required": [ + "label", + "visibility" + ], + "properties": { + "label": { + "type": "string" + }, + "labelerDid": { + "type": "string", + "description": "Which labeler does this preference apply to? If undefined, applies globally.", + "format": "did" + }, + "visibility": { + "type": "string", + "knownValues": [ + "ignore", + "show", + "warn", + "hide" + ] + } + } + }, + "feedViewPref": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "feed": { + "type": "string", + "description": "The URI of the feed, or an identifier which describes the feed." + }, + "hideQuotePosts": { + "type": "boolean", + "description": "Hide quote posts in the feed." + }, + "hideReplies": { + "type": "boolean", + "description": "Hide replies in the feed." + }, + "hideRepliesByLikeCount": { + "type": "integer", + "description": "Hide replies in the feed if they do not have this number of likes." + }, + "hideRepliesByUnfollowed": { + "type": "boolean", + "description": "Hide replies in the feed if they are not by followed users.", + "default": true + }, + "hideReposts": { + "type": "boolean", + "description": "Hide reposts in the feed." + } + } + }, + "hiddenPostsPref": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "A list of URIs of posts the account owner has hidden.", + "items": { + "type": "string", + "format": "at-uri" + } + } + } + }, + "interestsPref": { + "type": "object", + "required": [ + "tags" + ], + "properties": { + "tags": { + "type": "array", + "description": "A list of tags which describe the account owner's interests gathered during onboarding.", + "items": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "maxLength": 100 + } + } + }, + "knownFollowers": { + "type": "object", + "description": "The subject's followers whom you also follow", + "required": [ + "count", + "followers" + ], + "properties": { + "count": { + "type": "integer" + }, + "followers": { + "type": "array", + "items": { + "type": "ref", + "ref": "#profileViewBasic" + }, + "minLength": 0, + "maxLength": 5 + } + } + }, + "labelerPrefItem": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "labelersPref": { + "type": "object", + "required": [ + "labelers" + ], + "properties": { + "labelers": { + "type": "array", + "items": { + "type": "ref", + "ref": "#labelerPrefItem" + } + } + } + }, + "mutedWord": { + "type": "object", + "description": "A word that the account owner has muted.", + "required": [ + "value", + "targets" + ], + "properties": { + "actorTarget": { + "type": "string", + "description": "Groups of users to apply the muted word to. If undefined, applies to all users.", + "default": "all", + "knownValues": [ + "all", + "exclude-following" + ] + }, + "expiresAt": { + "type": "string", + "description": "The date and time at which the muted word will expire and no longer be applied.", + "format": "datetime" + }, + "id": { + "type": "string" + }, + "targets": { + "type": "array", + "description": "The intended targets of the muted word.", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#mutedWordTarget" + } + }, + "value": { + "type": "string", + "description": "The muted word itself.", + "maxLength": 10000, + "maxGraphemes": 1000 + } + } + }, + "mutedWordTarget": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64, + "knownValues": [ + "content", + "tag" + ] + }, + "mutedWordsPref": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "A list of words the account owner has muted.", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#mutedWord" + } + } + } + }, + "nux": { + "type": "object", + "description": "A new user experiences (NUX) storage object", + "required": [ + "id", + "completed" + ], + "properties": { + "completed": { + "type": "boolean", + "default": false + }, + "data": { + "type": "string", + "description": "Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.", + "maxLength": 3000, + "maxGraphemes": 300 + }, + "expiresAt": { + "type": "string", + "description": "The date and time at which the NUX will expire and should be considered completed.", + "format": "datetime" + }, + "id": { + "type": "string", + "maxLength": 100 + } + } + }, + "personalDetailsPref": { + "type": "object", + "properties": { + "birthDate": { + "type": "string", + "description": "The birth date of account owner.", + "format": "datetime" + } + } + }, + "postInteractionSettingsPref": { + "type": "object", + "description": "Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.", + "required": [], + "properties": { + "postgateEmbeddingRules": { + "type": "array", + "description": "Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.", + "items": { + "type": "union", + "refs": [ + "app.bsky.feed.postgate#disableRule" + ] + }, + "maxLength": 5 + }, + "threadgateAllowRules": { + "type": "array", + "description": "Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.", + "items": { + "type": "union", + "refs": [ + "app.bsky.feed.threadgate#mentionRule", + "app.bsky.feed.threadgate#followerRule", + "app.bsky.feed.threadgate#followingRule", + "app.bsky.feed.threadgate#listRule" + ] + }, + "maxLength": 5 + } + } + }, + "preferences": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "#adultContentPref", + "#contentLabelPref", + "#savedFeedsPref", + "#savedFeedsPrefV2", + "#personalDetailsPref", + "#feedViewPref", + "#threadViewPref", + "#interestsPref", + "#mutedWordsPref", + "#hiddenPostsPref", + "#bskyAppStatePref", + "#labelersPref", + "#postInteractionSettingsPref", + "#verificationPrefs" + ] + } + }, + "profileAssociated": { + "type": "object", + "properties": { + "activitySubscription": { + "type": "ref", + "ref": "#profileAssociatedActivitySubscription" + }, + "chat": { + "type": "ref", + "ref": "#profileAssociatedChat" + }, + "feedgens": { + "type": "integer" + }, + "labeler": { + "type": "boolean" + }, + "lists": { + "type": "integer" + }, + "starterPacks": { + "type": "integer" + } + } + }, + "profileAssociatedActivitySubscription": { + "type": "object", + "required": [ + "allowSubscriptions" + ], + "properties": { + "allowSubscriptions": { + "type": "string", + "knownValues": [ + "followers", + "mutuals", + "none" + ] + } + } + }, + "profileAssociatedChat": { + "type": "object", + "required": [ + "allowIncoming" + ], + "properties": { + "allowIncoming": { + "type": "string", + "knownValues": [ + "all", + "none", + "following" + ] + } + } + }, + "profileView": { + "type": "object", + "required": [ + "did", + "handle" + ], + "properties": { + "associated": { + "type": "ref", + "ref": "#profileAssociated" + }, + "avatar": { + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "debug": { + "type": "unknown", + "description": "Debug information for internal development" + }, + "description": { + "type": "string", + "maxLength": 2560, + "maxGraphemes": 256 + }, + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "handle": { + "type": "string", + "format": "handle" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "pronouns": { + "type": "string" + }, + "status": { + "type": "ref", + "ref": "#statusView" + }, + "verification": { + "type": "ref", + "ref": "#verificationState" + }, + "viewer": { + "type": "ref", + "ref": "#viewerState" + } + } + }, + "profileViewBasic": { + "type": "object", + "required": [ + "did", + "handle" + ], + "properties": { + "associated": { + "type": "ref", + "ref": "#profileAssociated" + }, + "avatar": { + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "debug": { + "type": "unknown", + "description": "Debug information for internal development" + }, + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "handle": { + "type": "string", + "format": "handle" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "pronouns": { + "type": "string" + }, + "status": { + "type": "ref", + "ref": "#statusView" + }, + "verification": { + "type": "ref", + "ref": "#verificationState" + }, + "viewer": { + "type": "ref", + "ref": "#viewerState" + } + } + }, + "profileViewDetailed": { + "type": "object", + "required": [ + "did", + "handle" + ], + "properties": { + "associated": { + "type": "ref", + "ref": "#profileAssociated" + }, + "avatar": { + "type": "string", + "format": "uri" + }, + "banner": { + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "debug": { + "type": "unknown", + "description": "Debug information for internal development" + }, + "description": { + "type": "string", + "maxLength": 2560, + "maxGraphemes": 256 + }, + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "followersCount": { + "type": "integer" + }, + "followsCount": { + "type": "integer" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "joinedViaStarterPack": { + "type": "ref", + "ref": "app.bsky.graph.defs#starterPackViewBasic" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "pinnedPost": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "postsCount": { + "type": "integer" + }, + "pronouns": { + "type": "string" + }, + "status": { + "type": "ref", + "ref": "#statusView" + }, + "verification": { + "type": "ref", + "ref": "#verificationState" + }, + "viewer": { + "type": "ref", + "ref": "#viewerState" + }, + "website": { + "type": "string", + "format": "uri" + } + } + }, + "savedFeed": { + "type": "object", + "required": [ + "id", + "type", + "value", + "pinned" + ], + "properties": { + "id": { + "type": "string" + }, + "pinned": { + "type": "boolean" + }, + "type": { + "type": "string", + "knownValues": [ + "feed", + "list", + "timeline" + ] + }, + "value": { + "type": "string" + } + } + }, + "savedFeedsPref": { + "type": "object", + "required": [ + "pinned", + "saved" + ], + "properties": { + "pinned": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + } + }, + "saved": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + } + }, + "timelineIndex": { + "type": "integer" + } + } + }, + "savedFeedsPrefV2": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#savedFeed" + } + } + } + }, + "statusView": { + "type": "object", + "required": [ + "status", + "record" + ], + "properties": { + "embed": { + "type": "union", + "description": "An optional embed associated with the status.", + "refs": [ + "app.bsky.embed.external#view" + ] + }, + "expiresAt": { + "type": "string", + "description": "The date when this status will expire. The application might choose to no longer return the status after expiration.", + "format": "datetime" + }, + "isActive": { + "type": "boolean", + "description": "True if the status is not expired, false if it is expired. Only present if expiration was set." + }, + "record": { + "type": "unknown" + }, + "status": { + "type": "string", + "description": "The status for the account.", + "knownValues": [ + "app.bsky.actor.status#live" + ] + } + } + }, + "threadViewPref": { + "type": "object", + "properties": { + "prioritizeFollowedUsers": { + "type": "boolean", + "description": "Show followed users at the top of all replies." + }, + "sort": { + "type": "string", + "description": "Sorting mode for threads.", + "knownValues": [ + "oldest", + "newest", + "most-likes", + "random", + "hotness" + ] + } + } + }, + "verificationPrefs": { + "type": "object", + "description": "Preferences for how verified accounts appear in the app.", + "required": [], + "properties": { + "hideBadges": { + "type": "boolean", + "description": "Hide the blue check badges for verified accounts and trusted verifiers.", + "default": false + } + } + }, + "verificationState": { + "type": "object", + "description": "Represents the verification information about the user this object is attached to.", + "required": [ + "verifications", + "verifiedStatus", + "trustedVerifierStatus" + ], + "properties": { + "trustedVerifierStatus": { + "type": "string", + "description": "The user's status as a trusted verifier.", + "knownValues": [ + "valid", + "invalid", + "none" + ] + }, + "verifications": { + "type": "array", + "description": "All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.", + "items": { + "type": "ref", + "ref": "#verificationView" + } + }, + "verifiedStatus": { + "type": "string", + "description": "The user's status as a verified account.", + "knownValues": [ + "valid", + "invalid", + "none" + ] + } + } + }, + "verificationView": { + "type": "object", + "description": "An individual verification for an associated subject.", + "required": [ + "issuer", + "uri", + "isValid", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Timestamp when the verification was created.", + "format": "datetime" + }, + "isValid": { + "type": "boolean", + "description": "True if the verification passes validation, otherwise false." + }, + "issuer": { + "type": "string", + "description": "The user who issued this verification.", + "format": "did" + }, + "uri": { + "type": "string", + "description": "The AT-URI of the verification record.", + "format": "at-uri" + } + } + }, + "viewerState": { + "type": "object", + "description": "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.", + "properties": { + "activitySubscription": { + "type": "ref", + "description": "This property is present only in selected cases, as an optimization.", + "ref": "app.bsky.notification.defs#activitySubscription" + }, + "blockedBy": { + "type": "boolean" + }, + "blocking": { + "type": "string", + "format": "at-uri" + }, + "blockingByList": { + "type": "ref", + "ref": "app.bsky.graph.defs#listViewBasic" + }, + "followedBy": { + "type": "string", + "format": "at-uri" + }, + "following": { + "type": "string", + "format": "at-uri" + }, + "knownFollowers": { + "type": "ref", + "description": "This property is present only in selected cases, as an optimization.", + "ref": "#knownFollowers" + }, + "muted": { + "type": "boolean" + }, + "mutedByList": { + "type": "ref", + "ref": "app.bsky.graph.defs#listViewBasic" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_getPreferences.json b/crates/weaver-api/lexicons/app_bsky_actor_getPreferences.json new file mode 100644 index 0000000..9c37cb9 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_getPreferences.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.getPreferences", + "defs": { + "main": { + "type": "query", + "description": "Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth.", + "parameters": { + "type": "params", + "properties": {} + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "preferences" + ], + "properties": { + "preferences": { + "type": "ref", + "ref": "app.bsky.actor.defs#preferences" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_getProfile.json b/crates/weaver-api/lexicons/app_bsky_actor_getProfile.json new file mode 100644 index 0000000..7295fba --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_getProfile.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.getProfile", + "defs": { + "main": { + "type": "query", + "description": "Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "description": "Handle or DID of account to fetch profile of.", + "format": "at-identifier" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewDetailed" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_getProfiles.json b/crates/weaver-api/lexicons/app_bsky_actor_getProfiles.json new file mode 100644 index 0000000..e4c3fea --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_getProfiles.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.getProfiles", + "defs": { + "main": { + "type": "query", + "description": "Get detailed profile views of multiple actors.", + "parameters": { + "type": "params", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "string", + "format": "at-identifier" + }, + "maxLength": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "profiles" + ], + "properties": { + "profiles": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewDetailed" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_getSuggestions.json b/crates/weaver-api/lexicons/app_bsky_actor_getSuggestions.json new file mode 100644 index 0000000..2f533e4 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_getSuggestions.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.getSuggestions", + "defs": { + "main": { + "type": "query", + "description": "Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + }, + "cursor": { + "type": "string" + }, + "recId": { + "type": "integer", + "description": "Snowflake for this recommendation, use when submitting recommendation events." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_profile.json b/crates/weaver-api/lexicons/app_bsky_actor_profile.json new file mode 100644 index 0000000..414214d --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_profile.json @@ -0,0 +1,74 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.profile", + "defs": { + "main": { + "type": "record", + "description": "A declaration of a Bluesky account profile.", + "key": "literal:self", + "record": { + "type": "object", + "properties": { + "avatar": { + "type": "blob", + "description": "Small image to be displayed next to posts from account. AKA, 'profile picture'", + "accept": [ + "image/png", + "image/jpeg" + ], + "maxSize": 1000000 + }, + "banner": { + "type": "blob", + "description": "Larger horizontal image to display behind profile view.", + "accept": [ + "image/png", + "image/jpeg" + ], + "maxSize": 1000000 + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "description": { + "type": "string", + "description": "Free-form profile description text.", + "maxLength": 2560, + "maxGraphemes": 256 + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "joinedViaStarterPack": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "labels": { + "type": "union", + "description": "Self-label values, specific to the Bluesky application, on the overall account.", + "refs": [ + "com.atproto.label.defs#selfLabels" + ] + }, + "pinnedPost": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "pronouns": { + "type": "string", + "description": "Free-form pronouns text.", + "maxLength": 200, + "maxGraphemes": 20 + }, + "website": { + "type": "string", + "format": "uri" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_putPreferences.json b/crates/weaver-api/lexicons/app_bsky_actor_putPreferences.json new file mode 100644 index 0000000..86dc47f --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_putPreferences.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.putPreferences", + "defs": { + "main": { + "type": "procedure", + "description": "Set the private preferences attached to the account.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "preferences" + ], + "properties": { + "preferences": { + "type": "ref", + "ref": "app.bsky.actor.defs#preferences" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_searchActors.json b/crates/weaver-api/lexicons/app_bsky_actor_searchActors.json new file mode 100644 index 0000000..c81bb18 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_searchActors.json @@ -0,0 +1,53 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.searchActors", + "defs": { + "main": { + "type": "query", + "description": "Find actors (profiles) matching search criteria. Does not require auth.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string", + "description": "Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended." + }, + "term": { + "type": "string", + "description": "DEPRECATED: use 'q' instead." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_searchActorsTypeahead.json b/crates/weaver-api/lexicons/app_bsky_actor_searchActorsTypeahead.json new file mode 100644 index 0000000..9fcae20 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_searchActorsTypeahead.json @@ -0,0 +1,47 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.searchActorsTypeahead", + "defs": { + "main": { + "type": "query", + "description": "Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth.", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string", + "description": "Search query prefix; not a full query string." + }, + "term": { + "type": "string", + "description": "DEPRECATED: use 'q' instead." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewBasic" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_actor_status.json b/crates/weaver-api/lexicons/app_bsky_actor_status.json new file mode 100644 index 0000000..ead520d --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_actor_status.json @@ -0,0 +1,47 @@ +{ + "lexicon": 1, + "id": "app.bsky.actor.status", + "defs": { + "live": { + "type": "token", + "description": "Advertises an account as currently offering live content." + }, + "main": { + "type": "record", + "description": "A declaration of a Bluesky account status.", + "key": "literal:self", + "record": { + "type": "object", + "required": [ + "status", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "durationMinutes": { + "type": "integer", + "description": "The duration of the status in minutes. Applications can choose to impose minimum and maximum limits.", + "minimum": 1 + }, + "embed": { + "type": "union", + "description": "An optional embed associated with the status.", + "refs": [ + "app.bsky.embed.external" + ] + }, + "status": { + "type": "string", + "description": "The status for the account.", + "knownValues": [ + "app.bsky.actor.status#live" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_bookmark_createBookmark.json b/crates/weaver-api/lexicons/app_bsky_bookmark_createBookmark.json new file mode 100644 index 0000000..ad0be39 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_bookmark_createBookmark.json @@ -0,0 +1,36 @@ +{ + "lexicon": 1, + "id": "app.bsky.bookmark.createBookmark", + "defs": { + "main": { + "type": "procedure", + "description": "Creates a private bookmark for the specified record. Currently, only `app.bsky.feed.post` records are supported. Requires authentication.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + }, + "errors": [ + { + "description": "The URI to be bookmarked is for an unsupported collection.", + "name": "UnsupportedCollection" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_bookmark_defs.json b/crates/weaver-api/lexicons/app_bsky_bookmark_defs.json new file mode 100644 index 0000000..e29e6a4 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_bookmark_defs.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "app.bsky.bookmark.defs", + "defs": { + "bookmark": { + "type": "object", + "description": "Object used to store bookmark data in stash.", + "required": [ + "subject" + ], + "properties": { + "subject": { + "type": "ref", + "description": "A strong ref to the record to be bookmarked. Currently, only `app.bsky.feed.post` records are supported.", + "ref": "com.atproto.repo.strongRef" + } + } + }, + "bookmarkView": { + "type": "object", + "required": [ + "subject", + "item" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "item": { + "type": "union", + "refs": [ + "app.bsky.feed.defs#blockedPost", + "app.bsky.feed.defs#notFoundPost", + "app.bsky.feed.defs#postView" + ] + }, + "subject": { + "type": "ref", + "description": "A strong ref to the bookmarked record.", + "ref": "com.atproto.repo.strongRef" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_bookmark_deleteBookmark.json b/crates/weaver-api/lexicons/app_bsky_bookmark_deleteBookmark.json new file mode 100644 index 0000000..7e5c59e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_bookmark_deleteBookmark.json @@ -0,0 +1,31 @@ +{ + "lexicon": 1, + "id": "app.bsky.bookmark.deleteBookmark", + "defs": { + "main": { + "type": "procedure", + "description": "Deletes a private bookmark for the specified record. Currently, only `app.bsky.feed.post` records are supported. Requires authentication.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + }, + "errors": [ + { + "description": "The URI to be bookmarked is for an unsupported collection.", + "name": "UnsupportedCollection" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_bookmark_getBookmarks.json b/crates/weaver-api/lexicons/app_bsky_bookmark_getBookmarks.json new file mode 100644 index 0000000..c1576d0 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_bookmark_getBookmarks.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "app.bsky.bookmark.getBookmarks", + "defs": { + "main": { + "type": "query", + "description": "Gets views of records bookmarked by the authenticated user. Requires authentication.", + "parameters": { + "type": "params", + "properties": { + "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": "ref", + "ref": "app.bsky.bookmark.defs#bookmarkView" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_embed_defs.json b/crates/weaver-api/lexicons/app_bsky_embed_defs.json new file mode 100644 index 0000000..32ddeaa --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_embed_defs.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "app.bsky.embed.defs", + "defs": { + "aspectRatio": { + "type": "object", + "description": "width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.", + "required": [ + "width", + "height" + ], + "properties": { + "height": { + "type": "integer", + "minimum": 1 + }, + "width": { + "type": "integer", + "minimum": 1 + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_embed_external.json b/crates/weaver-api/lexicons/app_bsky_embed_external.json new file mode 100644 index 0000000..a6ed107 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_embed_external.json @@ -0,0 +1,82 @@ +{ + "lexicon": 1, + "id": "app.bsky.embed.external", + "defs": { + "external": { + "type": "object", + "required": [ + "uri", + "title", + "description" + ], + "properties": { + "description": { + "type": "string" + }, + "thumb": { + "type": "blob", + "accept": [ + "image/*" + ], + "maxSize": 1000000 + }, + "title": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "uri" + } + } + }, + "main": { + "type": "object", + "description": "A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).", + "required": [ + "external" + ], + "properties": { + "external": { + "type": "ref", + "ref": "#external" + } + } + }, + "view": { + "type": "object", + "required": [ + "external" + ], + "properties": { + "external": { + "type": "ref", + "ref": "#viewExternal" + } + } + }, + "viewExternal": { + "type": "object", + "required": [ + "uri", + "title", + "description" + ], + "properties": { + "description": { + "type": "string" + }, + "thumb": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_embed_images.json b/crates/weaver-api/lexicons/app_bsky_embed_images.json new file mode 100644 index 0000000..93ddae2 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_embed_images.json @@ -0,0 +1,91 @@ +{ + "lexicon": 1, + "id": "app.bsky.embed.images", + "description": "A set of images embedded in a Bluesky record (eg, a post).", + "defs": { + "image": { + "type": "object", + "required": [ + "image", + "alt" + ], + "properties": { + "alt": { + "type": "string", + "description": "Alt text description of the image, for accessibility." + }, + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + }, + "image": { + "type": "blob", + "accept": [ + "image/*" + ], + "maxSize": 1000000 + } + } + }, + "main": { + "type": "object", + "required": [ + "images" + ], + "properties": { + "images": { + "type": "array", + "items": { + "type": "ref", + "ref": "#image" + }, + "maxLength": 4 + } + } + }, + "view": { + "type": "object", + "required": [ + "images" + ], + "properties": { + "images": { + "type": "array", + "items": { + "type": "ref", + "ref": "#viewImage" + }, + "maxLength": 4 + } + } + }, + "viewImage": { + "type": "object", + "required": [ + "thumb", + "fullsize", + "alt" + ], + "properties": { + "alt": { + "type": "string", + "description": "Alt text description of the image, for accessibility." + }, + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + }, + "fullsize": { + "type": "string", + "description": "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.", + "format": "uri" + }, + "thumb": { + "type": "string", + "description": "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.", + "format": "uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_embed_record.json b/crates/weaver-api/lexicons/app_bsky_embed_record.json new file mode 100644 index 0000000..e26dc31 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_embed_record.json @@ -0,0 +1,160 @@ +{ + "lexicon": 1, + "id": "app.bsky.embed.record", + "description": "A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.", + "defs": { + "main": { + "type": "object", + "required": [ + "record" + ], + "properties": { + "record": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + }, + "view": { + "type": "object", + "required": [ + "record" + ], + "properties": { + "record": { + "type": "union", + "refs": [ + "#viewRecord", + "#viewNotFound", + "#viewBlocked", + "#viewDetached", + "app.bsky.feed.defs#generatorView", + "app.bsky.graph.defs#listView", + "app.bsky.labeler.defs#labelerView", + "app.bsky.graph.defs#starterPackViewBasic" + ] + } + } + }, + "viewBlocked": { + "type": "object", + "required": [ + "uri", + "blocked", + "author" + ], + "properties": { + "author": { + "type": "ref", + "ref": "app.bsky.feed.defs#blockedAuthor" + }, + "blocked": { + "type": "boolean", + "const": true + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "viewDetached": { + "type": "object", + "required": [ + "uri", + "detached" + ], + "properties": { + "detached": { + "type": "boolean", + "const": true + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "viewNotFound": { + "type": "object", + "required": [ + "uri", + "notFound" + ], + "properties": { + "notFound": { + "type": "boolean", + "const": true + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "viewRecord": { + "type": "object", + "required": [ + "uri", + "cid", + "author", + "value", + "indexedAt" + ], + "properties": { + "author": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewBasic" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "embeds": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "app.bsky.embed.images#view", + "app.bsky.embed.video#view", + "app.bsky.embed.external#view", + "app.bsky.embed.record#view", + "app.bsky.embed.recordWithMedia#view" + ] + } + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "likeCount": { + "type": "integer" + }, + "quoteCount": { + "type": "integer" + }, + "replyCount": { + "type": "integer" + }, + "repostCount": { + "type": "integer" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "value": { + "type": "unknown", + "description": "The record data itself." + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_embed_recordWithMedia.json b/crates/weaver-api/lexicons/app_bsky_embed_recordWithMedia.json new file mode 100644 index 0000000..83d2a7c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_embed_recordWithMedia.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "app.bsky.embed.recordWithMedia", + "description": "A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.", + "defs": { + "main": { + "type": "object", + "required": [ + "record", + "media" + ], + "properties": { + "media": { + "type": "union", + "refs": [ + "app.bsky.embed.images", + "app.bsky.embed.video", + "app.bsky.embed.external" + ] + }, + "record": { + "type": "ref", + "ref": "app.bsky.embed.record" + } + } + }, + "view": { + "type": "object", + "required": [ + "record", + "media" + ], + "properties": { + "media": { + "type": "union", + "refs": [ + "app.bsky.embed.images#view", + "app.bsky.embed.video#view", + "app.bsky.embed.external#view" + ] + }, + "record": { + "type": "ref", + "ref": "app.bsky.embed.record#view" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_embed_video.json b/crates/weaver-api/lexicons/app_bsky_embed_video.json new file mode 100644 index 0000000..72f143e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_embed_video.json @@ -0,0 +1,91 @@ +{ + "lexicon": 1, + "id": "app.bsky.embed.video", + "description": "A video embedded in a Bluesky record (eg, a post).", + "defs": { + "caption": { + "type": "object", + "required": [ + "lang", + "file" + ], + "properties": { + "file": { + "type": "blob", + "accept": [ + "text/vtt" + ], + "maxSize": 20000 + }, + "lang": { + "type": "string", + "format": "language" + } + } + }, + "main": { + "type": "object", + "required": [ + "video" + ], + "properties": { + "alt": { + "type": "string", + "description": "Alt text description of the video, for accessibility.", + "maxLength": 10000, + "maxGraphemes": 1000 + }, + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + }, + "captions": { + "type": "array", + "items": { + "type": "ref", + "ref": "#caption" + }, + "maxLength": 20 + }, + "video": { + "type": "blob", + "description": "The mp4 video file. May be up to 100mb, formerly limited to 50mb.", + "accept": [ + "video/mp4" + ], + "maxSize": 100000000 + } + } + }, + "view": { + "type": "object", + "required": [ + "cid", + "playlist" + ], + "properties": { + "alt": { + "type": "string", + "maxLength": 10000, + "maxGraphemes": 1000 + }, + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "playlist": { + "type": "string", + "format": "uri" + }, + "thumbnail": { + "type": "string", + "format": "uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_defs.json b/crates/weaver-api/lexicons/app_bsky_feed_defs.json new file mode 100644 index 0000000..2839529 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_defs.json @@ -0,0 +1,543 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.defs", + "defs": { + "blockedAuthor": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "viewer": { + "type": "ref", + "ref": "app.bsky.actor.defs#viewerState" + } + } + }, + "blockedPost": { + "type": "object", + "required": [ + "uri", + "blocked", + "author" + ], + "properties": { + "author": { + "type": "ref", + "ref": "#blockedAuthor" + }, + "blocked": { + "type": "boolean", + "const": true + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "clickthroughAuthor": { + "type": "token", + "description": "User clicked through to the author of the feed item" + }, + "clickthroughEmbed": { + "type": "token", + "description": "User clicked through to the embedded content of the feed item" + }, + "clickthroughItem": { + "type": "token", + "description": "User clicked through to the feed item" + }, + "clickthroughReposter": { + "type": "token", + "description": "User clicked through to the reposter of the feed item" + }, + "contentModeUnspecified": { + "type": "token", + "description": "Declares the feed generator returns any types of posts." + }, + "contentModeVideo": { + "type": "token", + "description": "Declares the feed generator returns posts containing app.bsky.embed.video embeds." + }, + "feedViewPost": { + "type": "object", + "required": [ + "post" + ], + "properties": { + "feedContext": { + "type": "string", + "description": "Context provided by feed generator that may be passed back alongside interactions.", + "maxLength": 2000 + }, + "post": { + "type": "ref", + "ref": "#postView" + }, + "reason": { + "type": "union", + "refs": [ + "#reasonRepost", + "#reasonPin" + ] + }, + "reply": { + "type": "ref", + "ref": "#replyRef" + }, + "reqId": { + "type": "string", + "description": "Unique identifier per request that may be passed back alongside interactions.", + "maxLength": 100 + } + } + }, + "generatorView": { + "type": "object", + "required": [ + "uri", + "cid", + "did", + "creator", + "displayName", + "indexedAt" + ], + "properties": { + "acceptsInteractions": { + "type": "boolean" + }, + "avatar": { + "type": "string", + "format": "uri" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "contentMode": { + "type": "string", + "knownValues": [ + "app.bsky.feed.defs#contentModeUnspecified", + "app.bsky.feed.defs#contentModeVideo" + ] + }, + "creator": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + }, + "description": { + "type": "string", + "maxLength": 3000, + "maxGraphemes": 300 + }, + "descriptionFacets": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + } + }, + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "likeCount": { + "type": "integer", + "minimum": 0 + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "viewer": { + "type": "ref", + "ref": "#generatorViewerState" + } + } + }, + "generatorViewerState": { + "type": "object", + "properties": { + "like": { + "type": "string", + "format": "at-uri" + } + } + }, + "interaction": { + "type": "object", + "properties": { + "event": { + "type": "string", + "knownValues": [ + "app.bsky.feed.defs#requestLess", + "app.bsky.feed.defs#requestMore", + "app.bsky.feed.defs#clickthroughItem", + "app.bsky.feed.defs#clickthroughAuthor", + "app.bsky.feed.defs#clickthroughReposter", + "app.bsky.feed.defs#clickthroughEmbed", + "app.bsky.feed.defs#interactionSeen", + "app.bsky.feed.defs#interactionLike", + "app.bsky.feed.defs#interactionRepost", + "app.bsky.feed.defs#interactionReply", + "app.bsky.feed.defs#interactionQuote", + "app.bsky.feed.defs#interactionShare" + ] + }, + "feedContext": { + "type": "string", + "description": "Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.", + "maxLength": 2000 + }, + "item": { + "type": "string", + "format": "at-uri" + }, + "reqId": { + "type": "string", + "description": "Unique identifier per request that may be passed back alongside interactions.", + "maxLength": 100 + } + } + }, + "interactionLike": { + "type": "token", + "description": "User liked the feed item" + }, + "interactionQuote": { + "type": "token", + "description": "User quoted the feed item" + }, + "interactionReply": { + "type": "token", + "description": "User replied to the feed item" + }, + "interactionRepost": { + "type": "token", + "description": "User reposted the feed item" + }, + "interactionSeen": { + "type": "token", + "description": "Feed item was seen by user" + }, + "interactionShare": { + "type": "token", + "description": "User shared the feed item" + }, + "notFoundPost": { + "type": "object", + "required": [ + "uri", + "notFound" + ], + "properties": { + "notFound": { + "type": "boolean", + "const": true + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "postView": { + "type": "object", + "required": [ + "uri", + "cid", + "author", + "record", + "indexedAt" + ], + "properties": { + "author": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewBasic" + }, + "bookmarkCount": { + "type": "integer" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "debug": { + "type": "unknown", + "description": "Debug information for internal development" + }, + "embed": { + "type": "union", + "refs": [ + "app.bsky.embed.images#view", + "app.bsky.embed.video#view", + "app.bsky.embed.external#view", + "app.bsky.embed.record#view", + "app.bsky.embed.recordWithMedia#view" + ] + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "likeCount": { + "type": "integer" + }, + "quoteCount": { + "type": "integer" + }, + "record": { + "type": "unknown" + }, + "replyCount": { + "type": "integer" + }, + "repostCount": { + "type": "integer" + }, + "threadgate": { + "type": "ref", + "ref": "#threadgateView" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "viewer": { + "type": "ref", + "ref": "#viewerState" + } + } + }, + "reasonPin": { + "type": "object", + "properties": {} + }, + "reasonRepost": { + "type": "object", + "required": [ + "by", + "indexedAt" + ], + "properties": { + "by": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewBasic" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "replyRef": { + "type": "object", + "required": [ + "root", + "parent" + ], + "properties": { + "grandparentAuthor": { + "type": "ref", + "description": "When parent is a reply to another post, this is the author of that post.", + "ref": "app.bsky.actor.defs#profileViewBasic" + }, + "parent": { + "type": "union", + "refs": [ + "#postView", + "#notFoundPost", + "#blockedPost" + ] + }, + "root": { + "type": "union", + "refs": [ + "#postView", + "#notFoundPost", + "#blockedPost" + ] + } + } + }, + "requestLess": { + "type": "token", + "description": "Request that less content like the given feed item be shown in the feed" + }, + "requestMore": { + "type": "token", + "description": "Request that more content like the given feed item be shown in the feed" + }, + "skeletonFeedPost": { + "type": "object", + "required": [ + "post" + ], + "properties": { + "feedContext": { + "type": "string", + "description": "Context that will be passed through to client and may be passed to feed generator back alongside interactions.", + "maxLength": 2000 + }, + "post": { + "type": "string", + "format": "at-uri" + }, + "reason": { + "type": "union", + "refs": [ + "#skeletonReasonRepost", + "#skeletonReasonPin" + ] + } + } + }, + "skeletonReasonPin": { + "type": "object", + "properties": {} + }, + "skeletonReasonRepost": { + "type": "object", + "required": [ + "repost" + ], + "properties": { + "repost": { + "type": "string", + "format": "at-uri" + } + } + }, + "threadContext": { + "type": "object", + "description": "Metadata about this post within the context of the thread it is in.", + "properties": { + "rootAuthorLike": { + "type": "string", + "format": "at-uri" + } + } + }, + "threadViewPost": { + "type": "object", + "required": [ + "post" + ], + "properties": { + "parent": { + "type": "union", + "refs": [ + "#threadViewPost", + "#notFoundPost", + "#blockedPost" + ] + }, + "post": { + "type": "ref", + "ref": "#postView" + }, + "replies": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "#threadViewPost", + "#notFoundPost", + "#blockedPost" + ] + } + }, + "threadContext": { + "type": "ref", + "ref": "#threadContext" + } + } + }, + "threadgateView": { + "type": "object", + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "lists": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#listViewBasic" + } + }, + "record": { + "type": "unknown" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "viewerState": { + "type": "object", + "description": "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.", + "properties": { + "bookmarked": { + "type": "boolean" + }, + "embeddingDisabled": { + "type": "boolean" + }, + "like": { + "type": "string", + "format": "at-uri" + }, + "pinned": { + "type": "boolean" + }, + "replyDisabled": { + "type": "boolean" + }, + "repost": { + "type": "string", + "format": "at-uri" + }, + "threadMuted": { + "type": "boolean" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_describeFeedGenerator.json b/crates/weaver-api/lexicons/app_bsky_feed_describeFeedGenerator.json new file mode 100644 index 0000000..b465afd --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_describeFeedGenerator.json @@ -0,0 +1,60 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.describeFeedGenerator", + "defs": { + "feed": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "links": { + "type": "object", + "properties": { + "privacyPolicy": { + "type": "string" + }, + "termsOfService": { + "type": "string" + } + } + }, + "main": { + "type": "query", + "description": "Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View).", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "feeds" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "#feed" + } + }, + "links": { + "type": "ref", + "ref": "#links" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_generator.json b/crates/weaver-api/lexicons/app_bsky_feed_generator.json new file mode 100644 index 0000000..64fc250 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_generator.json @@ -0,0 +1,72 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.generator", + "defs": { + "main": { + "type": "record", + "description": "Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository.", + "key": "any", + "record": { + "type": "object", + "required": [ + "did", + "displayName", + "createdAt" + ], + "properties": { + "acceptsInteractions": { + "type": "boolean", + "description": "Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions" + }, + "avatar": { + "type": "blob", + "accept": [ + "image/png", + "image/jpeg" + ], + "maxSize": 1000000 + }, + "contentMode": { + "type": "string", + "knownValues": [ + "app.bsky.feed.defs#contentModeUnspecified", + "app.bsky.feed.defs#contentModeVideo" + ] + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "description": { + "type": "string", + "maxLength": 3000, + "maxGraphemes": 300 + }, + "descriptionFacets": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + } + }, + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string", + "maxLength": 240, + "maxGraphemes": 24 + }, + "labels": { + "type": "union", + "description": "Self-label values", + "refs": [ + "com.atproto.label.defs#selfLabels" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getActorFeeds.json b/crates/weaver-api/lexicons/app_bsky_feed_getActorFeeds.json new file mode 100644 index 0000000..ae09cfc --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getActorFeeds.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getActorFeeds", + "defs": { + "main": { + "type": "query", + "description": "Get a list of feeds (feed generator records) created by the actor (in the actor's repo).", + "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": [ + "feeds" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#generatorView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getActorLikes.json b/crates/weaver-api/lexicons/app_bsky_feed_getActorLikes.json new file mode 100644 index 0000000..f9d8224 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getActorLikes.json @@ -0,0 +1,60 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getActorLikes", + "defs": { + "main": { + "type": "query", + "description": "Get a list of posts liked by an actor. Requires auth, actor must be the requesting account.", + "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": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#feedViewPost" + } + } + } + } + }, + "errors": [ + { + "name": "BlockedActor" + }, + { + "name": "BlockedByActor" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getAuthorFeed.json b/crates/weaver-api/lexicons/app_bsky_feed_getAuthorFeed.json new file mode 100644 index 0000000..298eff9 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getAuthorFeed.json @@ -0,0 +1,76 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getAuthorFeed", + "defs": { + "main": { + "type": "query", + "description": "Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "filter": { + "type": "string", + "description": "Combinations of post/repost types to include in response.", + "default": "posts_with_replies", + "knownValues": [ + "posts_with_replies", + "posts_no_replies", + "posts_with_media", + "posts_and_author_threads", + "posts_with_video" + ] + }, + "includePins": { + "type": "boolean", + "default": false + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#feedViewPost" + } + } + } + } + }, + "errors": [ + { + "name": "BlockedActor" + }, + { + "name": "BlockedByActor" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getFeed.json b/crates/weaver-api/lexicons/app_bsky_feed_getFeed.json new file mode 100644 index 0000000..8cd75e6 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getFeed.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getFeed", + "defs": { + "main": { + "type": "query", + "description": "Get a hydrated feed from an actor's selected feed generator. Implemented by App View.", + "parameters": { + "type": "params", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "string", + "format": "at-uri" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#feedViewPost" + } + } + } + } + }, + "errors": [ + { + "name": "UnknownFeed" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getFeedGenerator.json b/crates/weaver-api/lexicons/app_bsky_feed_getFeedGenerator.json new file mode 100644 index 0000000..ed0502a --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getFeedGenerator.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getFeedGenerator", + "defs": { + "main": { + "type": "query", + "description": "Get information about a feed generator. Implemented by AppView.", + "parameters": { + "type": "params", + "required": [ + "feed" + ], + "properties": { + "feed": { + "type": "string", + "description": "AT-URI of the feed generator record.", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "view", + "isOnline", + "isValid" + ], + "properties": { + "isOnline": { + "type": "boolean", + "description": "Indicates whether the feed generator service has been online recently, or else seems to be inactive." + }, + "isValid": { + "type": "boolean", + "description": "Indicates whether the feed generator service is compatible with the record declaration." + }, + "view": { + "type": "ref", + "ref": "app.bsky.feed.defs#generatorView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getFeedGenerators.json b/crates/weaver-api/lexicons/app_bsky_feed_getFeedGenerators.json new file mode 100644 index 0000000..3d4cdc5 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getFeedGenerators.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getFeedGenerators", + "defs": { + "main": { + "type": "query", + "description": "Get information about a list of feed generators.", + "parameters": { + "type": "params", + "required": [ + "feeds" + ], + "properties": { + "feeds": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feeds" + ], + "properties": { + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#generatorView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getFeedSkeleton.json b/crates/weaver-api/lexicons/app_bsky_feed_getFeedSkeleton.json new file mode 100644 index 0000000..1731b6a --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getFeedSkeleton.json @@ -0,0 +1,63 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getFeedSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service.", + "parameters": { + "type": "params", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "string", + "description": "Reference to feed generator record describing the specific feed being requested.", + "format": "at-uri" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#skeletonFeedPost" + } + }, + "reqId": { + "type": "string", + "description": "Unique identifier per request that may be passed back alongside interactions.", + "maxLength": 100 + } + } + } + }, + "errors": [ + { + "name": "UnknownFeed" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getLikes.json b/crates/weaver-api/lexicons/app_bsky_feed_getLikes.json new file mode 100644 index 0000000..5edfcb9 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getLikes.json @@ -0,0 +1,89 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getLikes", + "defs": { + "like": { + "type": "object", + "required": [ + "indexedAt", + "createdAt", + "actor" + ], + "properties": { + "actor": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "main": { + "type": "query", + "description": "Get like records which reference a subject (by AT-URI and CID).", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "cid": { + "type": "string", + "description": "CID of the subject record (aka, specific version of record), to filter likes.", + "format": "cid" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "uri": { + "type": "string", + "description": "AT-URI of the subject (eg, a post record).", + "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": "ref", + "ref": "#like" + } + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getListFeed.json b/crates/weaver-api/lexicons/app_bsky_feed_getListFeed.json new file mode 100644 index 0000000..cc9eba3 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getListFeed.json @@ -0,0 +1,58 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getListFeed", + "defs": { + "main": { + "type": "query", + "description": "Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "list" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "list": { + "type": "string", + "description": "Reference (AT-URI) to the list record.", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#feedViewPost" + } + } + } + } + }, + "errors": [ + { + "name": "UnknownList" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getPostThread.json b/crates/weaver-api/lexicons/app_bsky_feed_getPostThread.json new file mode 100644 index 0000000..05b3dcd --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getPostThread.json @@ -0,0 +1,65 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getPostThread", + "defs": { + "main": { + "type": "query", + "description": "Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "depth": { + "type": "integer", + "description": "How many levels of reply depth should be included in response.", + "default": 6, + "minimum": 0, + "maximum": 1000 + }, + "parentHeight": { + "type": "integer", + "description": "How many levels of parent (and grandparent, etc) post to include.", + "default": 80, + "minimum": 0, + "maximum": 1000 + }, + "uri": { + "type": "string", + "description": "Reference (AT-URI) to post record.", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "type": "union", + "refs": [ + "app.bsky.feed.defs#threadViewPost", + "app.bsky.feed.defs#notFoundPost", + "app.bsky.feed.defs#blockedPost" + ] + }, + "threadgate": { + "type": "ref", + "ref": "app.bsky.feed.defs#threadgateView" + } + } + } + }, + "errors": [ + { + "name": "NotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getPosts.json b/crates/weaver-api/lexicons/app_bsky_feed_getPosts.json new file mode 100644 index 0000000..70aa53c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getPosts.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getPosts", + "defs": { + "main": { + "type": "query", + "description": "Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.", + "parameters": { + "type": "params", + "required": [ + "uris" + ], + "properties": { + "uris": { + "type": "array", + "description": "List of post AT-URIs to return hydrated views for.", + "items": { + "type": "string", + "format": "at-uri" + }, + "maxLength": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "posts" + ], + "properties": { + "posts": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#postView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getQuotes.json b/crates/weaver-api/lexicons/app_bsky_feed_getQuotes.json new file mode 100644 index 0000000..b29506e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getQuotes.json @@ -0,0 +1,67 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getQuotes", + "defs": { + "main": { + "type": "query", + "description": "Get a list of quotes for a given post.", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "cid": { + "type": "string", + "description": "If supplied, filters to quotes of specific version (by CID) of the post record.", + "format": "cid" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "uri": { + "type": "string", + "description": "Reference (AT-URI) of post record", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "posts" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "cursor": { + "type": "string" + }, + "posts": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#postView" + } + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getRepostedBy.json b/crates/weaver-api/lexicons/app_bsky_feed_getRepostedBy.json new file mode 100644 index 0000000..b715d58 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getRepostedBy.json @@ -0,0 +1,67 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getRepostedBy", + "defs": { + "main": { + "type": "query", + "description": "Get a list of reposts for a given post.", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "cid": { + "type": "string", + "description": "If supplied, filters to reposts of specific version (by CID) of the post record.", + "format": "cid" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "uri": { + "type": "string", + "description": "Reference (AT-URI) of post record", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "repostedBy" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "cursor": { + "type": "string" + }, + "repostedBy": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getSuggestedFeeds.json b/crates/weaver-api/lexicons/app_bsky_feed_getSuggestedFeeds.json new file mode 100644 index 0000000..18d8a8e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getSuggestedFeeds.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getSuggestedFeeds", + "defs": { + "main": { + "type": "query", + "description": "Get a list of suggested feeds (feed generators) for the requesting account.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feeds" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#generatorView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_getTimeline.json b/crates/weaver-api/lexicons/app_bsky_feed_getTimeline.json new file mode 100644 index 0000000..221726e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_getTimeline.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.getTimeline", + "defs": { + "main": { + "type": "query", + "description": "Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.", + "parameters": { + "type": "params", + "properties": { + "algorithm": { + "type": "string", + "description": "Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism." + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#feedViewPost" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_like.json b/crates/weaver-api/lexicons/app_bsky_feed_like.json new file mode 100644 index 0000000..b4b780c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_like.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.like", + "defs": { + "main": { + "type": "record", + "description": "Record declaring a 'like' of a piece of subject content.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "subject": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "via": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_post.json b/crates/weaver-api/lexicons/app_bsky_feed_post.json new file mode 100644 index 0000000..56de9ed --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_post.json @@ -0,0 +1,144 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.post", + "defs": { + "entity": { + "type": "object", + "description": "Deprecated: use facets instead.", + "required": [ + "index", + "type", + "value" + ], + "properties": { + "index": { + "type": "ref", + "ref": "#textSlice" + }, + "type": { + "type": "string", + "description": "Expected values are 'mention' and 'link'." + }, + "value": { + "type": "string" + } + } + }, + "main": { + "type": "record", + "description": "Record containing a Bluesky post.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "text", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Client-declared timestamp when this post was originally created.", + "format": "datetime" + }, + "embed": { + "type": "union", + "refs": [ + "app.bsky.embed.images", + "app.bsky.embed.video", + "app.bsky.embed.external", + "app.bsky.embed.record", + "app.bsky.embed.recordWithMedia" + ] + }, + "entities": { + "type": "array", + "description": "DEPRECATED: replaced by app.bsky.richtext.facet.", + "items": { + "type": "ref", + "ref": "#entity" + } + }, + "facets": { + "type": "array", + "description": "Annotations of text (mentions, URLs, hashtags, etc)", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + } + }, + "labels": { + "type": "union", + "description": "Self-label values for this post. Effectively content warnings.", + "refs": [ + "com.atproto.label.defs#selfLabels" + ] + }, + "langs": { + "type": "array", + "description": "Indicates human language of post primary text content.", + "items": { + "type": "string", + "format": "language" + }, + "maxLength": 3 + }, + "reply": { + "type": "ref", + "ref": "#replyRef" + }, + "tags": { + "type": "array", + "description": "Additional hashtags, in addition to any included in post text and facets.", + "items": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "maxLength": 8 + }, + "text": { + "type": "string", + "description": "The primary post content. May be an empty string, if there are embeds.", + "maxLength": 3000, + "maxGraphemes": 300 + } + } + } + }, + "replyRef": { + "type": "object", + "required": [ + "root", + "parent" + ], + "properties": { + "parent": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "root": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + }, + "textSlice": { + "type": "object", + "description": "Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.", + "required": [ + "start", + "end" + ], + "properties": { + "end": { + "type": "integer", + "minimum": 0 + }, + "start": { + "type": "integer", + "minimum": 0 + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_postgate.json b/crates/weaver-api/lexicons/app_bsky_feed_postgate.json new file mode 100644 index 0000000..4b408e9 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_postgate.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.postgate", + "defs": { + "disableRule": { + "type": "object", + "description": "Disables embedding of this post.", + "properties": {} + }, + "main": { + "type": "record", + "description": "Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "post", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "detachedEmbeddingUris": { + "type": "array", + "description": "List of AT-URIs embedding this post that the author has detached from.", + "items": { + "type": "string", + "format": "at-uri" + }, + "maxLength": 50 + }, + "embeddingRules": { + "type": "array", + "description": "List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed.", + "items": { + "type": "union", + "refs": [ + "#disableRule" + ] + }, + "maxLength": 5 + }, + "post": { + "type": "string", + "description": "Reference (AT-URI) to the post record.", + "format": "at-uri" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_repost.json b/crates/weaver-api/lexicons/app_bsky_feed_repost.json new file mode 100644 index 0000000..1bb1171 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_repost.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.repost", + "defs": { + "main": { + "type": "record", + "description": "Record representing a 'repost' of an existing Bluesky post.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "subject": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "via": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_searchPosts.json b/crates/weaver-api/lexicons/app_bsky_feed_searchPosts.json new file mode 100644 index 0000000..06556d7 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_searchPosts.json @@ -0,0 +1,112 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.searchPosts", + "defs": { + "main": { + "type": "query", + "description": "Find posts matching search criteria, returning views of those posts. Note that this API endpoint may require authentication (eg, not public) for some service providers and implementations.", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "author": { + "type": "string", + "description": "Filter to posts by the given account. Handles are resolved to DID before query-time.", + "format": "at-identifier" + }, + "cursor": { + "type": "string", + "description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set." + }, + "domain": { + "type": "string", + "description": "Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization." + }, + "lang": { + "type": "string", + "description": "Filter to posts in the given language. Expected to be based on post language field, though server may override language detection.", + "format": "language" + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 100 + }, + "mentions": { + "type": "string", + "description": "Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions.", + "format": "at-identifier" + }, + "q": { + "type": "string", + "description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended." + }, + "since": { + "type": "string", + "description": "Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD)." + }, + "sort": { + "type": "string", + "description": "Specifies the ranking order of results.", + "default": "latest", + "knownValues": [ + "top", + "latest" + ] + }, + "tag": { + "type": "array", + "description": "Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching.", + "items": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + } + }, + "until": { + "type": "string", + "description": "Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD)." + }, + "url": { + "type": "string", + "description": "Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching.", + "format": "uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "posts" + ], + "properties": { + "cursor": { + "type": "string" + }, + "hitsTotal": { + "type": "integer", + "description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits." + }, + "posts": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#postView" + } + } + } + } + }, + "errors": [ + { + "name": "BadQueryString" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_sendInteractions.json b/crates/weaver-api/lexicons/app_bsky_feed_sendInteractions.json new file mode 100644 index 0000000..8fa331c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_sendInteractions.json @@ -0,0 +1,35 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.sendInteractions", + "defs": { + "main": { + "type": "procedure", + "description": "Send information about interactions with feed items back to the feed generator that served them.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "interactions" + ], + "properties": { + "interactions": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#interaction" + } + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": {} + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_feed_threadgate.json b/crates/weaver-api/lexicons/app_bsky_feed_threadgate.json new file mode 100644 index 0000000..7a6c456 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_feed_threadgate.json @@ -0,0 +1,80 @@ +{ + "lexicon": 1, + "id": "app.bsky.feed.threadgate", + "defs": { + "followerRule": { + "type": "object", + "description": "Allow replies from actors who follow you.", + "properties": {} + }, + "followingRule": { + "type": "object", + "description": "Allow replies from actors you follow.", + "properties": {} + }, + "listRule": { + "type": "object", + "description": "Allow replies from actors on a list.", + "required": [ + "list" + ], + "properties": { + "list": { + "type": "string", + "format": "at-uri" + } + } + }, + "main": { + "type": "record", + "description": "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "post", + "createdAt" + ], + "properties": { + "allow": { + "type": "array", + "description": "List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.", + "items": { + "type": "union", + "refs": [ + "#mentionRule", + "#followerRule", + "#followingRule", + "#listRule" + ] + }, + "maxLength": 5 + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "hiddenReplies": { + "type": "array", + "description": "List of hidden reply URIs.", + "items": { + "type": "string", + "format": "at-uri" + }, + "maxLength": 300 + }, + "post": { + "type": "string", + "description": "Reference (AT-URI) to the post record.", + "format": "at-uri" + } + } + } + }, + "mentionRule": { + "type": "object", + "description": "Allow replies from actors mentioned in your post.", + "properties": {} + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_block.json b/crates/weaver-api/lexicons/app_bsky_graph_block.json new file mode 100644 index 0000000..60286e9 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_block.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.block", + "defs": { + "main": { + "type": "record", + "description": "Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "subject": { + "type": "string", + "description": "DID of the account to be blocked.", + "format": "did" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_defs.json b/crates/weaver-api/lexicons/app_bsky_graph_defs.json new file mode 100644 index 0000000..5bd6b9d --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_defs.json @@ -0,0 +1,332 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.defs", + "defs": { + "curatelist": { + "type": "token", + "description": "A list of actors used for curation purposes such as list feeds or interaction gating." + }, + "listItemView": { + "type": "object", + "required": [ + "uri", + "subject" + ], + "properties": { + "subject": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "listPurpose": { + "type": "string", + "knownValues": [ + "app.bsky.graph.defs#modlist", + "app.bsky.graph.defs#curatelist", + "app.bsky.graph.defs#referencelist" + ] + }, + "listView": { + "type": "object", + "required": [ + "uri", + "cid", + "creator", + "name", + "purpose", + "indexedAt" + ], + "properties": { + "avatar": { + "type": "string", + "format": "uri" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "creator": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + }, + "description": { + "type": "string", + "maxLength": 3000, + "maxGraphemes": 300 + }, + "descriptionFacets": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + } + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "listItemCount": { + "type": "integer", + "minimum": 0 + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 64 + }, + "purpose": { + "type": "ref", + "ref": "#listPurpose" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "viewer": { + "type": "ref", + "ref": "#listViewerState" + } + } + }, + "listViewBasic": { + "type": "object", + "required": [ + "uri", + "cid", + "name", + "purpose" + ], + "properties": { + "avatar": { + "type": "string", + "format": "uri" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "listItemCount": { + "type": "integer", + "minimum": 0 + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 64 + }, + "purpose": { + "type": "ref", + "ref": "#listPurpose" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "viewer": { + "type": "ref", + "ref": "#listViewerState" + } + } + }, + "listViewerState": { + "type": "object", + "properties": { + "blocked": { + "type": "string", + "format": "at-uri" + }, + "muted": { + "type": "boolean" + } + } + }, + "modlist": { + "type": "token", + "description": "A list of actors to apply an aggregate moderation action (mute/block) on." + }, + "notFoundActor": { + "type": "object", + "description": "indicates that a handle or DID could not be resolved", + "required": [ + "actor", + "notFound" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "notFound": { + "type": "boolean", + "const": true + } + } + }, + "referencelist": { + "type": "token", + "description": "A list of actors used for only for reference purposes such as within a starter pack." + }, + "relationship": { + "type": "object", + "description": "lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "followedBy": { + "type": "string", + "description": "if the actor is followed by this DID, contains the AT-URI of the follow record", + "format": "at-uri" + }, + "following": { + "type": "string", + "description": "if the actor follows this DID, this is the AT-URI of the follow record", + "format": "at-uri" + } + } + }, + "starterPackView": { + "type": "object", + "required": [ + "uri", + "cid", + "record", + "creator", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "creator": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewBasic" + }, + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#generatorView" + }, + "maxLength": 3 + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "joinedAllTimeCount": { + "type": "integer", + "minimum": 0 + }, + "joinedWeekCount": { + "type": "integer", + "minimum": 0 + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "list": { + "type": "ref", + "ref": "#listViewBasic" + }, + "listItemsSample": { + "type": "array", + "items": { + "type": "ref", + "ref": "#listItemView" + }, + "maxLength": 12 + }, + "record": { + "type": "unknown" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "starterPackViewBasic": { + "type": "object", + "required": [ + "uri", + "cid", + "record", + "creator", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "creator": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewBasic" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "joinedAllTimeCount": { + "type": "integer", + "minimum": 0 + }, + "joinedWeekCount": { + "type": "integer", + "minimum": 0 + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "listItemCount": { + "type": "integer", + "minimum": 0 + }, + "record": { + "type": "unknown" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_follow.json b/crates/weaver-api/lexicons/app_bsky_graph_follow.json new file mode 100644 index 0000000..cdceba0 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_follow.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.follow", + "defs": { + "main": { + "type": "record", + "description": "Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "subject": { + "type": "string", + "format": "did" + }, + "via": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getActorStarterPacks.json b/crates/weaver-api/lexicons/app_bsky_graph_getActorStarterPacks.json new file mode 100644 index 0000000..f86ee16 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getActorStarterPacks.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getActorStarterPacks", + "defs": { + "main": { + "type": "query", + "description": "Get a list of starter packs created by the 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 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacks" + ], + "properties": { + "cursor": { + "type": "string" + }, + "starterPacks": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#starterPackViewBasic" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getBlocks.json b/crates/weaver-api/lexicons/app_bsky_graph_getBlocks.json new file mode 100644 index 0000000..9c7800c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getBlocks.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getBlocks", + "defs": { + "main": { + "type": "query", + "description": "Enumerates which accounts the requesting account is currently blocking. Requires auth.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "blocks" + ], + "properties": { + "blocks": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getFollowers.json b/crates/weaver-api/lexicons/app_bsky_graph_getFollowers.json new file mode 100644 index 0000000..b273df7 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getFollowers.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getFollowers", + "defs": { + "main": { + "type": "query", + "description": "Enumerates accounts which follow a specified account (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 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject", + "followers" + ], + "properties": { + "cursor": { + "type": "string" + }, + "followers": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + }, + "subject": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getFollows.json b/crates/weaver-api/lexicons/app_bsky_graph_getFollows.json new file mode 100644 index 0000000..cd9592d --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getFollows.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getFollows", + "defs": { + "main": { + "type": "query", + "description": "Enumerates accounts which a specified account (actor) follows.", + "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", + "follows" + ], + "properties": { + "cursor": { + "type": "string" + }, + "follows": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + }, + "subject": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getKnownFollowers.json b/crates/weaver-api/lexicons/app_bsky_graph_getKnownFollowers.json new file mode 100644 index 0000000..1f64d51 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getKnownFollowers.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getKnownFollowers", + "defs": { + "main": { + "type": "query", + "description": "Enumerates accounts which follow a specified account (actor) and are followed by the viewer.", + "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": "app.bsky.actor.defs#profileView" + } + }, + "subject": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getList.json b/crates/weaver-api/lexicons/app_bsky_graph_getList.json new file mode 100644 index 0000000..473116b --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getList.json @@ -0,0 +1,58 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getList", + "defs": { + "main": { + "type": "query", + "description": "Gets a 'view' (with additional context) of a specified list.", + "parameters": { + "type": "params", + "required": [ + "list" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "list": { + "type": "string", + "description": "Reference (AT-URI) of the list record to hydrate.", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "list", + "items" + ], + "properties": { + "cursor": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#listItemView" + } + }, + "list": { + "type": "ref", + "ref": "app.bsky.graph.defs#listView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getListBlocks.json b/crates/weaver-api/lexicons/app_bsky_graph_getListBlocks.json new file mode 100644 index 0000000..ff18088 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getListBlocks.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getListBlocks", + "defs": { + "main": { + "type": "query", + "description": "Get mod lists that the requesting account (actor) is blocking. Requires auth.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "lists" + ], + "properties": { + "cursor": { + "type": "string" + }, + "lists": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#listView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getListMutes.json b/crates/weaver-api/lexicons/app_bsky_graph_getListMutes.json new file mode 100644 index 0000000..ec0b5df --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getListMutes.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getListMutes", + "defs": { + "main": { + "type": "query", + "description": "Enumerates mod lists that the requesting account (actor) currently has muted. Requires auth.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "lists" + ], + "properties": { + "cursor": { + "type": "string" + }, + "lists": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#listView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getLists.json b/crates/weaver-api/lexicons/app_bsky_graph_getLists.json new file mode 100644 index 0000000..48d8f09 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getLists.json @@ -0,0 +1,64 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getLists", + "defs": { + "main": { + "type": "query", + "description": "Enumerates the lists created by a specified account (actor).", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "description": "The account (actor) to enumerate lists from.", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "purposes": { + "type": "array", + "description": "Optional filter by list purpose. If not specified, all supported types are returned.", + "items": { + "type": "string", + "knownValues": [ + "modlist", + "curatelist" + ] + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "lists" + ], + "properties": { + "cursor": { + "type": "string" + }, + "lists": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#listView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getListsWithMembership.json b/crates/weaver-api/lexicons/app_bsky_graph_getListsWithMembership.json new file mode 100644 index 0000000..b2f168e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getListsWithMembership.json @@ -0,0 +1,81 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getListsWithMembership", + "defs": { + "listWithMembership": { + "type": "object", + "description": "A list and an optional list item indicating membership of a target user to that list.", + "required": [ + "list" + ], + "properties": { + "list": { + "type": "ref", + "ref": "app.bsky.graph.defs#listView" + }, + "listItem": { + "type": "ref", + "ref": "app.bsky.graph.defs#listItemView" + } + } + }, + "main": { + "type": "query", + "description": "Enumerates the lists created by the session user, and includes membership information about `actor` in those lists. Only supports curation and moderation lists (no reference lists, used in starter packs). Requires auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "description": "The account (actor) to check for membership.", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "purposes": { + "type": "array", + "description": "Optional filter by list purpose. If not specified, all supported types are returned.", + "items": { + "type": "string", + "knownValues": [ + "modlist", + "curatelist" + ] + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "listsWithMembership" + ], + "properties": { + "cursor": { + "type": "string" + }, + "listsWithMembership": { + "type": "array", + "items": { + "type": "ref", + "ref": "#listWithMembership" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getMutes.json b/crates/weaver-api/lexicons/app_bsky_graph_getMutes.json new file mode 100644 index 0000000..174fe74 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getMutes.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getMutes", + "defs": { + "main": { + "type": "query", + "description": "Enumerates accounts that the requesting account (actor) currently has muted. Requires auth.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "mutes" + ], + "properties": { + "cursor": { + "type": "string" + }, + "mutes": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getRelationships.json b/crates/weaver-api/lexicons/app_bsky_graph_getRelationships.json new file mode 100644 index 0000000..0cd0cc8 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getRelationships.json @@ -0,0 +1,63 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getRelationships", + "defs": { + "main": { + "type": "query", + "description": "Enumerates public relationships between one account, and a list of other accounts. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "description": "Primary account requesting relationships for.", + "format": "at-identifier" + }, + "others": { + "type": "array", + "description": "List of 'other' accounts to be related back to the primary.", + "items": { + "type": "string", + "format": "at-identifier" + }, + "maxLength": 30 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "relationships" + ], + "properties": { + "actor": { + "type": "string", + "format": "did" + }, + "relationships": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "app.bsky.graph.defs#relationship", + "app.bsky.graph.defs#notFoundActor" + ] + } + } + } + } + }, + "errors": [ + { + "description": "the primary actor at-identifier could not be resolved", + "name": "ActorNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getStarterPack.json b/crates/weaver-api/lexicons/app_bsky_graph_getStarterPack.json new file mode 100644 index 0000000..4055fcf --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getStarterPack.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getStarterPack", + "defs": { + "main": { + "type": "query", + "description": "Gets a view of a starter pack.", + "parameters": { + "type": "params", + "required": [ + "starterPack" + ], + "properties": { + "starterPack": { + "type": "string", + "description": "Reference (AT-URI) of the starter pack record.", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPack" + ], + "properties": { + "starterPack": { + "type": "ref", + "ref": "app.bsky.graph.defs#starterPackView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getStarterPacks.json b/crates/weaver-api/lexicons/app_bsky_graph_getStarterPacks.json new file mode 100644 index 0000000..359acc5 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getStarterPacks.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getStarterPacks", + "defs": { + "main": { + "type": "query", + "description": "Get views for a list of starter packs.", + "parameters": { + "type": "params", + "required": [ + "uris" + ], + "properties": { + "uris": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + }, + "maxLength": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacks" + ], + "properties": { + "starterPacks": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#starterPackViewBasic" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getStarterPacksWithMembership.json b/crates/weaver-api/lexicons/app_bsky_graph_getStarterPacksWithMembership.json new file mode 100644 index 0000000..aba67be --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getStarterPacksWithMembership.json @@ -0,0 +1,70 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getStarterPacksWithMembership", + "defs": { + "main": { + "type": "query", + "description": "Enumerates the starter packs created by the session user, and includes membership information about `actor` in those starter packs. Requires auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "description": "The account (actor) to check for membership.", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacksWithMembership" + ], + "properties": { + "cursor": { + "type": "string" + }, + "starterPacksWithMembership": { + "type": "array", + "items": { + "type": "ref", + "ref": "#starterPackWithMembership" + } + } + } + } + } + }, + "starterPackWithMembership": { + "type": "object", + "description": "A starter pack and an optional list item indicating membership of a target user to that starter pack.", + "required": [ + "starterPack" + ], + "properties": { + "listItem": { + "type": "ref", + "ref": "app.bsky.graph.defs#listItemView" + }, + "starterPack": { + "type": "ref", + "ref": "app.bsky.graph.defs#starterPackView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_getSuggestedFollowsByActor.json b/crates/weaver-api/lexicons/app_bsky_graph_getSuggestedFollowsByActor.json new file mode 100644 index 0000000..ae294a0 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_getSuggestedFollowsByActor.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.getSuggestedFollowsByActor", + "defs": { + "main": { + "type": "query", + "description": "Enumerates follows similar to a given account (actor). Expected use is to recommend additional accounts immediately after following one account.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "suggestions" + ], + "properties": { + "isFallback": { + "type": "boolean", + "description": "If true, response has fallen-back to generic results, and is not scoped using relativeToDid", + "default": false + }, + "recId": { + "type": "integer", + "description": "Snowflake for this recommendation, use when submitting recommendation events." + }, + "suggestions": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_list.json b/crates/weaver-api/lexicons/app_bsky_graph_list.json new file mode 100644 index 0000000..02b1f45 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_list.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.list", + "defs": { + "main": { + "type": "record", + "description": "Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "name", + "purpose", + "createdAt" + ], + "properties": { + "avatar": { + "type": "blob", + "accept": [ + "image/png", + "image/jpeg" + ], + "maxSize": 1000000 + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "description": { + "type": "string", + "maxLength": 3000, + "maxGraphemes": 300 + }, + "descriptionFacets": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + } + }, + "labels": { + "type": "union", + "refs": [ + "com.atproto.label.defs#selfLabels" + ] + }, + "name": { + "type": "string", + "description": "Display name for list; can not be empty.", + "minLength": 1, + "maxLength": 64 + }, + "purpose": { + "type": "ref", + "description": "Defines the purpose of the list (aka, moderation-oriented or curration-oriented)", + "ref": "app.bsky.graph.defs#listPurpose" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_listblock.json b/crates/weaver-api/lexicons/app_bsky_graph_listblock.json new file mode 100644 index 0000000..a0c3ba4 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_listblock.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.listblock", + "defs": { + "main": { + "type": "record", + "description": "Record representing a block relationship against an entire an entire list of accounts (actors).", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "subject": { + "type": "string", + "description": "Reference (AT-URI) to the mod list record.", + "format": "at-uri" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_listitem.json b/crates/weaver-api/lexicons/app_bsky_graph_listitem.json new file mode 100644 index 0000000..afd6f87 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_listitem.json @@ -0,0 +1,35 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.listitem", + "defs": { + "main": { + "type": "record", + "description": "Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "list", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "list": { + "type": "string", + "description": "Reference (AT-URI) to the list record (app.bsky.graph.list).", + "format": "at-uri" + }, + "subject": { + "type": "string", + "description": "The account which is included on the list.", + "format": "did" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_muteActor.json b/crates/weaver-api/lexicons/app_bsky_graph_muteActor.json new file mode 100644 index 0000000..82d680d --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_muteActor.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.muteActor", + "defs": { + "main": { + "type": "procedure", + "description": "Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_muteActorList.json b/crates/weaver-api/lexicons/app_bsky_graph_muteActorList.json new file mode 100644 index 0000000..106eca5 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_muteActorList.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.muteActorList", + "defs": { + "main": { + "type": "procedure", + "description": "Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "list" + ], + "properties": { + "list": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_muteThread.json b/crates/weaver-api/lexicons/app_bsky_graph_muteThread.json new file mode 100644 index 0000000..a378f0e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_muteThread.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.muteThread", + "defs": { + "main": { + "type": "procedure", + "description": "Mutes a thread preventing notifications from the thread and any of its children. Mutes are private in Bluesky. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "root" + ], + "properties": { + "root": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_searchStarterPacks.json b/crates/weaver-api/lexicons/app_bsky_graph_searchStarterPacks.json new file mode 100644 index 0000000..0bf6bac --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_searchStarterPacks.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.searchStarterPacks", + "defs": { + "main": { + "type": "query", + "description": "Find starter packs matching search criteria. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string", + "description": "Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacks" + ], + "properties": { + "cursor": { + "type": "string" + }, + "starterPacks": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#starterPackViewBasic" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_starterpack.json b/crates/weaver-api/lexicons/app_bsky_graph_starterpack.json new file mode 100644 index 0000000..aa86a4f --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_starterpack.json @@ -0,0 +1,69 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.starterpack", + "defs": { + "feedItem": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "main": { + "type": "record", + "description": "Record defining a starter pack of actors and feeds for new users.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "name", + "list", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "description": { + "type": "string", + "maxLength": 3000, + "maxGraphemes": 300 + }, + "descriptionFacets": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + } + }, + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "#feedItem" + }, + "maxLength": 3 + }, + "list": { + "type": "string", + "description": "Reference (AT-URI) to the list record.", + "format": "at-uri" + }, + "name": { + "type": "string", + "description": "Display name for starter pack; can not be empty.", + "minLength": 1, + "maxLength": 500, + "maxGraphemes": 50 + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_unmuteActor.json b/crates/weaver-api/lexicons/app_bsky_graph_unmuteActor.json new file mode 100644 index 0000000..b741267 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_unmuteActor.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.unmuteActor", + "defs": { + "main": { + "type": "procedure", + "description": "Unmutes the specified account. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_unmuteActorList.json b/crates/weaver-api/lexicons/app_bsky_graph_unmuteActorList.json new file mode 100644 index 0000000..dd75a10 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_unmuteActorList.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.unmuteActorList", + "defs": { + "main": { + "type": "procedure", + "description": "Unmutes the specified list of accounts. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "list" + ], + "properties": { + "list": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_unmuteThread.json b/crates/weaver-api/lexicons/app_bsky_graph_unmuteThread.json new file mode 100644 index 0000000..cb050fb --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_unmuteThread.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.unmuteThread", + "defs": { + "main": { + "type": "procedure", + "description": "Unmutes the specified thread. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "root" + ], + "properties": { + "root": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_graph_verification.json b/crates/weaver-api/lexicons/app_bsky_graph_verification.json new file mode 100644 index 0000000..a93f420 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_graph_verification.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "app.bsky.graph.verification", + "defs": { + "main": { + "type": "record", + "description": "Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "handle", + "displayName", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Date of when the verification was created.", + "format": "datetime" + }, + "displayName": { + "type": "string", + "description": "Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying." + }, + "handle": { + "type": "string", + "description": "Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.", + "format": "handle" + }, + "subject": { + "type": "string", + "description": "DID of the subject the verification applies to.", + "format": "did" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_labeler_defs.json b/crates/weaver-api/lexicons/app_bsky_labeler_defs.json new file mode 100644 index 0000000..9d7bd97 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_labeler_defs.json @@ -0,0 +1,152 @@ +{ + "lexicon": 1, + "id": "app.bsky.labeler.defs", + "defs": { + "labelerPolicies": { + "type": "object", + "required": [ + "labelValues" + ], + "properties": { + "labelValueDefinitions": { + "type": "array", + "description": "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#labelValueDefinition" + } + }, + "labelValues": { + "type": "array", + "description": "The label values which this labeler publishes. May include global or custom labels.", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#labelValue" + } + } + } + }, + "labelerView": { + "type": "object", + "required": [ + "uri", + "cid", + "creator", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "creator": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "likeCount": { + "type": "integer", + "minimum": 0 + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "viewer": { + "type": "ref", + "ref": "#labelerViewerState" + } + } + }, + "labelerViewDetailed": { + "type": "object", + "required": [ + "uri", + "cid", + "creator", + "policies", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "creator": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "likeCount": { + "type": "integer", + "minimum": 0 + }, + "policies": { + "type": "ref", + "ref": "app.bsky.labeler.defs#labelerPolicies" + }, + "reasonTypes": { + "type": "array", + "description": "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.", + "items": { + "type": "ref", + "ref": "com.atproto.moderation.defs#reasonType" + } + }, + "subjectCollections": { + "type": "array", + "description": "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.", + "items": { + "type": "string", + "format": "nsid" + } + }, + "subjectTypes": { + "type": "array", + "description": "The set of subject types (account, record, etc) this service accepts reports on.", + "items": { + "type": "ref", + "ref": "com.atproto.moderation.defs#subjectType" + } + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "viewer": { + "type": "ref", + "ref": "#labelerViewerState" + } + } + }, + "labelerViewerState": { + "type": "object", + "properties": { + "like": { + "type": "string", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_labeler_getServices.json b/crates/weaver-api/lexicons/app_bsky_labeler_getServices.json new file mode 100644 index 0000000..8620b1d --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_labeler_getServices.json @@ -0,0 +1,50 @@ +{ + "lexicon": 1, + "id": "app.bsky.labeler.getServices", + "defs": { + "main": { + "type": "query", + "description": "Get information about a list of labeler services.", + "parameters": { + "type": "params", + "required": [ + "dids" + ], + "properties": { + "detailed": { + "type": "boolean", + "default": false + }, + "dids": { + "type": "array", + "items": { + "type": "string", + "format": "did" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "views" + ], + "properties": { + "views": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "app.bsky.labeler.defs#labelerView", + "app.bsky.labeler.defs#labelerViewDetailed" + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_labeler_service.json b/crates/weaver-api/lexicons/app_bsky_labeler_service.json new file mode 100644 index 0000000..507eef1 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_labeler_service.json @@ -0,0 +1,58 @@ +{ + "lexicon": 1, + "id": "app.bsky.labeler.service", + "defs": { + "main": { + "type": "record", + "description": "A declaration of the existence of labeler service.", + "key": "literal:self", + "record": { + "type": "object", + "required": [ + "policies", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "union", + "refs": [ + "com.atproto.label.defs#selfLabels" + ] + }, + "policies": { + "type": "ref", + "ref": "app.bsky.labeler.defs#labelerPolicies" + }, + "reasonTypes": { + "type": "array", + "description": "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.", + "items": { + "type": "ref", + "ref": "com.atproto.moderation.defs#reasonType" + } + }, + "subjectCollections": { + "type": "array", + "description": "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.", + "items": { + "type": "string", + "format": "nsid" + } + }, + "subjectTypes": { + "type": "array", + "description": "The set of subject types (account, record, etc) this service accepts reports on.", + "items": { + "type": "ref", + "ref": "com.atproto.moderation.defs#subjectType" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_declaration.json b/crates/weaver-api/lexicons/app_bsky_notification_declaration.json new file mode 100644 index 0000000..3ba1fd4 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_declaration.json @@ -0,0 +1,28 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.declaration", + "defs": { + "main": { + "type": "record", + "description": "A declaration of the user's choices related to notifications that can be produced by them.", + "key": "literal:self", + "record": { + "type": "object", + "required": [ + "allowSubscriptions" + ], + "properties": { + "allowSubscriptions": { + "type": "string", + "description": "A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'.", + "knownValues": [ + "followers", + "mutuals", + "none" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_defs.json b/crates/weaver-api/lexicons/app_bsky_notification_defs.json new file mode 100644 index 0000000..774dc06 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_defs.json @@ -0,0 +1,172 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.defs", + "defs": { + "activitySubscription": { + "type": "object", + "required": [ + "post", + "reply" + ], + "properties": { + "post": { + "type": "boolean" + }, + "reply": { + "type": "boolean" + } + } + }, + "chatPreference": { + "type": "object", + "required": [ + "include", + "push" + ], + "properties": { + "include": { + "type": "string", + "knownValues": [ + "all", + "accepted" + ] + }, + "push": { + "type": "boolean" + } + } + }, + "filterablePreference": { + "type": "object", + "required": [ + "include", + "list", + "push" + ], + "properties": { + "include": { + "type": "string", + "knownValues": [ + "all", + "follows" + ] + }, + "list": { + "type": "boolean" + }, + "push": { + "type": "boolean" + } + } + }, + "preference": { + "type": "object", + "required": [ + "list", + "push" + ], + "properties": { + "list": { + "type": "boolean" + }, + "push": { + "type": "boolean" + } + } + }, + "preferences": { + "type": "object", + "required": [ + "chat", + "follow", + "like", + "likeViaRepost", + "mention", + "quote", + "reply", + "repost", + "repostViaRepost", + "starterpackJoined", + "subscribedPost", + "unverified", + "verified" + ], + "properties": { + "chat": { + "type": "ref", + "ref": "#chatPreference" + }, + "follow": { + "type": "ref", + "ref": "#filterablePreference" + }, + "like": { + "type": "ref", + "ref": "#filterablePreference" + }, + "likeViaRepost": { + "type": "ref", + "ref": "#filterablePreference" + }, + "mention": { + "type": "ref", + "ref": "#filterablePreference" + }, + "quote": { + "type": "ref", + "ref": "#filterablePreference" + }, + "reply": { + "type": "ref", + "ref": "#filterablePreference" + }, + "repost": { + "type": "ref", + "ref": "#filterablePreference" + }, + "repostViaRepost": { + "type": "ref", + "ref": "#filterablePreference" + }, + "starterpackJoined": { + "type": "ref", + "ref": "#preference" + }, + "subscribedPost": { + "type": "ref", + "ref": "#preference" + }, + "unverified": { + "type": "ref", + "ref": "#preference" + }, + "verified": { + "type": "ref", + "ref": "#preference" + } + } + }, + "recordDeleted": { + "type": "object", + "properties": {} + }, + "subjectActivitySubscription": { + "type": "object", + "description": "Object used to store activity subscription data in stash.", + "required": [ + "subject", + "activitySubscription" + ], + "properties": { + "activitySubscription": { + "type": "ref", + "ref": "#activitySubscription" + }, + "subject": { + "type": "string", + "format": "did" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_getPreferences.json b/crates/weaver-api/lexicons/app_bsky_notification_getPreferences.json new file mode 100644 index 0000000..b032219 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_getPreferences.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.getPreferences", + "defs": { + "main": { + "type": "query", + "description": "Get notification-related preferences for an account. Requires auth.", + "parameters": { + "type": "params", + "properties": {} + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "preferences" + ], + "properties": { + "preferences": { + "type": "ref", + "ref": "app.bsky.notification.defs#preferences" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_getUnreadCount.json b/crates/weaver-api/lexicons/app_bsky_notification_getUnreadCount.json new file mode 100644 index 0000000..a7593a0 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_getUnreadCount.json @@ -0,0 +1,36 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.getUnreadCount", + "defs": { + "main": { + "type": "query", + "description": "Count the number of unread notifications for the requesting account. Requires auth.", + "parameters": { + "type": "params", + "properties": { + "priority": { + "type": "boolean" + }, + "seenAt": { + "type": "string", + "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/app_bsky_notification_listActivitySubscriptions.json b/crates/weaver-api/lexicons/app_bsky_notification_listActivitySubscriptions.json new file mode 100644 index 0000000..ac0cf74 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_listActivitySubscriptions.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.listActivitySubscriptions", + "defs": { + "main": { + "type": "query", + "description": "Enumerate all accounts to which the requesting account is subscribed to receive notifications for. Requires auth.", + "parameters": { + "type": "params", + "properties": { + "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": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_listNotifications.json b/crates/weaver-api/lexicons/app_bsky_notification_listNotifications.json new file mode 100644 index 0000000..a7c5105 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_listNotifications.json @@ -0,0 +1,132 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.listNotifications", + "defs": { + "main": { + "type": "query", + "description": "Enumerate notifications for the requesting account. Requires auth.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "priority": { + "type": "boolean" + }, + "reasons": { + "type": "array", + "description": "Notification reasons to include in response.", + "items": { + "type": "string", + "description": "A reason that matches the reason property of #notification." + } + }, + "seenAt": { + "type": "string", + "format": "datetime" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notifications" + ], + "properties": { + "cursor": { + "type": "string" + }, + "notifications": { + "type": "array", + "items": { + "type": "ref", + "ref": "#notification" + } + }, + "priority": { + "type": "boolean" + }, + "seenAt": { + "type": "string", + "format": "datetime" + } + } + } + } + }, + "notification": { + "type": "object", + "required": [ + "uri", + "cid", + "author", + "reason", + "record", + "isRead", + "indexedAt" + ], + "properties": { + "author": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "isRead": { + "type": "boolean" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "reason": { + "type": "string", + "description": "The reason why this notification was delivered - e.g. your post was liked, or you received a new follower.", + "knownValues": [ + "like", + "repost", + "follow", + "mention", + "reply", + "quote", + "starterpack-joined", + "verified", + "unverified", + "like-via-repost", + "repost-via-repost", + "subscribed-post" + ] + }, + "reasonSubject": { + "type": "string", + "format": "at-uri" + }, + "record": { + "type": "unknown" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_putActivitySubscription.json b/crates/weaver-api/lexicons/app_bsky_notification_putActivitySubscription.json new file mode 100644 index 0000000..3a2ec02 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_putActivitySubscription.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.putActivitySubscription", + "defs": { + "main": { + "type": "procedure", + "description": "Puts an activity subscription entry. The key should be omitted for creation and provided for updates. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject", + "activitySubscription" + ], + "properties": { + "activitySubscription": { + "type": "ref", + "ref": "app.bsky.notification.defs#activitySubscription" + }, + "subject": { + "type": "string", + "format": "did" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject" + ], + "properties": { + "activitySubscription": { + "type": "ref", + "ref": "app.bsky.notification.defs#activitySubscription" + }, + "subject": { + "type": "string", + "format": "did" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_putPreferences.json b/crates/weaver-api/lexicons/app_bsky_notification_putPreferences.json new file mode 100644 index 0000000..3e641ae --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_putPreferences.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.putPreferences", + "defs": { + "main": { + "type": "procedure", + "description": "Set notification-related preferences for an account. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "priority" + ], + "properties": { + "priority": { + "type": "boolean" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_putPreferencesV2.json b/crates/weaver-api/lexicons/app_bsky_notification_putPreferencesV2.json new file mode 100644 index 0000000..7341472 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_putPreferencesV2.json @@ -0,0 +1,85 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.putPreferencesV2", + "defs": { + "main": { + "type": "procedure", + "description": "Set notification-related preferences for an account. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "chat": { + "type": "ref", + "ref": "app.bsky.notification.defs#chatPreference" + }, + "follow": { + "type": "ref", + "ref": "app.bsky.notification.defs#filterablePreference" + }, + "like": { + "type": "ref", + "ref": "app.bsky.notification.defs#filterablePreference" + }, + "likeViaRepost": { + "type": "ref", + "ref": "app.bsky.notification.defs#filterablePreference" + }, + "mention": { + "type": "ref", + "ref": "app.bsky.notification.defs#filterablePreference" + }, + "quote": { + "type": "ref", + "ref": "app.bsky.notification.defs#filterablePreference" + }, + "reply": { + "type": "ref", + "ref": "app.bsky.notification.defs#filterablePreference" + }, + "repost": { + "type": "ref", + "ref": "app.bsky.notification.defs#filterablePreference" + }, + "repostViaRepost": { + "type": "ref", + "ref": "app.bsky.notification.defs#filterablePreference" + }, + "starterpackJoined": { + "type": "ref", + "ref": "app.bsky.notification.defs#preference" + }, + "subscribedPost": { + "type": "ref", + "ref": "app.bsky.notification.defs#preference" + }, + "unverified": { + "type": "ref", + "ref": "app.bsky.notification.defs#preference" + }, + "verified": { + "type": "ref", + "ref": "app.bsky.notification.defs#preference" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "preferences" + ], + "properties": { + "preferences": { + "type": "ref", + "ref": "app.bsky.notification.defs#preferences" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_registerPush.json b/crates/weaver-api/lexicons/app_bsky_notification_registerPush.json new file mode 100644 index 0000000..cca17a0 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_registerPush.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.registerPush", + "defs": { + "main": { + "type": "procedure", + "description": "Register to receive push notifications, via a specified service, for the requesting account. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "serviceDid", + "token", + "platform", + "appId" + ], + "properties": { + "ageRestricted": { + "type": "boolean", + "description": "Set to true when the actor is age restricted" + }, + "appId": { + "type": "string" + }, + "platform": { + "type": "string", + "knownValues": [ + "ios", + "android", + "web" + ] + }, + "serviceDid": { + "type": "string", + "format": "did" + }, + "token": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_unregisterPush.json b/crates/weaver-api/lexicons/app_bsky_notification_unregisterPush.json new file mode 100644 index 0000000..1f6c30a --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_unregisterPush.json @@ -0,0 +1,42 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.unregisterPush", + "defs": { + "main": { + "type": "procedure", + "description": "The inverse of registerPush - inform a specified service that push notifications should no longer be sent to the given token for the requesting account. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "serviceDid", + "token", + "platform", + "appId" + ], + "properties": { + "appId": { + "type": "string" + }, + "platform": { + "type": "string", + "knownValues": [ + "ios", + "android", + "web" + ] + }, + "serviceDid": { + "type": "string", + "format": "did" + }, + "token": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_notification_updateSeen.json b/crates/weaver-api/lexicons/app_bsky_notification_updateSeen.json new file mode 100644 index 0000000..ac69282 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_notification_updateSeen.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "app.bsky.notification.updateSeen", + "defs": { + "main": { + "type": "procedure", + "description": "Notify server that the requesting account has seen notifications. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "seenAt" + ], + "properties": { + "seenAt": { + "type": "string", + "format": "datetime" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_richtext_facet.json b/crates/weaver-api/lexicons/app_bsky_richtext_facet.json new file mode 100644 index 0000000..8fb76ce --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_richtext_facet.json @@ -0,0 +1,89 @@ +{ + "lexicon": 1, + "id": "app.bsky.richtext.facet", + "defs": { + "byteSlice": { + "type": "object", + "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.", + "required": [ + "byteStart", + "byteEnd" + ], + "properties": { + "byteEnd": { + "type": "integer", + "minimum": 0 + }, + "byteStart": { + "type": "integer", + "minimum": 0 + } + } + }, + "link": { + "type": "object", + "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "uri" + } + } + }, + "main": { + "type": "object", + "description": "Annotation of a sub-string within rich text.", + "required": [ + "index", + "features" + ], + "properties": { + "features": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "#mention", + "#link", + "#tag" + ] + } + }, + "index": { + "type": "ref", + "ref": "#byteSlice" + } + } + }, + "mention": { + "type": "object", + "description": "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "tag": { + "type": "object", + "description": "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').", + "required": [ + "tag" + ], + "properties": { + "tag": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_defs.json b/crates/weaver-api/lexicons/app_bsky_unspecced_defs.json new file mode 100644 index 0000000..0bae0e2 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_defs.json @@ -0,0 +1,283 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.defs", + "defs": { + "ageAssuranceEvent": { + "type": "object", + "description": "Object used to store age assurance data in stash.", + "required": [ + "createdAt", + "status", + "attemptId" + ], + "properties": { + "attemptId": { + "type": "string", + "description": "The unique identifier for this instance of the age assurance flow, in UUID format." + }, + "completeIp": { + "type": "string", + "description": "The IP address used when completing the AA flow." + }, + "completeUa": { + "type": "string", + "description": "The user agent used when completing the AA flow." + }, + "createdAt": { + "type": "string", + "description": "The date and time of this write operation.", + "format": "datetime" + }, + "email": { + "type": "string", + "description": "The email used for AA." + }, + "initIp": { + "type": "string", + "description": "The IP address used when initiating the AA flow." + }, + "initUa": { + "type": "string", + "description": "The user agent used when initiating the AA flow." + }, + "status": { + "type": "string", + "description": "The status of the age assurance process.", + "knownValues": [ + "unknown", + "pending", + "assured" + ] + } + } + }, + "ageAssuranceState": { + "type": "object", + "description": "The computed state of the age assurance process, returned to the user in question on certain authenticated requests.", + "required": [ + "status" + ], + "properties": { + "lastInitiatedAt": { + "type": "string", + "description": "The timestamp when this state was last updated.", + "format": "datetime" + }, + "status": { + "type": "string", + "description": "The status of the age assurance process.", + "knownValues": [ + "unknown", + "pending", + "assured", + "blocked" + ] + } + } + }, + "skeletonSearchActor": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "skeletonSearchPost": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "skeletonSearchStarterPack": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "skeletonTrend": { + "type": "object", + "required": [ + "topic", + "displayName", + "link", + "startedAt", + "postCount", + "dids" + ], + "properties": { + "category": { + "type": "string" + }, + "dids": { + "type": "array", + "items": { + "type": "string", + "format": "did" + } + }, + "displayName": { + "type": "string" + }, + "link": { + "type": "string" + }, + "postCount": { + "type": "integer" + }, + "startedAt": { + "type": "string", + "format": "datetime" + }, + "status": { + "type": "string", + "knownValues": [ + "hot" + ] + }, + "topic": { + "type": "string" + } + } + }, + "threadItemBlocked": { + "type": "object", + "required": [ + "author" + ], + "properties": { + "author": { + "type": "ref", + "ref": "app.bsky.feed.defs#blockedAuthor" + } + } + }, + "threadItemNoUnauthenticated": { + "type": "object", + "properties": {} + }, + "threadItemNotFound": { + "type": "object", + "properties": {} + }, + "threadItemPost": { + "type": "object", + "required": [ + "post", + "moreParents", + "moreReplies", + "opThread", + "hiddenByThreadgate", + "mutedByViewer" + ], + "properties": { + "hiddenByThreadgate": { + "type": "boolean", + "description": "The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread." + }, + "moreParents": { + "type": "boolean", + "description": "This post has more parents that were not present in the response. This is just a boolean, without the number of parents." + }, + "moreReplies": { + "type": "integer", + "description": "This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate." + }, + "mutedByViewer": { + "type": "boolean", + "description": "This is by an account muted by the viewer requesting it." + }, + "opThread": { + "type": "boolean", + "description": "This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread." + }, + "post": { + "type": "ref", + "ref": "app.bsky.feed.defs#postView" + } + } + }, + "trendView": { + "type": "object", + "required": [ + "topic", + "displayName", + "link", + "startedAt", + "postCount", + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewBasic" + } + }, + "category": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "link": { + "type": "string" + }, + "postCount": { + "type": "integer" + }, + "startedAt": { + "type": "string", + "format": "datetime" + }, + "status": { + "type": "string", + "knownValues": [ + "hot" + ] + }, + "topic": { + "type": "string" + } + } + }, + "trendingTopic": { + "type": "object", + "required": [ + "topic", + "link" + ], + "properties": { + "description": { + "type": "string" + }, + "displayName": { + "type": "string" + }, + "link": { + "type": "string" + }, + "topic": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getAgeAssuranceState.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getAgeAssuranceState.json new file mode 100644 index 0000000..542f292 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getAgeAssuranceState.json @@ -0,0 +1,17 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getAgeAssuranceState", + "defs": { + "main": { + "type": "query", + "description": "Returns the current state of the age assurance process for an account. This is used to check if the user has completed age assurance or if further action is required.", + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#ageAssuranceState" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getConfig.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getConfig.json new file mode 100644 index 0000000..565b4ef --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getConfig.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getConfig", + "defs": { + "liveNowConfig": { + "type": "object", + "required": [ + "did", + "domains" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "domains": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "main": { + "type": "query", + "description": "Get miscellaneous runtime configuration.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [], + "properties": { + "checkEmailConfirmed": { + "type": "boolean" + }, + "liveNow": { + "type": "array", + "items": { + "type": "ref", + "ref": "#liveNowConfig" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacks.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacks.json new file mode 100644 index 0000000..baa0d2c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacks.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getOnboardingSuggestedStarterPacks", + "defs": { + "main": { + "type": "query", + "description": "Get a list of suggested starterpacks for onboarding", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacks" + ], + "properties": { + "starterPacks": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#starterPackView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacksSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacksSkeleton.json new file mode 100644 index 0000000..0d4021c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getOnboardingSuggestedStarterPacksSkeleton.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Get a skeleton of suggested starterpacks for onboarding. Intended to be called and hydrated by app.bsky.unspecced.getOnboardingSuggestedStarterPacks", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries).", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacks" + ], + "properties": { + "starterPacks": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getPopularFeedGenerators.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getPopularFeedGenerators.json new file mode 100644 index 0000000..3a4fb84 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getPopularFeedGenerators.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getPopularFeedGenerators", + "defs": { + "main": { + "type": "query", + "description": "An unspecced view of globally popular feed generators.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "query": { + "type": "string" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feeds" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#generatorView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadOtherV2.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadOtherV2.json new file mode 100644 index 0000000..5d52338 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadOtherV2.json @@ -0,0 +1,71 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getPostThreadOtherV2", + "defs": { + "main": { + "type": "query", + "description": "(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests.", + "parameters": { + "type": "params", + "required": [ + "anchor" + ], + "properties": { + "anchor": { + "type": "string", + "description": "Reference (AT-URI) to post record. This is the anchor post.", + "format": "at-uri" + }, + "prioritizeFollowedUsers": { + "type": "boolean", + "description": "Whether to prioritize posts from followed users. It only has effect when the user is authenticated.", + "default": false + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "thread" + ], + "properties": { + "thread": { + "type": "array", + "description": "A flat list of other thread items. The depth of each item is indicated by the depth property inside the item.", + "items": { + "type": "ref", + "ref": "#threadItem" + } + } + } + } + } + }, + "threadItem": { + "type": "object", + "required": [ + "uri", + "depth", + "value" + ], + "properties": { + "depth": { + "type": "integer", + "description": "The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths." + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "value": { + "type": "union", + "refs": [ + "app.bsky.unspecced.defs#threadItemPost" + ] + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadV2.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadV2.json new file mode 100644 index 0000000..46d2883 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getPostThreadV2.json @@ -0,0 +1,112 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getPostThreadV2", + "defs": { + "main": { + "type": "query", + "description": "(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get posts in a thread. It is based in an anchor post at any depth of the tree, and returns posts above it (recursively resolving the parent, without further branching to their replies) and below it (recursive replies, with branching to their replies). Does not require auth, but additional metadata and filtering will be applied for authed requests.", + "parameters": { + "type": "params", + "required": [ + "anchor" + ], + "properties": { + "above": { + "type": "boolean", + "description": "Whether to include parents above the anchor.", + "default": true + }, + "anchor": { + "type": "string", + "description": "Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post.", + "format": "at-uri" + }, + "below": { + "type": "integer", + "description": "How many levels of replies to include below the anchor.", + "default": 6, + "minimum": 0, + "maximum": 20 + }, + "branchingFactor": { + "type": "integer", + "description": "Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated).", + "default": 10, + "minimum": 0, + "maximum": 100 + }, + "prioritizeFollowedUsers": { + "type": "boolean", + "description": "Whether to prioritize posts from followed users. It only has effect when the user is authenticated.", + "default": false + }, + "sort": { + "type": "string", + "description": "Sorting for the thread replies.", + "default": "oldest", + "knownValues": [ + "newest", + "oldest", + "top" + ] + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "thread", + "hasOtherReplies" + ], + "properties": { + "hasOtherReplies": { + "type": "boolean", + "description": "Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them." + }, + "thread": { + "type": "array", + "description": "A flat list of thread items. The depth of each item is indicated by the depth property inside the item.", + "items": { + "type": "ref", + "ref": "#threadItem" + } + }, + "threadgate": { + "type": "ref", + "ref": "app.bsky.feed.defs#threadgateView" + } + } + } + } + }, + "threadItem": { + "type": "object", + "required": [ + "uri", + "depth", + "value" + ], + "properties": { + "depth": { + "type": "integer", + "description": "The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths." + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "value": { + "type": "union", + "refs": [ + "app.bsky.unspecced.defs#threadItemPost", + "app.bsky.unspecced.defs#threadItemNoUnauthenticated", + "app.bsky.unspecced.defs#threadItemNotFound", + "app.bsky.unspecced.defs#threadItemBlocked" + ] + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedFeeds.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedFeeds.json new file mode 100644 index 0000000..775ad55 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedFeeds.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getSuggestedFeeds", + "defs": { + "main": { + "type": "query", + "description": "Get a list of suggested feeds", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feeds" + ], + "properties": { + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.feed.defs#generatorView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedFeedsSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedFeedsSkeleton.json new file mode 100644 index 0000000..034c608 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedFeedsSkeleton.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getSuggestedFeedsSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Get a skeleton of suggested feeds. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedFeeds", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries).", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feeds" + ], + "properties": { + "feeds": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedStarterPacks.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedStarterPacks.json new file mode 100644 index 0000000..6c3d84c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedStarterPacks.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getSuggestedStarterPacks", + "defs": { + "main": { + "type": "query", + "description": "Get a list of suggested starterpacks", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacks" + ], + "properties": { + "starterPacks": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.graph.defs#starterPackView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedStarterPacksSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedStarterPacksSkeleton.json new file mode 100644 index 0000000..3a0c89c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedStarterPacksSkeleton.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getSuggestedStarterPacksSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Get a skeleton of suggested starterpacks. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedStarterpacks", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries).", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacks" + ], + "properties": { + "starterPacks": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedUsers.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedUsers.json new file mode 100644 index 0000000..bc653c8 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedUsers.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getSuggestedUsers", + "defs": { + "main": { + "type": "query", + "description": "Get a list of suggested users", + "parameters": { + "type": "params", + "properties": { + "category": { + "type": "string", + "description": "Category of users to get suggestions for." + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 50 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedUsersSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedUsersSkeleton.json new file mode 100644 index 0000000..118a8bc --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestedUsersSkeleton.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getSuggestedUsersSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Get a skeleton of suggested users. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsers", + "parameters": { + "type": "params", + "properties": { + "category": { + "type": "string", + "description": "Category of users to get suggestions for." + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 50 + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries).", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "dids" + ], + "properties": { + "dids": { + "type": "array", + "items": { + "type": "string", + "format": "did" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestionsSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestionsSkeleton.json new file mode 100644 index 0000000..62dc031 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getSuggestionsSkeleton.json @@ -0,0 +1,64 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getSuggestionsSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "relativeToDid": { + "type": "string", + "description": "DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer.", + "format": "did" + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#skeletonSearchActor" + } + }, + "cursor": { + "type": "string" + }, + "recId": { + "type": "integer", + "description": "Snowflake for this recommendation, use when submitting recommendation events." + }, + "relativeToDid": { + "type": "string", + "description": "DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer.", + "format": "did" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getTaggedSuggestions.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getTaggedSuggestions.json new file mode 100644 index 0000000..b1fdcb1 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getTaggedSuggestions.json @@ -0,0 +1,56 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getTaggedSuggestions", + "defs": { + "main": { + "type": "query", + "description": "Get a list of suggestions (feeds and users) tagged with categories", + "parameters": { + "type": "params", + "properties": {} + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "suggestions" + ], + "properties": { + "suggestions": { + "type": "array", + "items": { + "type": "ref", + "ref": "#suggestion" + } + } + } + } + } + }, + "suggestion": { + "type": "object", + "required": [ + "tag", + "subjectType", + "subject" + ], + "properties": { + "subject": { + "type": "string", + "format": "uri" + }, + "subjectType": { + "type": "string", + "knownValues": [ + "actor", + "feed" + ] + }, + "tag": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getTrendingTopics.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getTrendingTopics.json new file mode 100644 index 0000000..b7b5c5f --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getTrendingTopics.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getTrendingTopics", + "defs": { + "main": { + "type": "query", + "description": "Get a list of trending topics", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "topics", + "suggested" + ], + "properties": { + "suggested": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#trendingTopic" + } + }, + "topics": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#trendingTopic" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getTrends.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getTrends.json new file mode 100644 index 0000000..9656267 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getTrends.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getTrends", + "defs": { + "main": { + "type": "query", + "description": "Get the current trends on the network", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "trends" + ], + "properties": { + "trends": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#trendView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_getTrendsSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_getTrendsSkeleton.json new file mode 100644 index 0000000..cbb2f6e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_getTrendsSkeleton.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.getTrendsSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Get the skeleton of trends on the network. Intended to be called and then hydrated through app.bsky.unspecced.getTrends", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries).", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "trends" + ], + "properties": { + "trends": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#skeletonTrend" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_initAgeAssurance.json b/crates/weaver-api/lexicons/app_bsky_unspecced_initAgeAssurance.json new file mode 100644 index 0000000..bb1926c --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_initAgeAssurance.json @@ -0,0 +1,53 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.initAgeAssurance", + "defs": { + "main": { + "type": "procedure", + "description": "Initiate age assurance for an account. This is a one-time action that will start the process of verifying the user's age.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "email", + "language", + "countryCode" + ], + "properties": { + "countryCode": { + "type": "string", + "description": "An ISO 3166-1 alpha-2 code of the user's location." + }, + "email": { + "type": "string", + "description": "The user's email address to receive assurance instructions." + }, + "language": { + "type": "string", + "description": "The user's preferred language for communication during the assurance process." + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#ageAssuranceState" + } + }, + "errors": [ + { + "name": "InvalidEmail" + }, + { + "name": "DidTooLong" + }, + { + "name": "InvalidInitiation" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_searchActorsSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_searchActorsSkeleton.json new file mode 100644 index 0000000..7e94d3e --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_searchActorsSkeleton.json @@ -0,0 +1,71 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.searchActorsSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Backend Actors (profile) search, returns only skeleton.", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "cursor": { + "type": "string", + "description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set." + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string", + "description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax." + }, + "typeahead": { + "type": "boolean", + "description": "If true, acts as fast/simple 'typeahead' query." + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#skeletonSearchActor" + } + }, + "cursor": { + "type": "string" + }, + "hitsTotal": { + "type": "integer", + "description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits." + } + } + } + }, + "errors": [ + { + "name": "BadQueryString" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_searchPostsSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_searchPostsSkeleton.json new file mode 100644 index 0000000..4993085 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_searchPostsSkeleton.json @@ -0,0 +1,117 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.searchPostsSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Backend Posts search, returns only skeleton", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "author": { + "type": "string", + "description": "Filter to posts by the given account. Handles are resolved to DID before query-time.", + "format": "at-identifier" + }, + "cursor": { + "type": "string", + "description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set." + }, + "domain": { + "type": "string", + "description": "Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization." + }, + "lang": { + "type": "string", + "description": "Filter to posts in the given language. Expected to be based on post language field, though server may override language detection.", + "format": "language" + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 100 + }, + "mentions": { + "type": "string", + "description": "Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions.", + "format": "at-identifier" + }, + "q": { + "type": "string", + "description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended." + }, + "since": { + "type": "string", + "description": "Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD)." + }, + "sort": { + "type": "string", + "description": "Specifies the ranking order of results.", + "default": "latest", + "knownValues": [ + "top", + "latest" + ] + }, + "tag": { + "type": "array", + "description": "Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching.", + "items": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + } + }, + "until": { + "type": "string", + "description": "Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD)." + }, + "url": { + "type": "string", + "description": "Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching.", + "format": "uri" + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "posts" + ], + "properties": { + "cursor": { + "type": "string" + }, + "hitsTotal": { + "type": "integer", + "description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits." + }, + "posts": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#skeletonSearchPost" + } + } + } + } + }, + "errors": [ + { + "name": "BadQueryString" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_unspecced_searchStarterPacksSkeleton.json b/crates/weaver-api/lexicons/app_bsky_unspecced_searchStarterPacksSkeleton.json new file mode 100644 index 0000000..d26954a --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_unspecced_searchStarterPacksSkeleton.json @@ -0,0 +1,67 @@ +{ + "lexicon": 1, + "id": "app.bsky.unspecced.searchStarterPacksSkeleton", + "defs": { + "main": { + "type": "query", + "description": "Backend Starter Pack search, returns only skeleton.", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "cursor": { + "type": "string", + "description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set." + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string", + "description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended." + }, + "viewer": { + "type": "string", + "description": "DID of the account making the request (not included for public/unauthenticated queries).", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "starterPacks" + ], + "properties": { + "cursor": { + "type": "string" + }, + "hitsTotal": { + "type": "integer", + "description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits." + }, + "starterPacks": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.bsky.unspecced.defs#skeletonSearchStarterPack" + } + } + } + } + }, + "errors": [ + { + "name": "BadQueryString" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_video_defs.json b/crates/weaver-api/lexicons/app_bsky_video_defs.json new file mode 100644 index 0000000..d4db613 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_video_defs.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "app.bsky.video.defs", + "defs": { + "jobStatus": { + "type": "object", + "required": [ + "jobId", + "did", + "state" + ], + "properties": { + "blob": { + "type": "blob" + }, + "did": { + "type": "string", + "format": "did" + }, + "error": { + "type": "string" + }, + "jobId": { + "type": "string" + }, + "message": { + "type": "string" + }, + "progress": { + "type": "integer", + "description": "Progress within the current processing state.", + "minimum": 0, + "maximum": 100 + }, + "state": { + "type": "string", + "description": "The state of the video processing job. All values not listed as a known value indicate that the job is in process.", + "knownValues": [ + "JOB_STATE_COMPLETED", + "JOB_STATE_FAILED" + ] + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_video_getJobStatus.json b/crates/weaver-api/lexicons/app_bsky_video_getJobStatus.json new file mode 100644 index 0000000..d2583c9 --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_video_getJobStatus.json @@ -0,0 +1,36 @@ +{ + "lexicon": 1, + "id": "app.bsky.video.getJobStatus", + "defs": { + "main": { + "type": "query", + "description": "Get status details for a video processing job.", + "parameters": { + "type": "params", + "required": [ + "jobId" + ], + "properties": { + "jobId": { + "type": "string" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "jobStatus" + ], + "properties": { + "jobStatus": { + "type": "ref", + "ref": "app.bsky.video.defs#jobStatus" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_video_getUploadLimits.json b/crates/weaver-api/lexicons/app_bsky_video_getUploadLimits.json new file mode 100644 index 0000000..b11ebfc --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_video_getUploadLimits.json @@ -0,0 +1,36 @@ +{ + "lexicon": 1, + "id": "app.bsky.video.getUploadLimits", + "defs": { + "main": { + "type": "query", + "description": "Get video upload limits for the authenticated user.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "canUpload" + ], + "properties": { + "canUpload": { + "type": "boolean" + }, + "error": { + "type": "string" + }, + "message": { + "type": "string" + }, + "remainingDailyBytes": { + "type": "integer" + }, + "remainingDailyVideos": { + "type": "integer" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/app_bsky_video_uploadVideo.json b/crates/weaver-api/lexicons/app_bsky_video_uploadVideo.json new file mode 100644 index 0000000..51d59cc --- /dev/null +++ b/crates/weaver-api/lexicons/app_bsky_video_uploadVideo.json @@ -0,0 +1,28 @@ +{ + "lexicon": 1, + "id": "app.bsky.video.uploadVideo", + "defs": { + "main": { + "type": "procedure", + "description": "Upload a video to be processed then stored on the PDS.", + "input": { + "encoding": "video/mp4" + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "jobStatus" + ], + "properties": { + "jobStatus": { + "type": "ref", + "ref": "app.bsky.video.defs#jobStatus" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_actor_declaration.json b/crates/weaver-api/lexicons/chat_bsky_actor_declaration.json new file mode 100644 index 0000000..9d40332 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_actor_declaration.json @@ -0,0 +1,27 @@ +{ + "lexicon": 1, + "id": "chat.bsky.actor.declaration", + "defs": { + "main": { + "type": "record", + "description": "A declaration of a Bluesky chat account.", + "key": "literal:self", + "record": { + "type": "object", + "required": [ + "allowIncoming" + ], + "properties": { + "allowIncoming": { + "type": "string", + "knownValues": [ + "all", + "none", + "following" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_actor_defs.json b/crates/weaver-api/lexicons/chat_bsky_actor_defs.json new file mode 100644 index 0000000..8786eae --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_actor_defs.json @@ -0,0 +1,55 @@ +{ + "lexicon": 1, + "id": "chat.bsky.actor.defs", + "defs": { + "profileViewBasic": { + "type": "object", + "required": [ + "did", + "handle" + ], + "properties": { + "associated": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileAssociated" + }, + "avatar": { + "type": "string", + "format": "uri" + }, + "chatDisabled": { + "type": "boolean", + "description": "Set to true when the actor cannot actively participate in conversations" + }, + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "handle": { + "type": "string", + "format": "handle" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "verification": { + "type": "ref", + "ref": "app.bsky.actor.defs#verificationState" + }, + "viewer": { + "type": "ref", + "ref": "app.bsky.actor.defs#viewerState" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_actor_deleteAccount.json b/crates/weaver-api/lexicons/chat_bsky_actor_deleteAccount.json new file mode 100644 index 0000000..acd2717 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_actor_deleteAccount.json @@ -0,0 +1,16 @@ +{ + "lexicon": 1, + "id": "chat.bsky.actor.deleteAccount", + "defs": { + "main": { + "type": "procedure", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": {} + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_actor_exportAccountData.json b/crates/weaver-api/lexicons/chat_bsky_actor_exportAccountData.json new file mode 100644 index 0000000..f55878e --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_actor_exportAccountData.json @@ -0,0 +1,12 @@ +{ + "lexicon": 1, + "id": "chat.bsky.actor.exportAccountData", + "defs": { + "main": { + "type": "query", + "output": { + "encoding": "application/jsonl" + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_acceptConvo.json b/crates/weaver-api/lexicons/chat_bsky_convo_acceptConvo.json new file mode 100644 index 0000000..bd97611 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_acceptConvo.json @@ -0,0 +1,35 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.acceptConvo", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "rev": { + "type": "string", + "description": "Rev when the convo was accepted. If not present, the convo was already accepted." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_addReaction.json b/crates/weaver-api/lexicons/chat_bsky_convo_addReaction.json new file mode 100644 index 0000000..c5be6c7 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_addReaction.json @@ -0,0 +1,65 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.addReaction", + "defs": { + "main": { + "type": "procedure", + "description": "Adds an emoji reaction to a message. Requires authentication. It is idempotent, so multiple calls from the same user with the same emoji result in a single reaction.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId", + "messageId", + "value" + ], + "properties": { + "convoId": { + "type": "string" + }, + "messageId": { + "type": "string" + }, + "value": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "minGraphemes": 1, + "maxGraphemes": 1 + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "ref", + "ref": "chat.bsky.convo.defs#messageView" + } + } + } + }, + "errors": [ + { + "description": "Indicates that the message has been deleted and reactions can no longer be added/removed.", + "name": "ReactionMessageDeleted" + }, + { + "description": "Indicates that the message has the maximum number of reactions allowed for a single user, and the requested reaction wasn't yet present. If it was already present, the request will not fail since it is idempotent.", + "name": "ReactionLimitReached" + }, + { + "description": "Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji.", + "name": "ReactionInvalidValue" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_defs.json b/crates/weaver-api/lexicons/chat_bsky_convo_defs.json new file mode 100644 index 0000000..67082f0 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_defs.json @@ -0,0 +1,444 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.defs", + "defs": { + "convoView": { + "type": "object", + "required": [ + "id", + "rev", + "members", + "muted", + "unreadCount" + ], + "properties": { + "id": { + "type": "string" + }, + "lastMessage": { + "type": "union", + "refs": [ + "#messageView", + "#deletedMessageView" + ] + }, + "lastReaction": { + "type": "union", + "refs": [ + "#messageAndReactionView" + ] + }, + "members": { + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.actor.defs#profileViewBasic" + } + }, + "muted": { + "type": "boolean" + }, + "rev": { + "type": "string" + }, + "status": { + "type": "string", + "knownValues": [ + "request", + "accepted" + ] + }, + "unreadCount": { + "type": "integer" + } + } + }, + "deletedMessageView": { + "type": "object", + "required": [ + "id", + "rev", + "sender", + "sentAt" + ], + "properties": { + "id": { + "type": "string" + }, + "rev": { + "type": "string" + }, + "sender": { + "type": "ref", + "ref": "#messageViewSender" + }, + "sentAt": { + "type": "string", + "format": "datetime" + } + } + }, + "logAcceptConvo": { + "type": "object", + "required": [ + "rev", + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "rev": { + "type": "string" + } + } + }, + "logAddReaction": { + "type": "object", + "required": [ + "rev", + "convoId", + "message", + "reaction" + ], + "properties": { + "convoId": { + "type": "string" + }, + "message": { + "type": "union", + "refs": [ + "#messageView", + "#deletedMessageView" + ] + }, + "reaction": { + "type": "ref", + "ref": "#reactionView" + }, + "rev": { + "type": "string" + } + } + }, + "logBeginConvo": { + "type": "object", + "required": [ + "rev", + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "rev": { + "type": "string" + } + } + }, + "logCreateMessage": { + "type": "object", + "required": [ + "rev", + "convoId", + "message" + ], + "properties": { + "convoId": { + "type": "string" + }, + "message": { + "type": "union", + "refs": [ + "#messageView", + "#deletedMessageView" + ] + }, + "rev": { + "type": "string" + } + } + }, + "logDeleteMessage": { + "type": "object", + "required": [ + "rev", + "convoId", + "message" + ], + "properties": { + "convoId": { + "type": "string" + }, + "message": { + "type": "union", + "refs": [ + "#messageView", + "#deletedMessageView" + ] + }, + "rev": { + "type": "string" + } + } + }, + "logLeaveConvo": { + "type": "object", + "required": [ + "rev", + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "rev": { + "type": "string" + } + } + }, + "logMuteConvo": { + "type": "object", + "required": [ + "rev", + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "rev": { + "type": "string" + } + } + }, + "logReadMessage": { + "type": "object", + "required": [ + "rev", + "convoId", + "message" + ], + "properties": { + "convoId": { + "type": "string" + }, + "message": { + "type": "union", + "refs": [ + "#messageView", + "#deletedMessageView" + ] + }, + "rev": { + "type": "string" + } + } + }, + "logRemoveReaction": { + "type": "object", + "required": [ + "rev", + "convoId", + "message", + "reaction" + ], + "properties": { + "convoId": { + "type": "string" + }, + "message": { + "type": "union", + "refs": [ + "#messageView", + "#deletedMessageView" + ] + }, + "reaction": { + "type": "ref", + "ref": "#reactionView" + }, + "rev": { + "type": "string" + } + } + }, + "logUnmuteConvo": { + "type": "object", + "required": [ + "rev", + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "rev": { + "type": "string" + } + } + }, + "messageAndReactionView": { + "type": "object", + "required": [ + "message", + "reaction" + ], + "properties": { + "message": { + "type": "ref", + "ref": "#messageView" + }, + "reaction": { + "type": "ref", + "ref": "#reactionView" + } + } + }, + "messageInput": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "embed": { + "type": "union", + "refs": [ + "app.bsky.embed.record" + ] + }, + "facets": { + "type": "array", + "description": "Annotations of text (mentions, URLs, hashtags, etc)", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + } + }, + "text": { + "type": "string", + "maxLength": 10000, + "maxGraphemes": 1000 + } + } + }, + "messageRef": { + "type": "object", + "required": [ + "did", + "messageId", + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "did": { + "type": "string", + "format": "did" + }, + "messageId": { + "type": "string" + } + } + }, + "messageView": { + "type": "object", + "required": [ + "id", + "rev", + "text", + "sender", + "sentAt" + ], + "properties": { + "embed": { + "type": "union", + "refs": [ + "app.bsky.embed.record#view" + ] + }, + "facets": { + "type": "array", + "description": "Annotations of text (mentions, URLs, hashtags, etc)", + "items": { + "type": "ref", + "ref": "app.bsky.richtext.facet" + } + }, + "id": { + "type": "string" + }, + "reactions": { + "type": "array", + "description": "Reactions to this message, in ascending order of creation time.", + "items": { + "type": "ref", + "ref": "#reactionView" + } + }, + "rev": { + "type": "string" + }, + "sender": { + "type": "ref", + "ref": "#messageViewSender" + }, + "sentAt": { + "type": "string", + "format": "datetime" + }, + "text": { + "type": "string", + "maxLength": 10000, + "maxGraphemes": 1000 + } + } + }, + "messageViewSender": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "reactionView": { + "type": "object", + "required": [ + "value", + "sender", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "sender": { + "type": "ref", + "ref": "#reactionViewSender" + }, + "value": { + "type": "string" + } + } + }, + "reactionViewSender": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_deleteMessageForSelf.json b/crates/weaver-api/lexicons/chat_bsky_convo_deleteMessageForSelf.json new file mode 100644 index 0000000..6f52b14 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_deleteMessageForSelf.json @@ -0,0 +1,34 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.deleteMessageForSelf", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId", + "messageId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "messageId": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "chat.bsky.convo.defs#deletedMessageView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_getConvo.json b/crates/weaver-api/lexicons/chat_bsky_convo_getConvo.json new file mode 100644 index 0000000..5034ba0 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_getConvo.json @@ -0,0 +1,35 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.getConvo", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": [ + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convo" + ], + "properties": { + "convo": { + "type": "ref", + "ref": "chat.bsky.convo.defs#convoView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_getConvoAvailability.json b/crates/weaver-api/lexicons/chat_bsky_convo_getConvoAvailability.json new file mode 100644 index 0000000..7cc0eac --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_getConvoAvailability.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.getConvoAvailability", + "defs": { + "main": { + "type": "query", + "description": "Get whether the requester and the other members can chat. If an existing convo is found for these members, it is returned.", + "parameters": { + "type": "params", + "required": [ + "members" + ], + "properties": { + "members": { + "type": "array", + "items": { + "type": "string", + "format": "did" + }, + "minLength": 1, + "maxLength": 10 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "canChat" + ], + "properties": { + "canChat": { + "type": "boolean" + }, + "convo": { + "type": "ref", + "ref": "chat.bsky.convo.defs#convoView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_getConvoForMembers.json b/crates/weaver-api/lexicons/chat_bsky_convo_getConvoForMembers.json new file mode 100644 index 0000000..e985aaa --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_getConvoForMembers.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.getConvoForMembers", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": [ + "members" + ], + "properties": { + "members": { + "type": "array", + "items": { + "type": "string", + "format": "did" + }, + "minLength": 1, + "maxLength": 10 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convo" + ], + "properties": { + "convo": { + "type": "ref", + "ref": "chat.bsky.convo.defs#convoView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_getLog.json b/crates/weaver-api/lexicons/chat_bsky_convo_getLog.json new file mode 100644 index 0000000..16da84b --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_getLog.json @@ -0,0 +1,50 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.getLog", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": [], + "properties": { + "cursor": { + "type": "string" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "logs" + ], + "properties": { + "cursor": { + "type": "string" + }, + "logs": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "chat.bsky.convo.defs#logBeginConvo", + "chat.bsky.convo.defs#logAcceptConvo", + "chat.bsky.convo.defs#logLeaveConvo", + "chat.bsky.convo.defs#logMuteConvo", + "chat.bsky.convo.defs#logUnmuteConvo", + "chat.bsky.convo.defs#logCreateMessage", + "chat.bsky.convo.defs#logDeleteMessage", + "chat.bsky.convo.defs#logReadMessage", + "chat.bsky.convo.defs#logAddReaction", + "chat.bsky.convo.defs#logRemoveReaction" + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_getMessages.json b/crates/weaver-api/lexicons/chat_bsky_convo_getMessages.json new file mode 100644 index 0000000..30a4e65 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_getMessages.json @@ -0,0 +1,53 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.getMessages", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": [ + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "messages" + ], + "properties": { + "cursor": { + "type": "string" + }, + "messages": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "chat.bsky.convo.defs#messageView", + "chat.bsky.convo.defs#deletedMessageView" + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_leaveConvo.json b/crates/weaver-api/lexicons/chat_bsky_convo_leaveConvo.json new file mode 100644 index 0000000..7ac826c --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_leaveConvo.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.leaveConvo", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId", + "rev" + ], + "properties": { + "convoId": { + "type": "string" + }, + "rev": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_listConvos.json b/crates/weaver-api/lexicons/chat_bsky_convo_listConvos.json new file mode 100644 index 0000000..f886281 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_listConvos.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.listConvos", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "readState": { + "type": "string", + "knownValues": [ + "unread" + ] + }, + "status": { + "type": "string", + "knownValues": [ + "request", + "accepted" + ] + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convos" + ], + "properties": { + "convos": { + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.convo.defs#convoView" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_muteConvo.json b/crates/weaver-api/lexicons/chat_bsky_convo_muteConvo.json new file mode 100644 index 0000000..e96a6ce --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_muteConvo.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.muteConvo", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convo" + ], + "properties": { + "convo": { + "type": "ref", + "ref": "chat.bsky.convo.defs#convoView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_removeReaction.json b/crates/weaver-api/lexicons/chat_bsky_convo_removeReaction.json new file mode 100644 index 0000000..c71f334 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_removeReaction.json @@ -0,0 +1,61 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.removeReaction", + "defs": { + "main": { + "type": "procedure", + "description": "Removes an emoji reaction from a message. Requires authentication. It is idempotent, so multiple calls from the same user with the same emoji result in that reaction not being present, even if it already wasn't.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId", + "messageId", + "value" + ], + "properties": { + "convoId": { + "type": "string" + }, + "messageId": { + "type": "string" + }, + "value": { + "type": "string", + "minLength": 1, + "maxLength": 64, + "minGraphemes": 1, + "maxGraphemes": 1 + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "ref", + "ref": "chat.bsky.convo.defs#messageView" + } + } + } + }, + "errors": [ + { + "description": "Indicates that the message has been deleted and reactions can no longer be added/removed.", + "name": "ReactionMessageDeleted" + }, + { + "description": "Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji.", + "name": "ReactionInvalidValue" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_sendMessage.json b/crates/weaver-api/lexicons/chat_bsky_convo_sendMessage.json new file mode 100644 index 0000000..9e101e5 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_sendMessage.json @@ -0,0 +1,35 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.sendMessage", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId", + "message" + ], + "properties": { + "convoId": { + "type": "string" + }, + "message": { + "type": "ref", + "ref": "chat.bsky.convo.defs#messageInput" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "chat.bsky.convo.defs#messageView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_sendMessageBatch.json b/crates/weaver-api/lexicons/chat_bsky_convo_sendMessageBatch.json new file mode 100644 index 0000000..e833553 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_sendMessageBatch.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.sendMessageBatch", + "defs": { + "batchItem": { + "type": "object", + "required": [ + "convoId", + "message" + ], + "properties": { + "convoId": { + "type": "string" + }, + "message": { + "type": "ref", + "ref": "chat.bsky.convo.defs#messageInput" + } + } + }, + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "type": "ref", + "ref": "#batchItem" + }, + "maxLength": 100 + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "type": "ref", + "ref": "chat.bsky.convo.defs#messageView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_unmuteConvo.json b/crates/weaver-api/lexicons/chat_bsky_convo_unmuteConvo.json new file mode 100644 index 0000000..4d95440 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_unmuteConvo.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.unmuteConvo", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convo" + ], + "properties": { + "convo": { + "type": "ref", + "ref": "chat.bsky.convo.defs#convoView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_updateAllRead.json b/crates/weaver-api/lexicons/chat_bsky_convo_updateAllRead.json new file mode 100644 index 0000000..ff08aba --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_updateAllRead.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.updateAllRead", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string", + "knownValues": [ + "request", + "accepted" + ] + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "updatedCount" + ], + "properties": { + "updatedCount": { + "type": "integer", + "description": "The count of updated convos." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_convo_updateRead.json b/crates/weaver-api/lexicons/chat_bsky_convo_updateRead.json new file mode 100644 index 0000000..7eb6447 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_convo_updateRead.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "chat.bsky.convo.updateRead", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convoId" + ], + "properties": { + "convoId": { + "type": "string" + }, + "messageId": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "convo" + ], + "properties": { + "convo": { + "type": "ref", + "ref": "chat.bsky.convo.defs#convoView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_moderation_getActorMetadata.json b/crates/weaver-api/lexicons/chat_bsky_moderation_getActorMetadata.json new file mode 100644 index 0000000..9aea15e --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_moderation_getActorMetadata.json @@ -0,0 +1,69 @@ +{ + "lexicon": 1, + "id": "chat.bsky.moderation.getActorMetadata", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "day", + "month", + "all" + ], + "properties": { + "all": { + "type": "ref", + "ref": "#metadata" + }, + "day": { + "type": "ref", + "ref": "#metadata" + }, + "month": { + "type": "ref", + "ref": "#metadata" + } + } + } + } + }, + "metadata": { + "type": "object", + "required": [ + "messagesSent", + "messagesReceived", + "convos", + "convosStarted" + ], + "properties": { + "convos": { + "type": "integer" + }, + "convosStarted": { + "type": "integer" + }, + "messagesReceived": { + "type": "integer" + }, + "messagesSent": { + "type": "integer" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_moderation_getMessageContext.json b/crates/weaver-api/lexicons/chat_bsky_moderation_getMessageContext.json new file mode 100644 index 0000000..f643c2f --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_moderation_getMessageContext.json @@ -0,0 +1,53 @@ +{ + "lexicon": 1, + "id": "chat.bsky.moderation.getMessageContext", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": [ + "messageId" + ], + "properties": { + "after": { + "type": "integer", + "default": 5 + }, + "before": { + "type": "integer", + "default": 5 + }, + "convoId": { + "type": "string", + "description": "Conversation that the message is from. NOTE: this field will eventually be required." + }, + "messageId": { + "type": "string" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "messages" + ], + "properties": { + "messages": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "chat.bsky.convo.defs#messageView", + "chat.bsky.convo.defs#deletedMessageView" + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/chat_bsky_moderation_updateActorAccess.json b/crates/weaver-api/lexicons/chat_bsky_moderation_updateActorAccess.json new file mode 100644 index 0000000..a7a31b9 --- /dev/null +++ b/crates/weaver-api/lexicons/chat_bsky_moderation_updateActorAccess.json @@ -0,0 +1,31 @@ +{ + "lexicon": 1, + "id": "chat.bsky.moderation.updateActorAccess", + "defs": { + "main": { + "type": "procedure", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actor", + "allowAccess" + ], + "properties": { + "actor": { + "type": "string", + "format": "did" + }, + "allowAccess": { + "type": "boolean" + }, + "ref": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_defs.json b/crates/weaver-api/lexicons/com_atproto_admin_defs.json new file mode 100644 index 0000000..30ea6ca --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_defs.json @@ -0,0 +1,131 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.defs", + "defs": { + "accountView": { + "type": "object", + "required": [ + "did", + "handle", + "indexedAt" + ], + "properties": { + "deactivatedAt": { + "type": "string", + "format": "datetime" + }, + "did": { + "type": "string", + "format": "did" + }, + "email": { + "type": "string" + }, + "emailConfirmedAt": { + "type": "string", + "format": "datetime" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "inviteNote": { + "type": "string" + }, + "invitedBy": { + "type": "ref", + "ref": "com.atproto.server.defs#inviteCode" + }, + "invites": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.server.defs#inviteCode" + } + }, + "invitesDisabled": { + "type": "boolean" + }, + "relatedRecords": { + "type": "array", + "items": { + "type": "unknown" + } + }, + "threatSignatures": { + "type": "array", + "items": { + "type": "ref", + "ref": "#threatSignature" + } + } + } + }, + "repoBlobRef": { + "type": "object", + "required": [ + "did", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "did": { + "type": "string", + "format": "did" + }, + "recordUri": { + "type": "string", + "format": "at-uri" + } + } + }, + "repoRef": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "statusAttr": { + "type": "object", + "required": [ + "applied" + ], + "properties": { + "applied": { + "type": "boolean" + }, + "ref": { + "type": "string" + } + } + }, + "threatSignature": { + "type": "object", + "required": [ + "property", + "value" + ], + "properties": { + "property": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_deleteAccount.json b/crates/weaver-api/lexicons/com_atproto_admin_deleteAccount.json new file mode 100644 index 0000000..554bfc8 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_deleteAccount.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.deleteAccount", + "defs": { + "main": { + "type": "procedure", + "description": "Delete a user account as an administrator.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_disableAccountInvites.json b/crates/weaver-api/lexicons/com_atproto_admin_disableAccountInvites.json new file mode 100644 index 0000000..89a9203 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_disableAccountInvites.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.disableAccountInvites", + "defs": { + "main": { + "type": "procedure", + "description": "Disable an account from receiving new invite codes, but does not invalidate existing codes.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string", + "format": "did" + }, + "note": { + "type": "string", + "description": "Optional reason for disabled invites." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_disableInviteCodes.json b/crates/weaver-api/lexicons/com_atproto_admin_disableInviteCodes.json new file mode 100644 index 0000000..b4ebc77 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_disableInviteCodes.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.disableInviteCodes", + "defs": { + "main": { + "type": "procedure", + "description": "Disable some set of codes and/or all codes associated with a set of users.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "string" + } + }, + "codes": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_enableAccountInvites.json b/crates/weaver-api/lexicons/com_atproto_admin_enableAccountInvites.json new file mode 100644 index 0000000..8c04f4c --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_enableAccountInvites.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.enableAccountInvites", + "defs": { + "main": { + "type": "procedure", + "description": "Re-enable an account's ability to receive invite codes.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string", + "format": "did" + }, + "note": { + "type": "string", + "description": "Optional reason for enabled invites." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_getAccountInfo.json b/crates/weaver-api/lexicons/com_atproto_admin_getAccountInfo.json new file mode 100644 index 0000000..9068252 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_getAccountInfo.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.getAccountInfo", + "defs": { + "main": { + "type": "query", + "description": "Get details about an account.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "com.atproto.admin.defs#accountView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_getAccountInfos.json b/crates/weaver-api/lexicons/com_atproto_admin_getAccountInfos.json new file mode 100644 index 0000000..1578bab --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_getAccountInfos.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.getAccountInfos", + "defs": { + "main": { + "type": "query", + "description": "Get details about some accounts.", + "parameters": { + "type": "params", + "required": [ + "dids" + ], + "properties": { + "dids": { + "type": "array", + "items": { + "type": "string", + "format": "did" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "infos" + ], + "properties": { + "infos": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.admin.defs#accountView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_getInviteCodes.json b/crates/weaver-api/lexicons/com_atproto_admin_getInviteCodes.json new file mode 100644 index 0000000..0a0fadb --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_getInviteCodes.json @@ -0,0 +1,53 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.getInviteCodes", + "defs": { + "main": { + "type": "query", + "description": "Get an admin view of invite codes.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 100, + "minimum": 1, + "maximum": 500 + }, + "sort": { + "type": "string", + "default": "recent", + "knownValues": [ + "recent", + "usage" + ] + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "codes" + ], + "properties": { + "codes": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.server.defs#inviteCode" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_getSubjectStatus.json b/crates/weaver-api/lexicons/com_atproto_admin_getSubjectStatus.json new file mode 100644 index 0000000..f8bc5ab --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_getSubjectStatus.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.getSubjectStatus", + "defs": { + "main": { + "type": "query", + "description": "Get the service-specific admin status of a subject (account, record, or blob).", + "parameters": { + "type": "params", + "properties": { + "blob": { + "type": "string", + "format": "cid" + }, + "did": { + "type": "string", + "format": "did" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject" + ], + "properties": { + "deactivated": { + "type": "ref", + "ref": "com.atproto.admin.defs#statusAttr" + }, + "subject": { + "type": "union", + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "com.atproto.admin.defs#repoBlobRef" + ] + }, + "takedown": { + "type": "ref", + "ref": "com.atproto.admin.defs#statusAttr" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_searchAccounts.json b/crates/weaver-api/lexicons/com_atproto_admin_searchAccounts.json new file mode 100644 index 0000000..c61f854 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_searchAccounts.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.searchAccounts", + "defs": { + "main": { + "type": "query", + "description": "Get list of accounts that matches your search query.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "email": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "accounts" + ], + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.admin.defs#accountView" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_sendEmail.json b/crates/weaver-api/lexicons/com_atproto_admin_sendEmail.json new file mode 100644 index 0000000..8271704 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_sendEmail.json @@ -0,0 +1,55 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.sendEmail", + "defs": { + "main": { + "type": "procedure", + "description": "Send email to a user's account email address.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "recipientDid", + "content", + "senderDid" + ], + "properties": { + "comment": { + "type": "string", + "description": "Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers" + }, + "content": { + "type": "string" + }, + "recipientDid": { + "type": "string", + "format": "did" + }, + "senderDid": { + "type": "string", + "format": "did" + }, + "subject": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "sent" + ], + "properties": { + "sent": { + "type": "boolean" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_updateAccountEmail.json b/crates/weaver-api/lexicons/com_atproto_admin_updateAccountEmail.json new file mode 100644 index 0000000..ec1545a --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_updateAccountEmail.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.updateAccountEmail", + "defs": { + "main": { + "type": "procedure", + "description": "Administrative action to update an account's email.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "account", + "email" + ], + "properties": { + "account": { + "type": "string", + "description": "The handle or DID of the repo.", + "format": "at-identifier" + }, + "email": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_updateAccountHandle.json b/crates/weaver-api/lexicons/com_atproto_admin_updateAccountHandle.json new file mode 100644 index 0000000..747623f --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_updateAccountHandle.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.updateAccountHandle", + "defs": { + "main": { + "type": "procedure", + "description": "Administrative action to update an account's handle.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "handle" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "handle": { + "type": "string", + "format": "handle" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_updateAccountPassword.json b/crates/weaver-api/lexicons/com_atproto_admin_updateAccountPassword.json new file mode 100644 index 0000000..c57c86d --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_updateAccountPassword.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.updateAccountPassword", + "defs": { + "main": { + "type": "procedure", + "description": "Update the password for a user account as an administrator.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "password" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "password": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_updateAccountSigningKey.json b/crates/weaver-api/lexicons/com_atproto_admin_updateAccountSigningKey.json new file mode 100644 index 0000000..35cb7a8 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_updateAccountSigningKey.json @@ -0,0 +1,31 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.updateAccountSigningKey", + "defs": { + "main": { + "type": "procedure", + "description": "Administrative action to update an account's signing key in their Did document.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "signingKey" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "signingKey": { + "type": "string", + "description": "Did-key formatted public key", + "format": "did" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_admin_updateSubjectStatus.json b/crates/weaver-api/lexicons/com_atproto_admin_updateSubjectStatus.json new file mode 100644 index 0000000..7659215 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_admin_updateSubjectStatus.json @@ -0,0 +1,60 @@ +{ + "lexicon": 1, + "id": "com.atproto.admin.updateSubjectStatus", + "defs": { + "main": { + "type": "procedure", + "description": "Update the service-specific admin status of a subject (account, record, or blob).", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject" + ], + "properties": { + "deactivated": { + "type": "ref", + "ref": "com.atproto.admin.defs#statusAttr" + }, + "subject": { + "type": "union", + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "com.atproto.admin.defs#repoBlobRef" + ] + }, + "takedown": { + "type": "ref", + "ref": "com.atproto.admin.defs#statusAttr" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject" + ], + "properties": { + "subject": { + "type": "union", + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "com.atproto.admin.defs#repoBlobRef" + ] + }, + "takedown": { + "type": "ref", + "ref": "com.atproto.admin.defs#statusAttr" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_defs.json b/crates/weaver-api/lexicons/com_atproto_identity_defs.json new file mode 100644 index 0000000..c4746b5 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_defs.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.defs", + "defs": { + "identityInfo": { + "type": "object", + "required": [ + "did", + "handle", + "didDoc" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "didDoc": { + "type": "unknown", + "description": "The complete DID document for the identity." + }, + "handle": { + "type": "string", + "description": "The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document.", + "format": "handle" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_getRecommendedDidCredentials.json b/crates/weaver-api/lexicons/com_atproto_identity_getRecommendedDidCredentials.json new file mode 100644 index 0000000..798f0ab --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_getRecommendedDidCredentials.json @@ -0,0 +1,37 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.getRecommendedDidCredentials", + "defs": { + "main": { + "type": "query", + "description": "Describe the credentials that should be included in the DID doc of an account that is migrating to this service.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "alsoKnownAs": { + "type": "array", + "items": { + "type": "string" + } + }, + "rotationKeys": { + "type": "array", + "description": "Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs.", + "items": { + "type": "string" + } + }, + "services": { + "type": "unknown" + }, + "verificationMethods": { + "type": "unknown" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_refreshIdentity.json b/crates/weaver-api/lexicons/com_atproto_identity_refreshIdentity.json new file mode 100644 index 0000000..da49d7e --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_refreshIdentity.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.refreshIdentity", + "defs": { + "main": { + "type": "procedure", + "description": "Request that the server re-resolve an identity (DID and handle). The server may ignore this request, or require authentication, depending on the role, implementation, and policy of the server.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "identifier" + ], + "properties": { + "identifier": { + "type": "string", + "format": "at-identifier" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "com.atproto.identity.defs#identityInfo" + } + }, + "errors": [ + { + "description": "The resolution process confirmed that the handle does not resolve to any DID.", + "name": "HandleNotFound" + }, + { + "description": "The DID resolution process confirmed that there is no current DID.", + "name": "DidNotFound" + }, + { + "description": "The DID previously existed, but has been deactivated.", + "name": "DidDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_requestPlcOperationSignature.json b/crates/weaver-api/lexicons/com_atproto_identity_requestPlcOperationSignature.json new file mode 100644 index 0000000..d56f370 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_requestPlcOperationSignature.json @@ -0,0 +1,10 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.requestPlcOperationSignature", + "defs": { + "main": { + "type": "procedure", + "description": "Request an email with a code to in order to request a signed PLC operation. Requires Auth." + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_resolveDid.json b/crates/weaver-api/lexicons/com_atproto_identity_resolveDid.json new file mode 100644 index 0000000..3e11352 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_resolveDid.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.resolveDid", + "defs": { + "main": { + "type": "query", + "description": "Resolves DID to DID document. Does not bi-directionally verify handle.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "description": "DID to resolve.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "didDoc" + ], + "properties": { + "didDoc": { + "type": "unknown", + "description": "The complete DID document for the identity." + } + } + } + }, + "errors": [ + { + "description": "The DID resolution process confirmed that there is no current DID.", + "name": "DidNotFound" + }, + { + "description": "The DID previously existed, but has been deactivated.", + "name": "DidDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_resolveHandle.json b/crates/weaver-api/lexicons/com_atproto_identity_resolveHandle.json new file mode 100644 index 0000000..95e33c8 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_resolveHandle.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.resolveHandle", + "defs": { + "main": { + "type": "query", + "description": "Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document.", + "parameters": { + "type": "params", + "required": [ + "handle" + ], + "properties": { + "handle": { + "type": "string", + "description": "The handle to resolve.", + "format": "handle" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + } + }, + "errors": [ + { + "description": "The resolution process confirmed that the handle does not resolve to any DID.", + "name": "HandleNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_resolveIdentity.json b/crates/weaver-api/lexicons/com_atproto_identity_resolveIdentity.json new file mode 100644 index 0000000..feda5d6 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_resolveIdentity.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.resolveIdentity", + "defs": { + "main": { + "type": "query", + "description": "Resolves an identity (DID or Handle) to a full identity (DID document and verified handle).", + "parameters": { + "type": "params", + "required": [ + "identifier" + ], + "properties": { + "identifier": { + "type": "string", + "description": "Handle or DID to resolve.", + "format": "at-identifier" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "com.atproto.identity.defs#identityInfo" + } + }, + "errors": [ + { + "description": "The resolution process confirmed that the handle does not resolve to any DID.", + "name": "HandleNotFound" + }, + { + "description": "The DID resolution process confirmed that there is no current DID.", + "name": "DidNotFound" + }, + { + "description": "The DID previously existed, but has been deactivated.", + "name": "DidDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_signPlcOperation.json b/crates/weaver-api/lexicons/com_atproto_identity_signPlcOperation.json new file mode 100644 index 0000000..72cc2f8 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_signPlcOperation.json @@ -0,0 +1,55 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.signPlcOperation", + "defs": { + "main": { + "type": "procedure", + "description": "Signs a PLC operation to update some value(s) in the requesting DID's document.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "alsoKnownAs": { + "type": "array", + "items": { + "type": "string" + } + }, + "rotationKeys": { + "type": "array", + "items": { + "type": "string" + } + }, + "services": { + "type": "unknown" + }, + "token": { + "type": "string", + "description": "A token received through com.atproto.identity.requestPlcOperationSignature" + }, + "verificationMethods": { + "type": "unknown" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "operation" + ], + "properties": { + "operation": { + "type": "unknown", + "description": "A signed DID PLC operation." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_submitPlcOperation.json b/crates/weaver-api/lexicons/com_atproto_identity_submitPlcOperation.json new file mode 100644 index 0000000..8ae131c --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_submitPlcOperation.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.submitPlcOperation", + "defs": { + "main": { + "type": "procedure", + "description": "Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "operation" + ], + "properties": { + "operation": { + "type": "unknown" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_identity_updateHandle.json b/crates/weaver-api/lexicons/com_atproto_identity_updateHandle.json new file mode 100644 index 0000000..6d73173 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_identity_updateHandle.json @@ -0,0 +1,26 @@ +{ + "lexicon": 1, + "id": "com.atproto.identity.updateHandle", + "defs": { + "main": { + "type": "procedure", + "description": "Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "handle" + ], + "properties": { + "handle": { + "type": "string", + "description": "The new handle.", + "format": "handle" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_label_defs.json b/crates/weaver-api/lexicons/com_atproto_label_defs.json new file mode 100644 index 0000000..0f14255 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_label_defs.json @@ -0,0 +1,192 @@ +{ + "lexicon": 1, + "id": "com.atproto.label.defs", + "defs": { + "label": { + "type": "object", + "description": "Metadata tag on an atproto resource (eg, repo or record).", + "required": [ + "src", + "uri", + "val", + "cts" + ], + "properties": { + "cid": { + "type": "string", + "description": "Optionally, CID specifying the specific version of 'uri' resource this label applies to.", + "format": "cid" + }, + "cts": { + "type": "string", + "description": "Timestamp when this label was created.", + "format": "datetime" + }, + "exp": { + "type": "string", + "description": "Timestamp at which this label expires (no longer applies).", + "format": "datetime" + }, + "neg": { + "type": "boolean", + "description": "If true, this is a negation label, overwriting a previous label." + }, + "sig": { + "type": "bytes", + "description": "Signature of dag-cbor encoded label." + }, + "src": { + "type": "string", + "description": "DID of the actor who created this label.", + "format": "did" + }, + "uri": { + "type": "string", + "description": "AT URI of the record, repository (account), or other resource that this label applies to.", + "format": "uri" + }, + "val": { + "type": "string", + "description": "The short string name of the value or type of this label.", + "maxLength": 128 + }, + "ver": { + "type": "integer", + "description": "The AT Protocol version of the label object." + } + } + }, + "labelValue": { + "type": "string", + "knownValues": [ + "!hide", + "!no-promote", + "!warn", + "!no-unauthenticated", + "dmca-violation", + "doxxing", + "porn", + "sexual", + "nudity", + "nsfl", + "gore" + ] + }, + "labelValueDefinition": { + "type": "object", + "description": "Declares a label value and its expected interpretations and behaviors.", + "required": [ + "identifier", + "severity", + "blurs", + "locales" + ], + "properties": { + "adultOnly": { + "type": "boolean", + "description": "Does the user need to have adult content enabled in order to configure this label?" + }, + "blurs": { + "type": "string", + "description": "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.", + "knownValues": [ + "content", + "media", + "none" + ] + }, + "defaultSetting": { + "type": "string", + "description": "The default setting for this label.", + "default": "warn", + "knownValues": [ + "ignore", + "warn", + "hide" + ] + }, + "identifier": { + "type": "string", + "description": "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).", + "maxLength": 100, + "maxGraphemes": 100 + }, + "locales": { + "type": "array", + "items": { + "type": "ref", + "ref": "#labelValueDefinitionStrings" + } + }, + "severity": { + "type": "string", + "description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.", + "knownValues": [ + "inform", + "alert", + "none" + ] + } + } + }, + "labelValueDefinitionStrings": { + "type": "object", + "description": "Strings which describe the label in the UI, localized into a specific language.", + "required": [ + "lang", + "name", + "description" + ], + "properties": { + "description": { + "type": "string", + "description": "A longer description of what the label means and why it might be applied.", + "maxLength": 100000, + "maxGraphemes": 10000 + }, + "lang": { + "type": "string", + "description": "The code of the language these strings are written in.", + "format": "language" + }, + "name": { + "type": "string", + "description": "A short human-readable name for the label.", + "maxLength": 640, + "maxGraphemes": 64 + } + } + }, + "selfLabel": { + "type": "object", + "description": "Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.", + "required": [ + "val" + ], + "properties": { + "val": { + "type": "string", + "description": "The short string name of the value or type of this label.", + "maxLength": 128 + } + } + }, + "selfLabels": { + "type": "object", + "description": "Metadata tags on an atproto record, published by the author within the record.", + "required": [ + "values" + ], + "properties": { + "values": { + "type": "array", + "items": { + "type": "ref", + "ref": "#selfLabel" + }, + "maxLength": 10 + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_label_queryLabels.json b/crates/weaver-api/lexicons/com_atproto_label_queryLabels.json new file mode 100644 index 0000000..a4ff2cc --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_label_queryLabels.json @@ -0,0 +1,63 @@ +{ + "lexicon": 1, + "id": "com.atproto.label.queryLabels", + "defs": { + "main": { + "type": "query", + "description": "Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth.", + "parameters": { + "type": "params", + "required": [ + "uriPatterns" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 250 + }, + "sources": { + "type": "array", + "description": "Optional list of label sources (DIDs) to filter on.", + "items": { + "type": "string", + "format": "did" + } + }, + "uriPatterns": { + "type": "array", + "description": "List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI.", + "items": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "labels" + ], + "properties": { + "cursor": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_label_subscribeLabels.json b/crates/weaver-api/lexicons/com_atproto_label_subscribeLabels.json new file mode 100644 index 0000000..c50b356 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_label_subscribeLabels.json @@ -0,0 +1,69 @@ +{ + "lexicon": 1, + "id": "com.atproto.label.subscribeLabels", + "defs": { + "info": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "message": { + "type": "string" + }, + "name": { + "type": "string", + "knownValues": [ + "OutdatedCursor" + ] + } + } + }, + "labels": { + "type": "object", + "required": [ + "seq", + "labels" + ], + "properties": { + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "seq": { + "type": "integer" + } + } + }, + "main": { + "type": "subscription", + "description": "Subscribe to stream of labels (and negations). Public endpoint implemented by mod services. Uses same sequencing scheme as repo event stream.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "integer", + "description": "The last known event seq number to backfill from." + } + } + }, + "message": { + "schema": { + "type": "union", + "refs": [ + "#labels", + "#info" + ] + } + }, + "errors": [ + { + "name": "FutureCursor" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_lexicon_schema.json b/crates/weaver-api/lexicons/com_atproto_lexicon_schema.json new file mode 100644 index 0000000..f2bb868 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_lexicon_schema.json @@ -0,0 +1,23 @@ +{ + "lexicon": 1, + "id": "com.atproto.lexicon.schema", + "defs": { + "main": { + "type": "record", + "description": "Representation of Lexicon schemas themselves, when published as atproto records. Note that the schema language is not defined in Lexicon; this meta schema currently only includes a single version field ('lexicon'). See the atproto specifications for description of the other expected top-level fields ('id', 'defs', etc).", + "key": "nsid", + "record": { + "type": "object", + "required": [ + "lexicon" + ], + "properties": { + "lexicon": { + "type": "integer", + "description": "Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system." + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_moderation_createReport.json b/crates/weaver-api/lexicons/com_atproto_moderation_createReport.json new file mode 100644 index 0000000..92d34c9 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_moderation_createReport.json @@ -0,0 +1,103 @@ +{ + "lexicon": 1, + "id": "com.atproto.moderation.createReport", + "defs": { + "main": { + "type": "procedure", + "description": "Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "reasonType", + "subject" + ], + "properties": { + "modTool": { + "type": "ref", + "ref": "#modTool" + }, + "reason": { + "type": "string", + "description": "Additional context about the content and violation.", + "maxLength": 20000, + "maxGraphemes": 2000 + }, + "reasonType": { + "type": "ref", + "description": "Indicates the broad category of violation the report is for.", + "ref": "com.atproto.moderation.defs#reasonType" + }, + "subject": { + "type": "union", + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef" + ] + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "id", + "reasonType", + "subject", + "reportedBy", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "id": { + "type": "integer" + }, + "reason": { + "type": "string", + "maxLength": 20000, + "maxGraphemes": 2000 + }, + "reasonType": { + "type": "ref", + "ref": "com.atproto.moderation.defs#reasonType" + }, + "reportedBy": { + "type": "string", + "format": "did" + }, + "subject": { + "type": "union", + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef" + ] + } + } + } + } + }, + "modTool": { + "type": "object", + "description": "Moderation tool information for tracing the source of the action", + "required": [ + "name" + ], + "properties": { + "meta": { + "type": "unknown", + "description": "Additional arbitrary metadata about the source" + }, + "name": { + "type": "string", + "description": "Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome')" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_moderation_defs.json b/crates/weaver-api/lexicons/com_atproto_moderation_defs.json new file mode 100644 index 0000000..3f3135e --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_moderation_defs.json @@ -0,0 +1,95 @@ +{ + "lexicon": 1, + "id": "com.atproto.moderation.defs", + "defs": { + "reasonAppeal": { + "type": "token", + "description": "Appeal a previously taken moderation action" + }, + "reasonMisleading": { + "type": "token", + "description": "Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`." + }, + "reasonOther": { + "type": "token", + "description": "Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`." + }, + "reasonRude": { + "type": "token", + "description": "Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`." + }, + "reasonSexual": { + "type": "token", + "description": "Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`." + }, + "reasonSpam": { + "type": "token", + "description": "Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`." + }, + "reasonType": { + "type": "string", + "knownValues": [ + "com.atproto.moderation.defs#reasonSpam", + "com.atproto.moderation.defs#reasonViolation", + "com.atproto.moderation.defs#reasonMisleading", + "com.atproto.moderation.defs#reasonSexual", + "com.atproto.moderation.defs#reasonRude", + "com.atproto.moderation.defs#reasonOther", + "com.atproto.moderation.defs#reasonAppeal", + "tools.ozone.report.defs#reasonAppeal", + "tools.ozone.report.defs#reasonOther", + "tools.ozone.report.defs#reasonViolenceAnimal", + "tools.ozone.report.defs#reasonViolenceThreats", + "tools.ozone.report.defs#reasonViolenceGraphicContent", + "tools.ozone.report.defs#reasonViolenceGlorification", + "tools.ozone.report.defs#reasonViolenceExtremistContent", + "tools.ozone.report.defs#reasonViolenceTrafficking", + "tools.ozone.report.defs#reasonViolenceOther", + "tools.ozone.report.defs#reasonSexualAbuseContent", + "tools.ozone.report.defs#reasonSexualNCII", + "tools.ozone.report.defs#reasonSexualDeepfake", + "tools.ozone.report.defs#reasonSexualAnimal", + "tools.ozone.report.defs#reasonSexualUnlabeled", + "tools.ozone.report.defs#reasonSexualOther", + "tools.ozone.report.defs#reasonChildSafetyCSAM", + "tools.ozone.report.defs#reasonChildSafetyGroom", + "tools.ozone.report.defs#reasonChildSafetyPrivacy", + "tools.ozone.report.defs#reasonChildSafetyHarassment", + "tools.ozone.report.defs#reasonChildSafetyOther", + "tools.ozone.report.defs#reasonHarassmentTroll", + "tools.ozone.report.defs#reasonHarassmentTargeted", + "tools.ozone.report.defs#reasonHarassmentHateSpeech", + "tools.ozone.report.defs#reasonHarassmentDoxxing", + "tools.ozone.report.defs#reasonHarassmentOther", + "tools.ozone.report.defs#reasonMisleadingBot", + "tools.ozone.report.defs#reasonMisleadingImpersonation", + "tools.ozone.report.defs#reasonMisleadingSpam", + "tools.ozone.report.defs#reasonMisleadingScam", + "tools.ozone.report.defs#reasonMisleadingElections", + "tools.ozone.report.defs#reasonMisleadingOther", + "tools.ozone.report.defs#reasonRuleSiteSecurity", + "tools.ozone.report.defs#reasonRuleProhibitedSales", + "tools.ozone.report.defs#reasonRuleBanEvasion", + "tools.ozone.report.defs#reasonRuleOther", + "tools.ozone.report.defs#reasonSelfHarmContent", + "tools.ozone.report.defs#reasonSelfHarmED", + "tools.ozone.report.defs#reasonSelfHarmStunts", + "tools.ozone.report.defs#reasonSelfHarmSubstances", + "tools.ozone.report.defs#reasonSelfHarmOther" + ] + }, + "reasonViolation": { + "type": "token", + "description": "Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`." + }, + "subjectType": { + "type": "string", + "description": "Tag describing a type of subject that might be reported.", + "knownValues": [ + "account", + "record", + "chat" + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_applyWrites.json b/crates/weaver-api/lexicons/com_atproto_repo_applyWrites.json new file mode 100644 index 0000000..65d8659 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_applyWrites.json @@ -0,0 +1,195 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.applyWrites", + "defs": { + "create": { + "type": "object", + "description": "Operation which creates a new record.", + "required": [ + "collection", + "value" + ], + "properties": { + "collection": { + "type": "string", + "format": "nsid" + }, + "rkey": { + "type": "string", + "description": "NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility.", + "format": "record-key", + "maxLength": 512 + }, + "value": { + "type": "unknown" + } + } + }, + "createResult": { + "type": "object", + "required": [ + "uri", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "validationStatus": { + "type": "string", + "knownValues": [ + "valid", + "unknown" + ] + } + } + }, + "delete": { + "type": "object", + "description": "Operation which deletes an existing record.", + "required": [ + "collection", + "rkey" + ], + "properties": { + "collection": { + "type": "string", + "format": "nsid" + }, + "rkey": { + "type": "string", + "format": "record-key" + } + } + }, + "deleteResult": { + "type": "object", + "required": [], + "properties": {} + }, + "main": { + "type": "procedure", + "description": "Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repo", + "writes" + ], + "properties": { + "repo": { + "type": "string", + "description": "The handle or DID of the repo (aka, current account).", + "format": "at-identifier" + }, + "swapCommit": { + "type": "string", + "description": "If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.", + "format": "cid" + }, + "validate": { + "type": "boolean", + "description": "Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons." + }, + "writes": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "#create", + "#update", + "#delete" + ], + "closed": true + } + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [], + "properties": { + "commit": { + "type": "ref", + "ref": "com.atproto.repo.defs#commitMeta" + }, + "results": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "#createResult", + "#updateResult", + "#deleteResult" + ], + "closed": true + } + } + } + } + }, + "errors": [ + { + "description": "Indicates that the 'swapCommit' parameter did not match current commit.", + "name": "InvalidSwap" + } + ] + }, + "update": { + "type": "object", + "description": "Operation which updates an existing record.", + "required": [ + "collection", + "rkey", + "value" + ], + "properties": { + "collection": { + "type": "string", + "format": "nsid" + }, + "rkey": { + "type": "string", + "format": "record-key" + }, + "value": { + "type": "unknown" + } + } + }, + "updateResult": { + "type": "object", + "required": [ + "uri", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "validationStatus": { + "type": "string", + "knownValues": [ + "valid", + "unknown" + ] + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_createRecord.json b/crates/weaver-api/lexicons/com_atproto_repo_createRecord.json new file mode 100644 index 0000000..1786452 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_createRecord.json @@ -0,0 +1,89 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.createRecord", + "defs": { + "main": { + "type": "procedure", + "description": "Create a single new repository record. Requires auth, implemented by PDS.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repo", + "collection", + "record" + ], + "properties": { + "collection": { + "type": "string", + "description": "The NSID of the record collection.", + "format": "nsid" + }, + "record": { + "type": "unknown", + "description": "The record itself. Must contain a $type field." + }, + "repo": { + "type": "string", + "description": "The handle or DID of the repo (aka, current account).", + "format": "at-identifier" + }, + "rkey": { + "type": "string", + "description": "The Record Key.", + "format": "record-key", + "maxLength": 512 + }, + "swapCommit": { + "type": "string", + "description": "Compare and swap with the previous commit by CID.", + "format": "cid" + }, + "validate": { + "type": "boolean", + "description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons." + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "commit": { + "type": "ref", + "ref": "com.atproto.repo.defs#commitMeta" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "validationStatus": { + "type": "string", + "knownValues": [ + "valid", + "unknown" + ] + } + } + } + }, + "errors": [ + { + "description": "Indicates that 'swapCommit' didn't match current repo commit.", + "name": "InvalidSwap" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_defs.json b/crates/weaver-api/lexicons/com_atproto_repo_defs.json new file mode 100644 index 0000000..407e84a --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_defs.json @@ -0,0 +1,23 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.defs", + "defs": { + "commitMeta": { + "type": "object", + "required": [ + "cid", + "rev" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "rev": { + "type": "string", + "format": "tid" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_deleteRecord.json b/crates/weaver-api/lexicons/com_atproto_repo_deleteRecord.json new file mode 100644 index 0000000..daeb777 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_deleteRecord.json @@ -0,0 +1,65 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.deleteRecord", + "defs": { + "main": { + "type": "procedure", + "description": "Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repo", + "collection", + "rkey" + ], + "properties": { + "collection": { + "type": "string", + "description": "The NSID of the record collection.", + "format": "nsid" + }, + "repo": { + "type": "string", + "description": "The handle or DID of the repo (aka, current account).", + "format": "at-identifier" + }, + "rkey": { + "type": "string", + "description": "The Record Key.", + "format": "record-key" + }, + "swapCommit": { + "type": "string", + "description": "Compare and swap with the previous commit by CID.", + "format": "cid" + }, + "swapRecord": { + "type": "string", + "description": "Compare and swap with the previous record by CID.", + "format": "cid" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "commit": { + "type": "ref", + "ref": "com.atproto.repo.defs#commitMeta" + } + } + } + }, + "errors": [ + { + "name": "InvalidSwap" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_describeRepo.json b/crates/weaver-api/lexicons/com_atproto_repo_describeRepo.json new file mode 100644 index 0000000..58a51cf --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_describeRepo.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.describeRepo", + "defs": { + "main": { + "type": "query", + "description": "Get information about an account and repository, including the list of collections. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "repo" + ], + "properties": { + "repo": { + "type": "string", + "description": "The handle or DID of the repo.", + "format": "at-identifier" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "handle", + "did", + "didDoc", + "collections", + "handleIsCorrect" + ], + "properties": { + "collections": { + "type": "array", + "description": "List of all the collections (NSIDs) for which this repo contains at least one record.", + "items": { + "type": "string", + "format": "nsid" + } + }, + "did": { + "type": "string", + "format": "did" + }, + "didDoc": { + "type": "unknown", + "description": "The complete DID document for this account." + }, + "handle": { + "type": "string", + "format": "handle" + }, + "handleIsCorrect": { + "type": "boolean", + "description": "Indicates if handle is currently valid (resolves bi-directionally)" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_getRecord.json b/crates/weaver-api/lexicons/com_atproto_repo_getRecord.json new file mode 100644 index 0000000..658dbe3 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_getRecord.json @@ -0,0 +1,68 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.getRecord", + "defs": { + "main": { + "type": "query", + "description": "Get a single record from a repository. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "repo", + "collection", + "rkey" + ], + "properties": { + "cid": { + "type": "string", + "description": "The CID of the version of the record. If not specified, then return the most recent version.", + "format": "cid" + }, + "collection": { + "type": "string", + "description": "The NSID of the record collection.", + "format": "nsid" + }, + "repo": { + "type": "string", + "description": "The handle or DID of the repo.", + "format": "at-identifier" + }, + "rkey": { + "type": "string", + "description": "The Record Key.", + "format": "record-key" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "value" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "value": { + "type": "unknown" + } + } + } + }, + "errors": [ + { + "name": "RecordNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_importRepo.json b/crates/weaver-api/lexicons/com_atproto_repo_importRepo.json new file mode 100644 index 0000000..3e7919a --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_importRepo.json @@ -0,0 +1,13 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.importRepo", + "defs": { + "main": { + "type": "procedure", + "description": "Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.", + "input": { + "encoding": "application/vnd.ipld.car" + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_listMissingBlobs.json b/crates/weaver-api/lexicons/com_atproto_repo_listMissingBlobs.json new file mode 100644 index 0000000..4f3eebb --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_listMissingBlobs.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.listMissingBlobs", + "defs": { + "main": { + "type": "query", + "description": "Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 500, + "minimum": 1, + "maximum": 1000 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "blobs" + ], + "properties": { + "blobs": { + "type": "array", + "items": { + "type": "ref", + "ref": "#recordBlob" + } + }, + "cursor": { + "type": "string" + } + } + } + } + }, + "recordBlob": { + "type": "object", + "required": [ + "cid", + "recordUri" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "recordUri": { + "type": "string", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_listRecords.json b/crates/weaver-api/lexicons/com_atproto_repo_listRecords.json new file mode 100644 index 0000000..c1eecdd --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_listRecords.json @@ -0,0 +1,85 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.listRecords", + "defs": { + "main": { + "type": "query", + "description": "List a range of records in a repository, matching a specific collection. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "repo", + "collection" + ], + "properties": { + "collection": { + "type": "string", + "description": "The NSID of the record type.", + "format": "nsid" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "description": "The number of records to return.", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "repo": { + "type": "string", + "description": "The handle or DID of the repo.", + "format": "at-identifier" + }, + "reverse": { + "type": "boolean", + "description": "Flag to reverse the order of the returned records." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "records" + ], + "properties": { + "cursor": { + "type": "string" + }, + "records": { + "type": "array", + "items": { + "type": "ref", + "ref": "#record" + } + } + } + } + } + }, + "record": { + "type": "object", + "required": [ + "uri", + "cid", + "value" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "value": { + "type": "unknown" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_putRecord.json b/crates/weaver-api/lexicons/com_atproto_repo_putRecord.json new file mode 100644 index 0000000..9b3ccdf --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_putRecord.json @@ -0,0 +1,97 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.putRecord", + "defs": { + "main": { + "type": "procedure", + "description": "Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repo", + "collection", + "rkey", + "record" + ], + "nullable": [ + "swapRecord" + ], + "properties": { + "collection": { + "type": "string", + "description": "The NSID of the record collection.", + "format": "nsid" + }, + "record": { + "type": "unknown", + "description": "The record to write." + }, + "repo": { + "type": "string", + "description": "The handle or DID of the repo (aka, current account).", + "format": "at-identifier" + }, + "rkey": { + "type": "string", + "description": "The Record Key.", + "format": "record-key", + "maxLength": 512 + }, + "swapCommit": { + "type": "string", + "description": "Compare and swap with the previous commit by CID.", + "format": "cid" + }, + "swapRecord": { + "type": "string", + "description": "Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation", + "format": "cid" + }, + "validate": { + "type": "boolean", + "description": "Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons." + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "commit": { + "type": "ref", + "ref": "com.atproto.repo.defs#commitMeta" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "validationStatus": { + "type": "string", + "knownValues": [ + "valid", + "unknown" + ] + } + } + } + }, + "errors": [ + { + "name": "InvalidSwap" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_strongRef.json b/crates/weaver-api/lexicons/com_atproto_repo_strongRef.json new file mode 100644 index 0000000..ba1c649 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_strongRef.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.strongRef", + "description": "A URI with a content-hash fingerprint.", + "defs": { + "main": { + "type": "object", + "required": [ + "uri", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_repo_uploadBlob.json b/crates/weaver-api/lexicons/com_atproto_repo_uploadBlob.json new file mode 100644 index 0000000..a84b071 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_repo_uploadBlob.json @@ -0,0 +1,27 @@ +{ + "lexicon": 1, + "id": "com.atproto.repo.uploadBlob", + "defs": { + "main": { + "type": "procedure", + "description": "Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.", + "input": { + "encoding": "*/*" + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "blob" + ], + "properties": { + "blob": { + "type": "blob" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_activateAccount.json b/crates/weaver-api/lexicons/com_atproto_server_activateAccount.json new file mode 100644 index 0000000..ae3289f --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_activateAccount.json @@ -0,0 +1,10 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.activateAccount", + "defs": { + "main": { + "type": "procedure", + "description": "Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup." + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_checkAccountStatus.json b/crates/weaver-api/lexicons/com_atproto_server_checkAccountStatus.json new file mode 100644 index 0000000..a968002 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_checkAccountStatus.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.checkAccountStatus", + "defs": { + "main": { + "type": "query", + "description": "Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "activated", + "validDid", + "repoCommit", + "repoRev", + "repoBlocks", + "indexedRecords", + "privateStateValues", + "expectedBlobs", + "importedBlobs" + ], + "properties": { + "activated": { + "type": "boolean" + }, + "expectedBlobs": { + "type": "integer" + }, + "importedBlobs": { + "type": "integer" + }, + "indexedRecords": { + "type": "integer" + }, + "privateStateValues": { + "type": "integer" + }, + "repoBlocks": { + "type": "integer" + }, + "repoCommit": { + "type": "string", + "format": "cid" + }, + "repoRev": { + "type": "string" + }, + "validDid": { + "type": "boolean" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_confirmEmail.json b/crates/weaver-api/lexicons/com_atproto_server_confirmEmail.json new file mode 100644 index 0000000..42645be --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_confirmEmail.json @@ -0,0 +1,42 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.confirmEmail", + "defs": { + "main": { + "type": "procedure", + "description": "Confirm an email using a token from com.atproto.server.requestEmailConfirmation.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "email", + "token" + ], + "properties": { + "email": { + "type": "string" + }, + "token": { + "type": "string" + } + } + } + }, + "errors": [ + { + "name": "AccountNotFound" + }, + { + "name": "ExpiredToken" + }, + { + "name": "InvalidToken" + }, + { + "name": "InvalidEmail" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_createAccount.json b/crates/weaver-api/lexicons/com_atproto_server_createAccount.json new file mode 100644 index 0000000..c36df22 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_createAccount.json @@ -0,0 +1,112 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.createAccount", + "defs": { + "main": { + "type": "procedure", + "description": "Create an account. Implemented by PDS.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "handle" + ], + "properties": { + "did": { + "type": "string", + "description": "Pre-existing atproto DID, being imported to a new account.", + "format": "did" + }, + "email": { + "type": "string" + }, + "handle": { + "type": "string", + "description": "Requested handle for the account.", + "format": "handle" + }, + "inviteCode": { + "type": "string" + }, + "password": { + "type": "string", + "description": "Initial account password. May need to meet instance-specific password strength requirements." + }, + "plcOp": { + "type": "unknown", + "description": "A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented." + }, + "recoveryKey": { + "type": "string", + "description": "DID PLC rotation key (aka, recovery key) to be included in PLC creation operation." + }, + "verificationCode": { + "type": "string" + }, + "verificationPhone": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "description": "Account login session returned on successful account creation.", + "required": [ + "accessJwt", + "refreshJwt", + "handle", + "did" + ], + "properties": { + "accessJwt": { + "type": "string" + }, + "did": { + "type": "string", + "description": "The DID of the new account.", + "format": "did" + }, + "didDoc": { + "type": "unknown", + "description": "Complete DID document." + }, + "handle": { + "type": "string", + "format": "handle" + }, + "refreshJwt": { + "type": "string" + } + } + } + }, + "errors": [ + { + "name": "InvalidHandle" + }, + { + "name": "InvalidPassword" + }, + { + "name": "InvalidInviteCode" + }, + { + "name": "HandleNotAvailable" + }, + { + "name": "UnsupportedDomain" + }, + { + "name": "UnresolvableDid" + }, + { + "name": "IncompatibleDidDoc" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_createAppPassword.json b/crates/weaver-api/lexicons/com_atproto_server_createAppPassword.json new file mode 100644 index 0000000..f0d5f83 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_createAppPassword.json @@ -0,0 +1,64 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.createAppPassword", + "defs": { + "appPassword": { + "type": "object", + "required": [ + "name", + "password", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "privileged": { + "type": "boolean" + } + } + }, + "main": { + "type": "procedure", + "description": "Create an App Password.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "A short name for the App Password, to help distinguish them." + }, + "privileged": { + "type": "boolean", + "description": "If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients." + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "#appPassword" + } + }, + "errors": [ + { + "name": "AccountTakedown" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_createInviteCode.json b/crates/weaver-api/lexicons/com_atproto_server_createInviteCode.json new file mode 100644 index 0000000..5e54d1f --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_createInviteCode.json @@ -0,0 +1,42 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.createInviteCode", + "defs": { + "main": { + "type": "procedure", + "description": "Create an invite code.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "useCount" + ], + "properties": { + "forAccount": { + "type": "string", + "format": "did" + }, + "useCount": { + "type": "integer" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_createInviteCodes.json b/crates/weaver-api/lexicons/com_atproto_server_createInviteCodes.json new file mode 100644 index 0000000..905240a --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_createInviteCodes.json @@ -0,0 +1,72 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.createInviteCodes", + "defs": { + "accountCodes": { + "type": "object", + "required": [ + "account", + "codes" + ], + "properties": { + "account": { + "type": "string" + }, + "codes": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "main": { + "type": "procedure", + "description": "Create invite codes.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "codeCount", + "useCount" + ], + "properties": { + "codeCount": { + "type": "integer", + "default": 1 + }, + "forAccounts": { + "type": "array", + "items": { + "type": "string", + "format": "did" + } + }, + "useCount": { + "type": "integer" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "codes" + ], + "properties": { + "codes": { + "type": "array", + "items": { + "type": "ref", + "ref": "#accountCodes" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_createSession.json b/crates/weaver-api/lexicons/com_atproto_server_createSession.json new file mode 100644 index 0000000..2b01d43 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_createSession.json @@ -0,0 +1,96 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.createSession", + "defs": { + "main": { + "type": "procedure", + "description": "Create an authentication session.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "identifier", + "password" + ], + "properties": { + "allowTakendown": { + "type": "boolean", + "description": "When true, instead of throwing error for takendown accounts, a valid response with a narrow scoped token will be returned" + }, + "authFactorToken": { + "type": "string" + }, + "identifier": { + "type": "string", + "description": "Handle or other identifier supported by the server for the authenticating user." + }, + "password": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "accessJwt", + "refreshJwt", + "handle", + "did" + ], + "properties": { + "accessJwt": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "did": { + "type": "string", + "format": "did" + }, + "didDoc": { + "type": "unknown" + }, + "email": { + "type": "string" + }, + "emailAuthFactor": { + "type": "boolean" + }, + "emailConfirmed": { + "type": "boolean" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "refreshJwt": { + "type": "string" + }, + "status": { + "type": "string", + "description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", + "knownValues": [ + "takendown", + "suspended", + "deactivated" + ] + } + } + } + }, + "errors": [ + { + "name": "AccountTakedown" + }, + { + "name": "AuthFactorTokenRequired" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_deactivateAccount.json b/crates/weaver-api/lexicons/com_atproto_server_deactivateAccount.json new file mode 100644 index 0000000..6cdbd7f --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_deactivateAccount.json @@ -0,0 +1,23 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.deactivateAccount", + "defs": { + "main": { + "type": "procedure", + "description": "Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "deleteAfter": { + "type": "string", + "description": "A recommendation to server as to how long they should hold onto the deactivated account before deleting.", + "format": "datetime" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_defs.json b/crates/weaver-api/lexicons/com_atproto_server_defs.json new file mode 100644 index 0000000..411a52f --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_defs.json @@ -0,0 +1,63 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.defs", + "defs": { + "inviteCode": { + "type": "object", + "required": [ + "code", + "available", + "disabled", + "forAccount", + "createdBy", + "createdAt", + "uses" + ], + "properties": { + "available": { + "type": "integer" + }, + "code": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string" + }, + "disabled": { + "type": "boolean" + }, + "forAccount": { + "type": "string" + }, + "uses": { + "type": "array", + "items": { + "type": "ref", + "ref": "#inviteCodeUse" + } + } + } + }, + "inviteCodeUse": { + "type": "object", + "required": [ + "usedBy", + "usedAt" + ], + "properties": { + "usedAt": { + "type": "string", + "format": "datetime" + }, + "usedBy": { + "type": "string", + "format": "did" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_deleteAccount.json b/crates/weaver-api/lexicons/com_atproto_server_deleteAccount.json new file mode 100644 index 0000000..fc63708 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_deleteAccount.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.deleteAccount", + "defs": { + "main": { + "type": "procedure", + "description": "Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "password", + "token" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "password": { + "type": "string" + }, + "token": { + "type": "string" + } + } + } + }, + "errors": [ + { + "name": "ExpiredToken" + }, + { + "name": "InvalidToken" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_deleteSession.json b/crates/weaver-api/lexicons/com_atproto_server_deleteSession.json new file mode 100644 index 0000000..e5a5733 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_deleteSession.json @@ -0,0 +1,10 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.deleteSession", + "defs": { + "main": { + "type": "procedure", + "description": "Delete the current session. Requires auth." + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_describeServer.json b/crates/weaver-api/lexicons/com_atproto_server_describeServer.json new file mode 100644 index 0000000..36343a9 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_describeServer.json @@ -0,0 +1,72 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.describeServer", + "defs": { + "contact": { + "type": "object", + "properties": { + "email": { + "type": "string" + } + } + }, + "links": { + "type": "object", + "properties": { + "privacyPolicy": { + "type": "string", + "format": "uri" + }, + "termsOfService": { + "type": "string", + "format": "uri" + } + } + }, + "main": { + "type": "query", + "description": "Describes the server's account creation requirements and capabilities. Implemented by PDS.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "availableUserDomains" + ], + "properties": { + "availableUserDomains": { + "type": "array", + "description": "List of domain suffixes that can be used in account handles.", + "items": { + "type": "string" + } + }, + "contact": { + "type": "ref", + "description": "Contact information", + "ref": "#contact" + }, + "did": { + "type": "string", + "format": "did" + }, + "inviteCodeRequired": { + "type": "boolean", + "description": "If true, an invite code must be supplied to create an account on this instance." + }, + "links": { + "type": "ref", + "description": "URLs of service policy documents.", + "ref": "#links" + }, + "phoneVerificationRequired": { + "type": "boolean", + "description": "If true, a phone verification token must be supplied to create an account on this instance." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_getAccountInviteCodes.json b/crates/weaver-api/lexicons/com_atproto_server_getAccountInviteCodes.json new file mode 100644 index 0000000..83a2d34 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_getAccountInviteCodes.json @@ -0,0 +1,47 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.getAccountInviteCodes", + "defs": { + "main": { + "type": "query", + "description": "Get all invite codes for the current account. Requires auth.", + "parameters": { + "type": "params", + "properties": { + "createAvailable": { + "type": "boolean", + "description": "Controls whether any new 'earned' but not 'created' invites should be created.", + "default": true + }, + "includeUsed": { + "type": "boolean", + "default": true + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "codes" + ], + "properties": { + "codes": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.server.defs#inviteCode" + } + } + } + } + }, + "errors": [ + { + "name": "DuplicateCreate" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_getServiceAuth.json b/crates/weaver-api/lexicons/com_atproto_server_getServiceAuth.json new file mode 100644 index 0000000..a7157c0 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_getServiceAuth.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.getServiceAuth", + "defs": { + "main": { + "type": "query", + "description": "Get a signed token on behalf of the requesting DID for the requested service.", + "parameters": { + "type": "params", + "required": [ + "aud" + ], + "properties": { + "aud": { + "type": "string", + "description": "The DID of the service that the token will be used to authenticate with", + "format": "did" + }, + "exp": { + "type": "integer", + "description": "The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope." + }, + "lxm": { + "type": "string", + "description": "Lexicon (XRPC) method to bind the requested token to", + "format": "nsid" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "token" + ], + "properties": { + "token": { + "type": "string" + } + } + } + }, + "errors": [ + { + "description": "Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes.", + "name": "BadExpiration" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_getSession.json b/crates/weaver-api/lexicons/com_atproto_server_getSession.json new file mode 100644 index 0000000..ae6220d --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_getSession.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.getSession", + "defs": { + "main": { + "type": "query", + "description": "Get information about the current auth session. Requires auth.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "handle", + "did" + ], + "properties": { + "active": { + "type": "boolean" + }, + "did": { + "type": "string", + "format": "did" + }, + "didDoc": { + "type": "unknown" + }, + "email": { + "type": "string" + }, + "emailAuthFactor": { + "type": "boolean" + }, + "emailConfirmed": { + "type": "boolean" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "status": { + "type": "string", + "description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", + "knownValues": [ + "takendown", + "suspended", + "deactivated" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_listAppPasswords.json b/crates/weaver-api/lexicons/com_atproto_server_listAppPasswords.json new file mode 100644 index 0000000..96d95d9 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_listAppPasswords.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.listAppPasswords", + "defs": { + "appPassword": { + "type": "object", + "required": [ + "name", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "name": { + "type": "string" + }, + "privileged": { + "type": "boolean" + } + } + }, + "main": { + "type": "query", + "description": "List all App Passwords.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "passwords" + ], + "properties": { + "passwords": { + "type": "array", + "items": { + "type": "ref", + "ref": "#appPassword" + } + } + } + } + }, + "errors": [ + { + "name": "AccountTakedown" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_refreshSession.json b/crates/weaver-api/lexicons/com_atproto_server_refreshSession.json new file mode 100644 index 0000000..afab50b --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_refreshSession.json @@ -0,0 +1,58 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.refreshSession", + "defs": { + "main": { + "type": "procedure", + "description": "Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt').", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "accessJwt", + "refreshJwt", + "handle", + "did" + ], + "properties": { + "accessJwt": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "did": { + "type": "string", + "format": "did" + }, + "didDoc": { + "type": "unknown" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "refreshJwt": { + "type": "string" + }, + "status": { + "type": "string", + "description": "Hosting status of the account. If not specified, then assume 'active'.", + "knownValues": [ + "takendown", + "suspended", + "deactivated" + ] + } + } + } + }, + "errors": [ + { + "name": "AccountTakedown" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_requestAccountDelete.json b/crates/weaver-api/lexicons/com_atproto_server_requestAccountDelete.json new file mode 100644 index 0000000..fcb9a86 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_requestAccountDelete.json @@ -0,0 +1,10 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.requestAccountDelete", + "defs": { + "main": { + "type": "procedure", + "description": "Initiate a user account deletion via email." + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_requestEmailConfirmation.json b/crates/weaver-api/lexicons/com_atproto_server_requestEmailConfirmation.json new file mode 100644 index 0000000..b4fb3f3 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_requestEmailConfirmation.json @@ -0,0 +1,10 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.requestEmailConfirmation", + "defs": { + "main": { + "type": "procedure", + "description": "Request an email with a code to confirm ownership of email." + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_requestEmailUpdate.json b/crates/weaver-api/lexicons/com_atproto_server_requestEmailUpdate.json new file mode 100644 index 0000000..1d80c27 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_requestEmailUpdate.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.requestEmailUpdate", + "defs": { + "main": { + "type": "procedure", + "description": "Request a token in order to update email.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "tokenRequired" + ], + "properties": { + "tokenRequired": { + "type": "boolean" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_requestPasswordReset.json b/crates/weaver-api/lexicons/com_atproto_server_requestPasswordReset.json new file mode 100644 index 0000000..ae984f3 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_requestPasswordReset.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.requestPasswordReset", + "defs": { + "main": { + "type": "procedure", + "description": "Initiate a user account password reset via email.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_reserveSigningKey.json b/crates/weaver-api/lexicons/com_atproto_server_reserveSigningKey.json new file mode 100644 index 0000000..28f1372 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_reserveSigningKey.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.reserveSigningKey", + "defs": { + "main": { + "type": "procedure", + "description": "Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "did": { + "type": "string", + "description": "The DID to reserve a key for.", + "format": "did" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "signingKey" + ], + "properties": { + "signingKey": { + "type": "string", + "description": "The public key for the reserved signing key, in did:key serialization." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_resetPassword.json b/crates/weaver-api/lexicons/com_atproto_server_resetPassword.json new file mode 100644 index 0000000..da1aebf --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_resetPassword.json @@ -0,0 +1,36 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.resetPassword", + "defs": { + "main": { + "type": "procedure", + "description": "Reset a user account password using a token.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "token", + "password" + ], + "properties": { + "password": { + "type": "string" + }, + "token": { + "type": "string" + } + } + } + }, + "errors": [ + { + "name": "ExpiredToken" + }, + { + "name": "InvalidToken" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_revokeAppPassword.json b/crates/weaver-api/lexicons/com_atproto_server_revokeAppPassword.json new file mode 100644 index 0000000..caaad41 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_revokeAppPassword.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.revokeAppPassword", + "defs": { + "main": { + "type": "procedure", + "description": "Revoke an App Password by name.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_server_updateEmail.json b/crates/weaver-api/lexicons/com_atproto_server_updateEmail.json new file mode 100644 index 0000000..f23776f --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_server_updateEmail.json @@ -0,0 +1,42 @@ +{ + "lexicon": 1, + "id": "com.atproto.server.updateEmail", + "defs": { + "main": { + "type": "procedure", + "description": "Update an account's email.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string" + }, + "emailAuthFactor": { + "type": "boolean" + }, + "token": { + "type": "string", + "description": "Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed." + } + } + } + }, + "errors": [ + { + "name": "ExpiredToken" + }, + { + "name": "InvalidToken" + }, + { + "name": "TokenRequired" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_defs.json b/crates/weaver-api/lexicons/com_atproto_sync_defs.json new file mode 100644 index 0000000..5f0845e --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_defs.json @@ -0,0 +1,16 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.defs", + "defs": { + "hostStatus": { + "type": "string", + "knownValues": [ + "active", + "idle", + "offline", + "throttled", + "banned" + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getBlob.json b/crates/weaver-api/lexicons/com_atproto_sync_getBlob.json new file mode 100644 index 0000000..fcf6f22 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getBlob.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getBlob", + "defs": { + "main": { + "type": "query", + "description": "Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS.", + "parameters": { + "type": "params", + "required": [ + "did", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "description": "The CID of the blob to fetch", + "format": "cid" + }, + "did": { + "type": "string", + "description": "The DID of the account.", + "format": "did" + } + } + }, + "output": { + "encoding": "*/*" + }, + "errors": [ + { + "name": "BlobNotFound" + }, + { + "name": "RepoNotFound" + }, + { + "name": "RepoTakendown" + }, + { + "name": "RepoSuspended" + }, + { + "name": "RepoDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getBlocks.json b/crates/weaver-api/lexicons/com_atproto_sync_getBlocks.json new file mode 100644 index 0000000..4eb5516 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getBlocks.json @@ -0,0 +1,51 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getBlocks", + "defs": { + "main": { + "type": "query", + "description": "Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS.", + "parameters": { + "type": "params", + "required": [ + "did", + "cids" + ], + "properties": { + "cids": { + "type": "array", + "items": { + "type": "string", + "format": "cid" + } + }, + "did": { + "type": "string", + "description": "The DID of the repo.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/vnd.ipld.car" + }, + "errors": [ + { + "name": "BlockNotFound" + }, + { + "name": "RepoNotFound" + }, + { + "name": "RepoTakendown" + }, + { + "name": "RepoSuspended" + }, + { + "name": "RepoDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getCheckout.json b/crates/weaver-api/lexicons/com_atproto_sync_getCheckout.json new file mode 100644 index 0000000..95877fe --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getCheckout.json @@ -0,0 +1,26 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getCheckout", + "defs": { + "main": { + "type": "query", + "description": "DEPRECATED - please use com.atproto.sync.getRepo instead", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "description": "The DID of the repo.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/vnd.ipld.car" + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getHead.json b/crates/weaver-api/lexicons/com_atproto_sync_getHead.json new file mode 100644 index 0000000..ea64932 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getHead.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getHead", + "defs": { + "main": { + "type": "query", + "description": "DEPRECATED - please use com.atproto.sync.getLatestCommit instead", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "description": "The DID of the repo.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "root" + ], + "properties": { + "root": { + "type": "string", + "format": "cid" + } + } + } + }, + "errors": [ + { + "name": "HeadNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getHostStatus.json b/crates/weaver-api/lexicons/com_atproto_sync_getHostStatus.json new file mode 100644 index 0000000..3aab00a --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getHostStatus.json @@ -0,0 +1,53 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getHostStatus", + "defs": { + "main": { + "type": "query", + "description": "Returns information about a specified upstream host, as consumed by the server. Implemented by relays.", + "parameters": { + "type": "params", + "required": [ + "hostname" + ], + "properties": { + "hostname": { + "type": "string", + "description": "Hostname of the host (eg, PDS or relay) being queried." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "hostname" + ], + "properties": { + "accountCount": { + "type": "integer", + "description": "Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts." + }, + "hostname": { + "type": "string" + }, + "seq": { + "type": "integer", + "description": "Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor)." + }, + "status": { + "type": "ref", + "ref": "com.atproto.sync.defs#hostStatus" + } + } + } + }, + "errors": [ + { + "name": "HostNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getLatestCommit.json b/crates/weaver-api/lexicons/com_atproto_sync_getLatestCommit.json new file mode 100644 index 0000000..2005651 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getLatestCommit.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getLatestCommit", + "defs": { + "main": { + "type": "query", + "description": "Get the current commit CID & revision of the specified repo. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "description": "The DID of the repo.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "cid", + "rev" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "rev": { + "type": "string", + "format": "tid" + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound" + }, + { + "name": "RepoTakendown" + }, + { + "name": "RepoSuspended" + }, + { + "name": "RepoDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getRecord.json b/crates/weaver-api/lexicons/com_atproto_sync_getRecord.json new file mode 100644 index 0000000..3cf0d65 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getRecord.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getRecord", + "defs": { + "main": { + "type": "query", + "description": "Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "did", + "collection", + "rkey" + ], + "properties": { + "collection": { + "type": "string", + "format": "nsid" + }, + "did": { + "type": "string", + "description": "The DID of the repo.", + "format": "did" + }, + "rkey": { + "type": "string", + "description": "Record Key", + "format": "record-key" + } + } + }, + "output": { + "encoding": "application/vnd.ipld.car" + }, + "errors": [ + { + "name": "RecordNotFound" + }, + { + "name": "RepoNotFound" + }, + { + "name": "RepoTakendown" + }, + { + "name": "RepoSuspended" + }, + { + "name": "RepoDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getRepo.json b/crates/weaver-api/lexicons/com_atproto_sync_getRepo.json new file mode 100644 index 0000000..528f6bb --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getRepo.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getRepo", + "defs": { + "main": { + "type": "query", + "description": "Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "description": "The DID of the repo.", + "format": "did" + }, + "since": { + "type": "string", + "description": "The revision ('rev') of the repo to create a diff from.", + "format": "tid" + } + } + }, + "output": { + "encoding": "application/vnd.ipld.car" + }, + "errors": [ + { + "name": "RepoNotFound" + }, + { + "name": "RepoTakendown" + }, + { + "name": "RepoSuspended" + }, + { + "name": "RepoDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_getRepoStatus.json b/crates/weaver-api/lexicons/com_atproto_sync_getRepoStatus.json new file mode 100644 index 0000000..3cdc955 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_getRepoStatus.json @@ -0,0 +1,64 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.getRepoStatus", + "defs": { + "main": { + "type": "query", + "description": "Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "description": "The DID of the repo.", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "active" + ], + "properties": { + "active": { + "type": "boolean" + }, + "did": { + "type": "string", + "format": "did" + }, + "rev": { + "type": "string", + "description": "Optional field, the current rev of the repo, if active=true", + "format": "tid" + }, + "status": { + "type": "string", + "description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", + "knownValues": [ + "takendown", + "suspended", + "deleted", + "deactivated", + "desynchronized", + "throttled" + ] + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_listBlobs.json b/crates/weaver-api/lexicons/com_atproto_sync_listBlobs.json new file mode 100644 index 0000000..dfb2aa0 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_listBlobs.json @@ -0,0 +1,72 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.listBlobs", + "defs": { + "main": { + "type": "query", + "description": "List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "cursor": { + "type": "string" + }, + "did": { + "type": "string", + "description": "The DID of the repo.", + "format": "did" + }, + "limit": { + "type": "integer", + "default": 500, + "minimum": 1, + "maximum": 1000 + }, + "since": { + "type": "string", + "description": "Optional revision of the repo to list blobs since.", + "format": "tid" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "cids" + ], + "properties": { + "cids": { + "type": "array", + "items": { + "type": "string", + "format": "cid" + } + }, + "cursor": { + "type": "string" + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound" + }, + { + "name": "RepoTakendown" + }, + { + "name": "RepoSuspended" + }, + { + "name": "RepoDeactivated" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_listHosts.json b/crates/weaver-api/lexicons/com_atproto_sync_listHosts.json new file mode 100644 index 0000000..b8a1f89 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_listHosts.json @@ -0,0 +1,69 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.listHosts", + "defs": { + "host": { + "type": "object", + "required": [ + "hostname" + ], + "properties": { + "accountCount": { + "type": "integer" + }, + "hostname": { + "type": "string", + "description": "hostname of server; not a URL (no scheme)" + }, + "seq": { + "type": "integer", + "description": "Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor)." + }, + "status": { + "type": "ref", + "ref": "com.atproto.sync.defs#hostStatus" + } + } + }, + "main": { + "type": "query", + "description": "Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 200, + "minimum": 1, + "maximum": 1000 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "hosts" + ], + "properties": { + "cursor": { + "type": "string" + }, + "hosts": { + "type": "array", + "description": "Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first.", + "items": { + "type": "ref", + "ref": "#host" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_listRepos.json b/crates/weaver-api/lexicons/com_atproto_sync_listRepos.json new file mode 100644 index 0000000..a4e6e80 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_listRepos.json @@ -0,0 +1,83 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.listRepos", + "defs": { + "main": { + "type": "query", + "description": "Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 500, + "minimum": 1, + "maximum": 1000 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repos" + ], + "properties": { + "cursor": { + "type": "string" + }, + "repos": { + "type": "array", + "items": { + "type": "ref", + "ref": "#repo" + } + } + } + } + } + }, + "repo": { + "type": "object", + "required": [ + "did", + "head", + "rev" + ], + "properties": { + "active": { + "type": "boolean" + }, + "did": { + "type": "string", + "format": "did" + }, + "head": { + "type": "string", + "description": "Current repo commit CID", + "format": "cid" + }, + "rev": { + "type": "string", + "format": "tid" + }, + "status": { + "type": "string", + "description": "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", + "knownValues": [ + "takendown", + "suspended", + "deleted", + "deactivated", + "desynchronized", + "throttled" + ] + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_listReposByCollection.json b/crates/weaver-api/lexicons/com_atproto_sync_listReposByCollection.json new file mode 100644 index 0000000..52f5430 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_listReposByCollection.json @@ -0,0 +1,65 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.listReposByCollection", + "defs": { + "main": { + "type": "query", + "description": "Enumerates all the DIDs which have records with the given collection NSID.", + "parameters": { + "type": "params", + "required": [ + "collection" + ], + "properties": { + "collection": { + "type": "string", + "format": "nsid" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "description": "Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists.", + "default": 500, + "minimum": 1, + "maximum": 2000 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repos" + ], + "properties": { + "cursor": { + "type": "string" + }, + "repos": { + "type": "array", + "items": { + "type": "ref", + "ref": "#repo" + } + } + } + } + } + }, + "repo": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_notifyOfUpdate.json b/crates/weaver-api/lexicons/com_atproto_sync_notifyOfUpdate.json new file mode 100644 index 0000000..5a3c21e --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_notifyOfUpdate.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.notifyOfUpdate", + "defs": { + "main": { + "type": "procedure", + "description": "Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. DEPRECATED: just use com.atproto.sync.requestCrawl", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "hostname" + ], + "properties": { + "hostname": { + "type": "string", + "description": "Hostname of the current service (usually a PDS) that is notifying of update." + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_requestCrawl.json b/crates/weaver-api/lexicons/com_atproto_sync_requestCrawl.json new file mode 100644 index 0000000..5b31a3f --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_requestCrawl.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.requestCrawl", + "defs": { + "main": { + "type": "procedure", + "description": "Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "hostname" + ], + "properties": { + "hostname": { + "type": "string", + "description": "Hostname of the current service (eg, PDS) that is requesting to be crawled." + } + } + } + }, + "errors": [ + { + "name": "HostBanned" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_sync_subscribeRepos.json b/crates/weaver-api/lexicons/com_atproto_sync_subscribeRepos.json new file mode 100644 index 0000000..7be8242 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_sync_subscribeRepos.json @@ -0,0 +1,275 @@ +{ + "lexicon": 1, + "id": "com.atproto.sync.subscribeRepos", + "defs": { + "account": { + "type": "object", + "description": "Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.", + "required": [ + "seq", + "did", + "time", + "active" + ], + "properties": { + "active": { + "type": "boolean", + "description": "Indicates that the account has a repository which can be fetched from the host that emitted this event." + }, + "did": { + "type": "string", + "format": "did" + }, + "seq": { + "type": "integer" + }, + "status": { + "type": "string", + "description": "If active=false, this optional field indicates a reason for why the account is not active.", + "knownValues": [ + "takendown", + "suspended", + "deleted", + "deactivated", + "desynchronized", + "throttled" + ] + }, + "time": { + "type": "string", + "format": "datetime" + } + } + }, + "commit": { + "type": "object", + "description": "Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.", + "required": [ + "seq", + "rebase", + "tooBig", + "repo", + "commit", + "rev", + "since", + "blocks", + "ops", + "blobs", + "time" + ], + "nullable": [ + "since" + ], + "properties": { + "blobs": { + "type": "array", + "items": { + "type": "cid-link", + "description": "DEPRECATED -- will soon always be empty. List of new blobs (by CID) referenced by records in this commit." + } + }, + "blocks": { + "type": "bytes", + "description": "CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list.", + "maxLength": 2000000 + }, + "commit": { + "type": "cid-link", + "description": "Repo commit object CID." + }, + "ops": { + "type": "array", + "items": { + "type": "ref", + "description": "List of repo mutation operations in this commit (eg, records created, updated, or deleted).", + "ref": "#repoOp" + }, + "maxLength": 200 + }, + "prevData": { + "type": "cid-link", + "description": "The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose." + }, + "rebase": { + "type": "boolean", + "description": "DEPRECATED -- unused" + }, + "repo": { + "type": "string", + "description": "The repo this event comes from. Note that all other message types name this field 'did'.", + "format": "did" + }, + "rev": { + "type": "string", + "description": "The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event.", + "format": "tid" + }, + "seq": { + "type": "integer", + "description": "The stream sequence number of this message." + }, + "since": { + "type": "string", + "description": "The rev of the last emitted commit from this repo (if any).", + "format": "tid" + }, + "time": { + "type": "string", + "description": "Timestamp of when this message was originally broadcast.", + "format": "datetime" + }, + "tooBig": { + "type": "boolean", + "description": "DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data." + } + } + }, + "identity": { + "type": "object", + "description": "Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.", + "required": [ + "seq", + "did", + "time" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "handle": { + "type": "string", + "description": "The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details.", + "format": "handle" + }, + "seq": { + "type": "integer" + }, + "time": { + "type": "string", + "format": "datetime" + } + } + }, + "info": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "message": { + "type": "string" + }, + "name": { + "type": "string", + "knownValues": [ + "OutdatedCursor" + ] + } + } + }, + "main": { + "type": "subscription", + "description": "Repository event stream, aka Firehose endpoint. Outputs repo commits with diff data, and identity update events, for all repositories on the current server. See the atproto specifications for details around stream sequencing, repo versioning, CAR diff format, and more. Public and does not require auth; implemented by PDS and Relay.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "integer", + "description": "The last known event seq number to backfill from." + } + } + }, + "message": { + "schema": { + "type": "union", + "refs": [ + "#commit", + "#sync", + "#identity", + "#account", + "#info" + ] + } + }, + "errors": [ + { + "name": "FutureCursor" + }, + { + "description": "If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection.", + "name": "ConsumerTooSlow" + } + ] + }, + "repoOp": { + "type": "object", + "description": "A repo operation, ie a mutation of a single record.", + "required": [ + "action", + "path", + "cid" + ], + "nullable": [ + "cid" + ], + "properties": { + "action": { + "type": "string", + "knownValues": [ + "create", + "update", + "delete" + ] + }, + "cid": { + "type": "cid-link", + "description": "For creates and updates, the new record CID. For deletions, null." + }, + "path": { + "type": "string" + }, + "prev": { + "type": "cid-link", + "description": "For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined." + } + } + }, + "sync": { + "type": "object", + "description": "Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.", + "required": [ + "seq", + "did", + "blocks", + "rev", + "time" + ], + "properties": { + "blocks": { + "type": "bytes", + "description": "CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'.", + "maxLength": 10000 + }, + "did": { + "type": "string", + "description": "The account this repo event corresponds to. Must match that in the commit object.", + "format": "did" + }, + "rev": { + "type": "string", + "description": "The rev of the commit. This value must match that in the commit object." + }, + "seq": { + "type": "integer", + "description": "The stream sequence number of this message." + }, + "time": { + "type": "string", + "description": "Timestamp of when this message was originally broadcast.", + "format": "datetime" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_temp_addReservedHandle.json b/crates/weaver-api/lexicons/com_atproto_temp_addReservedHandle.json new file mode 100644 index 0000000..cd7454b --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_temp_addReservedHandle.json @@ -0,0 +1,31 @@ +{ + "lexicon": 1, + "id": "com.atproto.temp.addReservedHandle", + "defs": { + "main": { + "type": "procedure", + "description": "Add a handle to the set of reserved handles.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "handle" + ], + "properties": { + "handle": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": {} + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_temp_checkHandleAvailability.json b/crates/weaver-api/lexicons/com_atproto_temp_checkHandleAvailability.json new file mode 100644 index 0000000..82b37dc --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_temp_checkHandleAvailability.json @@ -0,0 +1,101 @@ +{ + "lexicon": 1, + "id": "com.atproto.temp.checkHandleAvailability", + "defs": { + "main": { + "type": "query", + "description": "Checks whether the provided handle is available. If the handle is not available, available suggestions will be returned. Optional inputs will be used to generate suggestions.", + "parameters": { + "type": "params", + "required": [ + "handle" + ], + "properties": { + "birthDate": { + "type": "string", + "description": "User-provided birth date. Might be used to build handle suggestions.", + "format": "datetime" + }, + "email": { + "type": "string", + "description": "User-provided email. Might be used to build handle suggestions." + }, + "handle": { + "type": "string", + "description": "Tentative handle. Will be checked for availability or used to build handle suggestions.", + "format": "handle" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "handle", + "result" + ], + "properties": { + "handle": { + "type": "string", + "description": "Echo of the input handle.", + "format": "handle" + }, + "result": { + "type": "union", + "refs": [ + "#resultAvailable", + "#resultUnavailable" + ] + } + } + } + }, + "errors": [ + { + "description": "An invalid email was provided.", + "name": "InvalidEmail" + } + ] + }, + "resultAvailable": { + "type": "object", + "description": "Indicates the provided handle is available.", + "properties": {} + }, + "resultUnavailable": { + "type": "object", + "description": "Indicates the provided handle is unavailable and gives suggestions of available handles.", + "required": [ + "suggestions" + ], + "properties": { + "suggestions": { + "type": "array", + "description": "List of suggested handles based on the provided inputs.", + "items": { + "type": "ref", + "ref": "#suggestion" + } + } + } + }, + "suggestion": { + "type": "object", + "required": [ + "handle", + "method" + ], + "properties": { + "handle": { + "type": "string", + "format": "handle" + }, + "method": { + "type": "string", + "description": "Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics." + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_temp_checkSignupQueue.json b/crates/weaver-api/lexicons/com_atproto_temp_checkSignupQueue.json new file mode 100644 index 0000000..52c0ede --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_temp_checkSignupQueue.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "com.atproto.temp.checkSignupQueue", + "defs": { + "main": { + "type": "query", + "description": "Check accounts location in signup queue.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "activated" + ], + "properties": { + "activated": { + "type": "boolean" + }, + "estimatedTimeMs": { + "type": "integer" + }, + "placeInQueue": { + "type": "integer" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_temp_dereferenceScope.json b/crates/weaver-api/lexicons/com_atproto_temp_dereferenceScope.json new file mode 100644 index 0000000..ba969a5 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_temp_dereferenceScope.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "com.atproto.temp.dereferenceScope", + "defs": { + "main": { + "type": "query", + "description": "Allows finding the oauth permission scope from a reference", + "parameters": { + "type": "params", + "required": [ + "scope" + ], + "properties": { + "scope": { + "type": "string", + "description": "The scope reference (starts with 'ref:')" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "scope" + ], + "properties": { + "scope": { + "type": "string", + "description": "The full oauth permission scope" + } + } + } + }, + "errors": [ + { + "description": "An invalid scope reference was provided.", + "name": "InvalidScopeReference" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_temp_fetchLabels.json b/crates/weaver-api/lexicons/com_atproto_temp_fetchLabels.json new file mode 100644 index 0000000..cf811fb --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_temp_fetchLabels.json @@ -0,0 +1,42 @@ +{ + "lexicon": 1, + "id": "com.atproto.temp.fetchLabels", + "defs": { + "main": { + "type": "query", + "description": "DEPRECATED: use queryLabels or subscribeLabels instead -- Fetch all labels from a labeler created after a certain date.", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 250 + }, + "since": { + "type": "integer" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "labels" + ], + "properties": { + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_temp_requestPhoneVerification.json b/crates/weaver-api/lexicons/com_atproto_temp_requestPhoneVerification.json new file mode 100644 index 0000000..eaf730d --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_temp_requestPhoneVerification.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "com.atproto.temp.requestPhoneVerification", + "defs": { + "main": { + "type": "procedure", + "description": "Request a verification code to be sent to the supplied phone number", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "phoneNumber" + ], + "properties": { + "phoneNumber": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/com_atproto_temp_revokeAccountCredentials.json b/crates/weaver-api/lexicons/com_atproto_temp_revokeAccountCredentials.json new file mode 100644 index 0000000..63503e2 --- /dev/null +++ b/crates/weaver-api/lexicons/com_atproto_temp_revokeAccountCredentials.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "com.atproto.temp.revokeAccountCredentials", + "defs": { + "main": { + "type": "procedure", + "description": "Revoke sessions, password, and app passwords associated with account. May be resolved by a password reset.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "string", + "format": "at-identifier" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_defs.json b/crates/weaver-api/lexicons/sh_weaver_actor_defs.json new file mode 100644 index 0000000..81bb07a --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_actor_defs.json @@ -0,0 +1,286 @@ +{ + "lexicon": 1, + "id": "sh.weaver.actor.defs", + "defs": { + "author": { + "type": "object", + "description": "A single author in a Weaver notebook.", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "handle": { + "type": "string", + "format": "handle" + } + } + }, + "pinnedList": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + }, + "profileDataView": { + "type": "object", + "required": [ + "inner" + ], + "properties": { + "inner": { + "type": "union", + "refs": [ + "#profileView", + "app.bsky.actor.defs#profileViewDetailed", + "#tangledProfileView" + ] + } + } + }, + "profileDataViewBasic": { + "type": "object", + "required": [ + "inner" + ], + "properties": { + "inner": { + "type": "union", + "refs": [ + "#profileViewBasic", + "app.bsky.actor.defs#profileViewBasic", + "#tangledProfileView" + ] + } + } + }, + "profileView": { + "type": "object", + "required": [ + "did", + "handle" + ], + "properties": { + "avatar": { + "type": "string", + "format": "uri" + }, + "banner": { + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "description": { + "type": "string", + "maxLength": 10240, + "maxGraphemes": 1024 + }, + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "handle": { + "type": "string", + "format": "handle" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "links": { + "type": "array", + "items": { + "type": "string", + "description": "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", + "format": "uri" + }, + "minLength": 0, + "maxLength": 5 + }, + "location": { + "type": "string", + "description": "Free-form location text.", + "maxLength": 400, + "maxGraphemes": 40 + }, + "pinned": { + "type": "ref", + "description": "Notebooks or other records pinned for display.", + "ref": "#pinnedList" + }, + "pronouns": { + "type": "ref", + "description": "Pronouns to use in user-generated content.", + "ref": "#pronounsList" + }, + "subscribedCount": { + "type": "integer" + }, + "subscriberCount": { + "type": "integer" + } + } + }, + "profileViewBasic": { + "type": "object", + "required": [ + "did", + "handle" + ], + "properties": { + "avatar": { + "type": "string", + "format": "uri" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "did": { + "type": "string", + "format": "did" + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "handle": { + "type": "string", + "format": "handle" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "pronouns": { + "type": "ref", + "description": "Pronouns to use in user-generated content.", + "ref": "#pronounsList" + } + } + }, + "pronounsList": { + "type": "array", + "items": { + "type": "string", + "maxLength": 500, + "maxGraphemes": 50, + "knownValues": [ + "she/her", + "he/him", + "they/them", + "it/its", + "she/they", + "he/they", + "they/he", + "they/she", + "any/all" + ] + }, + "maxLength": 5 + }, + "tangledProfileView": { + "type": "object", + "required": [ + "bluesky", + "did", + "handle" + ], + "properties": { + "bluesky": { + "type": "boolean", + "description": "Include link to this account on Bluesky." + }, + "description": { + "type": "string", + "description": "Free-form profile description text.", + "maxLength": 2560, + "maxGraphemes": 256 + }, + "did": { + "type": "string", + "format": "did" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "links": { + "type": "array", + "items": { + "type": "string", + "description": "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", + "format": "uri" + }, + "minLength": 0, + "maxLength": 5 + }, + "location": { + "type": "string", + "description": "Free-form location text.", + "maxLength": 400, + "maxGraphemes": 40 + }, + "pinnedRepositories": { + "type": "array", + "description": "Any ATURI, it is up to appviews to validate these fields.", + "items": { + "type": "string", + "format": "at-uri" + }, + "minLength": 0, + "maxLength": 6 + }, + "stats": { + "type": "array", + "items": { + "type": "string", + "description": "Vanity stats.", + "enum": [ + "merged-pull-request-count", + "closed-pull-request-count", + "open-pull-request-count", + "open-issue-count", + "closed-issue-count", + "repository-count" + ] + }, + "minLength": 0, + "maxLength": 2 + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_getProfile.json b/crates/weaver-api/lexicons/sh_weaver_actor_getProfile.json new file mode 100644 index 0000000..1403885 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_actor_getProfile.json @@ -0,0 +1,30 @@ +{ + "lexicon": 1, + "id": "sh.weaver.actor.getProfile", + "defs": { + "main": { + "type": "query", + "description": "Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "description": "Handle or DID of account to fetch profile of.", + "format": "at-identifier" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileDataView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_profile.json b/crates/weaver-api/lexicons/sh_weaver_actor_profile.json new file mode 100644 index 0000000..77ceba0 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_actor_profile.json @@ -0,0 +1,94 @@ +{ + "lexicon": 1, + "id": "sh.weaver.actor.profile", + "defs": { + "main": { + "type": "record", + "description": "A declaration of a Weaver account profile.", + "key": "literal:self", + "record": { + "type": "object", + "properties": { + "avatar": { + "type": "blob", + "description": "Small image to be displayed next to posts from account. AKA, 'profile picture'", + "accept": [ + "image/png", + "image/jpeg" + ], + "maxSize": 1000000 + }, + "banner": { + "type": "blob", + "description": "Larger horizontal image to display behind profile view.", + "accept": [ + "image/png", + "image/jpeg" + ], + "maxSize": 1000000 + }, + "bluesky": { + "type": "boolean", + "description": "Include link to this account on Bluesky." + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "description": { + "type": "string", + "description": "Free-form profile description text.", + "maxLength": 10240, + "maxGraphemes": 1024 + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "labels": { + "type": "union", + "description": "Self-label values, specific to the application, on the overall account.", + "refs": [ + "com.atproto.label.defs#selfLabels" + ] + }, + "links": { + "type": "array", + "items": { + "type": "string", + "description": "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", + "format": "uri" + }, + "minLength": 0, + "maxLength": 5 + }, + "location": { + "type": "string", + "description": "Free-form location text.", + "maxLength": 400, + "maxGraphemes": 40 + }, + "pinned": { + "type": "ref", + "description": "Notebooks or other records pinned for display.", + "ref": "sh.weaver.actor.defs#pinnedList" + }, + "pronouns": { + "type": "ref", + "description": "Pronouns to use in user-generated content.", + "ref": "sh.weaver.actor.defs#pronounsList" + }, + "streamplace": { + "type": "boolean", + "description": "Include link to this account on stream.place." + }, + "tangled": { + "type": "boolean", + "description": "Include link to this account on Tangled." + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_cursor.json b/crates/weaver-api/lexicons/sh_weaver_edit_cursor.json new file mode 100644 index 0000000..84693f8 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_cursor.json @@ -0,0 +1,129 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.cursor", + "defs": { + "containerId": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "union", + "refs": [ + "#normalContainerId", + "#rootContainerId" + ] + } + } + }, + "cursorSide": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "integer", + "description": "The side of an item the cursor is on (left = -1, right = 1, middle = 0)", + "enum": [ + -1, + 0, + 1 + ] + } + } + }, + "id": { + "type": "object", + "required": [ + "peer", + "counter" + ], + "properties": { + "counter": { + "type": "integer" + }, + "peer": { + "type": "integer" + } + } + }, + "main": { + "type": "record", + "description": "An edit record for a notebook.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "container", + "id" + ], + "properties": { + "container": { + "type": "ref", + "ref": "#containerId" + }, + "id": { + "type": "ref", + "ref": "#id" + }, + "side": { + "type": "ref", + "ref": "#cursorSide" + } + } + } + }, + "normalContainerId": { + "type": "object", + "required": [ + "peer", + "counter", + "container_type" + ], + "properties": { + "container_type": { + "type": "string", + "enum": [ + "Map", + "List", + "Text", + "Tree", + "MovableList", + "Counter" + ] + }, + "counter": { + "type": "integer" + }, + "peer": { + "type": "integer" + } + } + }, + "rootContainerId": { + "type": "object", + "required": [ + "name", + "container_type" + ], + "properties": { + "container_type": { + "type": "string", + "enum": [ + "Map", + "List", + "Text", + "Tree", + "MovableList", + "Counter" + ] + }, + "name": { + "type": "string" + } + } + } + } +} \ 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 new file mode 100644 index 0000000..81f8c7b --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_defs.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.defs", + "defs": { + "docRef": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "union", + "refs": [ + "#notebookRef", + "#entryRef" + ] + } + } + }, + "entryRef": { + "type": "object", + "required": [ + "notebook" + ], + "properties": { + "notebook": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + }, + "notebookRef": { + "type": "object", + "required": [ + "notebook" + ], + "properties": { + "notebook": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_diff.json b/crates/weaver-api/lexicons/sh_weaver_edit_diff.json new file mode 100644 index 0000000..ba32bac --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_diff.json @@ -0,0 +1,36 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.diff", + "defs": { + "main": { + "type": "record", + "description": "An edit record for a notebook.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "snapshot", + "root", + "doc" + ], + "properties": { + "doc": { + "type": "ref", + "ref": "sh.weaver.edit.defs#docRef" + }, + "root": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "snapshot": { + "type": "blob", + "accept": [ + "*/*" + ], + "maxSize": 3000000 + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_root.json b/crates/weaver-api/lexicons/sh_weaver_edit_root.json new file mode 100644 index 0000000..558fd34 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_root.json @@ -0,0 +1,41 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.root", + "defs": { + "main": { + "type": "record", + "description": "The starting point for edit history on a notebook.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "cid", + "uri", + "doc", + "snapshot" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "doc": { + "type": "ref", + "ref": "sh.weaver.edit.defs#docRef" + }, + "snapshot": { + "type": "blob", + "accept": [ + "*/*" + ], + "maxSize": 30000000 + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_embed_defs.json b/crates/weaver-api/lexicons/sh_weaver_embed_defs.json new file mode 100644 index 0000000..7179065 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_embed_defs.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "sh.weaver.embed.defs", + "defs": { + "percentSize": { + "type": "object", + "description": "Proportional size of the embed relative to the viewport in larger windows. The dimensions are percentage out of 100. Could we use more granularity? Maybe, but come on.", + "required": [ + "width", + "height" + ], + "properties": { + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + } + } + }, + "pixelSize": { + "type": "object", + "description": "Pixel-exact embed size. The dimensions are logical pixels, subject to scaling, so 200px at X2 scale is 400px.", + "required": [ + "width", + "height" + ], + "properties": { + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_embed_external.json b/crates/weaver-api/lexicons/sh_weaver_embed_external.json new file mode 100644 index 0000000..a1d7f5e --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_embed_external.json @@ -0,0 +1,90 @@ +{ + "lexicon": 1, + "id": "sh.weaver.embed.external", + "description": "A set of records embedded in a blog post.", + "defs": { + "externalEmbed": { + "type": "object", + "required": [ + "uri", + "title", + "description" + ], + "properties": { + "description": { + "type": "string" + }, + "thumb": { + "type": "blob", + "accept": [ + "image/*" + ], + "maxSize": 1000000 + }, + "title": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "uri" + } + } + }, + "main": { + "type": "object", + "required": [ + "embeds" + ], + "properties": { + "embeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "#externalEmbed" + }, + "maxLength": 48 + } + } + }, + "view": { + "type": "object", + "required": [ + "external" + ], + "properties": { + "external": { + "type": "array", + "items": { + "type": "ref", + "ref": "#viewExternal" + }, + "maxLength": 48 + } + } + }, + "viewExternal": { + "type": "object", + "required": [ + "uri", + "title", + "description" + ], + "properties": { + "description": { + "type": "string" + }, + "thumb": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_embed_images.json b/crates/weaver-api/lexicons/sh_weaver_embed_images.json new file mode 100644 index 0000000..cd180cf --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_embed_images.json @@ -0,0 +1,112 @@ +{ + "lexicon": 1, + "id": "sh.weaver.embed.images", + "description": "A set of images embedded in a blog post.", + "defs": { + "image": { + "type": "object", + "required": [ + "image", + "alt" + ], + "properties": { + "alt": { + "type": "string", + "description": "alt text description of the image" + }, + "blurhash": { + "type": "string", + "description": "Blurhash string for the image, used for low-resolution placeholders. This must be a valid Blurhash string.", + "maxLength": 32 + }, + "dimensions": { + "type": "union", + "refs": [ + "app.bsky.embed.defs#aspectRatio", + "sh.weaver.embed.defs#percentSize", + "sh.weaver.embed.defs#pixelSize" + ] + }, + "image": { + "type": "blob", + "accept": [ + "image/*" + ], + "maxSize": 3000000 + }, + "name": { + "type": "string", + "maxLength": 128 + } + } + }, + "main": { + "type": "object", + "required": [ + "images" + ], + "properties": { + "images": { + "type": "array", + "items": { + "type": "ref", + "ref": "#image" + }, + "maxLength": 48 + } + } + }, + "view": { + "type": "object", + "required": [ + "images" + ], + "properties": { + "images": { + "type": "array", + "items": { + "type": "ref", + "ref": "#viewImage" + }, + "maxLength": 48 + } + } + }, + "viewImage": { + "type": "object", + "required": [ + "thumb", + "fullsize", + "alt" + ], + "properties": { + "alt": { + "type": "string", + "description": "Alt text description of the image, for accessibility." + }, + "dimensions": { + "type": "union", + "refs": [ + "app.bsky.embed.defs#aspectRatio", + "sh.weaver.embed.defs#percentSize", + "sh.weaver.embed.defs#pixelSize" + ] + }, + "fullsize": { + "type": "string", + "description": "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.", + "format": "uri" + }, + "name": { + "type": "string", + "maxLength": 128 + }, + "thumb": { + "type": "string", + "description": "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.", + "format": "uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_embed_recordWithMedia.json b/crates/weaver-api/lexicons/sh_weaver_embed_recordWithMedia.json new file mode 100644 index 0000000..ca8da5c --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_embed_recordWithMedia.json @@ -0,0 +1,61 @@ +{ + "lexicon": 1, + "id": "sh.weaver.embed.recordWithMedia", + "description": "A representation of a record embedded in a Weaver record (eg, a notebook entry), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.", + "defs": { + "main": { + "type": "object", + "required": [ + "record", + "media" + ], + "properties": { + "media": { + "type": "union", + "refs": [ + "sh.weaver.embed.images", + "sh.weaver.embed.external", + "sh.weaver.embed.video", + "app.bsky.embed.images", + "app.bsky.embed.video", + "app.bsky.embed.external" + ] + }, + "record": { + "type": "union", + "refs": [ + "app.bsky.embed.record", + "sh.weaver.embed.records" + ] + } + } + }, + "view": { + "type": "object", + "required": [ + "record", + "media" + ], + "properties": { + "media": { + "type": "union", + "refs": [ + "sh.weaver.embed.images#view", + "sh.weaver.embed.external#view", + "sh.weaver.embed.video#view", + "app.bsky.embed.images#view", + "app.bsky.embed.video#view", + "app.bsky.embed.external#view" + ] + }, + "record": { + "type": "union", + "refs": [ + "sh.weaver.embed.records#view", + "app.bsky.embed.record#view" + ] + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_embed_records.json b/crates/weaver-api/lexicons/sh_weaver_embed_records.json new file mode 100644 index 0000000..a2d0746 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_embed_records.json @@ -0,0 +1,200 @@ +{ + "lexicon": 1, + "id": "sh.weaver.embed.records", + "description": "A set of records embedded in a blog post.", + "defs": { + "main": { + "type": "object", + "required": [ + "records" + ], + "properties": { + "records": { + "type": "array", + "items": { + "type": "ref", + "ref": "#recordEmbed" + }, + "maxLength": 48 + } + } + }, + "recordEmbed": { + "type": "object", + "required": [ + "record" + ], + "properties": { + "name": { + "type": "string", + "maxLength": 128 + }, + "record": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + }, + "recordEmbedView": { + "type": "object", + "required": [ + "recordView" + ], + "properties": { + "name": { + "type": "string", + "maxLength": 128 + }, + "recordView": { + "type": "union", + "refs": [ + "app.bsky.embed.images#view", + "app.bsky.embed.video#view", + "app.bsky.embed.external#view", + "app.bsky.embed.record#view", + "app.bsky.embed.recordWithMedia#view", + "sh.weaver.embed.records#view", + "sh.weaver.embed.images#view", + "sh.weaver.embed.recordWithMedia#view", + "sh.weaver.embed.video#view" + ] + } + } + }, + "view": { + "type": "object", + "required": [ + "record" + ], + "properties": { + "record": { + "type": "union", + "refs": [ + "#viewRecord", + "#viewNotFound", + "#viewBlocked", + "#viewDetached", + "app.bsky.feed.defs#generatorView", + "app.bsky.graph.defs#listView", + "app.bsky.labeler.defs#labelerView", + "app.bsky.graph.defs#starterPackViewBasic" + ] + } + } + }, + "viewBlocked": { + "type": "object", + "required": [ + "uri", + "blocked", + "author" + ], + "properties": { + "author": { + "type": "ref", + "ref": "app.bsky.feed.defs#blockedAuthor" + }, + "blocked": { + "type": "boolean", + "const": true + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "viewDetached": { + "type": "object", + "required": [ + "uri", + "detached" + ], + "properties": { + "detached": { + "type": "boolean", + "const": true + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "viewNotFound": { + "type": "object", + "required": [ + "uri", + "notFound" + ], + "properties": { + "notFound": { + "type": "boolean", + "const": true + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "viewRecord": { + "type": "object", + "required": [ + "uri", + "cid", + "author", + "value", + "indexedAt" + ], + "properties": { + "author": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileDataViewBasic" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "embeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "#recordEmbedView" + } + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "likeCount": { + "type": "integer" + }, + "quoteCount": { + "type": "integer" + }, + "replyCount": { + "type": "integer" + }, + "repostCount": { + "type": "integer" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "value": { + "type": "unknown", + "description": "The record data itself." + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_embed_video.json b/crates/weaver-api/lexicons/sh_weaver_embed_video.json new file mode 100644 index 0000000..e534dfa --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_embed_video.json @@ -0,0 +1,106 @@ +{ + "lexicon": 1, + "id": "sh.weaver.embed.video", + "description": "A video embedded in a Weaver record (eg, a notebook entry).", + "defs": { + "caption": { + "type": "object", + "required": [ + "lang", + "file" + ], + "properties": { + "file": { + "type": "blob", + "accept": [ + "text/vtt" + ], + "maxSize": 20000 + }, + "lang": { + "type": "string", + "format": "language" + } + } + }, + "main": { + "type": "object", + "required": [ + "videos" + ], + "properties": { + "videos": { + "type": "array", + "items": { + "type": "ref", + "ref": "#video" + } + } + } + }, + "video": { + "type": "object", + "required": [ + "video" + ], + "properties": { + "alt": { + "type": "string", + "description": "Alt text description of the video, for accessibility.", + "maxLength": 10000, + "maxGraphemes": 1000 + }, + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + }, + "captions": { + "type": "array", + "items": { + "type": "ref", + "ref": "#caption" + }, + "maxLength": 20 + }, + "video": { + "type": "blob", + "description": "The mp4 video file. May be up to 100mb, formerly limited to 50mb.", + "accept": [ + "video/mp4" + ], + "maxSize": 100000000 + } + } + }, + "view": { + "type": "object", + "required": [ + "cid", + "playlist" + ], + "properties": { + "alt": { + "type": "string", + "maxLength": 10000, + "maxGraphemes": 1000 + }, + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "playlist": { + "type": "string", + "format": "uri" + }, + "thumbnail": { + "type": "string", + "format": "uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_authors.json b/crates/weaver-api/lexicons/sh_weaver_notebook_authors.json new file mode 100644 index 0000000..89b377e --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_authors.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.authors", + "defs": { + "authorListItem": { + "type": "object", + "description": "A single author in a Weaver notebook.", + "required": [ + "profile, index" + ], + "properties": { + "index": { + "type": "integer" + }, + "profile": { + "type": "union", + "refs": [ + "app.bsky.actor.defs#profileViewBasic", + "sh.weaver.actor.defs#profileView" + ] + } + } + }, + "main": { + "type": "record", + "description": "Authors of a Weaver notebook.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "authorList" + ], + "properties": { + "authorList": { + "type": "array", + "items": { + "type": "ref", + "ref": "#authorListItem" + } + }, + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + } + } +} \ 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 new file mode 100644 index 0000000..bae28af --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_book.json @@ -0,0 +1,47 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.book", + "defs": { + "main": { + "type": "record", + "description": "Authors of a Weaver notebook.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "authors", + "entryList" + ], + "properties": { + "authors": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#author" + } + }, + "createdAt": { + "type": "string", + "description": "Client-declared timestamp when this was originally created.", + "format": "datetime" + }, + "entryList": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + }, + "tags": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#tags" + }, + "title": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#title" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_chapter.json b/crates/weaver-api/lexicons/sh_weaver_notebook_chapter.json new file mode 100644 index 0000000..23d86f5 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_chapter.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.chapter", + "defs": { + "main": { + "type": "record", + "description": "A grouping of entries in a notebook, intended to be displayed as a single page.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "notebook", + "authors", + "entryList" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Client-declared timestamp when this was originally created.", + "format": "datetime" + }, + "entryList": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + }, + "notebook": { + "type": "ref", + "description": "The notebook this page belongs to.", + "ref": "com.atproto.repo.strongRef" + }, + "tags": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#tags" + }, + "title": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#title" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json b/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json new file mode 100644 index 0000000..e9302c6 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json @@ -0,0 +1,202 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.defs", + "defs": { + "authorListView": { + "type": "object", + "required": [ + "profile", + "index" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "index": { + "type": "integer" + }, + "record": { + "type": "unknown" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "bookEntryRef": { + "type": "object", + "required": [ + "entry" + ], + "properties": { + "entry": { + "type": "ref", + "ref": "#entryView" + } + } + }, + "bookEntryView": { + "type": "object", + "description": "An ordered entry in a Weaver notebook.", + "required": [ + "entry", + "index" + ], + "properties": { + "entry": { + "type": "ref", + "ref": "#entryView" + }, + "index": { + "type": "integer" + }, + "next": { + "type": "ref", + "ref": "#bookEntryRef" + }, + "prev": { + "type": "ref", + "ref": "#bookEntryRef" + } + } + }, + "contentFormat": { + "type": "object", + "description": "The format of the content. This is used to determine how to render the content.", + "properties": { + "markdown": { + "type": "string", + "description": "The format of the content. This is used to determine how to render the content.", + "default": "weaver", + "enum": [ + "commonmark", + "gfm", + "obsidian", + "weaver" + ] + } + } + }, + "entryView": { + "type": "object", + "required": [ + "uri", + "cid", + "author", + "record", + "indexedAt" + ], + "properties": { + "authors": { + "type": "ref", + "ref": "#authorListView" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "record": { + "type": "unknown" + }, + "renderedView": { + "type": "ref", + "ref": "#renderedView" + }, + "tags": { + "type": "ref", + "ref": "#tags" + }, + "title": { + "type": "ref", + "ref": "#title" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "notebookView": { + "type": "object", + "required": [ + "uri", + "cid", + "author", + "record", + "indexedAt" + ], + "properties": { + "authors": { + "type": "ref", + "ref": "#authorListView" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "record": { + "type": "unknown" + }, + "tags": { + "type": "ref", + "ref": "#tags" + }, + "title": { + "type": "ref", + "ref": "#title" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "renderedView": { + "type": "object", + "description": "View of a rendered and cached notebook entry", + "required": [ + "html" + ], + "properties": { + "css": { + "type": "blob", + "accept": [ + "text/css" + ], + "maxSize": 1000000 + }, + "html": { + "type": "blob", + "accept": [ + "text/html" + ], + "maxSize": 1000000 + } + } + }, + "tags": { + "type": "array", + "description": "An array of tags associated with the notebook entry. Tags can help categorize and organize entries.", + "items": { + "type": "string", + "maxLength": 64 + }, + "maxLength": 10 + }, + "title": { + "type": "string", + "description": "The title of the notebook entry.", + "maxLength": 300 + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_entry.json b/crates/weaver-api/lexicons/sh_weaver_notebook_entry.json new file mode 100644 index 0000000..537df25 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_entry.json @@ -0,0 +1,68 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.entry", + "defs": { + "main": { + "type": "record", + "description": "A notebook entry", + "key": "tid", + "record": { + "type": "object", + "required": [ + "content", + "title", + "createdAt" + ], + "properties": { + "content": { + "type": "string", + "description": "The content of the notebook entry. This should be some flavor of Markdown.", + "maxLength": 200000 + }, + "createdAt": { + "type": "string", + "description": "Client-declared timestamp when this was originally created.", + "format": "datetime" + }, + "embeds": { + "type": "object", + "description": "The set of images and records, if any, embedded in the notebook entry.", + "properties": { + "externals": { + "type": "ref", + "ref": "sh.weaver.embed.external" + }, + "images": { + "type": "ref", + "ref": "sh.weaver.embed.images" + }, + "records": { + "type": "ref", + "ref": "sh.weaver.embed.records" + }, + "recordsWithMedia": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.embed.recordWithMedia" + } + }, + "videos": { + "type": "ref", + "ref": "sh.weaver.embed.video" + } + } + }, + "tags": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#tags" + }, + "title": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#title" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_publish_blob.json b/crates/weaver-api/lexicons/sh_weaver_publish_blob.json new file mode 100644 index 0000000..18bad19 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_publish_blob.json @@ -0,0 +1,27 @@ +{ + "lexicon": 1, + "id": "sh.weaver.publish.blob", + "defs": { + "main": { + "type": "record", + "description": "A simple record referencing a file hosted on a PDS", + "key": "tid", + "record": { + "type": "object", + "required": [ + "upload" + ], + "properties": { + "upload": { + "type": "blob", + "description": "Reference to the uploaded file", + "accept": [ + "*/*" + ], + "maxSize": 10000000 + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_publish_defs.json b/crates/weaver-api/lexicons/sh_weaver_publish_defs.json new file mode 100644 index 0000000..a0fcaf8 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_publish_defs.json @@ -0,0 +1,5 @@ +{ + "lexicon": 1, + "id": "sh.weaver.publish.defs", + "defs": {} +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_communication_createTemplate.json b/crates/weaver-api/lexicons/tools_ozone_communication_createTemplate.json new file mode 100644 index 0000000..884d208 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_communication_createTemplate.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "tools.ozone.communication.createTemplate", + "defs": { + "main": { + "type": "procedure", + "description": "Administrative action to create a new, re-usable communication (email for now) template.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject", + "contentMarkdown", + "name" + ], + "properties": { + "contentMarkdown": { + "type": "string", + "description": "Content of the template, markdown supported, can contain variable placeholders." + }, + "createdBy": { + "type": "string", + "description": "DID of the user who is creating the template.", + "format": "did" + }, + "lang": { + "type": "string", + "description": "Message language.", + "format": "language" + }, + "name": { + "type": "string", + "description": "Name of the template." + }, + "subject": { + "type": "string", + "description": "Subject of the message, used in emails." + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.communication.defs#templateView" + } + }, + "errors": [ + { + "name": "DuplicateTemplateName" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_communication_defs.json b/crates/weaver-api/lexicons/tools_ozone_communication_defs.json new file mode 100644 index 0000000..6c2cb3d --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_communication_defs.json @@ -0,0 +1,56 @@ +{ + "lexicon": 1, + "id": "tools.ozone.communication.defs", + "defs": { + "templateView": { + "type": "object", + "required": [ + "id", + "name", + "contentMarkdown", + "disabled", + "lastUpdatedBy", + "createdAt", + "updatedAt" + ], + "properties": { + "contentMarkdown": { + "type": "string", + "description": "Subject of the message, used in emails." + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "disabled": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "lang": { + "type": "string", + "description": "Message language.", + "format": "language" + }, + "lastUpdatedBy": { + "type": "string", + "description": "DID of the user who last updated the template.", + "format": "did" + }, + "name": { + "type": "string", + "description": "Name of the template." + }, + "subject": { + "type": "string", + "description": "Content of the template, can contain markdown and variable placeholders." + }, + "updatedAt": { + "type": "string", + "format": "datetime" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_communication_deleteTemplate.json b/crates/weaver-api/lexicons/tools_ozone_communication_deleteTemplate.json new file mode 100644 index 0000000..ac9929d --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_communication_deleteTemplate.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "tools.ozone.communication.deleteTemplate", + "defs": { + "main": { + "type": "procedure", + "description": "Delete a communication template.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_communication_listTemplates.json b/crates/weaver-api/lexicons/tools_ozone_communication_listTemplates.json new file mode 100644 index 0000000..6fb64cf --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_communication_listTemplates.json @@ -0,0 +1,28 @@ +{ + "lexicon": 1, + "id": "tools.ozone.communication.listTemplates", + "defs": { + "main": { + "type": "query", + "description": "Get list of all communication templates.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "communicationTemplates" + ], + "properties": { + "communicationTemplates": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.communication.defs#templateView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_communication_updateTemplate.json b/crates/weaver-api/lexicons/tools_ozone_communication_updateTemplate.json new file mode 100644 index 0000000..05869a5 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_communication_updateTemplate.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "tools.ozone.communication.updateTemplate", + "defs": { + "main": { + "type": "procedure", + "description": "Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "contentMarkdown": { + "type": "string", + "description": "Content of the template, markdown supported, can contain variable placeholders." + }, + "disabled": { + "type": "boolean" + }, + "id": { + "type": "string", + "description": "ID of the template to be updated." + }, + "lang": { + "type": "string", + "description": "Message language.", + "format": "language" + }, + "name": { + "type": "string", + "description": "Name of the template." + }, + "subject": { + "type": "string", + "description": "Subject of the message, used in emails." + }, + "updatedBy": { + "type": "string", + "description": "DID of the user who is updating the template.", + "format": "did" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.communication.defs#templateView" + } + }, + "errors": [ + { + "name": "DuplicateTemplateName" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_hosting_getAccountHistory.json b/crates/weaver-api/lexicons/tools_ozone_hosting_getAccountHistory.json new file mode 100644 index 0000000..5763366 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_hosting_getAccountHistory.json @@ -0,0 +1,144 @@ +{ + "lexicon": 1, + "id": "tools.ozone.hosting.getAccountHistory", + "defs": { + "accountCreated": { + "type": "object", + "required": [], + "properties": { + "email": { + "type": "string" + }, + "handle": { + "type": "string", + "format": "handle" + } + } + }, + "emailConfirmed": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string" + } + } + }, + "emailUpdated": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string" + } + } + }, + "event": { + "type": "object", + "required": [ + "details", + "createdBy", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string" + }, + "details": { + "type": "union", + "refs": [ + "#accountCreated", + "#emailUpdated", + "#emailConfirmed", + "#passwordUpdated", + "#handleUpdated" + ] + } + } + }, + "handleUpdated": { + "type": "object", + "required": [ + "handle" + ], + "properties": { + "handle": { + "type": "string", + "format": "handle" + } + } + }, + "main": { + "type": "query", + "description": "Get account history, e.g. log of updated email addresses or other identity information.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "cursor": { + "type": "string" + }, + "did": { + "type": "string", + "format": "did" + }, + "events": { + "type": "array", + "items": { + "type": "string", + "knownValues": [ + "accountCreated", + "emailUpdated", + "emailConfirmed", + "passwordUpdated", + "handleUpdated" + ] + } + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "cursor": { + "type": "string" + }, + "events": { + "type": "array", + "items": { + "type": "ref", + "ref": "#event" + } + } + } + } + } + }, + "passwordUpdated": { + "type": "object", + "required": [], + "properties": {} + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_cancelScheduledActions.json b/crates/weaver-api/lexicons/tools_ozone_moderation_cancelScheduledActions.json new file mode 100644 index 0000000..178a99f --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_cancelScheduledActions.json @@ -0,0 +1,85 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.cancelScheduledActions", + "defs": { + "cancellationResults": { + "type": "object", + "required": [ + "succeeded", + "failed" + ], + "properties": { + "failed": { + "type": "array", + "description": "DIDs for which cancellation failed with error details", + "items": { + "type": "ref", + "ref": "#failedCancellation" + } + }, + "succeeded": { + "type": "array", + "description": "DIDs for which all pending scheduled actions were successfully cancelled", + "items": { + "type": "string", + "format": "did" + } + } + } + }, + "failedCancellation": { + "type": "object", + "required": [ + "did", + "error" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "error": { + "type": "string" + }, + "errorCode": { + "type": "string" + } + } + }, + "main": { + "type": "procedure", + "description": "Cancel all pending scheduled moderation actions for specified subjects", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subjects" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment describing the reason for cancellation" + }, + "subjects": { + "type": "array", + "description": "Array of DID subjects to cancel scheduled actions for", + "items": { + "type": "string", + "format": "did" + }, + "maxLength": 100 + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "#cancellationResults" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_defs.json b/crates/weaver-api/lexicons/tools_ozone_moderation_defs.json new file mode 100644 index 0000000..26749a2 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_defs.json @@ -0,0 +1,1520 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.defs", + "defs": { + "accountEvent": { + "type": "object", + "description": "Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", + "required": [ + "timestamp", + "active" + ], + "properties": { + "active": { + "type": "boolean", + "description": "Indicates that the account has a repository which can be fetched from the host that emitted this event." + }, + "comment": { + "type": "string" + }, + "status": { + "type": "string", + "knownValues": [ + "unknown", + "deactivated", + "deleted", + "takendown", + "suspended", + "tombstoned" + ] + }, + "timestamp": { + "type": "string", + "format": "datetime" + } + } + }, + "accountHosting": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "deactivatedAt": { + "type": "string", + "format": "datetime" + }, + "deletedAt": { + "type": "string", + "format": "datetime" + }, + "reactivatedAt": { + "type": "string", + "format": "datetime" + }, + "status": { + "type": "string", + "knownValues": [ + "takendown", + "suspended", + "deleted", + "deactivated", + "unknown" + ] + }, + "updatedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "accountStats": { + "type": "object", + "description": "Statistics about a particular account subject", + "properties": { + "appealCount": { + "type": "integer", + "description": "Total number of appeals against a moderation action on the account" + }, + "escalateCount": { + "type": "integer", + "description": "Number of times the account was escalated" + }, + "reportCount": { + "type": "integer", + "description": "Total number of reports on the account" + }, + "suspendCount": { + "type": "integer", + "description": "Number of times the account was suspended" + }, + "takedownCount": { + "type": "integer", + "description": "Number of times the account was taken down" + } + } + }, + "accountStrike": { + "type": "object", + "description": "Strike information for an account", + "properties": { + "activeStrikeCount": { + "type": "integer", + "description": "Current number of active strikes (excluding expired strikes)" + }, + "firstStrikeAt": { + "type": "string", + "description": "Timestamp of the first strike received", + "format": "datetime" + }, + "lastStrikeAt": { + "type": "string", + "description": "Timestamp of the most recent strike received", + "format": "datetime" + }, + "totalStrikeCount": { + "type": "integer", + "description": "Total number of strikes ever received (including expired strikes)" + } + } + }, + "ageAssuranceEvent": { + "type": "object", + "description": "Age assurance info coming directly from users. Only works on DID subjects.", + "required": [ + "createdAt", + "status", + "attemptId" + ], + "properties": { + "attemptId": { + "type": "string", + "description": "The unique identifier for this instance of the age assurance flow, in UUID format." + }, + "completeIp": { + "type": "string", + "description": "The IP address used when completing the AA flow." + }, + "completeUa": { + "type": "string", + "description": "The user agent used when completing the AA flow." + }, + "createdAt": { + "type": "string", + "description": "The date and time of this write operation.", + "format": "datetime" + }, + "initIp": { + "type": "string", + "description": "The IP address used when initiating the AA flow." + }, + "initUa": { + "type": "string", + "description": "The user agent used when initiating the AA flow." + }, + "status": { + "type": "string", + "description": "The status of the age assurance process.", + "knownValues": [ + "unknown", + "pending", + "assured" + ] + } + } + }, + "ageAssuranceOverrideEvent": { + "type": "object", + "description": "Age assurance status override by moderators. Only works on DID subjects.", + "required": [ + "comment", + "status" + ], + "properties": { + "comment": { + "type": "string", + "description": "Comment describing the reason for the override." + }, + "status": { + "type": "string", + "description": "The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state.", + "knownValues": [ + "assured", + "reset", + "blocked" + ] + } + } + }, + "blobView": { + "type": "object", + "required": [ + "cid", + "mimeType", + "size", + "createdAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "details": { + "type": "union", + "refs": [ + "#imageDetails", + "#videoDetails" + ] + }, + "mimeType": { + "type": "string" + }, + "moderation": { + "type": "ref", + "ref": "#moderation" + }, + "size": { + "type": "integer" + } + } + }, + "cancelScheduledTakedownEvent": { + "type": "object", + "description": "Logs cancellation of a scheduled takedown action for an account.", + "properties": { + "comment": { + "type": "string" + } + } + }, + "identityEvent": { + "type": "object", + "description": "Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", + "required": [ + "timestamp" + ], + "properties": { + "comment": { + "type": "string" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "pdsHost": { + "type": "string", + "format": "uri" + }, + "timestamp": { + "type": "string", + "format": "datetime" + }, + "tombstone": { + "type": "boolean" + } + } + }, + "imageDetails": { + "type": "object", + "required": [ + "width", + "height" + ], + "properties": { + "height": { + "type": "integer" + }, + "width": { + "type": "integer" + } + } + }, + "modEventAcknowledge": { + "type": "object", + "properties": { + "acknowledgeAccountSubjects": { + "type": "boolean", + "description": "If true, all other reports on content authored by this account will be resolved (acknowledged)." + }, + "comment": { + "type": "string" + } + } + }, + "modEventComment": { + "type": "object", + "description": "Add a comment to a subject. An empty comment will clear any previously set sticky comment.", + "properties": { + "comment": { + "type": "string" + }, + "sticky": { + "type": "boolean", + "description": "Make the comment persistent on the subject" + } + } + }, + "modEventDivert": { + "type": "object", + "description": "Divert a record's blobs to a 3rd party service for further scanning/tagging", + "properties": { + "comment": { + "type": "string" + } + } + }, + "modEventEmail": { + "type": "object", + "description": "Keep a log of outgoing email to a user", + "required": [ + "subjectLine" + ], + "properties": { + "comment": { + "type": "string", + "description": "Additional comment about the outgoing comm." + }, + "content": { + "type": "string", + "description": "The content of the email sent to the user." + }, + "policies": { + "type": "array", + "description": "Names/Keywords of the policies that necessitated the email.", + "items": { + "type": "string" + }, + "maxLength": 5 + }, + "severityLevel": { + "type": "string", + "description": "Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense" + }, + "strikeCount": { + "type": "integer", + "description": "Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense." + }, + "strikeExpiresAt": { + "type": "string", + "description": "When the strike should expire. If not provided, the strike never expires.", + "format": "datetime" + }, + "subjectLine": { + "type": "string", + "description": "The subject line of the email sent to the user." + } + } + }, + "modEventEscalate": { + "type": "object", + "properties": { + "comment": { + "type": "string" + } + } + }, + "modEventLabel": { + "type": "object", + "description": "Apply/Negate labels on a subject", + "required": [ + "createLabelVals", + "negateLabelVals" + ], + "properties": { + "comment": { + "type": "string" + }, + "createLabelVals": { + "type": "array", + "items": { + "type": "string" + } + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the label will remain on the subject. Only applies on labels that are being added." + }, + "negateLabelVals": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "modEventMute": { + "type": "object", + "description": "Mute incoming reports on a subject", + "required": [ + "durationInHours" + ], + "properties": { + "comment": { + "type": "string" + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the subject should remain muted." + } + } + }, + "modEventMuteReporter": { + "type": "object", + "description": "Mute incoming reports from an account", + "properties": { + "comment": { + "type": "string" + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the account should remain muted. Falsy value here means a permanent mute." + } + } + }, + "modEventPriorityScore": { + "type": "object", + "description": "Set priority score of the subject. Higher score means higher priority.", + "required": [ + "score" + ], + "properties": { + "comment": { + "type": "string" + }, + "score": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + }, + "modEventReport": { + "type": "object", + "description": "Report a subject", + "required": [ + "reportType" + ], + "properties": { + "comment": { + "type": "string" + }, + "isReporterMuted": { + "type": "boolean", + "description": "Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject." + }, + "reportType": { + "type": "ref", + "ref": "com.atproto.moderation.defs#reasonType" + } + } + }, + "modEventResolveAppeal": { + "type": "object", + "description": "Resolve appeal on a subject", + "properties": { + "comment": { + "type": "string", + "description": "Describe resolution." + } + } + }, + "modEventReverseTakedown": { + "type": "object", + "description": "Revert take down action on a subject", + "properties": { + "comment": { + "type": "string", + "description": "Describe reasoning behind the reversal." + }, + "policies": { + "type": "array", + "description": "Names/Keywords of the policy infraction for which takedown is being reversed.", + "items": { + "type": "string" + }, + "maxLength": 5 + }, + "severityLevel": { + "type": "string", + "description": "Severity level of the violation. Usually set from the last policy infraction's severity." + }, + "strikeCount": { + "type": "integer", + "description": "Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity." + } + } + }, + "modEventTag": { + "type": "object", + "description": "Add/Remove a tag on a subject", + "required": [ + "add", + "remove" + ], + "properties": { + "add": { + "type": "array", + "description": "Tags to be added to the subject. If already exists, won't be duplicated.", + "items": { + "type": "string" + } + }, + "comment": { + "type": "string", + "description": "Additional comment about added/removed tags." + }, + "remove": { + "type": "array", + "description": "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated.", + "items": { + "type": "string" + } + } + } + }, + "modEventTakedown": { + "type": "object", + "description": "Take down a subject permanently or temporarily", + "properties": { + "acknowledgeAccountSubjects": { + "type": "boolean", + "description": "If true, all other reports on content authored by this account will be resolved (acknowledged)." + }, + "comment": { + "type": "string" + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the takedown should be in effect before automatically expiring." + }, + "policies": { + "type": "array", + "description": "Names/Keywords of the policies that drove the decision.", + "items": { + "type": "string" + }, + "maxLength": 5 + }, + "severityLevel": { + "type": "string", + "description": "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.)." + }, + "strikeCount": { + "type": "integer", + "description": "Number of strikes to assign to the user for this violation." + }, + "strikeExpiresAt": { + "type": "string", + "description": "When the strike should expire. If not provided, the strike never expires.", + "format": "datetime" + } + } + }, + "modEventUnmute": { + "type": "object", + "description": "Unmute action on a subject", + "properties": { + "comment": { + "type": "string", + "description": "Describe reasoning behind the reversal." + } + } + }, + "modEventUnmuteReporter": { + "type": "object", + "description": "Unmute incoming reports from an account", + "properties": { + "comment": { + "type": "string", + "description": "Describe reasoning behind the reversal." + } + } + }, + "modEventView": { + "type": "object", + "required": [ + "id", + "event", + "subject", + "subjectBlobCids", + "createdBy", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "format": "did" + }, + "creatorHandle": { + "type": "string" + }, + "event": { + "type": "union", + "refs": [ + "#modEventTakedown", + "#modEventReverseTakedown", + "#modEventComment", + "#modEventReport", + "#modEventLabel", + "#modEventAcknowledge", + "#modEventEscalate", + "#modEventMute", + "#modEventUnmute", + "#modEventMuteReporter", + "#modEventUnmuteReporter", + "#modEventEmail", + "#modEventResolveAppeal", + "#modEventDivert", + "#modEventTag", + "#accountEvent", + "#identityEvent", + "#recordEvent", + "#modEventPriorityScore", + "#ageAssuranceEvent", + "#ageAssuranceOverrideEvent", + "#revokeAccountCredentialsEvent", + "#scheduleTakedownEvent", + "#cancelScheduledTakedownEvent" + ] + }, + "id": { + "type": "integer" + }, + "modTool": { + "type": "ref", + "ref": "#modTool" + }, + "subject": { + "type": "union", + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "chat.bsky.convo.defs#messageRef" + ] + }, + "subjectBlobCids": { + "type": "array", + "items": { + "type": "string" + } + }, + "subjectHandle": { + "type": "string" + } + } + }, + "modEventViewDetail": { + "type": "object", + "required": [ + "id", + "event", + "subject", + "subjectBlobs", + "createdBy", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "format": "did" + }, + "event": { + "type": "union", + "refs": [ + "#modEventTakedown", + "#modEventReverseTakedown", + "#modEventComment", + "#modEventReport", + "#modEventLabel", + "#modEventAcknowledge", + "#modEventEscalate", + "#modEventMute", + "#modEventUnmute", + "#modEventMuteReporter", + "#modEventUnmuteReporter", + "#modEventEmail", + "#modEventResolveAppeal", + "#modEventDivert", + "#modEventTag", + "#accountEvent", + "#identityEvent", + "#recordEvent", + "#modEventPriorityScore", + "#ageAssuranceEvent", + "#ageAssuranceOverrideEvent", + "#revokeAccountCredentialsEvent", + "#scheduleTakedownEvent", + "#cancelScheduledTakedownEvent" + ] + }, + "id": { + "type": "integer" + }, + "modTool": { + "type": "ref", + "ref": "#modTool" + }, + "subject": { + "type": "union", + "refs": [ + "#repoView", + "#repoViewNotFound", + "#recordView", + "#recordViewNotFound" + ] + }, + "subjectBlobs": { + "type": "array", + "items": { + "type": "ref", + "ref": "#blobView" + } + } + } + }, + "modTool": { + "type": "object", + "description": "Moderation tool information for tracing the source of the action", + "required": [ + "name" + ], + "properties": { + "meta": { + "type": "unknown", + "description": "Additional arbitrary metadata about the source" + }, + "name": { + "type": "string", + "description": "Name/identifier of the source (e.g., 'automod', 'ozone/workspace')" + } + } + }, + "moderation": { + "type": "object", + "properties": { + "subjectStatus": { + "type": "ref", + "ref": "#subjectStatusView" + } + } + }, + "moderationDetail": { + "type": "object", + "properties": { + "subjectStatus": { + "type": "ref", + "ref": "#subjectStatusView" + } + } + }, + "recordEvent": { + "type": "object", + "description": "Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", + "required": [ + "timestamp", + "op" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "comment": { + "type": "string" + }, + "op": { + "type": "string", + "knownValues": [ + "create", + "update", + "delete" + ] + }, + "timestamp": { + "type": "string", + "format": "datetime" + } + } + }, + "recordHosting": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "deletedAt": { + "type": "string", + "format": "datetime" + }, + "status": { + "type": "string", + "knownValues": [ + "deleted", + "unknown" + ] + }, + "updatedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "recordView": { + "type": "object", + "required": [ + "uri", + "cid", + "value", + "blobCids", + "indexedAt", + "moderation", + "repo" + ], + "properties": { + "blobCids": { + "type": "array", + "items": { + "type": "string", + "format": "cid" + } + }, + "cid": { + "type": "string", + "format": "cid" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "moderation": { + "type": "ref", + "ref": "#moderation" + }, + "repo": { + "type": "ref", + "ref": "#repoView" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "value": { + "type": "unknown" + } + } + }, + "recordViewDetail": { + "type": "object", + "required": [ + "uri", + "cid", + "value", + "blobs", + "indexedAt", + "moderation", + "repo" + ], + "properties": { + "blobs": { + "type": "array", + "items": { + "type": "ref", + "ref": "#blobView" + } + }, + "cid": { + "type": "string", + "format": "cid" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "moderation": { + "type": "ref", + "ref": "#moderationDetail" + }, + "repo": { + "type": "ref", + "ref": "#repoView" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "value": { + "type": "unknown" + } + } + }, + "recordViewNotFound": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "recordsStats": { + "type": "object", + "description": "Statistics about a set of record subject items", + "properties": { + "appealedCount": { + "type": "integer", + "description": "Number of items that were appealed at least once" + }, + "escalatedCount": { + "type": "integer", + "description": "Number of items that were escalated at least once" + }, + "pendingCount": { + "type": "integer", + "description": "Number of item currently in \"reviewOpen\" or \"reviewEscalated\" state" + }, + "processedCount": { + "type": "integer", + "description": "Number of item currently in \"reviewNone\" or \"reviewClosed\" state" + }, + "reportedCount": { + "type": "integer", + "description": "Number of items that were reported at least once" + }, + "subjectCount": { + "type": "integer", + "description": "Total number of item in the set" + }, + "takendownCount": { + "type": "integer", + "description": "Number of item currently taken down" + }, + "totalReports": { + "type": "integer", + "description": "Cumulative sum of the number of reports on the items in the set" + } + } + }, + "repoView": { + "type": "object", + "required": [ + "did", + "handle", + "relatedRecords", + "indexedAt", + "moderation" + ], + "properties": { + "deactivatedAt": { + "type": "string", + "format": "datetime" + }, + "did": { + "type": "string", + "format": "did" + }, + "email": { + "type": "string" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "inviteNote": { + "type": "string" + }, + "invitedBy": { + "type": "ref", + "ref": "com.atproto.server.defs#inviteCode" + }, + "invitesDisabled": { + "type": "boolean" + }, + "moderation": { + "type": "ref", + "ref": "#moderation" + }, + "relatedRecords": { + "type": "array", + "items": { + "type": "unknown" + } + }, + "threatSignatures": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.admin.defs#threatSignature" + } + } + } + }, + "repoViewDetail": { + "type": "object", + "required": [ + "did", + "handle", + "relatedRecords", + "indexedAt", + "moderation" + ], + "properties": { + "deactivatedAt": { + "type": "string", + "format": "datetime" + }, + "did": { + "type": "string", + "format": "did" + }, + "email": { + "type": "string" + }, + "emailConfirmedAt": { + "type": "string", + "format": "datetime" + }, + "handle": { + "type": "string", + "format": "handle" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "inviteNote": { + "type": "string" + }, + "invitedBy": { + "type": "ref", + "ref": "com.atproto.server.defs#inviteCode" + }, + "invites": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.server.defs#inviteCode" + } + }, + "invitesDisabled": { + "type": "boolean" + }, + "labels": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.label.defs#label" + } + }, + "moderation": { + "type": "ref", + "ref": "#moderationDetail" + }, + "relatedRecords": { + "type": "array", + "items": { + "type": "unknown" + } + }, + "threatSignatures": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.admin.defs#threatSignature" + } + } + } + }, + "repoViewNotFound": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "reporterStats": { + "type": "object", + "required": [ + "did", + "accountReportCount", + "recordReportCount", + "reportedAccountCount", + "reportedRecordCount", + "takendownAccountCount", + "takendownRecordCount", + "labeledAccountCount", + "labeledRecordCount" + ], + "properties": { + "accountReportCount": { + "type": "integer", + "description": "The total number of reports made by the user on accounts." + }, + "did": { + "type": "string", + "format": "did" + }, + "labeledAccountCount": { + "type": "integer", + "description": "The total number of accounts labeled as a result of the user's reports." + }, + "labeledRecordCount": { + "type": "integer", + "description": "The total number of records labeled as a result of the user's reports." + }, + "recordReportCount": { + "type": "integer", + "description": "The total number of reports made by the user on records." + }, + "reportedAccountCount": { + "type": "integer", + "description": "The total number of accounts reported by the user." + }, + "reportedRecordCount": { + "type": "integer", + "description": "The total number of records reported by the user." + }, + "takendownAccountCount": { + "type": "integer", + "description": "The total number of accounts taken down as a result of the user's reports." + }, + "takendownRecordCount": { + "type": "integer", + "description": "The total number of records taken down as a result of the user's reports." + } + } + }, + "reviewClosed": { + "type": "token", + "description": "Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator" + }, + "reviewEscalated": { + "type": "token", + "description": "Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator" + }, + "reviewNone": { + "type": "token", + "description": "Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it" + }, + "reviewOpen": { + "type": "token", + "description": "Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator" + }, + "revokeAccountCredentialsEvent": { + "type": "object", + "description": "Account credentials revocation by moderators. Only works on DID subjects.", + "required": [ + "comment" + ], + "properties": { + "comment": { + "type": "string", + "description": "Comment describing the reason for the revocation." + } + } + }, + "scheduleTakedownEvent": { + "type": "object", + "description": "Logs a scheduled takedown action for an account.", + "properties": { + "comment": { + "type": "string" + }, + "executeAfter": { + "type": "string", + "format": "datetime" + }, + "executeAt": { + "type": "string", + "format": "datetime" + }, + "executeUntil": { + "type": "string", + "format": "datetime" + } + } + }, + "scheduledActionView": { + "type": "object", + "description": "View of a scheduled moderation action", + "required": [ + "id", + "action", + "did", + "createdBy", + "createdAt", + "status" + ], + "properties": { + "action": { + "type": "string", + "description": "Type of action to be executed", + "knownValues": [ + "takedown" + ] + }, + "createdAt": { + "type": "string", + "description": "When the scheduled action was created", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "description": "DID of the user who created this scheduled action", + "format": "did" + }, + "did": { + "type": "string", + "description": "Subject DID for the action", + "format": "did" + }, + "eventData": { + "type": "unknown", + "description": "Serialized event object that will be propagated to the event when performed" + }, + "executeAfter": { + "type": "string", + "description": "Earliest time to execute the action (for randomized scheduling)", + "format": "datetime" + }, + "executeAt": { + "type": "string", + "description": "Exact time to execute the action", + "format": "datetime" + }, + "executeUntil": { + "type": "string", + "description": "Latest time to execute the action (for randomized scheduling)", + "format": "datetime" + }, + "executionEventId": { + "type": "integer", + "description": "ID of the moderation event created when action was successfully executed" + }, + "id": { + "type": "integer", + "description": "Auto-incrementing row ID" + }, + "lastExecutedAt": { + "type": "string", + "description": "When the action was last attempted to be executed", + "format": "datetime" + }, + "lastFailureReason": { + "type": "string", + "description": "Reason for the last execution failure" + }, + "randomizeExecution": { + "type": "boolean", + "description": "Whether execution time should be randomized within the specified range" + }, + "status": { + "type": "string", + "description": "Current status of the scheduled action", + "knownValues": [ + "pending", + "executed", + "cancelled", + "failed" + ] + }, + "updatedAt": { + "type": "string", + "description": "When the scheduled action was last updated", + "format": "datetime" + } + } + }, + "subjectReviewState": { + "type": "string", + "knownValues": [ + "#reviewOpen", + "#reviewEscalated", + "#reviewClosed", + "#reviewNone" + ] + }, + "subjectStatusView": { + "type": "object", + "required": [ + "id", + "subject", + "createdAt", + "updatedAt", + "reviewState" + ], + "properties": { + "accountStats": { + "type": "ref", + "description": "Statistics related to the account subject", + "ref": "#accountStats" + }, + "accountStrike": { + "type": "ref", + "description": "Strike information for the account (account-level only)", + "ref": "#accountStrike" + }, + "ageAssuranceState": { + "type": "string", + "description": "Current age assurance state of the subject.", + "knownValues": [ + "pending", + "assured", + "unknown", + "reset", + "blocked" + ] + }, + "ageAssuranceUpdatedBy": { + "type": "string", + "description": "Whether or not the last successful update to age assurance was made by the user or admin.", + "knownValues": [ + "admin", + "user" + ] + }, + "appealed": { + "type": "boolean", + "description": "True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators." + }, + "comment": { + "type": "string", + "description": "Sticky comment on the subject." + }, + "createdAt": { + "type": "string", + "description": "Timestamp referencing the first moderation status impacting event was emitted on the subject", + "format": "datetime" + }, + "hosting": { + "type": "union", + "refs": [ + "#accountHosting", + "#recordHosting" + ] + }, + "id": { + "type": "integer" + }, + "lastAppealedAt": { + "type": "string", + "description": "Timestamp referencing when the author of the subject appealed a moderation action", + "format": "datetime" + }, + "lastReportedAt": { + "type": "string", + "format": "datetime" + }, + "lastReviewedAt": { + "type": "string", + "format": "datetime" + }, + "lastReviewedBy": { + "type": "string", + "format": "did" + }, + "muteReportingUntil": { + "type": "string", + "format": "datetime" + }, + "muteUntil": { + "type": "string", + "format": "datetime" + }, + "priorityScore": { + "type": "integer", + "description": "Numeric value representing the level of priority. Higher score means higher priority.", + "minimum": 0, + "maximum": 100 + }, + "recordsStats": { + "type": "ref", + "description": "Statistics related to the record subjects authored by the subject's account", + "ref": "#recordsStats" + }, + "reviewState": { + "type": "ref", + "ref": "#subjectReviewState" + }, + "subject": { + "type": "union", + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef", + "chat.bsky.convo.defs#messageRef" + ] + }, + "subjectBlobCids": { + "type": "array", + "items": { + "type": "string", + "format": "cid" + } + }, + "subjectRepoHandle": { + "type": "string" + }, + "suspendUntil": { + "type": "string", + "format": "datetime" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "takendown": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "description": "Timestamp referencing when the last update was made to the moderation status of the subject", + "format": "datetime" + } + } + }, + "subjectView": { + "type": "object", + "description": "Detailed view of a subject. For record subjects, the author's repo and profile will be returned.", + "required": [ + "type", + "subject" + ], + "properties": { + "profile": { + "type": "union", + "refs": [] + }, + "record": { + "type": "ref", + "ref": "#recordViewDetail" + }, + "repo": { + "type": "ref", + "ref": "#repoViewDetail" + }, + "status": { + "type": "ref", + "ref": "#subjectStatusView" + }, + "subject": { + "type": "string" + }, + "type": { + "type": "ref", + "ref": "com.atproto.moderation.defs#subjectType" + } + } + }, + "timelineEventPlcCreate": { + "type": "token", + "description": "Moderation event timeline event for a PLC create operation" + }, + "timelineEventPlcOperation": { + "type": "token", + "description": "Moderation event timeline event for generic PLC operation" + }, + "timelineEventPlcTombstone": { + "type": "token", + "description": "Moderation event timeline event for a PLC tombstone operation" + }, + "videoDetails": { + "type": "object", + "required": [ + "width", + "height", + "length" + ], + "properties": { + "height": { + "type": "integer" + }, + "length": { + "type": "integer" + }, + "width": { + "type": "integer" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_emitEvent.json b/crates/weaver-api/lexicons/tools_ozone_moderation_emitEvent.json new file mode 100644 index 0000000..2cd5ba0 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_emitEvent.json @@ -0,0 +1,94 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.emitEvent", + "defs": { + "main": { + "type": "procedure", + "description": "Take a moderation action on an actor.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "event", + "subject", + "createdBy" + ], + "properties": { + "createdBy": { + "type": "string", + "format": "did" + }, + "event": { + "type": "union", + "refs": [ + "tools.ozone.moderation.defs#modEventTakedown", + "tools.ozone.moderation.defs#modEventAcknowledge", + "tools.ozone.moderation.defs#modEventEscalate", + "tools.ozone.moderation.defs#modEventComment", + "tools.ozone.moderation.defs#modEventLabel", + "tools.ozone.moderation.defs#modEventReport", + "tools.ozone.moderation.defs#modEventMute", + "tools.ozone.moderation.defs#modEventUnmute", + "tools.ozone.moderation.defs#modEventMuteReporter", + "tools.ozone.moderation.defs#modEventUnmuteReporter", + "tools.ozone.moderation.defs#modEventReverseTakedown", + "tools.ozone.moderation.defs#modEventResolveAppeal", + "tools.ozone.moderation.defs#modEventEmail", + "tools.ozone.moderation.defs#modEventDivert", + "tools.ozone.moderation.defs#modEventTag", + "tools.ozone.moderation.defs#accountEvent", + "tools.ozone.moderation.defs#identityEvent", + "tools.ozone.moderation.defs#recordEvent", + "tools.ozone.moderation.defs#modEventPriorityScore", + "tools.ozone.moderation.defs#ageAssuranceEvent", + "tools.ozone.moderation.defs#ageAssuranceOverrideEvent", + "tools.ozone.moderation.defs#revokeAccountCredentialsEvent", + "tools.ozone.moderation.defs#scheduleTakedownEvent", + "tools.ozone.moderation.defs#cancelScheduledTakedownEvent" + ] + }, + "externalId": { + "type": "string", + "description": "An optional external ID for the event, used to deduplicate events from external systems. Fails when an event of same type with the same external ID exists for the same subject." + }, + "modTool": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#modTool" + }, + "subject": { + "type": "union", + "refs": [ + "com.atproto.admin.defs#repoRef", + "com.atproto.repo.strongRef" + ] + }, + "subjectBlobCids": { + "type": "array", + "items": { + "type": "string", + "format": "cid" + } + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#modEventView" + } + }, + "errors": [ + { + "name": "SubjectHasAction" + }, + { + "description": "An event with the same external ID already exists for the subject.", + "name": "DuplicateExternalId" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_getAccountTimeline.json b/crates/weaver-api/lexicons/tools_ozone_moderation_getAccountTimeline.json new file mode 100644 index 0000000..352cda4 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_getAccountTimeline.json @@ -0,0 +1,121 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.getAccountTimeline", + "defs": { + "main": { + "type": "query", + "description": "Get timeline of all available events of an account. This includes moderation events, account history and did history.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "timeline" + ], + "properties": { + "timeline": { + "type": "array", + "items": { + "type": "ref", + "ref": "#timelineItem" + } + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound" + } + ] + }, + "timelineItem": { + "type": "object", + "required": [ + "day", + "summary" + ], + "properties": { + "day": { + "type": "string" + }, + "summary": { + "type": "array", + "items": { + "type": "ref", + "ref": "#timelineItemSummary" + } + } + } + }, + "timelineItemSummary": { + "type": "object", + "required": [ + "eventSubjectType", + "eventType", + "count" + ], + "properties": { + "count": { + "type": "integer" + }, + "eventSubjectType": { + "type": "string", + "knownValues": [ + "account", + "record", + "chat" + ] + }, + "eventType": { + "type": "string", + "knownValues": [ + "tools.ozone.moderation.defs#modEventTakedown", + "tools.ozone.moderation.defs#modEventReverseTakedown", + "tools.ozone.moderation.defs#modEventComment", + "tools.ozone.moderation.defs#modEventReport", + "tools.ozone.moderation.defs#modEventLabel", + "tools.ozone.moderation.defs#modEventAcknowledge", + "tools.ozone.moderation.defs#modEventEscalate", + "tools.ozone.moderation.defs#modEventMute", + "tools.ozone.moderation.defs#modEventUnmute", + "tools.ozone.moderation.defs#modEventMuteReporter", + "tools.ozone.moderation.defs#modEventUnmuteReporter", + "tools.ozone.moderation.defs#modEventEmail", + "tools.ozone.moderation.defs#modEventResolveAppeal", + "tools.ozone.moderation.defs#modEventDivert", + "tools.ozone.moderation.defs#modEventTag", + "tools.ozone.moderation.defs#accountEvent", + "tools.ozone.moderation.defs#identityEvent", + "tools.ozone.moderation.defs#recordEvent", + "tools.ozone.moderation.defs#modEventPriorityScore", + "tools.ozone.moderation.defs#revokeAccountCredentialsEvent", + "tools.ozone.moderation.defs#ageAssuranceEvent", + "tools.ozone.moderation.defs#ageAssuranceOverrideEvent", + "tools.ozone.moderation.defs#timelineEventPlcCreate", + "tools.ozone.moderation.defs#timelineEventPlcOperation", + "tools.ozone.moderation.defs#timelineEventPlcTombstone", + "tools.ozone.hosting.getAccountHistory#accountCreated", + "tools.ozone.hosting.getAccountHistory#emailConfirmed", + "tools.ozone.hosting.getAccountHistory#passwordUpdated", + "tools.ozone.hosting.getAccountHistory#handleUpdated", + "tools.ozone.moderation.defs#scheduleTakedownEvent", + "tools.ozone.moderation.defs#cancelScheduledTakedownEvent" + ] + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_getEvent.json b/crates/weaver-api/lexicons/tools_ozone_moderation_getEvent.json new file mode 100644 index 0000000..4b6da84 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_getEvent.json @@ -0,0 +1,28 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.getEvent", + "defs": { + "main": { + "type": "query", + "description": "Get details about a moderation event.", + "parameters": { + "type": "params", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "integer" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#modEventViewDetail" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_getRecord.json b/crates/weaver-api/lexicons/tools_ozone_moderation_getRecord.json new file mode 100644 index 0000000..9552106 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_getRecord.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.getRecord", + "defs": { + "main": { + "type": "query", + "description": "Get details about a record.", + "parameters": { + "type": "params", + "required": [ + "uri" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#recordViewDetail" + } + }, + "errors": [ + { + "name": "RecordNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_getRecords.json b/crates/weaver-api/lexicons/tools_ozone_moderation_getRecords.json new file mode 100644 index 0000000..a8605eb --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_getRecords.json @@ -0,0 +1,47 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.getRecords", + "defs": { + "main": { + "type": "query", + "description": "Get details about some records.", + "parameters": { + "type": "params", + "required": [ + "uris" + ], + "properties": { + "uris": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + }, + "maxLength": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "records" + ], + "properties": { + "records": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "tools.ozone.moderation.defs#recordViewDetail", + "tools.ozone.moderation.defs#recordViewNotFound" + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_getRepo.json b/crates/weaver-api/lexicons/tools_ozone_moderation_getRepo.json new file mode 100644 index 0000000..ba8d7c9 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_getRepo.json @@ -0,0 +1,34 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.getRepo", + "defs": { + "main": { + "type": "query", + "description": "Get details about a repository.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#repoViewDetail" + } + }, + "errors": [ + { + "name": "RepoNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_getReporterStats.json b/crates/weaver-api/lexicons/tools_ozone_moderation_getReporterStats.json new file mode 100644 index 0000000..9198454 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_getReporterStats.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.getReporterStats", + "defs": { + "main": { + "type": "query", + "description": "Get reporter stats for a list of users.", + "parameters": { + "type": "params", + "required": [ + "dids" + ], + "properties": { + "dids": { + "type": "array", + "items": { + "type": "string", + "format": "did" + }, + "maxLength": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "stats" + ], + "properties": { + "stats": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#reporterStats" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_getRepos.json b/crates/weaver-api/lexicons/tools_ozone_moderation_getRepos.json new file mode 100644 index 0000000..4c8a5d3 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_getRepos.json @@ -0,0 +1,47 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.getRepos", + "defs": { + "main": { + "type": "query", + "description": "Get details about some repositories.", + "parameters": { + "type": "params", + "required": [ + "dids" + ], + "properties": { + "dids": { + "type": "array", + "items": { + "type": "string", + "format": "did" + }, + "maxLength": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repos" + ], + "properties": { + "repos": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "tools.ozone.moderation.defs#repoViewDetail", + "tools.ozone.moderation.defs#repoViewNotFound" + ] + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_getSubjects.json b/crates/weaver-api/lexicons/tools_ozone_moderation_getSubjects.json new file mode 100644 index 0000000..3a41aa5 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_getSubjects.json @@ -0,0 +1,44 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.getSubjects", + "defs": { + "main": { + "type": "query", + "description": "Get details about subjects.", + "parameters": { + "type": "params", + "required": [ + "subjects" + ], + "properties": { + "subjects": { + "type": "array", + "items": { + "type": "string" + }, + "minLength": 1, + "maxLength": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subjects" + ], + "properties": { + "subjects": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#subjectView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_listScheduledActions.json b/crates/weaver-api/lexicons/tools_ozone_moderation_listScheduledActions.json new file mode 100644 index 0000000..22a9d41 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_listScheduledActions.json @@ -0,0 +1,87 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.listScheduledActions", + "defs": { + "main": { + "type": "procedure", + "description": "List scheduled moderation actions with optional filtering", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "statuses" + ], + "properties": { + "cursor": { + "type": "string", + "description": "Cursor for pagination" + }, + "endsBefore": { + "type": "string", + "description": "Filter actions scheduled to execute before this time", + "format": "datetime" + }, + "limit": { + "type": "integer", + "description": "Maximum number of results to return", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "startsAfter": { + "type": "string", + "description": "Filter actions scheduled to execute after this time", + "format": "datetime" + }, + "statuses": { + "type": "array", + "description": "Filter actions by status", + "items": { + "type": "string", + "knownValues": [ + "pending", + "executed", + "cancelled", + "failed" + ] + }, + "minLength": 1 + }, + "subjects": { + "type": "array", + "description": "Filter actions for specific DID subjects", + "items": { + "type": "string", + "format": "did" + }, + "maxLength": 100 + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actions" + ], + "properties": { + "actions": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#scheduledActionView" + } + }, + "cursor": { + "type": "string", + "description": "Cursor for next page of results" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_queryEvents.json b/crates/weaver-api/lexicons/tools_ozone_moderation_queryEvents.json new file mode 100644 index 0000000..b85f745 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_queryEvents.json @@ -0,0 +1,176 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.queryEvents", + "defs": { + "main": { + "type": "query", + "description": "List moderation events related to a subject.", + "parameters": { + "type": "params", + "properties": { + "addedLabels": { + "type": "array", + "description": "If specified, only events where all of these labels were added are returned", + "items": { + "type": "string" + } + }, + "addedTags": { + "type": "array", + "description": "If specified, only events where all of these tags were added are returned", + "items": { + "type": "string" + } + }, + "ageAssuranceState": { + "type": "string", + "description": "If specified, only events where the age assurance state matches the given value are returned", + "knownValues": [ + "pending", + "assured", + "unknown", + "reset", + "blocked" + ] + }, + "batchId": { + "type": "string", + "description": "If specified, only events where the batchId matches the given value are returned" + }, + "collections": { + "type": "array", + "description": "If specified, only events where the subject belongs to the given collections will be returned. When subjectType is set to 'account', this will be ignored.", + "items": { + "type": "string", + "format": "nsid" + }, + "maxLength": 20 + }, + "comment": { + "type": "string", + "description": "If specified, only events with comments containing the keyword are returned. Apply || separator to use multiple keywords and match using OR condition." + }, + "createdAfter": { + "type": "string", + "description": "Retrieve events created after a given timestamp", + "format": "datetime" + }, + "createdBefore": { + "type": "string", + "description": "Retrieve events created before a given timestamp", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "format": "did" + }, + "cursor": { + "type": "string" + }, + "hasComment": { + "type": "boolean", + "description": "If true, only events with comments are returned" + }, + "includeAllUserRecords": { + "type": "boolean", + "description": "If true, events on all record types (posts, lists, profile etc.) or records from given 'collections' param, owned by the did are returned.", + "default": false + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "modTool": { + "type": "array", + "description": "If specified, only events where the modTool name matches any of the given values are returned", + "items": { + "type": "string" + } + }, + "policies": { + "type": "array", + "items": { + "type": "string", + "description": "If specified, only events where the action policies match any of the given policies are returned" + } + }, + "removedLabels": { + "type": "array", + "description": "If specified, only events where all of these labels were removed are returned", + "items": { + "type": "string" + } + }, + "removedTags": { + "type": "array", + "description": "If specified, only events where all of these tags were removed are returned", + "items": { + "type": "string" + } + }, + "reportTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "sortDirection": { + "type": "string", + "description": "Sort direction for the events. Defaults to descending order of created at timestamp.", + "default": "desc", + "enum": [ + "asc", + "desc" + ] + }, + "subject": { + "type": "string", + "format": "uri" + }, + "subjectType": { + "type": "string", + "description": "If specified, only events where the subject is of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.", + "knownValues": [ + "account", + "record" + ] + }, + "types": { + "type": "array", + "description": "The types of events (fully qualified string in the format of tools.ozone.moderation.defs#modEvent) to filter by. If not specified, all events are returned.", + "items": { + "type": "string" + } + }, + "withStrike": { + "type": "boolean", + "description": "If specified, only events where strikeCount value is set are returned." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "cursor": { + "type": "string" + }, + "events": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#modEventView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_queryStatuses.json b/crates/weaver-api/lexicons/tools_ozone_moderation_queryStatuses.json new file mode 100644 index 0000000..203868d --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_queryStatuses.json @@ -0,0 +1,233 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.queryStatuses", + "defs": { + "main": { + "type": "query", + "description": "View moderation statuses of subjects (record or repo).", + "parameters": { + "type": "params", + "properties": { + "ageAssuranceState": { + "type": "string", + "description": "If specified, only subjects with the given age assurance state will be returned.", + "knownValues": [ + "pending", + "assured", + "unknown", + "reset", + "blocked" + ] + }, + "appealed": { + "type": "boolean", + "description": "Get subjects in unresolved appealed status" + }, + "collections": { + "type": "array", + "description": "If specified, subjects belonging to the given collections will be returned. When subjectType is set to 'account', this will be ignored.", + "items": { + "type": "string", + "format": "nsid" + }, + "maxLength": 20 + }, + "comment": { + "type": "string", + "description": "Search subjects by keyword from comments" + }, + "cursor": { + "type": "string" + }, + "excludeTags": { + "type": "array", + "items": { + "type": "string" + } + }, + "hostingDeletedAfter": { + "type": "string", + "description": "Search subjects where the associated record/account was deleted after a given timestamp", + "format": "datetime" + }, + "hostingDeletedBefore": { + "type": "string", + "description": "Search subjects where the associated record/account was deleted before a given timestamp", + "format": "datetime" + }, + "hostingStatuses": { + "type": "array", + "description": "Search subjects by the status of the associated record/account", + "items": { + "type": "string" + } + }, + "hostingUpdatedAfter": { + "type": "string", + "description": "Search subjects where the associated record/account was updated after a given timestamp", + "format": "datetime" + }, + "hostingUpdatedBefore": { + "type": "string", + "description": "Search subjects where the associated record/account was updated before a given timestamp", + "format": "datetime" + }, + "ignoreSubjects": { + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + }, + "includeAllUserRecords": { + "type": "boolean", + "description": "All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned." + }, + "includeMuted": { + "type": "boolean", + "description": "By default, we don't include muted subjects in the results. Set this to true to include them." + }, + "lastReviewedBy": { + "type": "string", + "description": "Get all subject statuses that were reviewed by a specific moderator", + "format": "did" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "minAccountSuspendCount": { + "type": "integer", + "description": "If specified, only subjects that belong to an account that has at least this many suspensions will be returned." + }, + "minPriorityScore": { + "type": "integer", + "description": "If specified, only subjects that have priority score value above the given value will be returned.", + "minimum": 0, + "maximum": 100 + }, + "minReportedRecordsCount": { + "type": "integer", + "description": "If specified, only subjects that belong to an account that has at least this many reported records will be returned." + }, + "minStrikeCount": { + "type": "integer", + "description": "If specified, only subjects that belong to an account that has at least this many active strikes will be returned.", + "minimum": 1 + }, + "minTakendownRecordsCount": { + "type": "integer", + "description": "If specified, only subjects that belong to an account that has at least this many taken down records will be returned." + }, + "onlyMuted": { + "type": "boolean", + "description": "When set to true, only muted subjects and reporters will be returned." + }, + "queueCount": { + "type": "integer", + "description": "Number of queues being used by moderators. Subjects will be split among all queues." + }, + "queueIndex": { + "type": "integer", + "description": "Index of the queue to fetch subjects from. Works only when queueCount value is specified." + }, + "queueSeed": { + "type": "string", + "description": "A seeder to shuffle/balance the queue items." + }, + "reportedAfter": { + "type": "string", + "description": "Search subjects reported after a given timestamp", + "format": "datetime" + }, + "reportedBefore": { + "type": "string", + "description": "Search subjects reported before a given timestamp", + "format": "datetime" + }, + "reviewState": { + "type": "string", + "description": "Specify when fetching subjects in a certain state" + }, + "reviewedAfter": { + "type": "string", + "description": "Search subjects reviewed after a given timestamp", + "format": "datetime" + }, + "reviewedBefore": { + "type": "string", + "description": "Search subjects reviewed before a given timestamp", + "format": "datetime" + }, + "sortDirection": { + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ] + }, + "sortField": { + "type": "string", + "default": "lastReportedAt", + "enum": [ + "lastReviewedAt", + "lastReportedAt", + "reportedRecordsCount", + "takendownRecordsCount", + "priorityScore" + ] + }, + "subject": { + "type": "string", + "description": "The subject to get the status for.", + "format": "uri" + }, + "subjectType": { + "type": "string", + "description": "If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored.", + "knownValues": [ + "account", + "record" + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "description": "Items in this array are applied with OR filters. To apply AND filter, put all tags in the same string and separate using && characters" + }, + "maxLength": 25 + }, + "takendown": { + "type": "boolean", + "description": "Get subjects that were taken down" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subjectStatuses" + ], + "properties": { + "cursor": { + "type": "string" + }, + "subjectStatuses": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#subjectStatusView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_scheduleAction.json b/crates/weaver-api/lexicons/tools_ozone_moderation_scheduleAction.json new file mode 100644 index 0000000..168d927 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_scheduleAction.json @@ -0,0 +1,147 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.scheduleAction", + "defs": { + "failedScheduling": { + "type": "object", + "required": [ + "subject", + "error" + ], + "properties": { + "error": { + "type": "string" + }, + "errorCode": { + "type": "string" + }, + "subject": { + "type": "string", + "format": "did" + } + } + }, + "main": { + "type": "procedure", + "description": "Schedule a moderation action to be executed at a future time", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "action", + "subjects", + "createdBy", + "scheduling" + ], + "properties": { + "action": { + "type": "union", + "refs": [ + "#takedown" + ] + }, + "createdBy": { + "type": "string", + "format": "did" + }, + "modTool": { + "type": "ref", + "description": "This will be propagated to the moderation event when it is applied", + "ref": "tools.ozone.moderation.defs#modTool" + }, + "scheduling": { + "type": "ref", + "ref": "#schedulingConfig" + }, + "subjects": { + "type": "array", + "description": "Array of DID subjects to schedule the action for", + "items": { + "type": "string", + "format": "did" + }, + "maxLength": 100 + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "#scheduledActionResults" + } + } + }, + "scheduledActionResults": { + "type": "object", + "required": [ + "succeeded", + "failed" + ], + "properties": { + "failed": { + "type": "array", + "items": { + "type": "ref", + "ref": "#failedScheduling" + } + }, + "succeeded": { + "type": "array", + "items": { + "type": "string", + "format": "did" + } + } + } + }, + "schedulingConfig": { + "type": "object", + "description": "Configuration for when the action should be executed", + "properties": { + "executeAfter": { + "type": "string", + "description": "Earliest time to execute the action (for randomized scheduling)", + "format": "datetime" + }, + "executeAt": { + "type": "string", + "description": "Exact time to execute the action", + "format": "datetime" + }, + "executeUntil": { + "type": "string", + "description": "Latest time to execute the action (for randomized scheduling)", + "format": "datetime" + } + } + }, + "takedown": { + "type": "object", + "description": "Schedule a takedown action", + "properties": { + "acknowledgeAccountSubjects": { + "type": "boolean", + "description": "If true, all other reports on content authored by this account will be resolved (acknowledged)." + }, + "comment": { + "type": "string" + }, + "durationInHours": { + "type": "integer", + "description": "Indicates how long the takedown should be in effect before automatically expiring." + }, + "policies": { + "type": "array", + "description": "Names/Keywords of the policies that drove the decision.", + "items": { + "type": "string" + }, + "maxLength": 5 + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_moderation_searchRepos.json b/crates/weaver-api/lexicons/tools_ozone_moderation_searchRepos.json new file mode 100644 index 0000000..4d3b0bf --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_moderation_searchRepos.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "tools.ozone.moderation.searchRepos", + "defs": { + "main": { + "type": "query", + "description": "Find repositories based on a search term.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string" + }, + "term": { + "type": "string", + "description": "DEPRECATED: use 'q' instead" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repos" + ], + "properties": { + "cursor": { + "type": "string" + }, + "repos": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.moderation.defs#repoView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_report_defs.json b/crates/weaver-api/lexicons/tools_ozone_report_defs.json new file mode 100644 index 0000000..550e3ec --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_report_defs.json @@ -0,0 +1,211 @@ +{ + "lexicon": 1, + "id": "tools.ozone.report.defs", + "defs": { + "reasonAppeal": { + "type": "token", + "description": "Appeal a previously taken moderation action" + }, + "reasonChildSafetyCSAM": { + "type": "token", + "description": "Child sexual abuse material (CSAM). These reports will be sent only be sent to the application's Moderation Authority." + }, + "reasonChildSafetyGroom": { + "type": "token", + "description": "Grooming or predatory behavior. These reports will be sent only be sent to the application's Moderation Authority." + }, + "reasonChildSafetyHarassment": { + "type": "token", + "description": "Harassment or bullying of minors" + }, + "reasonChildSafetyOther": { + "type": "token", + "description": "Other child safety. These reports will be sent only be sent to the application's Moderation Authority." + }, + "reasonChildSafetyPrivacy": { + "type": "token", + "description": "Privacy violation involving a minor" + }, + "reasonHarassmentDoxxing": { + "type": "token", + "description": "Doxxing" + }, + "reasonHarassmentHateSpeech": { + "type": "token", + "description": "Hate speech" + }, + "reasonHarassmentOther": { + "type": "token", + "description": "Other harassing or hateful content" + }, + "reasonHarassmentTargeted": { + "type": "token", + "description": "Targeted harassment" + }, + "reasonHarassmentTroll": { + "type": "token", + "description": "Trolling" + }, + "reasonMisleadingBot": { + "type": "token", + "description": "Fake account or bot" + }, + "reasonMisleadingElections": { + "type": "token", + "description": "False information about elections" + }, + "reasonMisleadingImpersonation": { + "type": "token", + "description": "Impersonation" + }, + "reasonMisleadingOther": { + "type": "token", + "description": "Other misleading content" + }, + "reasonMisleadingScam": { + "type": "token", + "description": "Scam" + }, + "reasonMisleadingSpam": { + "type": "token", + "description": "Spam" + }, + "reasonOther": { + "type": "token", + "description": "An issue not included in these options" + }, + "reasonRuleBanEvasion": { + "type": "token", + "description": "Banned user returning" + }, + "reasonRuleOther": { + "type": "token", + "description": "Other" + }, + "reasonRuleProhibitedSales": { + "type": "token", + "description": "Promoting or selling prohibited items or services" + }, + "reasonRuleSiteSecurity": { + "type": "token", + "description": "Hacking or system attacks" + }, + "reasonSelfHarmContent": { + "type": "token", + "description": "Content promoting or depicting self-harm" + }, + "reasonSelfHarmED": { + "type": "token", + "description": "Eating disorders" + }, + "reasonSelfHarmOther": { + "type": "token", + "description": "Other dangerous content" + }, + "reasonSelfHarmStunts": { + "type": "token", + "description": "Dangerous challenges or activities" + }, + "reasonSelfHarmSubstances": { + "type": "token", + "description": "Dangerous substances or drug abuse" + }, + "reasonSexualAbuseContent": { + "type": "token", + "description": "Adult sexual abuse content" + }, + "reasonSexualAnimal": { + "type": "token", + "description": "Animal sexual abuse" + }, + "reasonSexualDeepfake": { + "type": "token", + "description": "Deepfake adult content" + }, + "reasonSexualNCII": { + "type": "token", + "description": "Non-consensual intimate imagery" + }, + "reasonSexualOther": { + "type": "token", + "description": "Other sexual violence content" + }, + "reasonSexualUnlabeled": { + "type": "token", + "description": "Unlabelled adult content" + }, + "reasonType": { + "type": "string", + "knownValues": [ + "tools.ozone.report.defs#reasonAppeal", + "tools.ozone.report.defs#reasonOther", + "tools.ozone.report.defs#reasonViolenceAnimal", + "tools.ozone.report.defs#reasonViolenceThreats", + "tools.ozone.report.defs#reasonViolenceGraphicContent", + "tools.ozone.report.defs#reasonViolenceGlorification", + "tools.ozone.report.defs#reasonViolenceExtremistContent", + "tools.ozone.report.defs#reasonViolenceTrafficking", + "tools.ozone.report.defs#reasonViolenceOther", + "tools.ozone.report.defs#reasonSexualAbuseContent", + "tools.ozone.report.defs#reasonSexualNCII", + "tools.ozone.report.defs#reasonSexualDeepfake", + "tools.ozone.report.defs#reasonSexualAnimal", + "tools.ozone.report.defs#reasonSexualUnlabeled", + "tools.ozone.report.defs#reasonSexualOther", + "tools.ozone.report.defs#reasonChildSafetyCSAM", + "tools.ozone.report.defs#reasonChildSafetyGroom", + "tools.ozone.report.defs#reasonChildSafetyPrivacy", + "tools.ozone.report.defs#reasonChildSafetyHarassment", + "tools.ozone.report.defs#reasonChildSafetyOther", + "tools.ozone.report.defs#reasonHarassmentTroll", + "tools.ozone.report.defs#reasonHarassmentTargeted", + "tools.ozone.report.defs#reasonHarassmentHateSpeech", + "tools.ozone.report.defs#reasonHarassmentDoxxing", + "tools.ozone.report.defs#reasonHarassmentOther", + "tools.ozone.report.defs#reasonMisleadingBot", + "tools.ozone.report.defs#reasonMisleadingImpersonation", + "tools.ozone.report.defs#reasonMisleadingSpam", + "tools.ozone.report.defs#reasonMisleadingScam", + "tools.ozone.report.defs#reasonMisleadingElections", + "tools.ozone.report.defs#reasonMisleadingOther", + "tools.ozone.report.defs#reasonRuleSiteSecurity", + "tools.ozone.report.defs#reasonRuleProhibitedSales", + "tools.ozone.report.defs#reasonRuleBanEvasion", + "tools.ozone.report.defs#reasonRuleOther", + "tools.ozone.report.defs#reasonSelfHarmContent", + "tools.ozone.report.defs#reasonSelfHarmED", + "tools.ozone.report.defs#reasonSelfHarmStunts", + "tools.ozone.report.defs#reasonSelfHarmSubstances", + "tools.ozone.report.defs#reasonSelfHarmOther" + ] + }, + "reasonViolenceAnimal": { + "type": "token", + "description": "Animal welfare violations" + }, + "reasonViolenceExtremistContent": { + "type": "token", + "description": "Extremist content. These reports will be sent only be sent to the application's Moderation Authority." + }, + "reasonViolenceGlorification": { + "type": "token", + "description": "Glorification of violence" + }, + "reasonViolenceGraphicContent": { + "type": "token", + "description": "Graphic violent content" + }, + "reasonViolenceOther": { + "type": "token", + "description": "Other violent content" + }, + "reasonViolenceThreats": { + "type": "token", + "description": "Threats or incitement" + }, + "reasonViolenceTrafficking": { + "type": "token", + "description": "Human trafficking" + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_safelink_addRule.json b/crates/weaver-api/lexicons/tools_ozone_safelink_addRule.json new file mode 100644 index 0000000..4adcbdb --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_safelink_addRule.json @@ -0,0 +1,66 @@ +{ + "lexicon": 1, + "id": "tools.ozone.safelink.addRule", + "defs": { + "main": { + "type": "procedure", + "description": "Add a new URL safety rule", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "url", + "pattern", + "action", + "reason" + ], + "properties": { + "action": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#actionType" + }, + "comment": { + "type": "string", + "description": "Optional comment about the decision" + }, + "createdBy": { + "type": "string", + "description": "Author DID. Only respected when using admin auth", + "format": "did" + }, + "pattern": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#patternType" + }, + "reason": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#reasonType" + }, + "url": { + "type": "string", + "description": "The URL or domain to apply the rule to" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#event" + } + }, + "errors": [ + { + "description": "The provided URL is invalid", + "name": "InvalidUrl" + }, + { + "description": "A rule for this URL/domain already exists", + "name": "RuleAlreadyExists" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_safelink_defs.json b/crates/weaver-api/lexicons/tools_ozone_safelink_defs.json new file mode 100644 index 0000000..6681736 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_safelink_defs.json @@ -0,0 +1,141 @@ +{ + "lexicon": 1, + "id": "tools.ozone.safelink.defs", + "defs": { + "actionType": { + "type": "string", + "knownValues": [ + "block", + "warn", + "whitelist" + ] + }, + "event": { + "type": "object", + "description": "An event for URL safety decisions", + "required": [ + "id", + "eventType", + "url", + "pattern", + "action", + "reason", + "createdBy", + "createdAt" + ], + "properties": { + "action": { + "type": "ref", + "ref": "#actionType" + }, + "comment": { + "type": "string", + "description": "Optional comment about the decision" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "description": "DID of the user who created this rule", + "format": "did" + }, + "eventType": { + "type": "ref", + "ref": "#eventType" + }, + "id": { + "type": "integer", + "description": "Auto-incrementing row ID" + }, + "pattern": { + "type": "ref", + "ref": "#patternType" + }, + "reason": { + "type": "ref", + "ref": "#reasonType" + }, + "url": { + "type": "string", + "description": "The URL that this rule applies to" + } + } + }, + "eventType": { + "type": "string", + "knownValues": [ + "addRule", + "updateRule", + "removeRule" + ] + }, + "patternType": { + "type": "string", + "knownValues": [ + "domain", + "url" + ] + }, + "reasonType": { + "type": "string", + "knownValues": [ + "csam", + "spam", + "phishing", + "none" + ] + }, + "urlRule": { + "type": "object", + "description": "Input for creating a URL safety rule", + "required": [ + "url", + "pattern", + "action", + "reason", + "createdBy", + "createdAt", + "updatedAt" + ], + "properties": { + "action": { + "type": "ref", + "ref": "#actionType" + }, + "comment": { + "type": "string", + "description": "Optional comment about the decision" + }, + "createdAt": { + "type": "string", + "description": "Timestamp when the rule was created", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "description": "DID of the user added the rule.", + "format": "did" + }, + "pattern": { + "type": "ref", + "ref": "#patternType" + }, + "reason": { + "type": "ref", + "ref": "#reasonType" + }, + "updatedAt": { + "type": "string", + "description": "Timestamp when the rule was last updated", + "format": "datetime" + }, + "url": { + "type": "string", + "description": "The URL or domain to apply the rule to" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_safelink_queryEvents.json b/crates/weaver-api/lexicons/tools_ozone_safelink_queryEvents.json new file mode 100644 index 0000000..304993d --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_safelink_queryEvents.json @@ -0,0 +1,71 @@ +{ + "lexicon": 1, + "id": "tools.ozone.safelink.queryEvents", + "defs": { + "main": { + "type": "procedure", + "description": "Query URL safety audit events", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "cursor": { + "type": "string", + "description": "Cursor for pagination" + }, + "limit": { + "type": "integer", + "description": "Maximum number of results to return", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "patternType": { + "type": "string", + "description": "Filter by pattern type" + }, + "sortDirection": { + "type": "string", + "description": "Sort direction", + "default": "desc", + "knownValues": [ + "asc", + "desc" + ] + }, + "urls": { + "type": "array", + "description": "Filter by specific URLs or domains", + "items": { + "type": "string" + } + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "events" + ], + "properties": { + "cursor": { + "type": "string", + "description": "Next cursor for pagination. Only present if there are more results." + }, + "events": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#event" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_safelink_queryRules.json b/crates/weaver-api/lexicons/tools_ozone_safelink_queryRules.json new file mode 100644 index 0000000..cc8067b --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_safelink_queryRules.json @@ -0,0 +1,87 @@ +{ + "lexicon": 1, + "id": "tools.ozone.safelink.queryRules", + "defs": { + "main": { + "type": "procedure", + "description": "Query URL safety rules", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "description": "Filter by action types", + "items": { + "type": "string" + } + }, + "createdBy": { + "type": "string", + "description": "Filter by rule creator", + "format": "did" + }, + "cursor": { + "type": "string", + "description": "Cursor for pagination" + }, + "limit": { + "type": "integer", + "description": "Maximum number of results to return", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "patternType": { + "type": "string", + "description": "Filter by pattern type" + }, + "reason": { + "type": "string", + "description": "Filter by reason type" + }, + "sortDirection": { + "type": "string", + "description": "Sort direction", + "default": "desc", + "knownValues": [ + "asc", + "desc" + ] + }, + "urls": { + "type": "array", + "description": "Filter by specific URLs or domains", + "items": { + "type": "string" + } + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "rules" + ], + "properties": { + "cursor": { + "type": "string", + "description": "Next cursor for pagination. Only present if there are more results." + }, + "rules": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#urlRule" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_safelink_removeRule.json b/crates/weaver-api/lexicons/tools_ozone_safelink_removeRule.json new file mode 100644 index 0000000..3e776f7 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_safelink_removeRule.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "tools.ozone.safelink.removeRule", + "defs": { + "main": { + "type": "procedure", + "description": "Remove an existing URL safety rule", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "url", + "pattern" + ], + "properties": { + "comment": { + "type": "string", + "description": "Optional comment about why the rule is being removed" + }, + "createdBy": { + "type": "string", + "description": "Optional DID of the user. Only respected when using admin auth.", + "format": "did" + }, + "pattern": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#patternType" + }, + "url": { + "type": "string", + "description": "The URL or domain to remove the rule for" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#event" + } + }, + "errors": [ + { + "description": "No active rule found for this URL/domain", + "name": "RuleNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_safelink_updateRule.json b/crates/weaver-api/lexicons/tools_ozone_safelink_updateRule.json new file mode 100644 index 0000000..479fbcc --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_safelink_updateRule.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "tools.ozone.safelink.updateRule", + "defs": { + "main": { + "type": "procedure", + "description": "Update an existing URL safety rule", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "url", + "pattern", + "action", + "reason" + ], + "properties": { + "action": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#actionType" + }, + "comment": { + "type": "string", + "description": "Optional comment about the update" + }, + "createdBy": { + "type": "string", + "description": "Optional DID to credit as the creator. Only respected for admin_token authentication.", + "format": "did" + }, + "pattern": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#patternType" + }, + "reason": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#reasonType" + }, + "url": { + "type": "string", + "description": "The URL or domain to update the rule for" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.safelink.defs#event" + } + }, + "errors": [ + { + "description": "No active rule found for this URL/domain", + "name": "RuleNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_server_getConfig.json b/crates/weaver-api/lexicons/tools_ozone_server_getConfig.json new file mode 100644 index 0000000..f630f17 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_server_getConfig.json @@ -0,0 +1,66 @@ +{ + "lexicon": 1, + "id": "tools.ozone.server.getConfig", + "defs": { + "main": { + "type": "query", + "description": "Get details about ozone's server configuration.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "appview": { + "type": "ref", + "ref": "#serviceConfig" + }, + "blobDivert": { + "type": "ref", + "ref": "#serviceConfig" + }, + "chat": { + "type": "ref", + "ref": "#serviceConfig" + }, + "pds": { + "type": "ref", + "ref": "#serviceConfig" + }, + "verifierDid": { + "type": "string", + "description": "The did of the verifier used for verification.", + "format": "did" + }, + "viewer": { + "type": "ref", + "ref": "#viewerConfig" + } + } + } + } + }, + "serviceConfig": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri" + } + } + }, + "viewerConfig": { + "type": "object", + "properties": { + "role": { + "type": "string", + "knownValues": [ + "tools.ozone.team.defs#roleAdmin", + "tools.ozone.team.defs#roleModerator", + "tools.ozone.team.defs#roleTriage", + "tools.ozone.team.defs#roleVerifier" + ] + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_set_addValues.json b/crates/weaver-api/lexicons/tools_ozone_set_addValues.json new file mode 100644 index 0000000..8ccd62d --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_set_addValues.json @@ -0,0 +1,35 @@ +{ + "lexicon": 1, + "id": "tools.ozone.set.addValues", + "defs": { + "main": { + "type": "procedure", + "description": "Add values to a specific set. Attempting to add values to a set that does not exist will result in an error.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "name", + "values" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the set to add values to" + }, + "values": { + "type": "array", + "description": "Array of string values to add to the set", + "items": { + "type": "string" + }, + "minLength": 1, + "maxLength": 1000 + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_set_defs.json b/crates/weaver-api/lexicons/tools_ozone_set_defs.json new file mode 100644 index 0000000..1d01ce7 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_set_defs.json @@ -0,0 +1,56 @@ +{ + "lexicon": 1, + "id": "tools.ozone.set.defs", + "defs": { + "set": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "description": { + "type": "string", + "maxLength": 10240, + "maxGraphemes": 1024 + }, + "name": { + "type": "string", + "minLength": 3, + "maxLength": 128 + } + } + }, + "setView": { + "type": "object", + "required": [ + "name", + "setSize", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "description": { + "type": "string", + "maxLength": 10240, + "maxGraphemes": 1024 + }, + "name": { + "type": "string", + "minLength": 3, + "maxLength": 128 + }, + "setSize": { + "type": "integer" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_set_deleteSet.json b/crates/weaver-api/lexicons/tools_ozone_set_deleteSet.json new file mode 100644 index 0000000..187053d --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_set_deleteSet.json @@ -0,0 +1,38 @@ +{ + "lexicon": 1, + "id": "tools.ozone.set.deleteSet", + "defs": { + "main": { + "type": "procedure", + "description": "Delete an entire set. Attempting to delete a set that does not exist will result in an error.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the set to delete" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": {} + } + }, + "errors": [ + { + "description": "set with the given name does not exist", + "name": "SetNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_set_deleteValues.json b/crates/weaver-api/lexicons/tools_ozone_set_deleteValues.json new file mode 100644 index 0000000..16befab --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_set_deleteValues.json @@ -0,0 +1,40 @@ +{ + "lexicon": 1, + "id": "tools.ozone.set.deleteValues", + "defs": { + "main": { + "type": "procedure", + "description": "Delete values from a specific set. Attempting to delete values that are not in the set will not result in an error", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "name", + "values" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the set to delete values from" + }, + "values": { + "type": "array", + "description": "Array of string values to delete from the set", + "items": { + "type": "string" + }, + "minLength": 1 + } + } + } + }, + "errors": [ + { + "description": "set with the given name does not exist", + "name": "SetNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_set_getValues.json b/crates/weaver-api/lexicons/tools_ozone_set_getValues.json new file mode 100644 index 0000000..b9abf1e --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_set_getValues.json @@ -0,0 +1,61 @@ +{ + "lexicon": 1, + "id": "tools.ozone.set.getValues", + "defs": { + "main": { + "type": "query", + "description": "Get a specific set and its values", + "parameters": { + "type": "params", + "required": [ + "name" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 100, + "minimum": 1, + "maximum": 1000 + }, + "name": { + "type": "string" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "set", + "values" + ], + "properties": { + "cursor": { + "type": "string" + }, + "set": { + "type": "ref", + "ref": "tools.ozone.set.defs#setView" + }, + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "errors": [ + { + "description": "set with the given name does not exist", + "name": "SetNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_set_querySets.json b/crates/weaver-api/lexicons/tools_ozone_set_querySets.json new file mode 100644 index 0000000..b29a4db --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_set_querySets.json @@ -0,0 +1,66 @@ +{ + "lexicon": 1, + "id": "tools.ozone.set.querySets", + "defs": { + "main": { + "type": "query", + "description": "Query available sets", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "namePrefix": { + "type": "string" + }, + "sortBy": { + "type": "string", + "default": "name", + "enum": [ + "name", + "createdAt", + "updatedAt" + ] + }, + "sortDirection": { + "type": "string", + "description": "Defaults to ascending order of name field.", + "default": "asc", + "enum": [ + "asc", + "desc" + ] + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "sets" + ], + "properties": { + "cursor": { + "type": "string" + }, + "sets": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.set.defs#setView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_set_upsertSet.json b/crates/weaver-api/lexicons/tools_ozone_set_upsertSet.json new file mode 100644 index 0000000..0f5c908 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_set_upsertSet.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "tools.ozone.set.upsertSet", + "defs": { + "main": { + "type": "procedure", + "description": "Create or update set metadata", + "input": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.set.defs#set" + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.set.defs#setView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_setting_defs.json b/crates/weaver-api/lexicons/tools_ozone_setting_defs.json new file mode 100644 index 0000000..0f63010 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_setting_defs.json @@ -0,0 +1,67 @@ +{ + "lexicon": 1, + "id": "tools.ozone.setting.defs", + "defs": { + "option": { + "type": "object", + "required": [ + "key", + "value", + "did", + "scope", + "createdBy", + "lastUpdatedBy" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "format": "did" + }, + "description": { + "type": "string", + "maxLength": 10240, + "maxGraphemes": 1024 + }, + "did": { + "type": "string", + "format": "did" + }, + "key": { + "type": "string", + "format": "nsid" + }, + "lastUpdatedBy": { + "type": "string", + "format": "did" + }, + "managerRole": { + "type": "string", + "knownValues": [ + "tools.ozone.team.defs#roleModerator", + "tools.ozone.team.defs#roleTriage", + "tools.ozone.team.defs#roleAdmin", + "tools.ozone.team.defs#roleVerifier" + ] + }, + "scope": { + "type": "string", + "knownValues": [ + "instance", + "personal" + ] + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "value": { + "type": "unknown" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_setting_listOptions.json b/crates/weaver-api/lexicons/tools_ozone_setting_listOptions.json new file mode 100644 index 0000000..17be658 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_setting_listOptions.json @@ -0,0 +1,66 @@ +{ + "lexicon": 1, + "id": "tools.ozone.setting.listOptions", + "defs": { + "main": { + "type": "query", + "description": "List settings with optional filtering", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "keys": { + "type": "array", + "description": "Filter for only the specified keys. Ignored if prefix is provided", + "items": { + "type": "string", + "format": "nsid" + }, + "maxLength": 100 + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "prefix": { + "type": "string", + "description": "Filter keys by prefix" + }, + "scope": { + "type": "string", + "default": "instance", + "knownValues": [ + "instance", + "personal" + ] + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "options" + ], + "properties": { + "cursor": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.setting.defs#option" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_setting_removeOptions.json b/crates/weaver-api/lexicons/tools_ozone_setting_removeOptions.json new file mode 100644 index 0000000..ba9fbe1 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_setting_removeOptions.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "tools.ozone.setting.removeOptions", + "defs": { + "main": { + "type": "procedure", + "description": "Delete settings by key", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "keys", + "scope" + ], + "properties": { + "keys": { + "type": "array", + "items": { + "type": "string", + "format": "nsid" + }, + "minLength": 1, + "maxLength": 200 + }, + "scope": { + "type": "string", + "knownValues": [ + "instance", + "personal" + ] + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": {} + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_setting_upsertOption.json b/crates/weaver-api/lexicons/tools_ozone_setting_upsertOption.json new file mode 100644 index 0000000..b587568 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_setting_upsertOption.json @@ -0,0 +1,65 @@ +{ + "lexicon": 1, + "id": "tools.ozone.setting.upsertOption", + "defs": { + "main": { + "type": "procedure", + "description": "Create or update setting option", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "key", + "scope", + "value" + ], + "properties": { + "description": { + "type": "string", + "maxLength": 2000 + }, + "key": { + "type": "string", + "format": "nsid" + }, + "managerRole": { + "type": "string", + "knownValues": [ + "tools.ozone.team.defs#roleModerator", + "tools.ozone.team.defs#roleTriage", + "tools.ozone.team.defs#roleVerifier", + "tools.ozone.team.defs#roleAdmin" + ] + }, + "scope": { + "type": "string", + "knownValues": [ + "instance", + "personal" + ] + }, + "value": { + "type": "unknown" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "option" + ], + "properties": { + "option": { + "type": "ref", + "ref": "tools.ozone.setting.defs#option" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_signature_defs.json b/crates/weaver-api/lexicons/tools_ozone_signature_defs.json new file mode 100644 index 0000000..a3cfc6d --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_signature_defs.json @@ -0,0 +1,21 @@ +{ + "lexicon": 1, + "id": "tools.ozone.signature.defs", + "defs": { + "sigDetail": { + "type": "object", + "required": [ + "property", + "value" + ], + "properties": { + "property": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_signature_findCorrelation.json b/crates/weaver-api/lexicons/tools_ozone_signature_findCorrelation.json new file mode 100644 index 0000000..c8b2113 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_signature_findCorrelation.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "tools.ozone.signature.findCorrelation", + "defs": { + "main": { + "type": "query", + "description": "Find all correlated threat signatures between 2 or more accounts.", + "parameters": { + "type": "params", + "required": [ + "dids" + ], + "properties": { + "dids": { + "type": "array", + "items": { + "type": "string", + "format": "did" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "details" + ], + "properties": { + "details": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.signature.defs#sigDetail" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_signature_findRelatedAccounts.json b/crates/weaver-api/lexicons/tools_ozone_signature_findRelatedAccounts.json new file mode 100644 index 0000000..45bd05f --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_signature_findRelatedAccounts.json @@ -0,0 +1,71 @@ +{ + "lexicon": 1, + "id": "tools.ozone.signature.findRelatedAccounts", + "defs": { + "main": { + "type": "query", + "description": "Get accounts that share some matching threat signatures with the root account.", + "parameters": { + "type": "params", + "required": [ + "did" + ], + "properties": { + "cursor": { + "type": "string" + }, + "did": { + "type": "string", + "format": "did" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "accounts" + ], + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "ref", + "ref": "#relatedAccount" + } + }, + "cursor": { + "type": "string" + } + } + } + } + }, + "relatedAccount": { + "type": "object", + "required": [ + "account" + ], + "properties": { + "account": { + "type": "ref", + "ref": "com.atproto.admin.defs#accountView" + }, + "similarities": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.signature.defs#sigDetail" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_signature_searchAccounts.json b/crates/weaver-api/lexicons/tools_ozone_signature_searchAccounts.json new file mode 100644 index 0000000..09c7be6 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_signature_searchAccounts.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "id": "tools.ozone.signature.searchAccounts", + "defs": { + "main": { + "type": "query", + "description": "Search for accounts that match one or more threat signature values.", + "parameters": { + "type": "params", + "required": [ + "values" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "values": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "accounts" + ], + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "ref", + "ref": "com.atproto.admin.defs#accountView" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_team_addMember.json b/crates/weaver-api/lexicons/tools_ozone_team_addMember.json new file mode 100644 index 0000000..bf68c42 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_team_addMember.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "tools.ozone.team.addMember", + "defs": { + "main": { + "type": "procedure", + "description": "Add a member to the ozone team. Requires admin role.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did", + "role" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "role": { + "type": "string", + "knownValues": [ + "tools.ozone.team.defs#roleAdmin", + "tools.ozone.team.defs#roleModerator", + "tools.ozone.team.defs#roleVerifier", + "tools.ozone.team.defs#roleTriage" + ] + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.team.defs#member" + } + }, + "errors": [ + { + "description": "Member already exists in the team.", + "name": "MemberAlreadyExists" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_team_defs.json b/crates/weaver-api/lexicons/tools_ozone_team_defs.json new file mode 100644 index 0000000..36982c0 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_team_defs.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "tools.ozone.team.defs", + "defs": { + "member": { + "type": "object", + "required": [ + "did", + "role" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "did": { + "type": "string", + "format": "did" + }, + "disabled": { + "type": "boolean" + }, + "lastUpdatedBy": { + "type": "string" + }, + "profile": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewDetailed" + }, + "role": { + "type": "string", + "knownValues": [ + "#roleAdmin", + "#roleModerator", + "#roleTriage", + "#roleVerifier" + ] + }, + "updatedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "roleAdmin": { + "type": "token", + "description": "Admin role. Highest level of access, can perform all actions." + }, + "roleModerator": { + "type": "token", + "description": "Moderator role. Can perform most actions." + }, + "roleTriage": { + "type": "token", + "description": "Triage role. Mostly intended for monitoring and escalating issues." + }, + "roleVerifier": { + "type": "token", + "description": "Verifier role. Only allowed to issue verifications." + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_team_deleteMember.json b/crates/weaver-api/lexicons/tools_ozone_team_deleteMember.json new file mode 100644 index 0000000..227055c --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_team_deleteMember.json @@ -0,0 +1,35 @@ +{ + "lexicon": 1, + "id": "tools.ozone.team.deleteMember", + "defs": { + "main": { + "type": "procedure", + "description": "Delete a member from ozone team. Requires admin role.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + } + }, + "errors": [ + { + "description": "The member being deleted does not exist", + "name": "MemberNotFound" + }, + { + "description": "You can not delete yourself from the team", + "name": "CannotDeleteSelf" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_team_listMembers.json b/crates/weaver-api/lexicons/tools_ozone_team_listMembers.json new file mode 100644 index 0000000..f590805 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_team_listMembers.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "tools.ozone.team.listMembers", + "defs": { + "main": { + "type": "query", + "description": "List all members with access to the ozone service.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "disabled": { + "type": "boolean" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "members" + ], + "properties": { + "cursor": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.team.defs#member" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_team_updateMember.json b/crates/weaver-api/lexicons/tools_ozone_team_updateMember.json new file mode 100644 index 0000000..4eb045a --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_team_updateMember.json @@ -0,0 +1,50 @@ +{ + "lexicon": 1, + "id": "tools.ozone.team.updateMember", + "defs": { + "main": { + "type": "procedure", + "description": "Update a member in the ozone service. Requires admin role.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "disabled": { + "type": "boolean" + }, + "role": { + "type": "string", + "knownValues": [ + "tools.ozone.team.defs#roleAdmin", + "tools.ozone.team.defs#roleModerator", + "tools.ozone.team.defs#roleVerifier", + "tools.ozone.team.defs#roleTriage" + ] + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "tools.ozone.team.defs#member" + } + }, + "errors": [ + { + "description": "The member being updated does not exist in the team", + "name": "MemberNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_verification_defs.json b/crates/weaver-api/lexicons/tools_ozone_verification_defs.json new file mode 100644 index 0000000..d631a99 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_verification_defs.json @@ -0,0 +1,85 @@ +{ + "lexicon": 1, + "id": "tools.ozone.verification.defs", + "defs": { + "verificationView": { + "type": "object", + "description": "Verification data for the associated subject.", + "required": [ + "issuer", + "uri", + "subject", + "handle", + "displayName", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Timestamp when the verification was created.", + "format": "datetime" + }, + "displayName": { + "type": "string", + "description": "Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying." + }, + "handle": { + "type": "string", + "description": "Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.", + "format": "handle" + }, + "issuer": { + "type": "string", + "description": "The user who issued this verification.", + "format": "did" + }, + "issuerProfile": { + "type": "union", + "refs": [] + }, + "issuerRepo": { + "type": "union", + "refs": [ + "tools.ozone.moderation.defs#repoViewDetail", + "tools.ozone.moderation.defs#repoViewNotFound" + ] + }, + "revokeReason": { + "type": "string", + "description": "Describes the reason for revocation, also indicating that the verification is no longer valid." + }, + "revokedAt": { + "type": "string", + "description": "Timestamp when the verification was revoked.", + "format": "datetime" + }, + "revokedBy": { + "type": "string", + "description": "The user who revoked this verification.", + "format": "did" + }, + "subject": { + "type": "string", + "description": "The subject of the verification.", + "format": "did" + }, + "subjectProfile": { + "type": "union", + "refs": [] + }, + "subjectRepo": { + "type": "union", + "refs": [ + "tools.ozone.moderation.defs#repoViewDetail", + "tools.ozone.moderation.defs#repoViewNotFound" + ] + }, + "uri": { + "type": "string", + "description": "The AT-URI of the verification record.", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_verification_grantVerifications.json b/crates/weaver-api/lexicons/tools_ozone_verification_grantVerifications.json new file mode 100644 index 0000000..8bf3f53 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_verification_grantVerifications.json @@ -0,0 +1,104 @@ +{ + "lexicon": 1, + "id": "tools.ozone.verification.grantVerifications", + "defs": { + "grantError": { + "type": "object", + "description": "Error object for failed verifications.", + "required": [ + "error", + "subject" + ], + "properties": { + "error": { + "type": "string", + "description": "Error message describing the reason for failure." + }, + "subject": { + "type": "string", + "description": "The did of the subject being verified", + "format": "did" + } + } + }, + "main": { + "type": "procedure", + "description": "Grant verifications to multiple subjects. Allows batch processing of up to 100 verifications at once.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "verifications" + ], + "properties": { + "verifications": { + "type": "array", + "description": "Array of verification requests to process", + "items": { + "type": "ref", + "ref": "#verificationInput" + }, + "maxLength": 100 + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "verifications", + "failedVerifications" + ], + "properties": { + "failedVerifications": { + "type": "array", + "items": { + "type": "ref", + "ref": "#grantError" + } + }, + "verifications": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.verification.defs#verificationView" + } + } + } + } + } + }, + "verificationInput": { + "type": "object", + "required": [ + "subject", + "handle", + "displayName" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Timestamp for verification record. Defaults to current time when not specified.", + "format": "datetime" + }, + "displayName": { + "type": "string", + "description": "Display name of the subject the verification applies to at the moment of verifying." + }, + "handle": { + "type": "string", + "description": "Handle of the subject the verification applies to at the moment of verifying.", + "format": "handle" + }, + "subject": { + "type": "string", + "description": "The did of the subject being verified", + "format": "did" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_verification_listVerifications.json b/crates/weaver-api/lexicons/tools_ozone_verification_listVerifications.json new file mode 100644 index 0000000..aebf41f --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_verification_listVerifications.json @@ -0,0 +1,88 @@ +{ + "lexicon": 1, + "id": "tools.ozone.verification.listVerifications", + "defs": { + "main": { + "type": "query", + "description": "List verifications", + "parameters": { + "type": "params", + "properties": { + "createdAfter": { + "type": "string", + "description": "Filter to verifications created after this timestamp", + "format": "datetime" + }, + "createdBefore": { + "type": "string", + "description": "Filter to verifications created before this timestamp", + "format": "datetime" + }, + "cursor": { + "type": "string", + "description": "Pagination cursor" + }, + "isRevoked": { + "type": "boolean", + "description": "Filter to verifications that are revoked or not. By default, includes both." + }, + "issuers": { + "type": "array", + "description": "Filter to verifications from specific issuers", + "items": { + "type": "string", + "format": "did" + }, + "maxLength": 100 + }, + "limit": { + "type": "integer", + "description": "Maximum number of results to return", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "sortDirection": { + "type": "string", + "description": "Sort direction for creation date", + "default": "desc", + "enum": [ + "asc", + "desc" + ] + }, + "subjects": { + "type": "array", + "description": "Filter to specific verified DIDs", + "items": { + "type": "string", + "format": "did" + }, + "maxLength": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "verifications" + ], + "properties": { + "cursor": { + "type": "string" + }, + "verifications": { + "type": "array", + "items": { + "type": "ref", + "ref": "tools.ozone.verification.defs#verificationView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/tools_ozone_verification_revokeVerifications.json b/crates/weaver-api/lexicons/tools_ozone_verification_revokeVerifications.json new file mode 100644 index 0000000..f011c09 --- /dev/null +++ b/crates/weaver-api/lexicons/tools_ozone_verification_revokeVerifications.json @@ -0,0 +1,83 @@ +{ + "lexicon": 1, + "id": "tools.ozone.verification.revokeVerifications", + "defs": { + "main": { + "type": "procedure", + "description": "Revoke previously granted verifications in batches of up to 100.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uris" + ], + "properties": { + "revokeReason": { + "type": "string", + "description": "Reason for revoking the verification. This is optional and can be omitted if not needed.", + "maxLength": 1000 + }, + "uris": { + "type": "array", + "description": "Array of verification record uris to revoke", + "items": { + "type": "string", + "description": "The AT-URI of the verification record to revoke.", + "format": "at-uri" + }, + "maxLength": 100 + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "revokedVerifications", + "failedRevocations" + ], + "properties": { + "failedRevocations": { + "type": "array", + "description": "List of verification uris that couldn't be revoked, including failure reasons", + "items": { + "type": "ref", + "ref": "#revokeError" + } + }, + "revokedVerifications": { + "type": "array", + "description": "List of verification uris successfully revoked", + "items": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + }, + "revokeError": { + "type": "object", + "description": "Error object for failed revocations", + "required": [ + "uri", + "error" + ], + "properties": { + "error": { + "type": "string", + "description": "Description of the error that occurred during revocation." + }, + "uri": { + "type": "string", + "description": "The AT-URI of the verification record that failed to revoke.", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky.rs b/crates/weaver-api/src/app_bsky.rs new file mode 100644 index 0000000..6cdcc8f --- /dev/null +++ b/crates/weaver-api/src/app_bsky.rs @@ -0,0 +1,15 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod actor; +pub mod bookmark; +pub mod embed; +pub mod feed; +pub mod graph; +pub mod labeler; +pub mod notification; +pub mod richtext; +pub mod unspecced; +pub mod video; \ 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 new file mode 100644 index 0000000..0c69f98 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor.rs @@ -0,0 +1,7715 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.actor.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_preferences; +pub mod get_profile; +pub mod get_profiles; +pub mod get_suggestions; +pub mod profile; +pub mod put_preferences; +pub mod search_actors; +pub mod search_actors_typeahead; +pub mod status; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AdultContentPref<'a> { + pub enabled: bool, +} + +pub mod adult_content_pref_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 Enabled; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Enabled = Unset; + } + ///State transition - sets the `enabled` field to Set + pub struct SetEnabled(PhantomData S>); + impl sealed::Sealed for SetEnabled {} + impl State for SetEnabled { + type Enabled = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `enabled` field + pub struct enabled(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AdultContentPrefBuilder<'a, S: adult_content_pref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> AdultContentPref<'a> { + /// Create a new builder for this type + pub fn new() -> AdultContentPrefBuilder<'a, adult_content_pref_state::Empty> { + AdultContentPrefBuilder::new() + } +} + +impl<'a> AdultContentPrefBuilder<'a, adult_content_pref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AdultContentPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AdultContentPrefBuilder<'a, S> +where + S: adult_content_pref_state::State, + S::Enabled: adult_content_pref_state::IsUnset, +{ + /// Set the `enabled` field (required) + pub fn enabled( + mut self, + value: impl Into, + ) -> AdultContentPrefBuilder<'a, adult_content_pref_state::SetEnabled> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AdultContentPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AdultContentPrefBuilder<'a, S> +where + S: adult_content_pref_state::State, + S::Enabled: adult_content_pref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AdultContentPref<'a> { + AdultContentPref { + enabled: 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>, + >, + ) -> AdultContentPref<'a> { + AdultContentPref { + enabled: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.actor.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("adultContentPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("enabled")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("enabled"), + ::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("bskyAppProgressGuide"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("guide")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("guide"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: 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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("bskyAppStatePref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "activeProgressGuide", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#bskyAppProgressGuide", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("nuxs"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Storage for NUXs the user has encountered.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#nux", + ), + }), + min_length: None, + max_length: Some(100usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "queuedNudges", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: 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, + }), + min_length: None, + max_length: Some(1000usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("contentLabelPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("label"), + ::jacquard_common::smol_str::SmolStr::new_static("visibility") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("label"), + ::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( + "labelerDid", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Which labeler does this preference apply to? If undefined, applies globally.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "visibility", + ), + ::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("feedViewPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("feed")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feed"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The URI of the feed, or an identifier which describes the feed.", + ), + ), + 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( + "hideQuotePosts", + ), + ::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( + "hideReplies", + ), + ::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( + "hideRepliesByLikeCount", + ), + ::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( + "hideRepliesByUnfollowed", + ), + ::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( + "hideReposts", + ), + ::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("hiddenPostsPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("items")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("items"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "A list of URIs of posts the account owner has hidden.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("interestsPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("tags")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tags"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "A list of tags which describe the account owner's interests gathered during onboarding.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: Some(100usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("knownFollowers"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "The subject's followers whom you also follow", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("count"), + ::jacquard_common::smol_str::SmolStr::new_static("followers") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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( + "followers", + ), + ::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( + "#profileViewBasic", + ), + }), + min_length: Some(0usize), + max_length: Some(5usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labelerPrefItem"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("labelersPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("labelers") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labelers"), + ::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( + "#labelerPrefItem", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("mutedWord"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A word that the account owner has muted.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::jacquard_common::smol_str::SmolStr::new_static("targets") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "actorTarget", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Groups of users to apply the muted word to. If undefined, applies to all users.", + ), + ), + 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( + "expiresAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The date and time at which the muted word will expire and no longer be applied.", + ), + ), + 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("id"), + ::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("targets"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "The intended targets of the muted word.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#mutedWordTarget", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The muted word itself.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(10000usize), + min_graphemes: None, + max_graphemes: Some(1000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("mutedWordTarget"), + ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("mutedWordsPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("items")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("items"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "A list of words the account owner has muted.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#mutedWord", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("nux"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A new user experiences (NUX) storage object", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("completed") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "completed", + ), + ::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("data"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + 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: Some( + ::jacquard_common::CowStr::new_static( + "The date and time at which the NUX will expire and should be considered completed.", + ), + ), + 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("id"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: 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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("personalDetailsPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "birthDate", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The birth date of account owner.", + ), + ), + 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( + "postInteractionSettingsPref", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.", + ), + ), + required: Some(vec![]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "postgateEmbeddingRules", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.feed.postgate#disableRule") + ], + closed: None, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "threadgateAllowRules", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.feed.threadgate#mentionRule"), + ::jacquard_common::CowStr::new_static("app.bsky.feed.threadgate#followerRule"), + ::jacquard_common::CowStr::new_static("app.bsky.feed.threadgate#followingRule"), + ::jacquard_common::CowStr::new_static("app.bsky.feed.threadgate#listRule") + ], + closed: None, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("preferences"), + ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#adultContentPref"), + ::jacquard_common::CowStr::new_static("#contentLabelPref"), + ::jacquard_common::CowStr::new_static("#savedFeedsPref"), + ::jacquard_common::CowStr::new_static("#savedFeedsPrefV2"), + ::jacquard_common::CowStr::new_static("#personalDetailsPref"), + ::jacquard_common::CowStr::new_static("#feedViewPref"), + ::jacquard_common::CowStr::new_static("#threadViewPref"), + ::jacquard_common::CowStr::new_static("#interestsPref"), + ::jacquard_common::CowStr::new_static("#mutedWordsPref"), + ::jacquard_common::CowStr::new_static("#hiddenPostsPref"), + ::jacquard_common::CowStr::new_static("#bskyAppStatePref"), + ::jacquard_common::CowStr::new_static("#labelersPref"), + ::jacquard_common::CowStr::new_static("#postInteractionSettingsPref"), + ::jacquard_common::CowStr::new_static("#verificationPrefs") + ], + closed: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profileAssociated"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "activitySubscription", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#profileAssociatedActivitySubscription", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("chat"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#profileAssociatedChat", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feedgens"), + ::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("labeler"), + ::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("lists"), + ::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( + "starterPacks", + ), + ::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( + "profileAssociatedActivitySubscription", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("allowSubscriptions") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "allowSubscriptions", + ), + ::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( + "profileAssociatedChat", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("allowIncoming") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "allowIncoming", + ), + ::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("profileView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "associated", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#profileAssociated", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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( + "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("debug"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(2560usize), + min_graphemes: None, + max_graphemes: Some(256usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pronouns"), + ::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::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#statusView"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "verification", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#verificationState", + ), + }), + ); + 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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profileViewBasic"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "associated", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#profileAssociated", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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( + "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("debug"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pronouns"), + ::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::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#statusView"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "verification", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#verificationState", + ), + }), + ); + 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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profileViewDetailed"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "associated", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#profileAssociated", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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("banner"), + ::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( + "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("debug"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(2560usize), + min_graphemes: None, + max_graphemes: Some(256usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followersCount", + ), + ::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( + "followsCount", + ), + ::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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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( + "joinedViaStarterPack", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.defs#starterPackViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "pinnedPost", + ), + ::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( + "postsCount", + ), + ::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("pronouns"), + ::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::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#statusView"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "verification", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#verificationState", + ), + }), + ); + 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.insert( + ::jacquard_common::smol_str::SmolStr::new_static("website"), + ::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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("savedFeed"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("type"), + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::jacquard_common::smol_str::SmolStr::new_static("pinned") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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("pinned"), + ::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("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("value"), + ::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("savedFeedsPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("pinned"), + ::jacquard_common::smol_str::SmolStr::new_static("saved") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pinned"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("saved"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "timelineIndex", + ), + ::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("savedFeedsPrefV2"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("items")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("items"), + ::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( + "app.bsky.actor.defs#savedFeed", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("statusView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_common::smol_str::SmolStr::new_static("record") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("embed"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: Some( + ::jacquard_common::CowStr::new_static( + "An optional embed associated with the status.", + ), + ), + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "expiresAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The date when this status will expire. The application might choose to no longer return the status after expiration.", + ), + ), + 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("isActive"), + ::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("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: 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( + "The status for the account.", + ), + ), + 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("threadViewPref"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "prioritizeFollowedUsers", + ), + ::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("sort"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Sorting mode for threads.", + ), + ), + 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("verificationPrefs"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Preferences for how verified accounts appear in the app.", + ), + ), + required: Some(vec![]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "hideBadges", + ), + ::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("verificationState"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Represents the verification information about the user this object is attached to.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("verifications"), + ::jacquard_common::smol_str::SmolStr::new_static("verifiedStatus"), + ::jacquard_common::smol_str::SmolStr::new_static("trustedVerifierStatus") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "trustedVerifierStatus", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user's status as a trusted verifier.", + ), + ), + 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( + "verifications", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#verificationView", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "verifiedStatus", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user's status as a verified account.", + ), + ), + 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("verificationView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "An individual verification for an associated subject.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("issuer"), + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("isValid"), + ::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: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp when the verification was created.", + ), + ), + 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("isValid"), + ::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("issuer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user who issued this verification.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "The AT-URI of the verification record.", + ), + ), + 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("viewerState"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "activitySubscription", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.notification.defs#activitySubscription", + ), + }), + ); + 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("blocking"), + ::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( + "blockingByList", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.defs#listViewBasic", + ), + }), + ); + 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( + "knownFollowers", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#knownFollowers", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("muted"), + ::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( + "mutedByList", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.defs#listViewBasic", + ), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AdultContentPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "adultContentPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct BskyAppProgressGuide<'a> { + #[serde(borrow)] + pub guide: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BskyAppProgressGuide<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "bskyAppProgressGuide" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.guide; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "guide", + ), + max: 100usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +/// A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct BskyAppStatePref<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub active_progress_guide: std::option::Option< + crate::app_bsky::actor::BskyAppProgressGuide<'a>, + >, + /// Storage for NUXs the user has encountered. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub nuxs: std::option::Option>>, + /// An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub queued_nudges: std::option::Option>>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BskyAppStatePref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "bskyAppStatePref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.nuxs { + #[allow(unused_comparisons)] + if value.len() > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "nuxs", + ), + max: 100usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.queued_nudges { + #[allow(unused_comparisons)] + if value.len() > 1000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "queued_nudges", + ), + max: 1000usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ContentLabelPref<'a> { + #[serde(borrow)] + pub label: jacquard_common::CowStr<'a>, + /// Which labeler does this preference apply to? If undefined, applies globally. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labeler_did: std::option::Option>, + #[serde(borrow)] + pub visibility: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ContentLabelPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "contentLabelPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct FeedViewPref<'a> { + /// The URI of the feed, or an identifier which describes the feed. + #[serde(borrow)] + pub feed: jacquard_common::CowStr<'a>, + /// Hide quote posts in the feed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hide_quote_posts: std::option::Option, + /// Hide replies in the feed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hide_replies: std::option::Option, + /// Hide replies in the feed if they do not have this number of likes. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hide_replies_by_like_count: std::option::Option, + /// Hide replies in the feed if they are not by followed users. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hide_replies_by_unfollowed: std::option::Option, + /// Hide reposts in the feed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hide_reposts: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedViewPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "feedViewPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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 HiddenPostsPref<'a> { + /// A list of URIs of posts the account owner has hidden. + #[serde(borrow)] + pub items: Vec>, +} + +pub mod hidden_posts_pref_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 Items; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Items = Unset; + } + ///State transition - sets the `items` field to Set + pub struct SetItems(PhantomData S>); + impl sealed::Sealed for SetItems {} + impl State for SetItems { + type Items = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `items` field + pub struct items(()); + } +} + +/// Builder for constructing an instance of this type +pub struct HiddenPostsPrefBuilder<'a, S: hidden_posts_pref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> HiddenPostsPref<'a> { + /// Create a new builder for this type + pub fn new() -> HiddenPostsPrefBuilder<'a, hidden_posts_pref_state::Empty> { + HiddenPostsPrefBuilder::new() + } +} + +impl<'a> HiddenPostsPrefBuilder<'a, hidden_posts_pref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + HiddenPostsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> HiddenPostsPrefBuilder<'a, S> +where + S: hidden_posts_pref_state::State, + S::Items: hidden_posts_pref_state::IsUnset, +{ + /// Set the `items` field (required) + pub fn items( + mut self, + value: impl Into>>, + ) -> HiddenPostsPrefBuilder<'a, hidden_posts_pref_state::SetItems> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + HiddenPostsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> HiddenPostsPrefBuilder<'a, S> +where + S: hidden_posts_pref_state::State, + S::Items: hidden_posts_pref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> HiddenPostsPref<'a> { + HiddenPostsPref { + items: 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>, + >, + ) -> HiddenPostsPref<'a> { + HiddenPostsPref { + items: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for HiddenPostsPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "hiddenPostsPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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 InterestsPref<'a> { + /// A list of tags which describe the account owner's interests gathered during onboarding. + #[serde(borrow)] + pub tags: Vec>, +} + +pub mod interests_pref_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 Tags; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Tags = Unset; + } + ///State transition - sets the `tags` field to Set + pub struct SetTags(PhantomData S>); + impl sealed::Sealed for SetTags {} + impl State for SetTags { + type Tags = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `tags` field + pub struct tags(()); + } +} + +/// Builder for constructing an instance of this type +pub struct InterestsPrefBuilder<'a, S: interests_pref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> InterestsPref<'a> { + /// Create a new builder for this type + pub fn new() -> InterestsPrefBuilder<'a, interests_pref_state::Empty> { + InterestsPrefBuilder::new() + } +} + +impl<'a> InterestsPrefBuilder<'a, interests_pref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + InterestsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InterestsPrefBuilder<'a, S> +where + S: interests_pref_state::State, + S::Tags: interests_pref_state::IsUnset, +{ + /// Set the `tags` field (required) + pub fn tags( + mut self, + value: impl Into>>, + ) -> InterestsPrefBuilder<'a, interests_pref_state::SetTags> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + InterestsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InterestsPrefBuilder<'a, S> +where + S: interests_pref_state::State, + S::Tags: interests_pref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> InterestsPref<'a> { + InterestsPref { + tags: 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>, + >, + ) -> InterestsPref<'a> { + InterestsPref { + tags: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for InterestsPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "interestsPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.tags; + #[allow(unused_comparisons)] + if value.len() > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "tags", + ), + max: 100usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +/// The subject's followers whom you also follow +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct KnownFollowers<'a> { + pub count: i64, + #[serde(borrow)] + pub followers: Vec>, +} + +pub mod known_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 Count; + type Followers; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Count = Unset; + type Followers = Unset; + } + ///State transition - sets the `count` field to Set + pub struct SetCount(PhantomData S>); + impl sealed::Sealed for SetCount {} + impl State for SetCount { + type Count = Set; + type Followers = S::Followers; + } + ///State transition - sets the `followers` field to Set + pub struct SetFollowers(PhantomData S>); + impl sealed::Sealed for SetFollowers {} + impl State for SetFollowers { + type Count = S::Count; + type Followers = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `count` field + pub struct count(()); + ///Marker type for the `followers` field + pub struct followers(()); + } +} + +/// Builder for constructing an instance of this type +pub struct KnownFollowersBuilder<'a, S: known_followers_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> KnownFollowers<'a> { + /// Create a new builder for this type + pub fn new() -> KnownFollowersBuilder<'a, known_followers_state::Empty> { + KnownFollowersBuilder::new() + } +} + +impl<'a> KnownFollowersBuilder<'a, known_followers_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + KnownFollowersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> KnownFollowersBuilder<'a, S> +where + S: known_followers_state::State, + S::Count: known_followers_state::IsUnset, +{ + /// Set the `count` field (required) + pub fn count( + mut self, + value: impl Into, + ) -> KnownFollowersBuilder<'a, known_followers_state::SetCount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + KnownFollowersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> KnownFollowersBuilder<'a, S> +where + S: known_followers_state::State, + S::Followers: known_followers_state::IsUnset, +{ + /// Set the `followers` field (required) + pub fn followers( + mut self, + value: impl Into>>, + ) -> KnownFollowersBuilder<'a, known_followers_state::SetFollowers> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + KnownFollowersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> KnownFollowersBuilder<'a, S> +where + S: known_followers_state::State, + S::Count: known_followers_state::IsSet, + S::Followers: known_followers_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> KnownFollowers<'a> { + KnownFollowers { + count: self.__unsafe_private_named.0.unwrap(), + followers: 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>, + >, + ) -> KnownFollowers<'a> { + KnownFollowers { + count: self.__unsafe_private_named.0.unwrap(), + followers: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for KnownFollowers<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "knownFollowers" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.followers; + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "followers", + ), + max: 5usize, + actual: value.len(), + }); + } + } + { + let value = &self.followers; + #[allow(unused_comparisons)] + if value.len() < 0usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "followers", + ), + min: 0usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct LabelerPrefItem<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod labeler_pref_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelerPrefItemBuilder<'a, S: labeler_pref_item_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> LabelerPrefItem<'a> { + /// Create a new builder for this type + pub fn new() -> LabelerPrefItemBuilder<'a, labeler_pref_item_state::Empty> { + LabelerPrefItemBuilder::new() + } +} + +impl<'a> LabelerPrefItemBuilder<'a, labeler_pref_item_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelerPrefItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelerPrefItemBuilder<'a, S> +where + S: labeler_pref_item_state::State, + S::Did: labeler_pref_item_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> LabelerPrefItemBuilder<'a, labeler_pref_item_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LabelerPrefItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelerPrefItemBuilder<'a, S> +where + S: labeler_pref_item_state::State, + S::Did: labeler_pref_item_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LabelerPrefItem<'a> { + LabelerPrefItem { + did: 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>, + >, + ) -> LabelerPrefItem<'a> { + LabelerPrefItem { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelerPrefItem<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "labelerPrefItem" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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 LabelersPref<'a> { + #[serde(borrow)] + pub labelers: Vec>, +} + +pub mod labelers_pref_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 Labelers; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Labelers = Unset; + } + ///State transition - sets the `labelers` field to Set + pub struct SetLabelers(PhantomData S>); + impl sealed::Sealed for SetLabelers {} + impl State for SetLabelers { + type Labelers = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `labelers` field + pub struct labelers(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelersPrefBuilder<'a, S: labelers_pref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> LabelersPref<'a> { + /// Create a new builder for this type + pub fn new() -> LabelersPrefBuilder<'a, labelers_pref_state::Empty> { + LabelersPrefBuilder::new() + } +} + +impl<'a> LabelersPrefBuilder<'a, labelers_pref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelersPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelersPrefBuilder<'a, S> +where + S: labelers_pref_state::State, + S::Labelers: labelers_pref_state::IsUnset, +{ + /// Set the `labelers` field (required) + pub fn labelers( + mut self, + value: impl Into>>, + ) -> LabelersPrefBuilder<'a, labelers_pref_state::SetLabelers> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LabelersPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelersPrefBuilder<'a, S> +where + S: labelers_pref_state::State, + S::Labelers: labelers_pref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LabelersPref<'a> { + LabelersPref { + labelers: 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>, + >, + ) -> LabelersPref<'a> { + LabelersPref { + labelers: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelersPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "labelersPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// A word that the account owner has muted. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct MutedWord<'a> { + /// Groups of users to apply the muted word to. If undefined, applies to all users. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub actor_target: Option>, + /// The date and time at which the muted word will expire and no longer be applied. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub expires_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub id: Option>, + /// The intended targets of the muted word. + #[serde(borrow)] + pub targets: Vec>, + /// The muted word itself. + #[serde(borrow)] + pub value: jacquard_common::CowStr<'a>, +} + +pub mod muted_word_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 Value; + type Targets; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Value = Unset; + type Targets = 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 Targets = S::Targets; + } + ///State transition - sets the `targets` field to Set + pub struct SetTargets(PhantomData S>); + impl sealed::Sealed for SetTargets {} + impl State for SetTargets { + type Value = S::Value; + type Targets = 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 `targets` field + pub struct targets(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MutedWordBuilder<'a, S: muted_word_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> MutedWord<'a> { + /// Create a new builder for this type + pub fn new() -> MutedWordBuilder<'a, muted_word_state::Empty> { + MutedWordBuilder::new() + } +} + +impl<'a> MutedWordBuilder<'a, muted_word_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MutedWordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: muted_word_state::State> MutedWordBuilder<'a, S> { + /// Set the `actorTarget` field (optional) + pub fn actor_target( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `actorTarget` field to an Option value (optional) + pub fn maybe_actor_target( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: muted_word_state::State> MutedWordBuilder<'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: muted_word_state::State> MutedWordBuilder<'a, S> { + /// Set the `id` field (optional) + pub fn id(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `id` field to an Option value (optional) + pub fn maybe_id(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> MutedWordBuilder<'a, S> +where + S: muted_word_state::State, + S::Targets: muted_word_state::IsUnset, +{ + /// Set the `targets` field (required) + pub fn targets( + mut self, + value: impl Into>>, + ) -> MutedWordBuilder<'a, muted_word_state::SetTargets> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + MutedWordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MutedWordBuilder<'a, S> +where + S: muted_word_state::State, + S::Value: muted_word_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> MutedWordBuilder<'a, muted_word_state::SetValue> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + MutedWordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MutedWordBuilder<'a, S> +where + S: muted_word_state::State, + S::Value: muted_word_state::IsSet, + S::Targets: muted_word_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> MutedWord<'a> { + MutedWord { + actor_target: self.__unsafe_private_named.0, + expires_at: self.__unsafe_private_named.1, + id: self.__unsafe_private_named.2, + targets: self.__unsafe_private_named.3.unwrap(), + value: 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>, + >, + ) -> MutedWord<'a> { + MutedWord { + actor_target: self.__unsafe_private_named.0, + expires_at: self.__unsafe_private_named.1, + id: self.__unsafe_private_named.2, + targets: self.__unsafe_private_named.3.unwrap(), + value: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MutedWord<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "mutedWord" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.value; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "value", + ), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.value; + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "value", + ), + max: 1000usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum MutedWordTarget<'a> { + Content, + Tag, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> MutedWordTarget<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Content => "content", + Self::Tag => "tag", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for MutedWordTarget<'a> { + fn from(s: &'a str) -> Self { + match s { + "content" => Self::Content, + "tag" => Self::Tag, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for MutedWordTarget<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "content" => Self::Content, + "tag" => Self::Tag, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for MutedWordTarget<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for MutedWordTarget<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for MutedWordTarget<'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 MutedWordTarget<'_> { + type Output = MutedWordTarget<'static>; + fn into_static(self) -> Self::Output { + match self { + MutedWordTarget::Content => MutedWordTarget::Content, + MutedWordTarget::Tag => MutedWordTarget::Tag, + MutedWordTarget::Other(v) => MutedWordTarget::Other(v.into_static()), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct MutedWordsPref<'a> { + /// A list of words the account owner has muted. + #[serde(borrow)] + pub items: Vec>, +} + +pub mod muted_words_pref_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 Items; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Items = Unset; + } + ///State transition - sets the `items` field to Set + pub struct SetItems(PhantomData S>); + impl sealed::Sealed for SetItems {} + impl State for SetItems { + type Items = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `items` field + pub struct items(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MutedWordsPrefBuilder<'a, S: muted_words_pref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> MutedWordsPref<'a> { + /// Create a new builder for this type + pub fn new() -> MutedWordsPrefBuilder<'a, muted_words_pref_state::Empty> { + MutedWordsPrefBuilder::new() + } +} + +impl<'a> MutedWordsPrefBuilder<'a, muted_words_pref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MutedWordsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MutedWordsPrefBuilder<'a, S> +where + S: muted_words_pref_state::State, + S::Items: muted_words_pref_state::IsUnset, +{ + /// Set the `items` field (required) + pub fn items( + mut self, + value: impl Into>>, + ) -> MutedWordsPrefBuilder<'a, muted_words_pref_state::SetItems> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MutedWordsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MutedWordsPrefBuilder<'a, S> +where + S: muted_words_pref_state::State, + S::Items: muted_words_pref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> MutedWordsPref<'a> { + MutedWordsPref { + items: 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>, + >, + ) -> MutedWordsPref<'a> { + MutedWordsPref { + items: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MutedWordsPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "mutedWordsPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// A new user experiences (NUX) storage object +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Nux<'a> { + pub completed: bool, + /// Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub data: Option>, + /// The date and time at which the NUX will expire and should be considered completed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub expires_at: Option, + #[serde(borrow)] + pub id: jacquard_common::CowStr<'a>, +} + +pub mod nux_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 Id; + type Completed; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct NuxBuilder<'a, S: nux_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> Nux<'a> { + /// Create a new builder for this type + pub fn new() -> NuxBuilder<'a, nux_state::Empty> { + NuxBuilder::new() + } +} + +impl<'a> NuxBuilder<'a, nux_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NuxBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NuxBuilder<'a, S> +where + S: nux_state::State, + S::Completed: nux_state::IsUnset, +{ + /// Set the `completed` field (required) + pub fn completed( + mut self, + value: impl Into, + ) -> NuxBuilder<'a, nux_state::SetCompleted> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NuxBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: nux_state::State> NuxBuilder<'a, S> { + /// Set the `data` field (optional) + pub fn data( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `data` field to an Option value (optional) + pub fn maybe_data(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: nux_state::State> NuxBuilder<'a, S> { + /// Set the `expiresAt` field (optional) + pub fn expires_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S> NuxBuilder<'a, S> +where + S: nux_state::State, + S::Id: nux_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into>, + ) -> NuxBuilder<'a, nux_state::SetId> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + NuxBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NuxBuilder<'a, S> +where + S: nux_state::State, + S::Id: nux_state::IsSet, + S::Completed: nux_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Nux<'a> { + Nux { + completed: self.__unsafe_private_named.0.unwrap(), + data: self.__unsafe_private_named.1, + expires_at: self.__unsafe_private_named.2, + id: 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>, + >, + ) -> Nux<'a> { + Nux { + completed: self.__unsafe_private_named.0.unwrap(), + data: self.__unsafe_private_named.1, + expires_at: self.__unsafe_private_named.2, + id: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Nux<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "nux" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.data { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "data", + ), + max: 3000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.data { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 300usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "data", + ), + max: 300usize, + actual: count, + }); + } + } + } + { + let value = &self.id; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "id", + ), + max: 100usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct PersonalDetailsPref<'a> { + /// The birth date of account owner. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub birth_date: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PersonalDetailsPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "personalDetailsPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct PostInteractionSettingsPref<'a> { + /// Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub postgate_embedding_rules: std::option::Option< + Vec>, + >, + /// Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub threadgate_allow_rules: std::option::Option< + Vec>, + >, +} + +#[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 PostInteractionSettingsPrefThreadgateAllowRulesItem<'a> { + #[serde(rename = "app.bsky.feed.threadgate#mentionRule")] + ThreadgateMentionRule(Box>), + #[serde(rename = "app.bsky.feed.threadgate#followerRule")] + ThreadgateFollowerRule(Box>), + #[serde(rename = "app.bsky.feed.threadgate#followingRule")] + ThreadgateFollowingRule(Box>), + #[serde(rename = "app.bsky.feed.threadgate#listRule")] + ThreadgateListRule(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PostInteractionSettingsPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "postInteractionSettingsPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.postgate_embedding_rules { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "postgate_embedding_rules", + ), + max: 5usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.threadgate_allow_rules { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "threadgate_allow_rules", + ), + max: 5usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[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 PreferencesItem<'a> { + #[serde(rename = "app.bsky.actor.defs#adultContentPref")] + AdultContentPref(Box>), + #[serde(rename = "app.bsky.actor.defs#contentLabelPref")] + ContentLabelPref(Box>), + #[serde(rename = "app.bsky.actor.defs#savedFeedsPref")] + SavedFeedsPref(Box>), + #[serde(rename = "app.bsky.actor.defs#savedFeedsPrefV2")] + SavedFeedsPrefV2(Box>), + #[serde(rename = "app.bsky.actor.defs#personalDetailsPref")] + PersonalDetailsPref(Box>), + #[serde(rename = "app.bsky.actor.defs#feedViewPref")] + FeedViewPref(Box>), + #[serde(rename = "app.bsky.actor.defs#threadViewPref")] + ThreadViewPref(Box>), + #[serde(rename = "app.bsky.actor.defs#interestsPref")] + InterestsPref(Box>), + #[serde(rename = "app.bsky.actor.defs#mutedWordsPref")] + MutedWordsPref(Box>), + #[serde(rename = "app.bsky.actor.defs#hiddenPostsPref")] + HiddenPostsPref(Box>), + #[serde(rename = "app.bsky.actor.defs#bskyAppStatePref")] + BskyAppStatePref(Box>), + #[serde(rename = "app.bsky.actor.defs#labelersPref")] + LabelersPref(Box>), + #[serde(rename = "app.bsky.actor.defs#postInteractionSettingsPref")] + PostInteractionSettingsPref( + Box>, + ), + #[serde(rename = "app.bsky.actor.defs#verificationPrefs")] + VerificationPrefs(Box>), +} + +pub type Preferences<'a> = Vec>; +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileAssociated<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub activity_subscription: std::option::Option< + crate::app_bsky::actor::ProfileAssociatedActivitySubscription<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub chat: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub feedgens: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub labeler: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub lists: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub starter_packs: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileAssociated<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "profileAssociated" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileAssociatedActivitySubscription<'a> { + #[serde(borrow)] + pub allow_subscriptions: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema +for ProfileAssociatedActivitySubscription<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "profileAssociatedActivitySubscription" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileAssociatedChat<'a> { + #[serde(borrow)] + pub allow_incoming: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileAssociatedChat<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "profileAssociatedChat" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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 ProfileView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub associated: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + /// Debug information for internal development + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub debug: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub indexed_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pronouns: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verification: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod profile_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 Did; + type Handle; + } + /// 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; + } + ///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 `did` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileViewBuilder<'a, S: profile_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> ProfileView<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileViewBuilder<'a, profile_view_state::Empty> { + ProfileViewBuilder::new() + } +} + +impl<'a> ProfileViewBuilder<'a, profile_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `associated` field (optional) + pub fn associated( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `associated` field to an Option value (optional) + pub fn maybe_associated( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `debug` field (optional) + pub fn debug( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `debug` field to an Option value (optional) + pub fn maybe_debug( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ProfileViewBuilder<'a, S> +where + S: profile_view_state::State, + S::Did: profile_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ProfileViewBuilder<'a, profile_view_state::SetDid> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + ProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> ProfileViewBuilder<'a, S> +where + S: profile_view_state::State, + S::Handle: profile_view_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> ProfileViewBuilder<'a, profile_view_state::SetHandle> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + ProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `indexedAt` field (optional) + pub fn indexed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.9 = 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.9 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `pronouns` field (optional) + pub fn pronouns( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = 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.10 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = 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.11 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `verification` field (optional) + pub fn verification( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `verification` field to an Option value (optional) + pub fn maybe_verification( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.13 = 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.13 = value; + self + } +} + +impl<'a, S> ProfileViewBuilder<'a, S> +where + S: profile_view_state::State, + S::Did: profile_view_state::IsSet, + S::Handle: profile_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ProfileView<'a> { + ProfileView { + associated: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + debug: self.__unsafe_private_named.3, + description: self.__unsafe_private_named.4, + did: self.__unsafe_private_named.5.unwrap(), + display_name: self.__unsafe_private_named.6, + handle: self.__unsafe_private_named.7.unwrap(), + indexed_at: self.__unsafe_private_named.8, + labels: self.__unsafe_private_named.9, + pronouns: self.__unsafe_private_named.10, + status: self.__unsafe_private_named.11, + verification: self.__unsafe_private_named.12, + viewer: self.__unsafe_private_named.13, + 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>, + >, + ) -> ProfileView<'a> { + ProfileView { + associated: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + debug: self.__unsafe_private_named.3, + description: self.__unsafe_private_named.4, + did: self.__unsafe_private_named.5.unwrap(), + display_name: self.__unsafe_private_named.6, + handle: self.__unsafe_private_named.7.unwrap(), + indexed_at: self.__unsafe_private_named.8, + labels: self.__unsafe_private_named.9, + pronouns: self.__unsafe_private_named.10, + status: self.__unsafe_private_named.11, + verification: self.__unsafe_private_named.12, + viewer: self.__unsafe_private_named.13, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileView<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "profileView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 2560usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 2560usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 256usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 256usize, + actual: count, + }); + } + } + } + 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(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileViewBasic<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub associated: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + /// Debug information for internal development + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub debug: Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pronouns: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verification: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod profile_view_basic_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 Did; + type Handle; + } + /// 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; + } + ///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 `did` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ProfileViewBasic<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { + ProfileViewBasicBuilder::new() + } +} + +impl<'a> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileViewBasicBuilder { + _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: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `associated` field (optional) + pub fn associated( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `associated` field to an Option value (optional) + pub fn maybe_associated( + 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 `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + 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 `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `debug` field (optional) + pub fn debug( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `debug` field to an Option value (optional) + pub fn maybe_debug( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> ProfileViewBasicBuilder<'a, S> +where + S: profile_view_basic_state::State, + S::Did: profile_view_basic_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid> { + 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 `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +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.6 = ::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 `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.7 = 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.7 = 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.8 = 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.8 = value; + self + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.9 = 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.9 = value; + self + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `verification` field (optional) + pub fn verification( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `verification` field to an Option value (optional) + pub fn maybe_verification( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = 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.11 = 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 { + associated: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + debug: self.__unsafe_private_named.3, + did: self.__unsafe_private_named.4.unwrap(), + display_name: self.__unsafe_private_named.5, + handle: self.__unsafe_private_named.6.unwrap(), + labels: self.__unsafe_private_named.7, + pronouns: self.__unsafe_private_named.8, + status: self.__unsafe_private_named.9, + verification: self.__unsafe_private_named.10, + viewer: self.__unsafe_private_named.11, + 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 { + associated: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + debug: self.__unsafe_private_named.3, + did: self.__unsafe_private_named.4.unwrap(), + display_name: self.__unsafe_private_named.5, + handle: self.__unsafe_private_named.6.unwrap(), + labels: self.__unsafe_private_named.7, + pronouns: self.__unsafe_private_named.8, + status: self.__unsafe_private_named.9, + verification: self.__unsafe_private_named.10, + viewer: self.__unsafe_private_named.11, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewBasic<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "profileViewBasic" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_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(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileViewDetailed<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub associated: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub banner: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + /// Debug information for internal development + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub debug: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub followers_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub follows_count: Option, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub indexed_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub joined_via_starter_pack: Option< + crate::app_bsky::graph::StarterPackViewBasic<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pinned_post: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub posts_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pronouns: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verification: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub website: Option>, +} + +pub mod profile_view_detailed_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 Did; + type Handle; + } + /// 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; + } + ///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 `did` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileViewDetailedBuilder<'a, S: profile_view_detailed_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>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ProfileViewDetailed<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::Empty> { + ProfileViewDetailedBuilder::new() + } +} + +impl<'a> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileViewDetailedBuilder { + _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, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `associated` field (optional) + pub fn associated( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `associated` field to an Option value (optional) + pub fn maybe_associated( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `banner` field (optional) + pub fn banner( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `banner` field to an Option value (optional) + pub fn maybe_banner( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = 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.3 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `debug` field (optional) + pub fn debug( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `debug` field to an Option value (optional) + pub fn maybe_debug( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> ProfileViewDetailedBuilder<'a, S> +where + S: profile_view_detailed_state::State, + S::Did: profile_view_detailed_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::SetDid> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + ProfileViewDetailedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `followersCount` field (optional) + pub fn followers_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `followersCount` field to an Option value (optional) + pub fn maybe_followers_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `followsCount` field (optional) + pub fn follows_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `followsCount` field to an Option value (optional) + pub fn maybe_follows_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S> ProfileViewDetailedBuilder<'a, S> +where + S: profile_view_detailed_state::State, + S::Handle: profile_view_detailed_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::SetHandle> { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + ProfileViewDetailedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `indexedAt` field (optional) + pub fn indexed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.11 = 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.11 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `joinedViaStarterPack` field (optional) + pub fn joined_via_starter_pack( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `joinedViaStarterPack` field to an Option value (optional) + pub fn maybe_joined_via_starter_pack( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.13 = 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.13 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `pinnedPost` field (optional) + pub fn pinned_post( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.14 = value.into(); + self + } + /// Set the `pinnedPost` field to an Option value (optional) + pub fn maybe_pinned_post( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.14 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `postsCount` field (optional) + pub fn posts_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.15 = value.into(); + self + } + /// Set the `postsCount` field to an Option value (optional) + pub fn maybe_posts_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.15 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `pronouns` field (optional) + pub fn pronouns( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.16 = 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.16 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.17 = 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.17 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `verification` field (optional) + pub fn verification( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.18 = value.into(); + self + } + /// Set the `verification` field to an Option value (optional) + pub fn maybe_verification( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.18 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.19 = 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.19 = value; + self + } +} + +impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { + /// Set the `website` field (optional) + pub fn website( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.20 = value.into(); + self + } + /// Set the `website` field to an Option value (optional) + pub fn maybe_website( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.20 = value; + self + } +} + +impl<'a, S> ProfileViewDetailedBuilder<'a, S> +where + S: profile_view_detailed_state::State, + S::Did: profile_view_detailed_state::IsSet, + S::Handle: profile_view_detailed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ProfileViewDetailed<'a> { + ProfileViewDetailed { + associated: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + banner: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3, + debug: self.__unsafe_private_named.4, + description: self.__unsafe_private_named.5, + did: self.__unsafe_private_named.6.unwrap(), + display_name: self.__unsafe_private_named.7, + followers_count: self.__unsafe_private_named.8, + follows_count: self.__unsafe_private_named.9, + handle: self.__unsafe_private_named.10.unwrap(), + indexed_at: self.__unsafe_private_named.11, + joined_via_starter_pack: self.__unsafe_private_named.12, + labels: self.__unsafe_private_named.13, + pinned_post: self.__unsafe_private_named.14, + posts_count: self.__unsafe_private_named.15, + pronouns: self.__unsafe_private_named.16, + status: self.__unsafe_private_named.17, + verification: self.__unsafe_private_named.18, + viewer: self.__unsafe_private_named.19, + website: self.__unsafe_private_named.20, + 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>, + >, + ) -> ProfileViewDetailed<'a> { + ProfileViewDetailed { + associated: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + banner: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3, + debug: self.__unsafe_private_named.4, + description: self.__unsafe_private_named.5, + did: self.__unsafe_private_named.6.unwrap(), + display_name: self.__unsafe_private_named.7, + followers_count: self.__unsafe_private_named.8, + follows_count: self.__unsafe_private_named.9, + handle: self.__unsafe_private_named.10.unwrap(), + indexed_at: self.__unsafe_private_named.11, + joined_via_starter_pack: self.__unsafe_private_named.12, + labels: self.__unsafe_private_named.13, + pinned_post: self.__unsafe_private_named.14, + posts_count: self.__unsafe_private_named.15, + pronouns: self.__unsafe_private_named.16, + status: self.__unsafe_private_named.17, + verification: self.__unsafe_private_named.18, + viewer: self.__unsafe_private_named.19, + website: self.__unsafe_private_named.20, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewDetailed<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "profileViewDetailed" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 2560usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 2560usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 256usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 256usize, + actual: count, + }); + } + } + } + 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(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SavedFeed<'a> { + #[serde(borrow)] + pub id: jacquard_common::CowStr<'a>, + pub pinned: bool, + #[serde(borrow)] + pub r#type: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub value: jacquard_common::CowStr<'a>, +} + +pub mod saved_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 { + type Id; + type Type; + type Value; + type Pinned; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Id = Unset; + type Type = Unset; + type Value = Unset; + type Pinned = 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 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 Value = S::Value; + type Pinned = S::Pinned; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Id = S::Id; + type Type = S::Type; + type Value = Set; + type Pinned = S::Pinned; + } + ///State transition - sets the `pinned` field to Set + pub struct SetPinned(PhantomData S>); + impl sealed::Sealed for SetPinned {} + impl State for SetPinned { + type Id = S::Id; + type Type = S::Type; + type Value = S::Value; + type Pinned = 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 `type` field + pub struct r#type(()); + ///Marker type for the `value` field + pub struct value(()); + ///Marker type for the `pinned` field + pub struct pinned(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SavedFeedBuilder<'a, S: saved_feed_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> SavedFeed<'a> { + /// Create a new builder for this type + pub fn new() -> SavedFeedBuilder<'a, saved_feed_state::Empty> { + SavedFeedBuilder::new() + } +} + +impl<'a> SavedFeedBuilder<'a, saved_feed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SavedFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedBuilder<'a, S> +where + S: saved_feed_state::State, + S::Id: saved_feed_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into>, + ) -> SavedFeedBuilder<'a, saved_feed_state::SetId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SavedFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedBuilder<'a, S> +where + S: saved_feed_state::State, + S::Pinned: saved_feed_state::IsUnset, +{ + /// Set the `pinned` field (required) + pub fn pinned( + mut self, + value: impl Into, + ) -> SavedFeedBuilder<'a, saved_feed_state::SetPinned> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SavedFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedBuilder<'a, S> +where + S: saved_feed_state::State, + S::Type: saved_feed_state::IsUnset, +{ + /// Set the `type` field (required) + pub fn r#type( + mut self, + value: impl Into>, + ) -> SavedFeedBuilder<'a, saved_feed_state::SetType> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SavedFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedBuilder<'a, S> +where + S: saved_feed_state::State, + S::Value: saved_feed_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> SavedFeedBuilder<'a, saved_feed_state::SetValue> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + SavedFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedBuilder<'a, S> +where + S: saved_feed_state::State, + S::Id: saved_feed_state::IsSet, + S::Type: saved_feed_state::IsSet, + S::Value: saved_feed_state::IsSet, + S::Pinned: saved_feed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SavedFeed<'a> { + SavedFeed { + id: self.__unsafe_private_named.0.unwrap(), + pinned: self.__unsafe_private_named.1.unwrap(), + r#type: self.__unsafe_private_named.2.unwrap(), + value: 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>, + >, + ) -> SavedFeed<'a> { + SavedFeed { + id: self.__unsafe_private_named.0.unwrap(), + pinned: self.__unsafe_private_named.1.unwrap(), + r#type: self.__unsafe_private_named.2.unwrap(), + value: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SavedFeed<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "savedFeed" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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 SavedFeedsPref<'a> { + #[serde(borrow)] + pub pinned: Vec>, + #[serde(borrow)] + pub saved: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub timeline_index: Option, +} + +pub mod saved_feeds_pref_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 Pinned; + type Saved; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Pinned = Unset; + 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 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 `pinned` field + pub struct pinned(()); + ///Marker type for the `saved` field + pub struct saved(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SavedFeedsPrefBuilder<'a, S: saved_feeds_pref_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> SavedFeedsPref<'a> { + /// Create a new builder for this type + pub fn new() -> SavedFeedsPrefBuilder<'a, saved_feeds_pref_state::Empty> { + SavedFeedsPrefBuilder::new() + } +} + +impl<'a> SavedFeedsPrefBuilder<'a, saved_feeds_pref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SavedFeedsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedsPrefBuilder<'a, S> +where + S: saved_feeds_pref_state::State, + S::Pinned: saved_feeds_pref_state::IsUnset, +{ + /// Set the `pinned` field (required) + pub fn pinned( + mut self, + value: impl Into>>, + ) -> SavedFeedsPrefBuilder<'a, saved_feeds_pref_state::SetPinned> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SavedFeedsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedsPrefBuilder<'a, S> +where + S: saved_feeds_pref_state::State, + S::Saved: saved_feeds_pref_state::IsUnset, +{ + /// Set the `saved` field (required) + pub fn saved( + mut self, + value: impl Into>>, + ) -> SavedFeedsPrefBuilder<'a, saved_feeds_pref_state::SetSaved> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SavedFeedsPrefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: saved_feeds_pref_state::State> SavedFeedsPrefBuilder<'a, S> { + /// Set the `timelineIndex` field (optional) + pub fn timeline_index(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `timelineIndex` field to an Option value (optional) + pub fn maybe_timeline_index(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> SavedFeedsPrefBuilder<'a, S> +where + S: saved_feeds_pref_state::State, + S::Pinned: saved_feeds_pref_state::IsSet, + S::Saved: saved_feeds_pref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SavedFeedsPref<'a> { + SavedFeedsPref { + pinned: self.__unsafe_private_named.0.unwrap(), + saved: self.__unsafe_private_named.1.unwrap(), + timeline_index: 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>, + >, + ) -> SavedFeedsPref<'a> { + SavedFeedsPref { + pinned: self.__unsafe_private_named.0.unwrap(), + saved: self.__unsafe_private_named.1.unwrap(), + timeline_index: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SavedFeedsPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "savedFeedsPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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 SavedFeedsPrefV2<'a> { + #[serde(borrow)] + pub items: Vec>, +} + +pub mod saved_feeds_pref_v2_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 Items; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Items = Unset; + } + ///State transition - sets the `items` field to Set + pub struct SetItems(PhantomData S>); + impl sealed::Sealed for SetItems {} + impl State for SetItems { + type Items = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `items` field + pub struct items(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SavedFeedsPrefV2Builder<'a, S: saved_feeds_pref_v2_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SavedFeedsPrefV2<'a> { + /// Create a new builder for this type + pub fn new() -> SavedFeedsPrefV2Builder<'a, saved_feeds_pref_v2_state::Empty> { + SavedFeedsPrefV2Builder::new() + } +} + +impl<'a> SavedFeedsPrefV2Builder<'a, saved_feeds_pref_v2_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SavedFeedsPrefV2Builder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedsPrefV2Builder<'a, S> +where + S: saved_feeds_pref_v2_state::State, + S::Items: saved_feeds_pref_v2_state::IsUnset, +{ + /// Set the `items` field (required) + pub fn items( + mut self, + value: impl Into>>, + ) -> SavedFeedsPrefV2Builder<'a, saved_feeds_pref_v2_state::SetItems> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SavedFeedsPrefV2Builder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SavedFeedsPrefV2Builder<'a, S> +where + S: saved_feeds_pref_v2_state::State, + S::Items: saved_feeds_pref_v2_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SavedFeedsPrefV2<'a> { + SavedFeedsPrefV2 { + items: 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>, + >, + ) -> SavedFeedsPrefV2<'a> { + SavedFeedsPrefV2 { + items: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SavedFeedsPrefV2<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "savedFeedsPrefV2" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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 StatusView<'a> { + /// An optional embed associated with the status. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embed: Option>, + /// The date when this status will expire. The application might choose to no longer return the status after expiration. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub expires_at: Option, + /// True if the status is not expired, false if it is expired. Only present if expiration was set. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub is_active: Option, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + /// The status for the account. + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, +} + +pub mod status_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 Record; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Status = Unset; + type Record = 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 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 Status = S::Status; + type Record = 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 `record` field + pub struct record(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StatusViewBuilder<'a, S: status_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> StatusView<'a> { + /// Create a new builder for this type + pub fn new() -> StatusViewBuilder<'a, status_view_state::Empty> { + StatusViewBuilder::new() + } +} + +impl<'a> StatusViewBuilder<'a, status_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StatusViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: status_view_state::State> StatusViewBuilder<'a, S> { + /// Set the `embed` field (optional) + pub fn embed( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `embed` field to an Option value (optional) + pub fn maybe_embed( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: status_view_state::State> StatusViewBuilder<'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: status_view_state::State> StatusViewBuilder<'a, S> { + /// Set the `isActive` field (optional) + pub fn is_active(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `isActive` field to an Option value (optional) + pub fn maybe_is_active(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> StatusViewBuilder<'a, S> +where + S: status_view_state::State, + S::Record: status_view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> StatusViewBuilder<'a, status_view_state::SetRecord> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + StatusViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StatusViewBuilder<'a, S> +where + S: status_view_state::State, + S::Status: status_view_state::IsUnset, +{ + /// Set the `status` field (required) + pub fn status( + mut self, + value: impl Into>, + ) -> StatusViewBuilder<'a, status_view_state::SetStatus> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + StatusViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StatusViewBuilder<'a, S> +where + S: status_view_state::State, + S::Status: status_view_state::IsSet, + S::Record: status_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> StatusView<'a> { + StatusView { + embed: self.__unsafe_private_named.0, + expires_at: self.__unsafe_private_named.1, + is_active: self.__unsafe_private_named.2, + record: self.__unsafe_private_named.3.unwrap(), + status: 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>, + >, + ) -> StatusView<'a> { + StatusView { + embed: self.__unsafe_private_named.0, + expires_at: self.__unsafe_private_named.1, + is_active: self.__unsafe_private_named.2, + record: self.__unsafe_private_named.3.unwrap(), + status: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StatusView<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "statusView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ThreadViewPref<'a> { + /// Show followed users at the top of all replies. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub prioritize_followed_users: std::option::Option, + /// Sorting mode for threads. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadViewPref<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "threadViewPref" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Preferences for how verified accounts appear in the app. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct VerificationPrefs<'a> { + /// Hide the blue check badges for verified accounts and trusted verifiers. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hide_badges: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for VerificationPrefs<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "verificationPrefs" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Represents the verification information about the user this object is attached to. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct VerificationState<'a> { + /// The user's status as a trusted verifier. + #[serde(borrow)] + pub trusted_verifier_status: jacquard_common::CowStr<'a>, + /// All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included. + #[serde(borrow)] + pub verifications: Vec>, + /// The user's status as a verified account. + #[serde(borrow)] + pub verified_status: jacquard_common::CowStr<'a>, +} + +pub mod verification_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 Verifications; + 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 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 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 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 `verified_status` field + pub struct verified_status(()); + ///Marker type for the `trusted_verifier_status` field + pub struct trusted_verifier_status(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VerificationStateBuilder<'a, S: verification_state_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> VerificationState<'a> { + /// Create a new builder for this type + pub fn new() -> VerificationStateBuilder<'a, verification_state_state::Empty> { + VerificationStateBuilder::new() + } +} + +impl<'a> VerificationStateBuilder<'a, verification_state_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VerificationStateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationStateBuilder<'a, S> +where + S: verification_state_state::State, + S::TrustedVerifierStatus: verification_state_state::IsUnset, +{ + /// Set the `trustedVerifierStatus` field (required) + pub fn trusted_verifier_status( + mut self, + value: impl Into>, + ) -> VerificationStateBuilder< + 'a, + verification_state_state::SetTrustedVerifierStatus, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + VerificationStateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationStateBuilder<'a, S> +where + S: verification_state_state::State, + S::Verifications: verification_state_state::IsUnset, +{ + /// Set the `verifications` field (required) + pub fn verifications( + mut self, + value: impl Into>>, + ) -> VerificationStateBuilder<'a, verification_state_state::SetVerifications> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + VerificationStateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationStateBuilder<'a, S> +where + S: verification_state_state::State, + S::VerifiedStatus: verification_state_state::IsUnset, +{ + /// Set the `verifiedStatus` field (required) + pub fn verified_status( + mut self, + value: impl Into>, + ) -> VerificationStateBuilder<'a, verification_state_state::SetVerifiedStatus> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + VerificationStateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationStateBuilder<'a, S> +where + S: verification_state_state::State, + S::Verifications: 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> { + VerificationState { + trusted_verifier_status: self.__unsafe_private_named.0.unwrap(), + verifications: self.__unsafe_private_named.1.unwrap(), + verified_status: 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>, + >, + ) -> VerificationState<'a> { + VerificationState { + trusted_verifier_status: self.__unsafe_private_named.0.unwrap(), + verifications: self.__unsafe_private_named.1.unwrap(), + verified_status: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for VerificationState<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "verificationState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// An individual verification for an associated subject. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct VerificationView<'a> { + /// Timestamp when the verification was created. + pub created_at: jacquard_common::types::string::Datetime, + /// True if the verification passes validation, otherwise false. + pub is_valid: bool, + /// The user who issued this verification. + #[serde(borrow)] + pub issuer: jacquard_common::types::string::Did<'a>, + /// The AT-URI of the verification record. + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod verification_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 Issuer; + type Uri; + type IsValid; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Issuer = Unset; + type Uri = Unset; + type IsValid = Unset; + type CreatedAt = Unset; + } + ///State transition - sets the `issuer` field to Set + pub struct SetIssuer(PhantomData S>); + impl sealed::Sealed for SetIssuer {} + impl State for SetIssuer { + type Issuer = Set; + type Uri = S::Uri; + type IsValid = S::IsValid; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Issuer = S::Issuer; + type Uri = Set; + type IsValid = S::IsValid; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `is_valid` field to Set + pub struct SetIsValid(PhantomData S>); + impl sealed::Sealed for SetIsValid {} + impl State for SetIsValid { + type Issuer = S::Issuer; + type Uri = S::Uri; + type IsValid = 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 Issuer = S::Issuer; + type Uri = S::Uri; + type IsValid = S::IsValid; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `issuer` field + pub struct issuer(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `is_valid` field + pub struct is_valid(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VerificationViewBuilder<'a, S: verification_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> VerificationView<'a> { + /// Create a new builder for this type + pub fn new() -> VerificationViewBuilder<'a, verification_view_state::Empty> { + VerificationViewBuilder::new() + } +} + +impl<'a> VerificationViewBuilder<'a, verification_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::CreatedAt: verification_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> VerificationViewBuilder<'a, verification_view_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::IsValid: verification_view_state::IsUnset, +{ + /// Set the `isValid` field (required) + pub fn is_valid( + mut self, + value: impl Into, + ) -> VerificationViewBuilder<'a, verification_view_state::SetIsValid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::Issuer: verification_view_state::IsUnset, +{ + /// Set the `issuer` field (required) + pub fn issuer( + mut self, + value: impl Into>, + ) -> VerificationViewBuilder<'a, verification_view_state::SetIssuer> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::Uri: verification_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> VerificationViewBuilder<'a, verification_view_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::Issuer: verification_view_state::IsSet, + S::Uri: verification_view_state::IsSet, + S::IsValid: verification_view_state::IsSet, + S::CreatedAt: verification_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> VerificationView<'a> { + VerificationView { + created_at: self.__unsafe_private_named.0.unwrap(), + is_valid: self.__unsafe_private_named.1.unwrap(), + issuer: self.__unsafe_private_named.2.unwrap(), + uri: 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>, + >, + ) -> VerificationView<'a> { + VerificationView { + created_at: self.__unsafe_private_named.0.unwrap(), + is_valid: self.__unsafe_private_named.1.unwrap(), + issuer: self.__unsafe_private_named.2.unwrap(), + uri: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for VerificationView<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "verificationView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ViewerState<'a> { + /// This property is present only in selected cases, as an optimization. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub activity_subscription: std::option::Option< + crate::app_bsky::notification::ActivitySubscription<'a>, + >, + #[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 blocking: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub blocking_by_list: std::option::Option>, + #[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>, + /// This property is present only in selected cases, as an optimization. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub known_followers: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub muted: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub muted_by_list: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewerState<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "viewerState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_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/app_bsky/actor/get_preferences.rs b/crates/weaver-api/src/app_bsky/actor/get_preferences.rs new file mode 100644 index 0000000..4086460 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/get_preferences.rs @@ -0,0 +1,59 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.actor.getPreferences +// +// 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 GetPreferences; +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPreferencesOutput<'a> { + #[serde(borrow)] + pub preferences: crate::app_bsky::actor::Preferences<'a>, +} + +/// Response type for +///app.bsky.actor.getPreferences +pub struct GetPreferencesResponse; +impl jacquard_common::xrpc::XrpcResp for GetPreferencesResponse { + const NSID: &'static str = "app.bsky.actor.getPreferences"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPreferencesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetPreferences { + const NSID: &'static str = "app.bsky.actor.getPreferences"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPreferencesResponse; +} + +/// Endpoint type for +///app.bsky.actor.getPreferences +pub struct GetPreferencesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetPreferencesRequest { + const PATH: &'static str = "/xrpc/app.bsky.actor.getPreferences"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPreferences; + type Response = GetPreferencesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/actor/get_profile.rs b/crates/weaver-api/src/app_bsky/actor/get_profile.rs new file mode 100644 index 0000000..4149b2c --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/get_profile.rs @@ -0,0 +1,155 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.actor.getProfile +// +// 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 GetProfile<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod get_profile_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 GetProfileBuilder<'a, S: get_profile_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetProfile<'a> { + /// Create a new builder for this type + pub fn new() -> GetProfileBuilder<'a, get_profile_state::Empty> { + GetProfileBuilder::new() + } +} + +impl<'a> GetProfileBuilder<'a, get_profile_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetProfileBuilder<'a, S> +where + S: get_profile_state::State, + S::Actor: get_profile_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetProfileBuilder<'a, get_profile_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetProfileBuilder<'a, S> +where + S: get_profile_state::State, + S::Actor: get_profile_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetProfile<'a> { + GetProfile { + actor: 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 GetProfileOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::app_bsky::actor::ProfileViewDetailed<'a>, +} + +/// Response type for +///app.bsky.actor.getProfile +pub struct GetProfileResponse; +impl jacquard_common::xrpc::XrpcResp for GetProfileResponse { + const NSID: &'static str = "app.bsky.actor.getProfile"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetProfileOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetProfile<'a> { + const NSID: &'static str = "app.bsky.actor.getProfile"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetProfileResponse; +} + +/// Endpoint type for +///app.bsky.actor.getProfile +pub struct GetProfileRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetProfileRequest { + const PATH: &'static str = "/xrpc/app.bsky.actor.getProfile"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetProfile<'de>; + type Response = GetProfileResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/actor/get_profiles.rs b/crates/weaver-api/src/app_bsky/actor/get_profiles.rs new file mode 100644 index 0000000..82d3d36 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/get_profiles.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.actor.getProfiles +// +// 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 GetProfiles<'a> { + #[serde(borrow)] + pub actors: Vec>, +} + +pub mod get_profiles_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 Actors; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actors = Unset; + } + ///State transition - sets the `actors` field to Set + pub struct SetActors(PhantomData S>); + impl sealed::Sealed for SetActors {} + impl State for SetActors { + type Actors = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actors` field + pub struct actors(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetProfilesBuilder<'a, S: get_profiles_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetProfiles<'a> { + /// Create a new builder for this type + pub fn new() -> GetProfilesBuilder<'a, get_profiles_state::Empty> { + GetProfilesBuilder::new() + } +} + +impl<'a> GetProfilesBuilder<'a, get_profiles_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetProfilesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetProfilesBuilder<'a, S> +where + S: get_profiles_state::State, + S::Actors: get_profiles_state::IsUnset, +{ + /// Set the `actors` field (required) + pub fn actors( + mut self, + value: impl Into>>, + ) -> GetProfilesBuilder<'a, get_profiles_state::SetActors> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetProfilesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetProfilesBuilder<'a, S> +where + S: get_profiles_state::State, + S::Actors: get_profiles_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetProfiles<'a> { + GetProfiles { + actors: 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 GetProfilesOutput<'a> { + #[serde(borrow)] + pub profiles: Vec>, +} + +/// Response type for +///app.bsky.actor.getProfiles +pub struct GetProfilesResponse; +impl jacquard_common::xrpc::XrpcResp for GetProfilesResponse { + const NSID: &'static str = "app.bsky.actor.getProfiles"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetProfilesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetProfiles<'a> { + const NSID: &'static str = "app.bsky.actor.getProfiles"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetProfilesResponse; +} + +/// Endpoint type for +///app.bsky.actor.getProfiles +pub struct GetProfilesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetProfilesRequest { + const PATH: &'static str = "/xrpc/app.bsky.actor.getProfiles"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetProfiles<'de>; + type Response = GetProfilesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/actor/get_suggestions.rs b/crates/weaver-api/src/app_bsky/actor/get_suggestions.rs new file mode 100644 index 0000000..b9d317b --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/get_suggestions.rs @@ -0,0 +1,162 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.actor.getSuggestions +// +// 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 GetSuggestions<'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_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 GetSuggestionsBuilder<'a, S: get_suggestions_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSuggestions<'a> { + /// Create a new builder for this type + pub fn new() -> GetSuggestionsBuilder<'a, get_suggestions_state::Empty> { + GetSuggestionsBuilder::new() + } +} + +impl<'a> GetSuggestionsBuilder<'a, get_suggestions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_suggestions_state::State> GetSuggestionsBuilder<'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_suggestions_state::State> GetSuggestionsBuilder<'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> GetSuggestionsBuilder<'a, S> +where + S: get_suggestions_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestions<'a> { + GetSuggestions { + 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 GetSuggestionsOutput<'a> { + #[serde(borrow)] + pub actors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Snowflake for this recommendation, use when submitting recommendation events. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub rec_id: std::option::Option, +} + +/// Response type for +///app.bsky.actor.getSuggestions +pub struct GetSuggestionsResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestionsResponse { + const NSID: &'static str = "app.bsky.actor.getSuggestions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSuggestions<'a> { + const NSID: &'static str = "app.bsky.actor.getSuggestions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestionsResponse; +} + +/// Endpoint type for +///app.bsky.actor.getSuggestions +pub struct GetSuggestionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestionsRequest { + const PATH: &'static str = "/xrpc/app.bsky.actor.getSuggestions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestions<'de>; + type Response = GetSuggestionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/actor/profile.rs b/crates/weaver-api/src/app_bsky/actor/profile.rs new file mode 100644 index 0000000..d73b207 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/profile.rs @@ -0,0 +1,705 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.actor.profile +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A declaration of a Bluesky account profile. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Profile<'a> { + /// Small image to be displayed next to posts from account. AKA, 'profile picture' + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + /// Larger horizontal image to display behind profile view. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub banner: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + /// Free-form profile description text. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub joined_via_starter_pack: Option< + crate::com_atproto::repo::strong_ref::StrongRef<'a>, + >, + /// Self-label values, specific to the Bluesky application, on the overall account. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pinned_post: Option>, + /// Free-form pronouns text. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pronouns: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub website: Option>, +} + +pub mod profile_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 ProfileBuilder<'a, S: profile_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Profile<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { + ProfileBuilder::new() + } +} + +impl<'a> ProfileBuilder<'a, profile_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `banner` field (optional) + pub fn banner( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `banner` field to an Option value (optional) + pub fn maybe_banner( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `joinedViaStarterPack` field (optional) + pub fn joined_via_starter_pack( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `joinedViaStarterPack` field to an Option value (optional) + pub fn maybe_joined_via_starter_pack( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'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_state::State> ProfileBuilder<'a, S> { + /// Set the `pinnedPost` field (optional) + pub fn pinned_post( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `pinnedPost` field to an Option value (optional) + pub fn maybe_pinned_post( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `pronouns` field (optional) + pub fn pronouns( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `website` field (optional) + pub fn website( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `website` field to an Option value (optional) + pub fn maybe_website( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, +{ + /// Build the final struct + pub fn build(self) -> Profile<'a> { + Profile { + avatar: self.__unsafe_private_named.0, + banner: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + description: self.__unsafe_private_named.3, + display_name: self.__unsafe_private_named.4, + joined_via_starter_pack: self.__unsafe_private_named.5, + labels: self.__unsafe_private_named.6, + pinned_post: self.__unsafe_private_named.7, + pronouns: self.__unsafe_private_named.8, + website: self.__unsafe_private_named.9, + 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>, + >, + ) -> Profile<'a> { + Profile { + avatar: self.__unsafe_private_named.0, + banner: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + description: self.__unsafe_private_named.3, + display_name: self.__unsafe_private_named.4, + joined_via_starter_pack: self.__unsafe_private_named.5, + labels: self.__unsafe_private_named.6, + pinned_post: self.__unsafe_private_named.7, + pronouns: self.__unsafe_private_named.8, + website: self.__unsafe_private_named.9, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Profile<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, + 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 ProfileGetRecordOutput<'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: Profile<'a>, +} + +impl From> for Profile<'_> { + fn from(output: ProfileGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Profile<'_> { + const NSID: &'static str = "app.bsky.actor.profile"; + type Record = ProfileRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ProfileRecord; +impl jacquard_common::xrpc::XrpcResp for ProfileRecord { + const NSID: &'static str = "app.bsky.actor.profile"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ProfileGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ProfileRecord { + const NSID: &'static str = "app.bsky.actor.profile"; + type Record = ProfileRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.profile" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_profile() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 2560usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 2560usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 256usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 256usize, + actual: count, + }); + } + } + } + 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, + }); + } + } + } + if let Some(ref value) = self.pronouns { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 200usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "pronouns", + ), + max: 200usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.pronouns { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 20usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "pronouns", + ), + max: 20usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +fn lexicon_doc_app_bsky_actor_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.actor.profile"), + 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( + "A declaration of a Bluesky account profile.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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("banner"), + ::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( + "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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Free-form profile description text.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(2560usize), + min_graphemes: None, + max_graphemes: Some(256usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "joinedViaStarterPack", + ), + ::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("labels"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: Some( + ::jacquard_common::CowStr::new_static( + "Self-label values, specific to the Bluesky application, on the overall account.", + ), + ), + refs: vec![ + ::jacquard_common::CowStr::new_static("com.atproto.label.defs#selfLabels") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "pinnedPost", + ), + ::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( + "pronouns", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Free-form pronouns text.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(200usize), + min_graphemes: None, + max_graphemes: Some(20usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("website"), + ::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 + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/actor/put_preferences.rs b/crates/weaver-api/src/app_bsky/actor/put_preferences.rs new file mode 100644 index 0000000..3f1a886 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/put_preferences.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.actor.putPreferences +// +// 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 PutPreferences<'a> { + #[serde(borrow)] + pub preferences: crate::app_bsky::actor::Preferences<'a>, +} + +pub mod put_preferences_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 Preferences; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Preferences = Unset; + } + ///State transition - sets the `preferences` field to Set + pub struct SetPreferences(PhantomData S>); + impl sealed::Sealed for SetPreferences {} + impl State for SetPreferences { + type Preferences = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `preferences` field + pub struct preferences(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PutPreferencesBuilder<'a, S: put_preferences_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PutPreferences<'a> { + /// Create a new builder for this type + pub fn new() -> PutPreferencesBuilder<'a, put_preferences_state::Empty> { + PutPreferencesBuilder::new() + } +} + +impl<'a> PutPreferencesBuilder<'a, put_preferences_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PutPreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutPreferencesBuilder<'a, S> +where + S: put_preferences_state::State, + S::Preferences: put_preferences_state::IsUnset, +{ + /// Set the `preferences` field (required) + pub fn preferences( + mut self, + value: impl Into>, + ) -> PutPreferencesBuilder<'a, put_preferences_state::SetPreferences> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PutPreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutPreferencesBuilder<'a, S> +where + S: put_preferences_state::State, + S::Preferences: put_preferences_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PutPreferences<'a> { + PutPreferences { + preferences: 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>, + >, + ) -> PutPreferences<'a> { + PutPreferences { + preferences: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.actor.putPreferences +pub struct PutPreferencesResponse; +impl jacquard_common::xrpc::XrpcResp for PutPreferencesResponse { + const NSID: &'static str = "app.bsky.actor.putPreferences"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for PutPreferences<'a> { + const NSID: &'static str = "app.bsky.actor.putPreferences"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = PutPreferencesResponse; +} + +/// Endpoint type for +///app.bsky.actor.putPreferences +pub struct PutPreferencesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for PutPreferencesRequest { + const PATH: &'static str = "/xrpc/app.bsky.actor.putPreferences"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = PutPreferences<'de>; + type Response = PutPreferencesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/actor/search_actors.rs b/crates/weaver-api/src/app_bsky/actor/search_actors.rs new file mode 100644 index 0000000..6f044d4 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/search_actors.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.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(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub q: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub term: std::option::Option>, +} + +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 {} + /// 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 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>, + ::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, 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: search_actors_state::State> SearchActorsBuilder<'a, S> { + /// Set the `q` field (optional) + pub fn q(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `q` field to an Option value (optional) + pub fn maybe_q(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: search_actors_state::State> SearchActorsBuilder<'a, S> { + /// Set the `term` field (optional) + pub fn term( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `term` field to an Option value (optional) + pub fn maybe_term(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> SearchActorsBuilder<'a, S> +where + S: search_actors_state::State, +{ + /// 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, + term: 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 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 +///app.bsky.actor.searchActors +pub struct SearchActorsResponse; +impl jacquard_common::xrpc::XrpcResp for SearchActorsResponse { + const NSID: &'static str = "app.bsky.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 = "app.bsky.actor.searchActors"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchActorsResponse; +} + +/// Endpoint type for +///app.bsky.actor.searchActors +pub struct SearchActorsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchActorsRequest { + const PATH: &'static str = "/xrpc/app.bsky.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/app_bsky/actor/search_actors_typeahead.rs b/crates/weaver-api/src/app_bsky/actor/search_actors_typeahead.rs new file mode 100644 index 0000000..23e2552 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/search_actors_typeahead.rs @@ -0,0 +1,177 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.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: 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 q: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub term: std::option::Option>, +} + +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 {} + /// 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 SearchActorsTypeaheadBuilder<'a, S: search_actors_typeahead_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> 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, 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: search_actors_typeahead_state::State> SearchActorsTypeaheadBuilder<'a, S> { + /// Set the `q` field (optional) + pub fn q(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `q` field to an Option value (optional) + pub fn maybe_q(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: search_actors_typeahead_state::State> SearchActorsTypeaheadBuilder<'a, S> { + /// Set the `term` field (optional) + pub fn term( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `term` field to an Option value (optional) + pub fn maybe_term(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> SearchActorsTypeaheadBuilder<'a, S> +where + S: search_actors_typeahead_state::State, +{ + /// Build the final struct + pub fn build(self) -> SearchActorsTypeahead<'a> { + SearchActorsTypeahead { + limit: self.__unsafe_private_named.0, + q: self.__unsafe_private_named.1, + term: 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 SearchActorsTypeaheadOutput<'a> { + #[serde(borrow)] + pub actors: Vec>, +} + +/// Response type for +///app.bsky.actor.searchActorsTypeahead +pub struct SearchActorsTypeaheadResponse; +impl jacquard_common::xrpc::XrpcResp for SearchActorsTypeaheadResponse { + const NSID: &'static str = "app.bsky.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 = "app.bsky.actor.searchActorsTypeahead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchActorsTypeaheadResponse; +} + +/// Endpoint type for +///app.bsky.actor.searchActorsTypeahead +pub struct SearchActorsTypeaheadRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchActorsTypeaheadRequest { + const PATH: &'static str = "/xrpc/app.bsky.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/app_bsky/actor/status.rs b/crates/weaver-api/src/app_bsky/actor/status.rs new file mode 100644 index 0000000..4105506 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/actor/status.rs @@ -0,0 +1,429 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.actor.status +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Advertises an account as currently offering live content. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct Live; +impl std::fmt::Display for Live { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "live") + } +} + +/// A declaration of a Bluesky account status. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Status<'a> { + pub created_at: jacquard_common::types::string::Datetime, + /// The duration of the status in minutes. Applications can choose to impose minimum and maximum limits. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub duration_minutes: Option, + /// An optional embed associated with the status. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embed: Option>, + /// The status for the account. + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, +} + +pub mod status_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 CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Status = Unset; + 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 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 `status` field + pub struct status(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StatusBuilder<'a, S: status_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> Status<'a> { + /// Create a new builder for this type + pub fn new() -> StatusBuilder<'a, status_state::Empty> { + StatusBuilder::new() + } +} + +impl<'a> StatusBuilder<'a, status_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StatusBuilder<'a, S> +where + S: status_state::State, + S::CreatedAt: status_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> StatusBuilder<'a, status_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + StatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: status_state::State> StatusBuilder<'a, S> { + /// Set the `durationMinutes` field (optional) + pub fn duration_minutes(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `durationMinutes` field to an Option value (optional) + pub fn maybe_duration_minutes(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: status_state::State> StatusBuilder<'a, S> { + /// Set the `embed` field (optional) + pub fn embed( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `embed` field to an Option value (optional) + pub fn maybe_embed( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> StatusBuilder<'a, S> +where + S: status_state::State, + S::Status: status_state::IsUnset, +{ + /// Set the `status` field (required) + pub fn status( + mut self, + value: impl Into>, + ) -> StatusBuilder<'a, status_state::SetStatus> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + StatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StatusBuilder<'a, S> +where + S: status_state::State, + S::Status: status_state::IsSet, + S::CreatedAt: status_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Status<'a> { + Status { + created_at: self.__unsafe_private_named.0.unwrap(), + duration_minutes: self.__unsafe_private_named.1, + embed: self.__unsafe_private_named.2, + status: 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>, + >, + ) -> Status<'a> { + Status { + created_at: self.__unsafe_private_named.0.unwrap(), + duration_minutes: self.__unsafe_private_named.1, + embed: self.__unsafe_private_named.2, + status: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Status<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, StatusRecord>, + 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 StatusGetRecordOutput<'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: Status<'a>, +} + +impl From> for Status<'_> { + fn from(output: StatusGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Status<'_> { + const NSID: &'static str = "app.bsky.actor.status"; + type Record = StatusRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct StatusRecord; +impl jacquard_common::xrpc::XrpcResp for StatusRecord { + const NSID: &'static str = "app.bsky.actor.status"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = StatusGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for StatusRecord { + const NSID: &'static str = "app.bsky.actor.status"; + type Record = StatusRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Status<'a> { + fn nsid() -> &'static str { + "app.bsky.actor.status" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_status() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.duration_minutes { + if *value < 1i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "duration_minutes", + ), + min: 1i64, + actual: *value, + }); + } + } + Ok(()) + } +} + +fn lexicon_doc_app_bsky_actor_status() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.actor.status"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("live"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + 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( + "A declaration of a Bluesky account status.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::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( + "durationMinutes", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(1i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("embed"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: Some( + ::jacquard_common::CowStr::new_static( + "An optional embed associated with the status.", + ), + ), + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.external") + ], + closed: 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( + "The status for the account.", + ), + ), + 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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/bookmark.rs b/crates/weaver-api/src/app_bsky/bookmark.rs new file mode 100644 index 0000000..3b38380 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/bookmark.rs @@ -0,0 +1,472 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.bookmark.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod create_bookmark; +pub mod delete_bookmark; +pub mod get_bookmarks; + +/// Object used to store bookmark data in stash. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Bookmark<'a> { + /// A strong ref to the record to be bookmarked. Currently, only `app.bsky.feed.post` records are supported. + #[serde(borrow)] + pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, +} + +pub mod bookmark_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 BookmarkBuilder<'a, S: bookmark_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Bookmark<'a> { + /// Create a new builder for this type + pub fn new() -> BookmarkBuilder<'a, bookmark_state::Empty> { + BookmarkBuilder::new() + } +} + +impl<'a> BookmarkBuilder<'a, bookmark_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookmarkBuilder<'a, S> +where + S: bookmark_state::State, + S::Subject: bookmark_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> BookmarkBuilder<'a, bookmark_state::SetSubject> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookmarkBuilder<'a, S> +where + S: bookmark_state::State, + S::Subject: bookmark_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Bookmark<'a> { + Bookmark { + subject: 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>, + >, + ) -> Bookmark<'a> { + Bookmark { + subject: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_bookmark_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.bookmark.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("bookmark"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Object used to store bookmark data in stash.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("subject")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("bookmarkView"), + ::jacquard_lexicon::lexicon::LexUserType::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("item") + ], + ), + 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("item"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.feed.defs#blockedPost"), + ::jacquard_common::CowStr::new_static("app.bsky.feed.defs#notFoundPost"), + ::jacquard_common::CowStr::new_static("app.bsky.feed.defs#postView") + ], + closed: 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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Bookmark<'a> { + fn nsid() -> &'static str { + "app.bsky.bookmark.defs" + } + fn def_name() -> &'static str { + "bookmark" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_bookmark_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 BookmarkView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + #[serde(borrow)] + pub item: BookmarkViewItem<'a>, + /// A strong ref to the bookmarked record. + #[serde(borrow)] + pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, +} + +pub mod bookmark_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 Subject; + type Item; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Subject = Unset; + type Item = 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 Item = S::Item; + } + ///State transition - sets the `item` field to Set + pub struct SetItem(PhantomData S>); + impl sealed::Sealed for SetItem {} + impl State for SetItem { + type Subject = S::Subject; + type Item = 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 `item` field + pub struct item(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BookmarkViewBuilder<'a, S: bookmark_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> BookmarkView<'a> { + /// Create a new builder for this type + pub fn new() -> BookmarkViewBuilder<'a, bookmark_view_state::Empty> { + BookmarkViewBuilder::new() + } +} + +impl<'a> BookmarkViewBuilder<'a, bookmark_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BookmarkViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: bookmark_view_state::State> BookmarkViewBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = 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.0 = value; + self + } +} + +impl<'a, S> BookmarkViewBuilder<'a, S> +where + S: bookmark_view_state::State, + S::Item: bookmark_view_state::IsUnset, +{ + /// Set the `item` field (required) + pub fn item( + mut self, + value: impl Into>, + ) -> BookmarkViewBuilder<'a, bookmark_view_state::SetItem> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + BookmarkViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookmarkViewBuilder<'a, S> +where + S: bookmark_view_state::State, + S::Subject: bookmark_view_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> BookmarkViewBuilder<'a, bookmark_view_state::SetSubject> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + BookmarkViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookmarkViewBuilder<'a, S> +where + S: bookmark_view_state::State, + S::Subject: bookmark_view_state::IsSet, + S::Item: bookmark_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> BookmarkView<'a> { + BookmarkView { + created_at: self.__unsafe_private_named.0, + item: self.__unsafe_private_named.1.unwrap(), + subject: 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>, + >, + ) -> BookmarkView<'a> { + BookmarkView { + created_at: self.__unsafe_private_named.0, + item: self.__unsafe_private_named.1.unwrap(), + subject: self.__unsafe_private_named.2.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 BookmarkViewItem<'a> { + #[serde(rename = "app.bsky.feed.defs#blockedPost")] + BlockedPost(Box>), + #[serde(rename = "app.bsky.feed.defs#notFoundPost")] + NotFoundPost(Box>), + #[serde(rename = "app.bsky.feed.defs#postView")] + PostView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookmarkView<'a> { + fn nsid() -> &'static str { + "app.bsky.bookmark.defs" + } + fn def_name() -> &'static str { + "bookmarkView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_bookmark_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/app_bsky/bookmark/create_bookmark.rs b/crates/weaver-api/src/app_bsky/bookmark/create_bookmark.rs new file mode 100644 index 0000000..b165fdb --- /dev/null +++ b/crates/weaver-api/src/app_bsky/bookmark/create_bookmark.rs @@ -0,0 +1,229 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.bookmark.createBookmark +// +// 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 CreateBookmark<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod create_bookmark_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 Cid; + } + /// 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; + } + ///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 `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CreateBookmarkBuilder<'a, S: create_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> CreateBookmark<'a> { + /// Create a new builder for this type + pub fn new() -> CreateBookmarkBuilder<'a, create_bookmark_state::Empty> { + CreateBookmarkBuilder::new() + } +} + +impl<'a> CreateBookmarkBuilder<'a, create_bookmark_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CreateBookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateBookmarkBuilder<'a, S> +where + S: create_bookmark_state::State, + S::Cid: create_bookmark_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> CreateBookmarkBuilder<'a, create_bookmark_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CreateBookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateBookmarkBuilder<'a, S> +where + S: create_bookmark_state::State, + S::Uri: create_bookmark_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> CreateBookmarkBuilder<'a, create_bookmark_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CreateBookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateBookmarkBuilder<'a, S> +where + S: create_bookmark_state::State, + S::Uri: create_bookmark_state::IsSet, + S::Cid: create_bookmark_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CreateBookmark<'a> { + CreateBookmark { + cid: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> CreateBookmark<'a> { + CreateBookmark { + cid: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[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 CreateBookmarkError<'a> { + /// The URI to be bookmarked is for an unsupported collection. + #[serde(rename = "UnsupportedCollection")] + UnsupportedCollection(std::option::Option), +} + +impl std::fmt::Display for CreateBookmarkError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::UnsupportedCollection(msg) => { + write!(f, "UnsupportedCollection")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.bookmark.createBookmark +pub struct CreateBookmarkResponse; +impl jacquard_common::xrpc::XrpcResp for CreateBookmarkResponse { + const NSID: &'static str = "app.bsky.bookmark.createBookmark"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = CreateBookmarkError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateBookmark<'a> { + const NSID: &'static str = "app.bsky.bookmark.createBookmark"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateBookmarkResponse; +} + +/// Endpoint type for +///app.bsky.bookmark.createBookmark +pub struct CreateBookmarkRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateBookmarkRequest { + const PATH: &'static str = "/xrpc/app.bsky.bookmark.createBookmark"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateBookmark<'de>; + type Response = CreateBookmarkResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/bookmark/delete_bookmark.rs b/crates/weaver-api/src/app_bsky/bookmark/delete_bookmark.rs new file mode 100644 index 0000000..533775e --- /dev/null +++ b/crates/weaver-api/src/app_bsky/bookmark/delete_bookmark.rs @@ -0,0 +1,192 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.bookmark.deleteBookmark +// +// 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 DeleteBookmark<'a> { + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod delete_bookmark_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 DeleteBookmarkBuilder<'a, S: delete_bookmark_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DeleteBookmark<'a> { + /// Create a new builder for this type + pub fn new() -> DeleteBookmarkBuilder<'a, delete_bookmark_state::Empty> { + DeleteBookmarkBuilder::new() + } +} + +impl<'a> DeleteBookmarkBuilder<'a, delete_bookmark_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeleteBookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteBookmarkBuilder<'a, S> +where + S: delete_bookmark_state::State, + S::Uri: delete_bookmark_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> DeleteBookmarkBuilder<'a, delete_bookmark_state::SetUri> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeleteBookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteBookmarkBuilder<'a, S> +where + S: delete_bookmark_state::State, + S::Uri: delete_bookmark_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DeleteBookmark<'a> { + DeleteBookmark { + uri: 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>, + >, + ) -> DeleteBookmark<'a> { + DeleteBookmark { + uri: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[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 DeleteBookmarkError<'a> { + /// The URI to be bookmarked is for an unsupported collection. + #[serde(rename = "UnsupportedCollection")] + UnsupportedCollection(std::option::Option), +} + +impl std::fmt::Display for DeleteBookmarkError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::UnsupportedCollection(msg) => { + write!(f, "UnsupportedCollection")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.bookmark.deleteBookmark +pub struct DeleteBookmarkResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteBookmarkResponse { + const NSID: &'static str = "app.bsky.bookmark.deleteBookmark"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = DeleteBookmarkError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteBookmark<'a> { + const NSID: &'static str = "app.bsky.bookmark.deleteBookmark"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteBookmarkResponse; +} + +/// Endpoint type for +///app.bsky.bookmark.deleteBookmark +pub struct DeleteBookmarkRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteBookmarkRequest { + const PATH: &'static str = "/xrpc/app.bsky.bookmark.deleteBookmark"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteBookmark<'de>; + type Response = DeleteBookmarkResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/bookmark/get_bookmarks.rs b/crates/weaver-api/src/app_bsky/bookmark/get_bookmarks.rs new file mode 100644 index 0000000..f605822 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/bookmark/get_bookmarks.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.bookmark.getBookmarks +// +// 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 GetBookmarks<'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_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 {} + /// 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 GetBookmarksBuilder<'a, S: get_bookmarks_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetBookmarks<'a> { + /// Create a new builder for this type + pub fn new() -> GetBookmarksBuilder<'a, get_bookmarks_state::Empty> { + GetBookmarksBuilder::new() + } +} + +impl<'a> GetBookmarksBuilder<'a, get_bookmarks_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetBookmarksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_bookmarks_state::State> GetBookmarksBuilder<'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_bookmarks_state::State> GetBookmarksBuilder<'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> GetBookmarksBuilder<'a, S> +where + S: get_bookmarks_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetBookmarks<'a> { + GetBookmarks { + 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 GetBookmarksOutput<'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 +///app.bsky.bookmark.getBookmarks +pub struct GetBookmarksResponse; +impl jacquard_common::xrpc::XrpcResp for GetBookmarksResponse { + const NSID: &'static str = "app.bsky.bookmark.getBookmarks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetBookmarksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetBookmarks<'a> { + const NSID: &'static str = "app.bsky.bookmark.getBookmarks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetBookmarksResponse; +} + +/// Endpoint type for +///app.bsky.bookmark.getBookmarks +pub struct GetBookmarksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetBookmarksRequest { + const PATH: &'static str = "/xrpc/app.bsky.bookmark.getBookmarks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetBookmarks<'de>; + type Response = GetBookmarksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/embed.rs b/crates/weaver-api/src/app_bsky/embed.rs new file mode 100644 index 0000000..edfa136 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/embed.rs @@ -0,0 +1,266 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.embed.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod external; +pub mod images; +pub mod record; +pub mod record_with_media; +pub mod video; + +/// width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AspectRatio<'a> { + pub height: i64, + pub width: i64, +} + +pub mod aspect_ratio_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 Width; + type Height; + } + /// 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; + } + ///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 `width` field + pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AspectRatioBuilder<'a, S: aspect_ratio_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> AspectRatio<'a> { + /// Create a new builder for this type + pub fn new() -> AspectRatioBuilder<'a, aspect_ratio_state::Empty> { + AspectRatioBuilder::new() + } +} + +impl<'a> AspectRatioBuilder<'a, aspect_ratio_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AspectRatioBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AspectRatioBuilder<'a, S> +where + S: aspect_ratio_state::State, + S::Height: aspect_ratio_state::IsUnset, +{ + /// Set the `height` field (required) + pub fn height( + mut self, + value: impl Into, + ) -> AspectRatioBuilder<'a, aspect_ratio_state::SetHeight> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AspectRatioBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AspectRatioBuilder<'a, S> +where + S: aspect_ratio_state::State, + S::Width: aspect_ratio_state::IsUnset, +{ + /// Set the `width` field (required) + pub fn width( + mut self, + value: impl Into, + ) -> AspectRatioBuilder<'a, aspect_ratio_state::SetWidth> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AspectRatioBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AspectRatioBuilder<'a, S> +where + S: aspect_ratio_state::State, + S::Width: aspect_ratio_state::IsSet, + S::Height: aspect_ratio_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AspectRatio<'a> { + AspectRatio { + height: self.__unsafe_private_named.0.unwrap(), + width: 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>, + >, + ) -> AspectRatio<'a> { + AspectRatio { + height: self.__unsafe_private_named.0.unwrap(), + width: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_embed_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.embed.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("aspectRatio"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("width"), + ::jacquard_common::smol_str::SmolStr::new_static("height") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("height"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(1i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("width"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(1i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AspectRatio<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.defs" + } + fn def_name() -> &'static str { + "aspectRatio" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.height; + if *value < 1i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "height", + ), + min: 1i64, + actual: *value, + }); + } + } + { + let value = &self.width; + if *value < 1i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "width", + ), + min: 1i64, + actual: *value, + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/embed/external.rs b/crates/weaver-api/src/app_bsky/embed/external.rs new file mode 100644 index 0000000..709ac8c --- /dev/null +++ b/crates/weaver-api/src/app_bsky/embed/external.rs @@ -0,0 +1,991 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.embed.external +// +// 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 External<'a> { + #[serde(borrow)] + pub description: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub thumb: Option>, + #[serde(borrow)] + pub title: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::Uri<'a>, +} + +pub mod external_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 Title; + type Description; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + type Title = Unset; + 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 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 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 `uri` field + pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `description` field + pub struct description(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ExternalBuilder<'a, S: external_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> External<'a> { + /// Create a new builder for this type + pub fn new() -> ExternalBuilder<'a, external_state::Empty> { + ExternalBuilder::new() + } +} + +impl<'a> ExternalBuilder<'a, external_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalBuilder<'a, S> +where + S: external_state::State, + S::Description: external_state::IsUnset, +{ + /// Set the `description` field (required) + pub fn description( + mut self, + value: impl Into>, + ) -> ExternalBuilder<'a, external_state::SetDescription> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: external_state::State> ExternalBuilder<'a, S> { + /// Set the `thumb` field (optional) + pub fn thumb( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `thumb` field to an Option value (optional) + pub fn maybe_thumb( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ExternalBuilder<'a, S> +where + S: external_state::State, + S::Title: external_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into>, + ) -> ExternalBuilder<'a, external_state::SetTitle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalBuilder<'a, S> +where + S: external_state::State, + S::Uri: external_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ExternalBuilder<'a, external_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalBuilder<'a, S> +where + S: external_state::State, + S::Uri: external_state::IsSet, + S::Title: external_state::IsSet, + S::Description: external_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> External<'a> { + External { + description: self.__unsafe_private_named.0.unwrap(), + thumb: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2.unwrap(), + uri: 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>, + >, + ) -> External<'a> { + External { + description: self.__unsafe_private_named.0.unwrap(), + thumb: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2.unwrap(), + uri: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_embed_external() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.embed.external"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("external"), + ::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("title"), + ::jacquard_common::smol_str::SmolStr::new_static("description") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::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("thumb"), + ::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("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::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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("external") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("external"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#external"), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("view"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("external") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("external"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#viewExternal", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewExternal"), + ::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("title"), + ::jacquard_common::smol_str::SmolStr::new_static("description") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::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("thumb"), + ::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("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::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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for External<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.external" + } + fn def_name() -> &'static str { + "external" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_external() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ExternalRecord<'a> { + #[serde(borrow)] + pub external: crate::app_bsky::embed::external::External<'a>, +} + +pub mod external_record_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 External; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type External = Unset; + } + ///State transition - sets the `external` field to Set + pub struct SetExternal(PhantomData S>); + impl sealed::Sealed for SetExternal {} + impl State for SetExternal { + type External = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `external` field + pub struct external(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ExternalRecordBuilder<'a, S: external_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ExternalRecord<'a> { + /// Create a new builder for this type + pub fn new() -> ExternalRecordBuilder<'a, external_record_state::Empty> { + ExternalRecordBuilder::new() + } +} + +impl<'a> ExternalRecordBuilder<'a, external_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ExternalRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalRecordBuilder<'a, S> +where + S: external_record_state::State, + S::External: external_record_state::IsUnset, +{ + /// Set the `external` field (required) + pub fn external( + mut self, + value: impl Into>, + ) -> ExternalRecordBuilder<'a, external_record_state::SetExternal> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ExternalRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalRecordBuilder<'a, S> +where + S: external_record_state::State, + S::External: external_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ExternalRecord<'a> { + ExternalRecord { + external: 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>, + >, + ) -> ExternalRecord<'a> { + ExternalRecord { + external: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ExternalRecord<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.external" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_external() + } + 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 View<'a> { + #[serde(borrow)] + pub external: crate::app_bsky::embed::external::ViewExternal<'a>, +} + +pub mod 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 External; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type External = Unset; + } + ///State transition - sets the `external` field to Set + pub struct SetExternal(PhantomData S>); + impl sealed::Sealed for SetExternal {} + impl State for SetExternal { + type External = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `external` field + pub struct external(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::External: view_state::IsUnset, +{ + /// Set the `external` field (required) + pub fn external( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetExternal> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::External: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + external: 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>, + >, + ) -> View<'a> { + View { + external: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.external" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_external() + } + 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 ViewExternal<'a> { + #[serde(borrow)] + pub description: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub thumb: Option>, + #[serde(borrow)] + pub title: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::Uri<'a>, +} + +pub mod view_external_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 Title; + type Description; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + type Title = Unset; + 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 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 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 `uri` field + pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `description` field + pub struct description(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewExternalBuilder<'a, S: view_external_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> ViewExternal<'a> { + /// Create a new builder for this type + pub fn new() -> ViewExternalBuilder<'a, view_external_state::Empty> { + ViewExternalBuilder::new() + } +} + +impl<'a> ViewExternalBuilder<'a, view_external_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewExternalBuilder<'a, S> +where + S: view_external_state::State, + S::Description: view_external_state::IsUnset, +{ + /// Set the `description` field (required) + pub fn description( + mut self, + value: impl Into>, + ) -> ViewExternalBuilder<'a, view_external_state::SetDescription> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_external_state::State> ViewExternalBuilder<'a, S> { + /// Set the `thumb` field (optional) + pub fn thumb( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `thumb` field to an Option value (optional) + pub fn maybe_thumb( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ViewExternalBuilder<'a, S> +where + S: view_external_state::State, + S::Title: view_external_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into>, + ) -> ViewExternalBuilder<'a, view_external_state::SetTitle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ViewExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewExternalBuilder<'a, S> +where + S: view_external_state::State, + S::Uri: view_external_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewExternalBuilder<'a, view_external_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ViewExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewExternalBuilder<'a, S> +where + S: view_external_state::State, + 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> { + ViewExternal { + description: self.__unsafe_private_named.0.unwrap(), + thumb: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2.unwrap(), + uri: 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>, + >, + ) -> ViewExternal<'a> { + ViewExternal { + description: self.__unsafe_private_named.0.unwrap(), + thumb: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2.unwrap(), + uri: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewExternal<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.external" + } + fn def_name() -> &'static str { + "viewExternal" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_external() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/embed/images.rs b/crates/weaver-api/src/app_bsky/embed/images.rs new file mode 100644 index 0000000..b855007 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/embed/images.rs @@ -0,0 +1,967 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.embed.images +// +// 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 Image<'a> { + /// Alt text description of the image, for accessibility. + #[serde(borrow)] + pub alt: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub aspect_ratio: Option>, + #[serde(borrow)] + pub image: jacquard_common::types::blob::BlobRef<'a>, +} + +pub mod image_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 Image; + type Alt; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ImageBuilder<'a, S: image_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> Image<'a> { + /// Create a new builder for this type + pub fn new() -> ImageBuilder<'a, image_state::Empty> { + ImageBuilder::new() + } +} + +impl<'a> ImageBuilder<'a, image_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImageBuilder<'a, S> +where + S: image_state::State, + S::Alt: image_state::IsUnset, +{ + /// Set the `alt` field (required) + pub fn alt( + mut self, + value: impl Into>, + ) -> ImageBuilder<'a, image_state::SetAlt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: image_state::State> ImageBuilder<'a, S> { + /// Set the `aspectRatio` field (optional) + pub fn aspect_ratio( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `aspectRatio` field to an Option value (optional) + pub fn maybe_aspect_ratio( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ImageBuilder<'a, S> +where + S: image_state::State, + S::Image: image_state::IsUnset, +{ + /// Set the `image` field (required) + pub fn image( + mut self, + value: impl Into>, + ) -> ImageBuilder<'a, image_state::SetImage> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImageBuilder<'a, S> +where + S: image_state::State, + S::Image: image_state::IsSet, + S::Alt: image_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Image<'a> { + Image { + alt: self.__unsafe_private_named.0.unwrap(), + aspect_ratio: self.__unsafe_private_named.1, + image: 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>, + >, + ) -> Image<'a> { + Image { + alt: self.__unsafe_private_named.0.unwrap(), + aspect_ratio: self.__unsafe_private_named.1, + image: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_embed_images() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.embed.images"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("image"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("image"), + ::jacquard_common::smol_str::SmolStr::new_static("alt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("alt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Alt text description of the image, for accessibility.", + ), + ), + 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( + "aspectRatio", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.embed.defs#aspectRatio", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("image"), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("images")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("images"), + ::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("#image"), + }), + min_length: None, + max_length: Some(4usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("view"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("images")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("images"), + ::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("#viewImage"), + }), + min_length: None, + max_length: Some(4usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewImage"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("thumb"), + ::jacquard_common::smol_str::SmolStr::new_static("fullsize"), + ::jacquard_common::smol_str::SmolStr::new_static("alt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("alt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Alt text description of the image, for accessibility.", + ), + ), + 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( + "aspectRatio", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.embed.defs#aspectRatio", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("fullsize"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.", + ), + ), + 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("thumb"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.", + ), + ), + 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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Image<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.images" + } + fn def_name() -> &'static str { + "image" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_images() + } + 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 Images<'a> { + #[serde(borrow)] + pub images: Vec>, +} + +pub mod images_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 Images; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Images = Unset; + } + ///State transition - sets the `images` field to Set + pub struct SetImages(PhantomData S>); + impl sealed::Sealed for SetImages {} + impl State for SetImages { + type Images = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `images` field + pub struct images(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ImagesBuilder<'a, S: images_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Images<'a> { + /// Create a new builder for this type + pub fn new() -> ImagesBuilder<'a, images_state::Empty> { + ImagesBuilder::new() + } +} + +impl<'a> ImagesBuilder<'a, images_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ImagesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImagesBuilder<'a, S> +where + S: images_state::State, + S::Images: images_state::IsUnset, +{ + /// Set the `images` field (required) + pub fn images( + mut self, + value: impl Into>>, + ) -> ImagesBuilder<'a, images_state::SetImages> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ImagesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImagesBuilder<'a, S> +where + S: images_state::State, + S::Images: images_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Images<'a> { + Images { + images: 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>, + >, + ) -> Images<'a> { + Images { + images: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Images<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.images" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_images() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.images; + #[allow(unused_comparisons)] + if value.len() > 4usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "images", + ), + max: 4usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct View<'a> { + #[serde(borrow)] + pub images: Vec>, +} + +pub mod 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 Images; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Images = Unset; + } + ///State transition - sets the `images` field to Set + pub struct SetImages(PhantomData S>); + impl sealed::Sealed for SetImages {} + impl State for SetImages { + type Images = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `images` field + pub struct images(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Images: view_state::IsUnset, +{ + /// Set the `images` field (required) + pub fn images( + mut self, + value: impl Into>>, + ) -> ViewBuilder<'a, view_state::SetImages> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Images: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + images: 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>, + >, + ) -> View<'a> { + View { + images: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.images" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_images() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.images; + #[allow(unused_comparisons)] + if value.len() > 4usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "images", + ), + max: 4usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ViewImage<'a> { + /// Alt text description of the image, for accessibility. + #[serde(borrow)] + pub alt: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub aspect_ratio: Option>, + /// Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. + #[serde(borrow)] + pub fullsize: jacquard_common::types::string::Uri<'a>, + /// Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. + #[serde(borrow)] + pub thumb: jacquard_common::types::string::Uri<'a>, +} + +pub mod view_image_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 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 Thumb = Unset; + type Fullsize = Unset; + type Alt = Unset; + } + ///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 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 Thumb = S::Thumb; + 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 Alt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewImageBuilder<'a, S: view_image_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> ViewImage<'a> { + /// Create a new builder for this type + pub fn new() -> ViewImageBuilder<'a, view_image_state::Empty> { + ViewImageBuilder::new() + } +} + +impl<'a> ViewImageBuilder<'a, view_image_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewImageBuilder<'a, S> +where + S: view_image_state::State, + S::Alt: view_image_state::IsUnset, +{ + /// Set the `alt` field (required) + pub fn alt( + mut self, + value: impl Into>, + ) -> ViewImageBuilder<'a, view_image_state::SetAlt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_image_state::State> ViewImageBuilder<'a, S> { + /// Set the `aspectRatio` field (optional) + pub fn aspect_ratio( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `aspectRatio` field to an Option value (optional) + pub fn maybe_aspect_ratio( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ViewImageBuilder<'a, S> +where + S: view_image_state::State, + S::Fullsize: view_image_state::IsUnset, +{ + /// Set the `fullsize` field (required) + pub fn fullsize( + mut self, + value: impl Into>, + ) -> ViewImageBuilder<'a, view_image_state::SetFullsize> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ViewImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewImageBuilder<'a, S> +where + S: view_image_state::State, + S::Thumb: view_image_state::IsUnset, +{ + /// Set the `thumb` field (required) + pub fn thumb( + mut self, + value: impl Into>, + ) -> ViewImageBuilder<'a, view_image_state::SetThumb> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ViewImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewImageBuilder<'a, S> +where + S: view_image_state::State, + 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> { + ViewImage { + alt: self.__unsafe_private_named.0.unwrap(), + aspect_ratio: self.__unsafe_private_named.1, + fullsize: self.__unsafe_private_named.2.unwrap(), + thumb: 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>, + >, + ) -> ViewImage<'a> { + ViewImage { + alt: self.__unsafe_private_named.0.unwrap(), + aspect_ratio: self.__unsafe_private_named.1, + fullsize: self.__unsafe_private_named.2.unwrap(), + thumb: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewImage<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.images" + } + fn def_name() -> &'static str { + "viewImage" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_images() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/embed/record.rs b/crates/weaver-api/src/app_bsky/embed/record.rs new file mode 100644 index 0000000..75d2c56 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/embed/record.rs @@ -0,0 +1,1710 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.embed.record +// +// 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 Record<'a> { + #[serde(borrow)] + pub record: crate::com_atproto::repo::strong_ref::StrongRef<'a>, +} + +pub mod record_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 Record; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `record` field + pub struct record(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordBuilder<'a, S: record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Record<'a> { + /// Create a new builder for this type + pub fn new() -> RecordBuilder<'a, record_state::Empty> { + RecordBuilder::new() + } +} + +impl<'a> RecordBuilder<'a, record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBuilder<'a, S> +where + S: record_state::State, + S::Record: record_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> RecordBuilder<'a, record_state::SetRecord> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBuilder<'a, S> +where + S: record_state::State, + S::Record: record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Record<'a> { + Record { + record: 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>, + >, + ) -> Record<'a> { + Record { + record: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_embed_record() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.embed.record"), + 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::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("record")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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( + "com.atproto.repo.strongRef", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("view"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("record")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#viewRecord"), + ::jacquard_common::CowStr::new_static("#viewNotFound"), + ::jacquard_common::CowStr::new_static("#viewBlocked"), + ::jacquard_common::CowStr::new_static("#viewDetached"), + ::jacquard_common::CowStr::new_static("app.bsky.feed.defs#generatorView"), + ::jacquard_common::CowStr::new_static("app.bsky.graph.defs#listView"), + ::jacquard_common::CowStr::new_static("app.bsky.labeler.defs#labelerView"), + ::jacquard_common::CowStr::new_static("app.bsky.graph.defs#starterPackViewBasic") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewBlocked"), + ::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("blocked"), + ::jacquard_common::smol_str::SmolStr::new_static("author") + ], + ), + 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( + "app.bsky.feed.defs#blockedAuthor", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blocked"), + ::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("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("viewDetached"), + ::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("detached") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("detached"), + ::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("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("viewNotFound"), + ::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("notFound") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notFound"), + ::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("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("viewRecord"), + ::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("author"), + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::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( + "app.bsky.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("embeds"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.images#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.video#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.record#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.recordWithMedia#view") + ], + closed: None, + }), + min_length: None, + max_length: 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: 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( + "quoteCount", + ), + ::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( + "replyCount", + ), + ::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( + "repostCount", + ), + ::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, + ), + 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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Record<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.record" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_record() + } + 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 View<'a> { + #[serde(borrow)] + pub record: ViewUnionRecord<'a>, +} + +pub mod 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 Record; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `record` field + pub struct record(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Record: view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetRecord> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Record: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + record: 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>, + >, + ) -> View<'a> { + View { + record: self.__unsafe_private_named.0.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 ViewUnionRecord<'a> { + #[serde(rename = "app.bsky.embed.record#viewRecord")] + ViewRecord(Box>), + #[serde(rename = "app.bsky.embed.record#viewNotFound")] + ViewNotFound(Box>), + #[serde(rename = "app.bsky.embed.record#viewBlocked")] + ViewBlocked(Box>), + #[serde(rename = "app.bsky.embed.record#viewDetached")] + ViewDetached(Box>), + #[serde(rename = "app.bsky.feed.defs#generatorView")] + GeneratorView(Box>), + #[serde(rename = "app.bsky.graph.defs#listView")] + ListView(Box>), + #[serde(rename = "app.bsky.labeler.defs#labelerView")] + LabelerView(Box>), + #[serde(rename = "app.bsky.graph.defs#starterPackViewBasic")] + StarterPackViewBasic(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.record" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_record() + } + 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 ViewBlocked<'a> { + #[serde(borrow)] + pub author: crate::app_bsky::feed::BlockedAuthor<'a>, + pub blocked: bool, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod view_blocked_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 Blocked; + type Author; + } + /// 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; + } + ///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; + } + ///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 `uri` field + pub struct uri(()); + ///Marker type for the `blocked` field + pub struct blocked(()); + ///Marker type for the `author` field + pub struct author(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBlockedBuilder<'a, S: view_blocked_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> ViewBlocked<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBlockedBuilder<'a, view_blocked_state::Empty> { + ViewBlockedBuilder::new() + } +} + +impl<'a> ViewBlockedBuilder<'a, view_blocked_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBlockedBuilder<'a, S> +where + S: view_blocked_state::State, + S::Author: view_blocked_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> ViewBlockedBuilder<'a, view_blocked_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBlockedBuilder<'a, S> +where + S: view_blocked_state::State, + S::Blocked: view_blocked_state::IsUnset, +{ + /// Set the `blocked` field (required) + pub fn blocked( + mut self, + value: impl Into, + ) -> ViewBlockedBuilder<'a, view_blocked_state::SetBlocked> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBlockedBuilder<'a, S> +where + S: view_blocked_state::State, + S::Uri: view_blocked_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewBlockedBuilder<'a, view_blocked_state::SetUri> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ViewBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBlockedBuilder<'a, S> +where + S: view_blocked_state::State, + 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> { + ViewBlocked { + author: self.__unsafe_private_named.0.unwrap(), + blocked: 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>, + >, + ) -> ViewBlocked<'a> { + ViewBlocked { + author: self.__unsafe_private_named.0.unwrap(), + blocked: 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 ViewBlocked<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.record" + } + fn def_name() -> &'static str { + "viewBlocked" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_record() + } + 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 ViewDetached<'a> { + pub detached: bool, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod view_detached_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 Detached; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewDetachedBuilder<'a, S: view_detached_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ViewDetached<'a> { + /// Create a new builder for this type + pub fn new() -> ViewDetachedBuilder<'a, view_detached_state::Empty> { + ViewDetachedBuilder::new() + } +} + +impl<'a> ViewDetachedBuilder<'a, view_detached_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewDetachedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewDetachedBuilder<'a, S> +where + S: view_detached_state::State, + S::Detached: view_detached_state::IsUnset, +{ + /// Set the `detached` field (required) + pub fn detached( + mut self, + value: impl Into, + ) -> ViewDetachedBuilder<'a, view_detached_state::SetDetached> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewDetachedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewDetachedBuilder<'a, S> +where + S: view_detached_state::State, + S::Uri: view_detached_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewDetachedBuilder<'a, view_detached_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewDetachedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewDetachedBuilder<'a, S> +where + S: view_detached_state::State, + S::Uri: view_detached_state::IsSet, + S::Detached: view_detached_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ViewDetached<'a> { + ViewDetached { + detached: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> ViewDetached<'a> { + ViewDetached { + detached: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewDetached<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.record" + } + fn def_name() -> &'static str { + "viewDetached" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_record() + } + 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 ViewNotFound<'a> { + pub not_found: bool, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod view_not_found_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 NotFound; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + 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 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 `uri` field + pub struct uri(()); + ///Marker type for the `not_found` field + pub struct not_found(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewNotFoundBuilder<'a, S: view_not_found_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ViewNotFound<'a> { + /// Create a new builder for this type + pub fn new() -> ViewNotFoundBuilder<'a, view_not_found_state::Empty> { + ViewNotFoundBuilder::new() + } +} + +impl<'a> ViewNotFoundBuilder<'a, view_not_found_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewNotFoundBuilder<'a, S> +where + S: view_not_found_state::State, + S::NotFound: view_not_found_state::IsUnset, +{ + /// Set the `notFound` field (required) + pub fn not_found( + mut self, + value: impl Into, + ) -> ViewNotFoundBuilder<'a, view_not_found_state::SetNotFound> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewNotFoundBuilder<'a, S> +where + S: view_not_found_state::State, + S::Uri: view_not_found_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewNotFoundBuilder<'a, view_not_found_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewNotFoundBuilder<'a, S> +where + S: view_not_found_state::State, + S::Uri: view_not_found_state::IsSet, + S::NotFound: view_not_found_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ViewNotFound<'a> { + ViewNotFound { + not_found: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> ViewNotFound<'a> { + ViewNotFound { + not_found: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewNotFound<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.record" + } + fn def_name() -> &'static str { + "viewNotFound" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_record() + } + 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 ViewRecord<'a> { + #[serde(borrow)] + pub author: crate::app_bsky::actor::ProfileViewBasic<'a>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embeds: Option>>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub like_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub quote_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reply_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub repost_count: Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + /// The record data itself. + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod view_record_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 Cid; + type Author; + type Value; + 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 Cid = Unset; + type Author = Unset; + type Value = 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; + type Cid = S::Cid; + type Author = S::Author; + type Value = S::Value; + 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 Cid = Set; + type Author = S::Author; + type Value = S::Value; + type IndexedAt = S::IndexedAt; + } + ///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 Cid = S::Cid; + type Author = Set; + type Value = S::Value; + type IndexedAt = S::IndexedAt; + } + ///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 Author = S::Author; + type Value = 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 Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + type Value = S::Value; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `value` field + pub struct value(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewRecordBuilder<'a, S: view_record_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> ViewRecord<'a> { + /// Create a new builder for this type + pub fn new() -> ViewRecordBuilder<'a, view_record_state::Empty> { + ViewRecordBuilder::new() + } +} + +impl<'a> ViewRecordBuilder<'a, view_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewRecordBuilder { + _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> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Author: view_record_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> ViewRecordBuilder<'a, view_record_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Cid: view_record_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> ViewRecordBuilder<'a, view_record_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `embeds` field (optional) + pub fn embeds( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::IndexedAt: view_record_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> ViewRecordBuilder<'a, view_record_state::SetIndexedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'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: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `quoteCount` field (optional) + pub fn quote_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `quoteCount` field to an Option value (optional) + pub fn maybe_quote_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `replyCount` field (optional) + pub fn reply_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `replyCount` field to an Option value (optional) + pub fn maybe_reply_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `repostCount` field (optional) + pub fn repost_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `repostCount` field to an Option value (optional) + pub fn maybe_repost_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Uri: view_record_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewRecordBuilder<'a, view_record_state::SetUri> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Value: view_record_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> ViewRecordBuilder<'a, view_record_state::SetValue> { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Uri: view_record_state::IsSet, + S::Cid: view_record_state::IsSet, + S::Author: view_record_state::IsSet, + S::Value: view_record_state::IsSet, + S::IndexedAt: view_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ViewRecord<'a> { + ViewRecord { + author: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + embeds: self.__unsafe_private_named.2, + indexed_at: self.__unsafe_private_named.3.unwrap(), + labels: self.__unsafe_private_named.4, + like_count: self.__unsafe_private_named.5, + quote_count: self.__unsafe_private_named.6, + reply_count: self.__unsafe_private_named.7, + repost_count: self.__unsafe_private_named.8, + uri: self.__unsafe_private_named.9.unwrap(), + value: self.__unsafe_private_named.10.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>, + >, + ) -> ViewRecord<'a> { + ViewRecord { + author: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + embeds: self.__unsafe_private_named.2, + indexed_at: self.__unsafe_private_named.3.unwrap(), + labels: self.__unsafe_private_named.4, + like_count: self.__unsafe_private_named.5, + quote_count: self.__unsafe_private_named.6, + reply_count: self.__unsafe_private_named.7, + repost_count: self.__unsafe_private_named.8, + uri: self.__unsafe_private_named.9.unwrap(), + value: self.__unsafe_private_named.10.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 ViewRecordEmbedsItem<'a> { + #[serde(rename = "app.bsky.embed.images#view")] + ImagesView(Box>), + #[serde(rename = "app.bsky.embed.video#view")] + VideoView(Box>), + #[serde(rename = "app.bsky.embed.external#view")] + ExternalView(Box>), + #[serde(rename = "app.bsky.embed.record#view")] + View(Box>), + #[serde(rename = "app.bsky.embed.recordWithMedia#view")] + RecordWithMediaView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewRecord<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.record" + } + fn def_name() -> &'static str { + "viewRecord" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_record() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file 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 new file mode 100644 index 0000000..11a250f --- /dev/null +++ b/crates/weaver-api/src/app_bsky/embed/record_with_media.rs @@ -0,0 +1,491 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.embed.recordWithMedia +// +// 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 RecordWithMedia<'a> { + #[serde(borrow)] + pub media: RecordWithMediaMedia<'a>, + #[serde(borrow)] + pub record: crate::app_bsky::embed::record::Record<'a>, +} + +pub mod record_with_media_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 Record; + type Media; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = Unset; + 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 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 `record` field + pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordWithMediaBuilder<'a, S: record_with_media_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RecordWithMedia<'a> { + /// Create a new builder for this type + pub fn new() -> RecordWithMediaBuilder<'a, record_with_media_state::Empty> { + RecordWithMediaBuilder::new() + } +} + +impl<'a> RecordWithMediaBuilder<'a, record_with_media_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordWithMediaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordWithMediaBuilder<'a, S> +where + S: record_with_media_state::State, + S::Media: record_with_media_state::IsUnset, +{ + /// Set the `media` field (required) + pub fn media( + mut self, + value: impl Into>, + ) -> RecordWithMediaBuilder<'a, record_with_media_state::SetMedia> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordWithMediaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordWithMediaBuilder<'a, S> +where + S: record_with_media_state::State, + S::Record: record_with_media_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> RecordWithMediaBuilder<'a, record_with_media_state::SetRecord> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RecordWithMediaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordWithMediaBuilder<'a, S> +where + S: record_with_media_state::State, + S::Record: record_with_media_state::IsSet, + S::Media: record_with_media_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RecordWithMedia<'a> { + RecordWithMedia { + media: self.__unsafe_private_named.0.unwrap(), + record: 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>, + >, + ) -> RecordWithMedia<'a> { + RecordWithMedia { + media: self.__unsafe_private_named.0.unwrap(), + record: self.__unsafe_private_named.1.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 RecordWithMediaMedia<'a> { + #[serde(rename = "app.bsky.embed.images")] + Images(Box>), + #[serde(rename = "app.bsky.embed.video")] + Video(Box>), + #[serde(rename = "app.bsky.embed.external")] + External(Box>), +} + +fn lexicon_doc_app_bsky_embed_recordWithMedia() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.embed.recordWithMedia"), + 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::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("media") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("media"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.images"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.video"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.external") + ], + closed: 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( + "app.bsky.embed.record", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("view"), + ::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("media") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("media"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.images#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.video#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view") + ], + closed: 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( + "app.bsky.embed.record#view", + ), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordWithMedia<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.recordWithMedia" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_recordWithMedia() + } + 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 View<'a> { + #[serde(borrow)] + pub media: ViewMedia<'a>, + #[serde(borrow)] + pub record: crate::app_bsky::embed::record::View<'a>, +} + +pub mod 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 Record; + type Media; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = Unset; + 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 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 `record` field + pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Media: view_state::IsUnset, +{ + /// Set the `media` field (required) + pub fn media( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetMedia> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Record: view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetRecord> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Record: view_state::IsSet, + S::Media: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + media: self.__unsafe_private_named.0.unwrap(), + record: 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>, + >, + ) -> View<'a> { + View { + media: self.__unsafe_private_named.0.unwrap(), + record: self.__unsafe_private_named.1.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 ViewMedia<'a> { + #[serde(rename = "app.bsky.embed.images#view")] + ImagesView(Box>), + #[serde(rename = "app.bsky.embed.video#view")] + VideoView(Box>), + #[serde(rename = "app.bsky.embed.external#view")] + ExternalView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.recordWithMedia" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_recordWithMedia() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/embed/video.rs b/crates/weaver-api/src/app_bsky/embed/video.rs new file mode 100644 index 0000000..bbfd5c2 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/embed/video.rs @@ -0,0 +1,925 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.embed.video +// +// 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 Caption<'a> { + #[serde(borrow)] + pub file: jacquard_common::types::blob::BlobRef<'a>, + pub lang: jacquard_common::types::string::Language, +} + +pub mod caption_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 Lang; + type File; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Lang = Unset; + 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 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 `lang` field + pub struct lang(()); + ///Marker type for the `file` field + pub struct file(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CaptionBuilder<'a, S: caption_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Caption<'a> { + /// Create a new builder for this type + pub fn new() -> CaptionBuilder<'a, caption_state::Empty> { + CaptionBuilder::new() + } +} + +impl<'a> CaptionBuilder<'a, caption_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CaptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptionBuilder<'a, S> +where + S: caption_state::State, + S::File: caption_state::IsUnset, +{ + /// Set the `file` field (required) + pub fn file( + mut self, + value: impl Into>, + ) -> CaptionBuilder<'a, caption_state::SetFile> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CaptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptionBuilder<'a, S> +where + S: caption_state::State, + S::Lang: caption_state::IsUnset, +{ + /// Set the `lang` field (required) + pub fn lang( + mut self, + value: impl Into, + ) -> CaptionBuilder<'a, caption_state::SetLang> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CaptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptionBuilder<'a, S> +where + S: caption_state::State, + S::Lang: caption_state::IsSet, + S::File: caption_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Caption<'a> { + Caption { + file: self.__unsafe_private_named.0.unwrap(), + lang: 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>, + >, + ) -> Caption<'a> { + Caption { + file: self.__unsafe_private_named.0.unwrap(), + lang: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_embed_video() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.embed.video"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("caption"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("lang"), + ::jacquard_common::smol_str::SmolStr::new_static("file") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("file"), + ::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("lang"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Language, + ), + 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("main"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("video")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("alt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Alt text description of the video, for accessibility.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(10000usize), + min_graphemes: None, + max_graphemes: Some(1000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "aspectRatio", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.embed.defs#aspectRatio", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("captions"), + ::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("#caption"), + }), + min_length: None, + max_length: Some(20usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("video"), + ::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("view"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("playlist") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("alt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(10000usize), + min_graphemes: None, + max_graphemes: Some(1000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "aspectRatio", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.embed.defs#aspectRatio", + ), + }), + ); + 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("playlist"), + ::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( + "thumbnail", + ), + ::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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Caption<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.video" + } + fn def_name() -> &'static str { + "caption" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_video() + } + 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 Video<'a> { + /// Alt text description of the video, for accessibility. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub alt: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub aspect_ratio: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub captions: Option>>, + /// The mp4 video file. May be up to 100mb, formerly limited to 50mb. + #[serde(borrow)] + pub video: jacquard_common::types::blob::BlobRef<'a>, +} + +pub mod video_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 Video; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Video = Unset; + } + ///State transition - sets the `video` field to Set + pub struct SetVideo(PhantomData S>); + impl sealed::Sealed for SetVideo {} + impl State for SetVideo { + type Video = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `video` field + pub struct video(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VideoBuilder<'a, S: video_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> Video<'a> { + /// Create a new builder for this type + pub fn new() -> VideoBuilder<'a, video_state::Empty> { + VideoBuilder::new() + } +} + +impl<'a> VideoBuilder<'a, video_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VideoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: video_state::State> VideoBuilder<'a, S> { + /// Set the `alt` field (optional) + pub fn alt(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `alt` field to an Option value (optional) + pub fn maybe_alt(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: video_state::State> VideoBuilder<'a, S> { + /// Set the `aspectRatio` field (optional) + pub fn aspect_ratio( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `aspectRatio` field to an Option value (optional) + pub fn maybe_aspect_ratio( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: video_state::State> VideoBuilder<'a, S> { + /// Set the `captions` field (optional) + pub fn captions( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `captions` field to an Option value (optional) + pub fn maybe_captions( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> VideoBuilder<'a, S> +where + S: video_state::State, + S::Video: video_state::IsUnset, +{ + /// Set the `video` field (required) + pub fn video( + mut self, + value: impl Into>, + ) -> VideoBuilder<'a, video_state::SetVideo> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + VideoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VideoBuilder<'a, S> +where + S: video_state::State, + S::Video: video_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Video<'a> { + Video { + alt: self.__unsafe_private_named.0, + aspect_ratio: self.__unsafe_private_named.1, + captions: self.__unsafe_private_named.2, + video: 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>, + >, + ) -> Video<'a> { + Video { + alt: self.__unsafe_private_named.0, + aspect_ratio: self.__unsafe_private_named.1, + captions: self.__unsafe_private_named.2, + video: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Video<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.video" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_video() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.alt { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "alt", + ), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.alt { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "alt", + ), + max: 1000usize, + actual: count, + }); + } + } + } + if let Some(ref value) = self.captions { + #[allow(unused_comparisons)] + if value.len() > 20usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "captions", + ), + max: 20usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct View<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub alt: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub aspect_ratio: Option>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub playlist: jacquard_common::types::string::Uri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub thumbnail: Option>, +} + +pub mod 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 Cid; + type Playlist; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: 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> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_state::State> ViewBuilder<'a, S> { + /// Set the `alt` field (optional) + pub fn alt(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `alt` field to an Option value (optional) + pub fn maybe_alt(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: view_state::State> ViewBuilder<'a, S> { + /// Set the `aspectRatio` field (optional) + pub fn aspect_ratio( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `aspectRatio` field to an Option value (optional) + pub fn maybe_aspect_ratio( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Cid: view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetCid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Playlist: view_state::IsUnset, +{ + /// Set the `playlist` field (required) + pub fn playlist( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetPlaylist> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_state::State> ViewBuilder<'a, S> { + /// Set the `thumbnail` field (optional) + pub fn thumbnail( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `thumbnail` field to an Option value (optional) + pub fn maybe_thumbnail( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Cid: view_state::IsSet, + S::Playlist: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + alt: self.__unsafe_private_named.0, + aspect_ratio: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + playlist: self.__unsafe_private_named.3.unwrap(), + thumbnail: self.__unsafe_private_named.4, + 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>, + >, + ) -> View<'a> { + View { + alt: self.__unsafe_private_named.0, + aspect_ratio: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + playlist: self.__unsafe_private_named.3.unwrap(), + thumbnail: self.__unsafe_private_named.4, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "app.bsky.embed.video" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_video() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.alt { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "alt", + ), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.alt { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "alt", + ), + max: 1000usize, + actual: count, + }); + } + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed.rs b/crates/weaver-api/src/app_bsky/feed.rs new file mode 100644 index 0000000..5cf8e7e --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed.rs @@ -0,0 +1,4994 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod describe_feed_generator; +pub mod generator; +pub mod get_actor_feeds; +pub mod get_actor_likes; +pub mod get_author_feed; +pub mod get_feed; +pub mod get_feed_generator; +pub mod get_feed_generators; +pub mod get_feed_skeleton; +pub mod get_likes; +pub mod get_list_feed; +pub mod get_post_thread; +pub mod get_posts; +pub mod get_quotes; +pub mod get_reposted_by; +pub mod get_suggested_feeds; +pub mod get_timeline; +pub mod like; +pub mod post; +pub mod postgate; +pub mod repost; +pub mod search_posts; +pub mod send_interactions; +pub mod threadgate; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct BlockedAuthor<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod blocked_author_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BlockedAuthorBuilder<'a, S: blocked_author_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> BlockedAuthor<'a> { + /// Create a new builder for this type + pub fn new() -> BlockedAuthorBuilder<'a, blocked_author_state::Empty> { + BlockedAuthorBuilder::new() + } +} + +impl<'a> BlockedAuthorBuilder<'a, blocked_author_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BlockedAuthorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlockedAuthorBuilder<'a, S> +where + S: blocked_author_state::State, + S::Did: blocked_author_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> BlockedAuthorBuilder<'a, blocked_author_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BlockedAuthorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: blocked_author_state::State> BlockedAuthorBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S> BlockedAuthorBuilder<'a, S> +where + S: blocked_author_state::State, + S::Did: blocked_author_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> BlockedAuthor<'a> { + BlockedAuthor { + did: self.__unsafe_private_named.0.unwrap(), + viewer: 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>, + >, + ) -> BlockedAuthor<'a> { + BlockedAuthor { + did: self.__unsafe_private_named.0.unwrap(), + viewer: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_feed_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blockedAuthor"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("viewer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#viewerState", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blockedPost"), + ::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("blocked"), + ::jacquard_common::smol_str::SmolStr::new_static("author") + ], + ), + 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( + "#blockedAuthor", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blocked"), + ::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("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("clickthroughAuthor"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("clickthroughEmbed"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("clickthroughItem"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("clickthroughReposter"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "contentModeUnspecified", + ), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("contentModeVideo"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feedViewPost"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("post")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "feedContext", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Context provided by feed generator that may be passed back alongside interactions.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(2000usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("post"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#postView"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#reasonRepost"), + ::jacquard_common::CowStr::new_static("#reasonPin") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reply"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#replyRef"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reqId"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Unique identifier per request that may be passed back alongside interactions.", + ), + ), + 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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("generatorView"), + ::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("did"), + ::jacquard_common::smol_str::SmolStr::new_static("creator"), + ::jacquard_common::smol_str::SmolStr::new_static("displayName"), + ::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( + "acceptsInteractions", + ), + ::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("avatar"), + ::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("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( + "contentMode", + ), + ::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("creator"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "descriptionFacets", + ), + ::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( + "app.bsky.richtext.facet", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::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( + "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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: 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: Some(0i64), + 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, + ), + 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("viewer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#generatorViewerState", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("generatorViewerState"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("like"), + ::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("interaction"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("event"), + ::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( + "feedContext", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(2000usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("item"), + ::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("reqId"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Unique identifier per request that may be passed back alongside interactions.", + ), + ), + 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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("interactionLike"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("interactionQuote"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("interactionReply"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("interactionRepost"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("interactionSeen"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("interactionShare"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notFoundPost"), + ::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("notFound") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notFound"), + ::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("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("postView"), + ::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("author"), + ::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("author"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileViewBasic", + ), + }), + ); + 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("debug"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("embed"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.images#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.video#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.record#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.recordWithMedia#view") + ], + closed: 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: 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( + "quoteCount", + ), + ::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::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "replyCount", + ), + ::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( + "repostCount", + ), + ::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( + "threadgate", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#threadgateView", + ), + }), + ); + 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("viewer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#viewerState"), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reasonPin"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reasonRepost"), + ::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( + "app.bsky.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("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("replyRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("root"), + ::jacquard_common::smol_str::SmolStr::new_static("parent") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "grandparentAuthor", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("parent"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#postView"), + ::jacquard_common::CowStr::new_static("#notFoundPost"), + ::jacquard_common::CowStr::new_static("#blockedPost") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("root"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#postView"), + ::jacquard_common::CowStr::new_static("#notFoundPost"), + ::jacquard_common::CowStr::new_static("#blockedPost") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("requestLess"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("requestMore"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("skeletonFeedPost"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("post")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "feedContext", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Context that will be passed through to client and may be passed to feed generator back alongside interactions.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(2000usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("post"), + ::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("reason"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#skeletonReasonRepost"), + ::jacquard_common::CowStr::new_static("#skeletonReasonPin") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("skeletonReasonPin"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("skeletonReasonRepost"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("repost")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repost"), + ::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("threadContext"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Metadata about this post within the context of the thread it is in.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "rootAuthorLike", + ), + ::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("threadViewPost"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("post")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("parent"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#threadViewPost"), + ::jacquard_common::CowStr::new_static("#notFoundPost"), + ::jacquard_common::CowStr::new_static("#blockedPost") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("post"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#postView"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("replies"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#threadViewPost"), + ::jacquard_common::CowStr::new_static("#notFoundPost"), + ::jacquard_common::CowStr::new_static("#blockedPost") + ], + closed: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "threadContext", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#threadContext", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("threadgateView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + 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("lists"), + ::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( + "app.bsky.graph.defs#listViewBasic", + ), + }), + min_length: None, + max_length: 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("viewerState"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "bookmarked", + ), + ::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( + "embeddingDisabled", + ), + ::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("like"), + ::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("pinned"), + ::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( + "replyDisabled", + ), + ::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("repost"), + ::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( + "threadMuted", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BlockedAuthor<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "blockedAuthor" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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 BlockedPost<'a> { + #[serde(borrow)] + pub author: crate::app_bsky::feed::BlockedAuthor<'a>, + pub blocked: bool, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod blocked_post_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 Blocked; + type Author; + } + /// 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; + } + ///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; + } + ///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 `uri` field + pub struct uri(()); + ///Marker type for the `blocked` field + pub struct blocked(()); + ///Marker type for the `author` field + pub struct author(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BlockedPostBuilder<'a, S: blocked_post_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> BlockedPost<'a> { + /// Create a new builder for this type + pub fn new() -> BlockedPostBuilder<'a, blocked_post_state::Empty> { + BlockedPostBuilder::new() + } +} + +impl<'a> BlockedPostBuilder<'a, blocked_post_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BlockedPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlockedPostBuilder<'a, S> +where + S: blocked_post_state::State, + S::Author: blocked_post_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> BlockedPostBuilder<'a, blocked_post_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BlockedPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlockedPostBuilder<'a, S> +where + S: blocked_post_state::State, + S::Blocked: blocked_post_state::IsUnset, +{ + /// Set the `blocked` field (required) + pub fn blocked( + mut self, + value: impl Into, + ) -> BlockedPostBuilder<'a, blocked_post_state::SetBlocked> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + BlockedPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlockedPostBuilder<'a, S> +where + S: blocked_post_state::State, + S::Uri: blocked_post_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> BlockedPostBuilder<'a, blocked_post_state::SetUri> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + BlockedPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> BlockedPost<'a> { + BlockedPost { + author: self.__unsafe_private_named.0.unwrap(), + blocked: 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>, + >, + ) -> BlockedPost<'a> { + BlockedPost { + author: self.__unsafe_private_named.0.unwrap(), + blocked: 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 BlockedPost<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "blockedPost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// User clicked through to the author of the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ClickthroughAuthor; +impl std::fmt::Display for ClickthroughAuthor { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "clickthroughAuthor") + } +} + +/// User clicked through to the embedded content of the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ClickthroughEmbed; +impl std::fmt::Display for ClickthroughEmbed { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "clickthroughEmbed") + } +} + +/// User clicked through to the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ClickthroughItem; +impl std::fmt::Display for ClickthroughItem { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "clickthroughItem") + } +} + +/// User clicked through to the reposter of the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ClickthroughReposter; +impl std::fmt::Display for ClickthroughReposter { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "clickthroughReposter") + } +} + +/// Declares the feed generator returns any types of posts. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ContentModeUnspecified; +impl std::fmt::Display for ContentModeUnspecified { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "contentModeUnspecified") + } +} + +/// Declares the feed generator returns posts containing app.bsky.embed.video embeds. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ContentModeVideo; +impl std::fmt::Display for ContentModeVideo { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "contentModeVideo") + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct FeedViewPost<'a> { + /// Context provided by feed generator that may be passed back alongside interactions. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub feed_context: Option>, + #[serde(borrow)] + pub post: crate::app_bsky::feed::PostView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reply: Option>, + /// Unique identifier per request that may be passed back alongside interactions. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub req_id: Option>, +} + +pub mod feed_view_post_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 Post; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Post = Unset; + } + ///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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `post` field + pub struct post(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FeedViewPostBuilder<'a, S: feed_view_post_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> FeedViewPost<'a> { + /// Create a new builder for this type + pub fn new() -> FeedViewPostBuilder<'a, feed_view_post_state::Empty> { + FeedViewPostBuilder::new() + } +} + +impl<'a> FeedViewPostBuilder<'a, feed_view_post_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FeedViewPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: feed_view_post_state::State> FeedViewPostBuilder<'a, S> { + /// Set the `feedContext` field (optional) + pub fn feed_context( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `feedContext` field to an Option value (optional) + pub fn maybe_feed_context( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> FeedViewPostBuilder<'a, S> +where + S: feed_view_post_state::State, + S::Post: feed_view_post_state::IsUnset, +{ + /// Set the `post` field (required) + pub fn post( + mut self, + value: impl Into>, + ) -> FeedViewPostBuilder<'a, feed_view_post_state::SetPost> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FeedViewPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: feed_view_post_state::State> FeedViewPostBuilder<'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: feed_view_post_state::State> FeedViewPostBuilder<'a, S> { + /// Set the `reply` field (optional) + pub fn reply( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `reply` field to an Option value (optional) + pub fn maybe_reply( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: feed_view_post_state::State> FeedViewPostBuilder<'a, S> { + /// Set the `reqId` field (optional) + pub fn req_id( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `reqId` field to an Option value (optional) + pub fn maybe_req_id(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> FeedViewPostBuilder<'a, S> +where + S: feed_view_post_state::State, + S::Post: feed_view_post_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FeedViewPost<'a> { + FeedViewPost { + feed_context: self.__unsafe_private_named.0, + post: self.__unsafe_private_named.1.unwrap(), + reason: self.__unsafe_private_named.2, + reply: self.__unsafe_private_named.3, + req_id: self.__unsafe_private_named.4, + 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>, + >, + ) -> FeedViewPost<'a> { + FeedViewPost { + feed_context: self.__unsafe_private_named.0, + post: self.__unsafe_private_named.1.unwrap(), + reason: self.__unsafe_private_named.2, + reply: self.__unsafe_private_named.3, + req_id: self.__unsafe_private_named.4, + 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 FeedViewPostReason<'a> { + #[serde(rename = "app.bsky.feed.defs#reasonRepost")] + ReasonRepost(Box>), + #[serde(rename = "app.bsky.feed.defs#reasonPin")] + ReasonPin(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedViewPost<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "feedViewPost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.feed_context { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 2000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "feed_context", + ), + max: 2000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.req_id { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "req_id", + ), + max: 100usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GeneratorView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub accepts_interactions: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub content_mode: Option>, + #[serde(borrow)] + pub creator: crate::app_bsky::actor::ProfileView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description_facets: Option>>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub display_name: jacquard_common::CowStr<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub like_count: Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod generator_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 Uri; + type Cid; + type Did; + type Creator; + type DisplayName; + 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 Cid = Unset; + type Did = Unset; + type Creator = Unset; + type DisplayName = 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; + type Cid = S::Cid; + type Did = S::Did; + type Creator = S::Creator; + type DisplayName = S::DisplayName; + 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 Cid = Set; + type Did = S::Did; + type Creator = S::Creator; + type DisplayName = S::DisplayName; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Uri = S::Uri; + type Cid = S::Cid; + type Did = Set; + type Creator = S::Creator; + type DisplayName = S::DisplayName; + 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 Cid = S::Cid; + type Did = S::Did; + type Creator = Set; + type DisplayName = S::DisplayName; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type Uri = S::Uri; + type Cid = S::Cid; + type Did = S::Did; + type Creator = S::Creator; + type DisplayName = 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 Uri = S::Uri; + type Cid = S::Cid; + type Did = S::Did; + type Creator = S::Creator; + type DisplayName = S::DisplayName; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `display_name` field + pub struct display_name(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GeneratorViewBuilder<'a, S: generator_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> GeneratorView<'a> { + /// Create a new builder for this type + pub fn new() -> GeneratorViewBuilder<'a, generator_view_state::Empty> { + GeneratorViewBuilder::new() + } +} + +impl<'a> GeneratorViewBuilder<'a, generator_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GeneratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { + /// Set the `acceptsInteractions` field (optional) + pub fn accepts_interactions(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `acceptsInteractions` field to an Option value (optional) + pub fn maybe_accepts_interactions(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GeneratorViewBuilder<'a, S> +where + S: generator_view_state::State, + S::Cid: generator_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> GeneratorViewBuilder<'a, generator_view_state::SetCid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GeneratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { + /// Set the `contentMode` field (optional) + pub fn content_mode( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `contentMode` field to an Option value (optional) + pub fn maybe_content_mode( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> GeneratorViewBuilder<'a, S> +where + S: generator_view_state::State, + S::Creator: generator_view_state::IsUnset, +{ + /// Set the `creator` field (required) + pub fn creator( + mut self, + value: impl Into>, + ) -> GeneratorViewBuilder<'a, generator_view_state::SetCreator> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + GeneratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { + /// Set the `descriptionFacets` field (optional) + pub fn description_facets( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `descriptionFacets` field to an Option value (optional) + pub fn maybe_description_facets( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> GeneratorViewBuilder<'a, S> +where + S: generator_view_state::State, + S::Did: generator_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GeneratorViewBuilder<'a, generator_view_state::SetDid> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + GeneratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GeneratorViewBuilder<'a, S> +where + S: generator_view_state::State, + S::DisplayName: generator_view_state::IsUnset, +{ + /// Set the `displayName` field (required) + pub fn display_name( + mut self, + value: impl Into>, + ) -> GeneratorViewBuilder<'a, generator_view_state::SetDisplayName> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + GeneratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GeneratorViewBuilder<'a, S> +where + S: generator_view_state::State, + S::IndexedAt: generator_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> GeneratorViewBuilder<'a, generator_view_state::SetIndexedAt> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + GeneratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.10 = 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.10 = value; + self + } +} + +impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { + /// Set the `likeCount` field (optional) + pub fn like_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.11 = 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.11 = value; + self + } +} + +impl<'a, S> GeneratorViewBuilder<'a, S> +where + S: generator_view_state::State, + S::Uri: generator_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> GeneratorViewBuilder<'a, generator_view_state::SetUri> { + self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); + GeneratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.13 = 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.13 = value; + self + } +} + +impl<'a, S> GeneratorViewBuilder<'a, S> +where + S: generator_view_state::State, + S::Uri: generator_view_state::IsSet, + S::Cid: generator_view_state::IsSet, + S::Did: generator_view_state::IsSet, + S::Creator: generator_view_state::IsSet, + S::DisplayName: generator_view_state::IsSet, + S::IndexedAt: generator_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GeneratorView<'a> { + GeneratorView { + accepts_interactions: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + content_mode: self.__unsafe_private_named.3, + creator: self.__unsafe_private_named.4.unwrap(), + description: self.__unsafe_private_named.5, + description_facets: self.__unsafe_private_named.6, + did: self.__unsafe_private_named.7.unwrap(), + display_name: self.__unsafe_private_named.8.unwrap(), + indexed_at: self.__unsafe_private_named.9.unwrap(), + labels: self.__unsafe_private_named.10, + like_count: self.__unsafe_private_named.11, + uri: self.__unsafe_private_named.12.unwrap(), + viewer: self.__unsafe_private_named.13, + 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>, + >, + ) -> GeneratorView<'a> { + GeneratorView { + accepts_interactions: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + content_mode: self.__unsafe_private_named.3, + creator: self.__unsafe_private_named.4.unwrap(), + description: self.__unsafe_private_named.5, + description_facets: self.__unsafe_private_named.6, + did: self.__unsafe_private_named.7.unwrap(), + display_name: self.__unsafe_private_named.8.unwrap(), + indexed_at: self.__unsafe_private_named.9.unwrap(), + labels: self.__unsafe_private_named.10, + like_count: self.__unsafe_private_named.11, + uri: self.__unsafe_private_named.12.unwrap(), + viewer: self.__unsafe_private_named.13, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for GeneratorView<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "generatorView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 3000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 300usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 300usize, + actual: count, + }); + } + } + } + if let Some(ref value) = self.like_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "like_count", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct GeneratorViewerState<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub like: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for GeneratorViewerState<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "generatorViewerState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Interaction<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub event: std::option::Option>, + /// Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub feed_context: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub item: std::option::Option>, + /// Unique identifier per request that may be passed back alongside interactions. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub req_id: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Interaction<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "interaction" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.feed_context { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 2000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "feed_context", + ), + max: 2000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.req_id { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "req_id", + ), + max: 100usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +/// User liked the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct InteractionLike; +impl std::fmt::Display for InteractionLike { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "interactionLike") + } +} + +/// User quoted the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct InteractionQuote; +impl std::fmt::Display for InteractionQuote { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "interactionQuote") + } +} + +/// User replied to the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct InteractionReply; +impl std::fmt::Display for InteractionReply { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "interactionReply") + } +} + +/// User reposted the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct InteractionRepost; +impl std::fmt::Display for InteractionRepost { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "interactionRepost") + } +} + +/// Feed item was seen by user +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct InteractionSeen; +impl std::fmt::Display for InteractionSeen { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "interactionSeen") + } +} + +/// User shared the feed item +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct InteractionShare; +impl std::fmt::Display for InteractionShare { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "interactionShare") + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct NotFoundPost<'a> { + pub not_found: bool, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod not_found_post_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 NotFound; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + 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 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 `uri` field + pub struct uri(()); + ///Marker type for the `not_found` field + pub struct not_found(()); + } +} + +/// Builder for constructing an instance of this type +pub struct NotFoundPostBuilder<'a, S: not_found_post_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> NotFoundPost<'a> { + /// Create a new builder for this type + pub fn new() -> NotFoundPostBuilder<'a, not_found_post_state::Empty> { + NotFoundPostBuilder::new() + } +} + +impl<'a> NotFoundPostBuilder<'a, not_found_post_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NotFoundPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotFoundPostBuilder<'a, S> +where + S: not_found_post_state::State, + S::NotFound: not_found_post_state::IsUnset, +{ + /// Set the `notFound` field (required) + pub fn not_found( + mut self, + value: impl Into, + ) -> NotFoundPostBuilder<'a, not_found_post_state::SetNotFound> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NotFoundPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotFoundPostBuilder<'a, S> +where + S: not_found_post_state::State, + S::Uri: not_found_post_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> NotFoundPostBuilder<'a, not_found_post_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + NotFoundPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotFoundPostBuilder<'a, S> +where + S: not_found_post_state::State, + S::Uri: not_found_post_state::IsSet, + S::NotFound: not_found_post_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> NotFoundPost<'a> { + NotFoundPost { + not_found: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> NotFoundPost<'a> { + NotFoundPost { + not_found: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotFoundPost<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "notFoundPost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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 PostView<'a> { + #[serde(borrow)] + pub author: crate::app_bsky::actor::ProfileViewBasic<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub bookmark_count: Option, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + /// Debug information for internal development + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub debug: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embed: Option>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub like_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub quote_count: Option, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reply_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub repost_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub threadgate: Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod post_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 Uri; + type Cid; + type Author; + 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 Cid = Unset; + type Author = Unset; + type Record = 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; + type Cid = S::Cid; + type Author = S::Author; + type Record = S::Record; + 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 Cid = Set; + type Author = S::Author; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + } + ///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 Cid = S::Cid; + type Author = Set; + type Record = S::Record; + 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 Cid = S::Cid; + type Author = S::Author; + 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 Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + type Record = S::Record; + 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 `cid` field + pub struct cid(()); + ///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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PostViewBuilder<'a, S: post_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> PostView<'a> { + /// Create a new builder for this type + pub fn new() -> PostViewBuilder<'a, post_view_state::Empty> { + PostViewBuilder::new() + } +} + +impl<'a> PostViewBuilder<'a, post_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PostViewBuilder { + _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> PostViewBuilder<'a, S> +where + S: post_view_state::State, + S::Author: post_view_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> PostViewBuilder<'a, post_view_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PostViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'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> PostViewBuilder<'a, S> +where + S: post_view_state::State, + S::Cid: post_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> PostViewBuilder<'a, post_view_state::SetCid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + PostViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { + /// Set the `debug` field (optional) + pub fn debug( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `debug` field to an Option value (optional) + pub fn maybe_debug( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { + /// Set the `embed` field (optional) + pub fn embed(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `embed` field to an Option value (optional) + pub fn maybe_embed(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> PostViewBuilder<'a, S> +where + S: post_view_state::State, + S::IndexedAt: post_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> PostViewBuilder<'a, post_view_state::SetIndexedAt> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + PostViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'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: post_view_state::State> PostViewBuilder<'a, S> { + /// Set the `likeCount` field (optional) + pub fn like_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.7 = 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.7 = value; + self + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { + /// Set the `quoteCount` field (optional) + pub fn quote_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `quoteCount` field to an Option value (optional) + pub fn maybe_quote_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> PostViewBuilder<'a, S> +where + S: post_view_state::State, + S::Record: post_view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> PostViewBuilder<'a, post_view_state::SetRecord> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + PostViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { + /// Set the `replyCount` field (optional) + pub fn reply_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `replyCount` field to an Option value (optional) + pub fn maybe_reply_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { + /// Set the `repostCount` field (optional) + pub fn repost_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `repostCount` field to an Option value (optional) + pub fn maybe_repost_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { + /// Set the `threadgate` field (optional) + pub fn threadgate( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `threadgate` field to an Option value (optional) + pub fn maybe_threadgate( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S> PostViewBuilder<'a, S> +where + S: post_view_state::State, + S::Uri: post_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> PostViewBuilder<'a, post_view_state::SetUri> { + self.__unsafe_private_named.13 = ::core::option::Option::Some(value.into()); + PostViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.14 = 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.14 = value; + self + } +} + +impl<'a, S> PostViewBuilder<'a, S> +where + S: post_view_state::State, + S::Uri: post_view_state::IsSet, + S::Cid: post_view_state::IsSet, + S::Author: post_view_state::IsSet, + S::Record: post_view_state::IsSet, + S::IndexedAt: post_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PostView<'a> { + PostView { + author: self.__unsafe_private_named.0.unwrap(), + bookmark_count: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + debug: self.__unsafe_private_named.3, + embed: self.__unsafe_private_named.4, + indexed_at: self.__unsafe_private_named.5.unwrap(), + labels: self.__unsafe_private_named.6, + like_count: self.__unsafe_private_named.7, + quote_count: self.__unsafe_private_named.8, + record: self.__unsafe_private_named.9.unwrap(), + reply_count: self.__unsafe_private_named.10, + repost_count: self.__unsafe_private_named.11, + threadgate: self.__unsafe_private_named.12, + uri: self.__unsafe_private_named.13.unwrap(), + viewer: 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>, + >, + ) -> PostView<'a> { + PostView { + author: self.__unsafe_private_named.0.unwrap(), + bookmark_count: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + debug: self.__unsafe_private_named.3, + embed: self.__unsafe_private_named.4, + indexed_at: self.__unsafe_private_named.5.unwrap(), + labels: self.__unsafe_private_named.6, + like_count: self.__unsafe_private_named.7, + quote_count: self.__unsafe_private_named.8, + record: self.__unsafe_private_named.9.unwrap(), + reply_count: self.__unsafe_private_named.10, + repost_count: self.__unsafe_private_named.11, + threadgate: self.__unsafe_private_named.12, + uri: self.__unsafe_private_named.13.unwrap(), + viewer: self.__unsafe_private_named.14, + 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 PostViewEmbed<'a> { + #[serde(rename = "app.bsky.embed.images#view")] + ImagesView(Box>), + #[serde(rename = "app.bsky.embed.video#view")] + VideoView(Box>), + #[serde(rename = "app.bsky.embed.external#view")] + ExternalView(Box>), + #[serde(rename = "app.bsky.embed.record#view")] + RecordView(Box>), + #[serde(rename = "app.bsky.embed.recordWithMedia#view")] + RecordWithMediaView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PostView<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "postView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ReasonPin<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonPin<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "reasonPin" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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 ReasonRepost<'a> { + #[serde(borrow)] + pub by: crate::app_bsky::actor::ProfileViewBasic<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: Option>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub uri: Option>, +} + +pub mod reason_repost_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 By; + type IndexedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type By = Unset; + 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 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 `by` field + pub struct by(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReasonRepostBuilder<'a, S: reason_repost_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> ReasonRepost<'a> { + /// Create a new builder for this type + pub fn new() -> ReasonRepostBuilder<'a, reason_repost_state::Empty> { + ReasonRepostBuilder::new() + } +} + +impl<'a> ReasonRepostBuilder<'a, reason_repost_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReasonRepostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReasonRepostBuilder<'a, S> +where + S: reason_repost_state::State, + S::By: reason_repost_state::IsUnset, +{ + /// Set the `by` field (required) + pub fn by( + mut self, + value: impl Into>, + ) -> ReasonRepostBuilder<'a, reason_repost_state::SetBy> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ReasonRepostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: reason_repost_state::State> ReasonRepostBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ReasonRepostBuilder<'a, S> +where + S: reason_repost_state::State, + S::IndexedAt: reason_repost_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> ReasonRepostBuilder<'a, reason_repost_state::SetIndexedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ReasonRepostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: reason_repost_state::State> ReasonRepostBuilder<'a, S> { + /// Set the `uri` field (optional) + pub fn uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `uri` field to an Option value (optional) + pub fn maybe_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> ReasonRepostBuilder<'a, S> +where + S: reason_repost_state::State, + S::By: reason_repost_state::IsSet, + S::IndexedAt: reason_repost_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ReasonRepost<'a> { + ReasonRepost { + by: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1, + indexed_at: self.__unsafe_private_named.2.unwrap(), + uri: 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>, + >, + ) -> ReasonRepost<'a> { + ReasonRepost { + by: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1, + indexed_at: self.__unsafe_private_named.2.unwrap(), + uri: self.__unsafe_private_named.3, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonRepost<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "reasonRepost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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 ReplyRef<'a> { + /// When parent is a reply to another post, this is the author of that post. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub grandparent_author: Option>, + #[serde(borrow)] + pub parent: ReplyRefParent<'a>, + #[serde(borrow)] + pub root: ReplyRefRoot<'a>, +} + +pub mod reply_ref_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 Root; + type Parent; + } + /// 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; + } + ///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 `root` field + pub struct root(()); + ///Marker type for the `parent` field + pub struct parent(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReplyRefBuilder<'a, S: reply_ref_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> ReplyRef<'a> { + /// Create a new builder for this type + pub fn new() -> ReplyRefBuilder<'a, reply_ref_state::Empty> { + ReplyRefBuilder::new() + } +} + +impl<'a> ReplyRefBuilder<'a, reply_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReplyRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: reply_ref_state::State> ReplyRefBuilder<'a, S> { + /// Set the `grandparentAuthor` field (optional) + pub fn grandparent_author( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `grandparentAuthor` field to an Option value (optional) + pub fn maybe_grandparent_author( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ReplyRefBuilder<'a, S> +where + S: reply_ref_state::State, + S::Parent: reply_ref_state::IsUnset, +{ + /// Set the `parent` field (required) + pub fn parent( + mut self, + value: impl Into>, + ) -> ReplyRefBuilder<'a, reply_ref_state::SetParent> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ReplyRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReplyRefBuilder<'a, S> +where + S: reply_ref_state::State, + S::Root: reply_ref_state::IsUnset, +{ + /// Set the `root` field (required) + pub fn root( + mut self, + value: impl Into>, + ) -> ReplyRefBuilder<'a, reply_ref_state::SetRoot> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ReplyRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReplyRefBuilder<'a, S> +where + S: reply_ref_state::State, + S::Root: reply_ref_state::IsSet, + S::Parent: reply_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ReplyRef<'a> { + ReplyRef { + grandparent_author: self.__unsafe_private_named.0, + parent: self.__unsafe_private_named.1.unwrap(), + root: 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>, + >, + ) -> ReplyRef<'a> { + ReplyRef { + grandparent_author: self.__unsafe_private_named.0, + parent: self.__unsafe_private_named.1.unwrap(), + root: self.__unsafe_private_named.2.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 ReplyRefParent<'a> { + #[serde(rename = "app.bsky.feed.defs#postView")] + PostView(Box>), + #[serde(rename = "app.bsky.feed.defs#notFoundPost")] + NotFoundPost(Box>), + #[serde(rename = "app.bsky.feed.defs#blockedPost")] + BlockedPost(Box>), +} + +#[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 ReplyRefRoot<'a> { + #[serde(rename = "app.bsky.feed.defs#postView")] + PostView(Box>), + #[serde(rename = "app.bsky.feed.defs#notFoundPost")] + NotFoundPost(Box>), + #[serde(rename = "app.bsky.feed.defs#blockedPost")] + BlockedPost(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReplyRef<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "replyRef" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Request that less content like the given feed item be shown in the feed +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct RequestLess; +impl std::fmt::Display for RequestLess { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "requestLess") + } +} + +/// Request that more content like the given feed item be shown in the feed +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct RequestMore; +impl std::fmt::Display for RequestMore { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "requestMore") + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SkeletonFeedPost<'a> { + /// Context that will be passed through to client and may be passed to feed generator back alongside interactions. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub feed_context: Option>, + #[serde(borrow)] + pub post: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason: Option>, +} + +pub mod skeleton_feed_post_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 Post; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Post = Unset; + } + ///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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `post` field + pub struct post(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SkeletonFeedPostBuilder<'a, S: skeleton_feed_post_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> SkeletonFeedPost<'a> { + /// Create a new builder for this type + pub fn new() -> SkeletonFeedPostBuilder<'a, skeleton_feed_post_state::Empty> { + SkeletonFeedPostBuilder::new() + } +} + +impl<'a> SkeletonFeedPostBuilder<'a, skeleton_feed_post_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SkeletonFeedPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: skeleton_feed_post_state::State> SkeletonFeedPostBuilder<'a, S> { + /// Set the `feedContext` field (optional) + pub fn feed_context( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `feedContext` field to an Option value (optional) + pub fn maybe_feed_context( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> SkeletonFeedPostBuilder<'a, S> +where + S: skeleton_feed_post_state::State, + S::Post: skeleton_feed_post_state::IsUnset, +{ + /// Set the `post` field (required) + pub fn post( + mut self, + value: impl Into>, + ) -> SkeletonFeedPostBuilder<'a, skeleton_feed_post_state::SetPost> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SkeletonFeedPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: skeleton_feed_post_state::State> SkeletonFeedPostBuilder<'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> SkeletonFeedPostBuilder<'a, S> +where + S: skeleton_feed_post_state::State, + S::Post: skeleton_feed_post_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SkeletonFeedPost<'a> { + SkeletonFeedPost { + feed_context: self.__unsafe_private_named.0, + post: self.__unsafe_private_named.1.unwrap(), + 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>, + >, + ) -> SkeletonFeedPost<'a> { + SkeletonFeedPost { + feed_context: self.__unsafe_private_named.0, + post: self.__unsafe_private_named.1.unwrap(), + reason: self.__unsafe_private_named.2, + 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 SkeletonFeedPostReason<'a> { + #[serde(rename = "app.bsky.feed.defs#skeletonReasonRepost")] + SkeletonReasonRepost(Box>), + #[serde(rename = "app.bsky.feed.defs#skeletonReasonPin")] + SkeletonReasonPin(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SkeletonFeedPost<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "skeletonFeedPost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.feed_context { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 2000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "feed_context", + ), + max: 2000usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct SkeletonReasonPin<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SkeletonReasonPin<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "skeletonReasonPin" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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 SkeletonReasonRepost<'a> { + #[serde(borrow)] + pub repost: jacquard_common::types::string::AtUri<'a>, +} + +pub mod skeleton_reason_repost_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 Repost; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Repost = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `repost` field + pub struct repost(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SkeletonReasonRepostBuilder<'a, S: skeleton_reason_repost_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SkeletonReasonRepost<'a> { + /// Create a new builder for this type + pub fn new() -> SkeletonReasonRepostBuilder< + 'a, + skeleton_reason_repost_state::Empty, + > { + SkeletonReasonRepostBuilder::new() + } +} + +impl<'a> SkeletonReasonRepostBuilder<'a, skeleton_reason_repost_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SkeletonReasonRepostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonReasonRepostBuilder<'a, S> +where + S: skeleton_reason_repost_state::State, + S::Repost: skeleton_reason_repost_state::IsUnset, +{ + /// Set the `repost` field (required) + pub fn repost( + mut self, + value: impl Into>, + ) -> SkeletonReasonRepostBuilder<'a, skeleton_reason_repost_state::SetRepost> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SkeletonReasonRepostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonReasonRepostBuilder<'a, S> +where + S: skeleton_reason_repost_state::State, + S::Repost: skeleton_reason_repost_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SkeletonReasonRepost<'a> { + SkeletonReasonRepost { + repost: 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>, + >, + ) -> SkeletonReasonRepost<'a> { + SkeletonReasonRepost { + repost: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SkeletonReasonRepost<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "skeletonReasonRepost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Metadata about this post within the context of the thread it is in. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ThreadContext<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub root_author_like: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadContext<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "threadContext" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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 ThreadViewPost<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub parent: Option>, + #[serde(borrow)] + pub post: crate::app_bsky::feed::PostView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub replies: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub thread_context: Option>, +} + +pub mod thread_view_post_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 Post; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Post = Unset; + } + ///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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `post` field + pub struct post(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ThreadViewPostBuilder<'a, S: thread_view_post_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> ThreadViewPost<'a> { + /// Create a new builder for this type + pub fn new() -> ThreadViewPostBuilder<'a, thread_view_post_state::Empty> { + ThreadViewPostBuilder::new() + } +} + +impl<'a> ThreadViewPostBuilder<'a, thread_view_post_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ThreadViewPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: thread_view_post_state::State> ThreadViewPostBuilder<'a, S> { + /// Set the `parent` field (optional) + pub fn parent(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `parent` field to an Option value (optional) + pub fn maybe_parent(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ThreadViewPostBuilder<'a, S> +where + S: thread_view_post_state::State, + S::Post: thread_view_post_state::IsUnset, +{ + /// Set the `post` field (required) + pub fn post( + mut self, + value: impl Into>, + ) -> ThreadViewPostBuilder<'a, thread_view_post_state::SetPost> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ThreadViewPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: thread_view_post_state::State> ThreadViewPostBuilder<'a, S> { + /// Set the `replies` field (optional) + pub fn replies( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `replies` field to an Option value (optional) + pub fn maybe_replies( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: thread_view_post_state::State> ThreadViewPostBuilder<'a, S> { + /// Set the `threadContext` field (optional) + pub fn thread_context( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `threadContext` field to an Option value (optional) + pub fn maybe_thread_context( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> ThreadViewPostBuilder<'a, S> +where + S: thread_view_post_state::State, + S::Post: thread_view_post_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ThreadViewPost<'a> { + ThreadViewPost { + parent: self.__unsafe_private_named.0, + post: self.__unsafe_private_named.1.unwrap(), + replies: self.__unsafe_private_named.2, + thread_context: 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>, + >, + ) -> ThreadViewPost<'a> { + ThreadViewPost { + parent: self.__unsafe_private_named.0, + post: self.__unsafe_private_named.1.unwrap(), + replies: self.__unsafe_private_named.2, + thread_context: self.__unsafe_private_named.3, + 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 ThreadViewPostParent<'a> { + #[serde(rename = "app.bsky.feed.defs#threadViewPost")] + ThreadViewPost(Box>), + #[serde(rename = "app.bsky.feed.defs#notFoundPost")] + NotFoundPost(Box>), + #[serde(rename = "app.bsky.feed.defs#blockedPost")] + BlockedPost(Box>), +} + +#[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 ThreadViewPostRepliesItem<'a> { + #[serde(rename = "app.bsky.feed.defs#threadViewPost")] + ThreadViewPost(Box>), + #[serde(rename = "app.bsky.feed.defs#notFoundPost")] + NotFoundPost(Box>), + #[serde(rename = "app.bsky.feed.defs#blockedPost")] + BlockedPost(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadViewPost<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "threadViewPost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ThreadgateView<'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 lists: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub record: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub uri: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadgateView<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "threadgateView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. +#[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")] + pub bookmarked: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub embedding_disabled: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub like: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub pinned: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reply_disabled: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub repost: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub thread_muted: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewerState<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.defs" + } + fn def_name() -> &'static str { + "viewerState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_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/app_bsky/feed/describe_feed_generator.rs b/crates/weaver-api/src/app_bsky/feed/describe_feed_generator.rs new file mode 100644 index 0000000..a6a60bc --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/describe_feed_generator.rs @@ -0,0 +1,346 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.describeFeedGenerator +// +// 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 Feed<'a> { + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod 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 { + 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 FeedBuilder<'a, S: feed_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Feed<'a> { + /// Create a new builder for this type + pub fn new() -> FeedBuilder<'a, feed_state::Empty> { + FeedBuilder::new() + } +} + +impl<'a> FeedBuilder<'a, feed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FeedBuilder<'a, S> +where + S: feed_state::State, + S::Uri: feed_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> FeedBuilder<'a, feed_state::SetUri> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FeedBuilder<'a, S> +where + S: feed_state::State, + S::Uri: feed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Feed<'a> { + Feed { + uri: 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>, + >, + ) -> Feed<'a> { + Feed { + uri: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_feed_describeFeedGenerator() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.describeFeedGenerator"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feed"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + 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("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("links"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "privacyPolicy", + ), + ::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( + "termsOfService", + ), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { + description: None, + parameters: None, + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Feed<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.describeFeedGenerator" + } + fn def_name() -> &'static str { + "feed" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_describeFeedGenerator() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Links<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub privacy_policy: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub terms_of_service: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Links<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.describeFeedGenerator" + } + fn def_name() -> &'static str { + "links" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_describeFeedGenerator() + } + 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 DescribeFeedGeneratorOutput<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub feeds: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub links: std::option::Option< + crate::app_bsky::feed::describe_feed_generator::Links<'a>, + >, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct DescribeFeedGenerator; +/// Response type for +///app.bsky.feed.describeFeedGenerator +pub struct DescribeFeedGeneratorResponse; +impl jacquard_common::xrpc::XrpcResp for DescribeFeedGeneratorResponse { + const NSID: &'static str = "app.bsky.feed.describeFeedGenerator"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DescribeFeedGeneratorOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for DescribeFeedGenerator { + const NSID: &'static str = "app.bsky.feed.describeFeedGenerator"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = DescribeFeedGeneratorResponse; +} + +/// Endpoint type for +///app.bsky.feed.describeFeedGenerator +pub struct DescribeFeedGeneratorRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DescribeFeedGeneratorRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.describeFeedGenerator"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = DescribeFeedGenerator; + type Response = DescribeFeedGeneratorResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/generator.rs b/crates/weaver-api/src/app_bsky/feed/generator.rs new file mode 100644 index 0000000..f1cf2c0 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/generator.rs @@ -0,0 +1,673 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.generator +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Generator<'a> { + /// Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub accepts_interactions: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub content_mode: Option>, + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description_facets: Option>>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub display_name: jacquard_common::CowStr<'a>, + /// Self-label values + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>, +} + +pub mod generator_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 Did; + type DisplayName; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type DisplayName = Unset; + type CreatedAt = 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 DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type Did = S::Did; + type DisplayName = 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 Did = S::Did; + type DisplayName = S::DisplayName; + type CreatedAt = 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 `display_name` field + pub struct display_name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GeneratorBuilder<'a, S: generator_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> Generator<'a> { + /// Create a new builder for this type + pub fn new() -> GeneratorBuilder<'a, generator_state::Empty> { + GeneratorBuilder::new() + } +} + +impl<'a> GeneratorBuilder<'a, generator_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GeneratorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: generator_state::State> GeneratorBuilder<'a, S> { + /// Set the `acceptsInteractions` field (optional) + pub fn accepts_interactions(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `acceptsInteractions` field to an Option value (optional) + pub fn maybe_accepts_interactions(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: generator_state::State> GeneratorBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: generator_state::State> GeneratorBuilder<'a, S> { + /// Set the `contentMode` field (optional) + pub fn content_mode( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `contentMode` field to an Option value (optional) + pub fn maybe_content_mode( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GeneratorBuilder<'a, S> +where + S: generator_state::State, + S::CreatedAt: generator_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> GeneratorBuilder<'a, generator_state::SetCreatedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + GeneratorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: generator_state::State> GeneratorBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: generator_state::State> GeneratorBuilder<'a, S> { + /// Set the `descriptionFacets` field (optional) + pub fn description_facets( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `descriptionFacets` field to an Option value (optional) + pub fn maybe_description_facets( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> GeneratorBuilder<'a, S> +where + S: generator_state::State, + S::Did: generator_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GeneratorBuilder<'a, generator_state::SetDid> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + GeneratorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GeneratorBuilder<'a, S> +where + S: generator_state::State, + S::DisplayName: generator_state::IsUnset, +{ + /// Set the `displayName` field (required) + pub fn display_name( + mut self, + value: impl Into>, + ) -> GeneratorBuilder<'a, generator_state::SetDisplayName> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + GeneratorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: generator_state::State> GeneratorBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = value; + self + } +} + +impl<'a, S> GeneratorBuilder<'a, S> +where + S: generator_state::State, + S::Did: generator_state::IsSet, + S::DisplayName: generator_state::IsSet, + S::CreatedAt: generator_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Generator<'a> { + Generator { + accepts_interactions: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + content_mode: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3.unwrap(), + description: self.__unsafe_private_named.4, + description_facets: self.__unsafe_private_named.5, + did: self.__unsafe_private_named.6.unwrap(), + display_name: self.__unsafe_private_named.7.unwrap(), + labels: self.__unsafe_private_named.8, + 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>, + >, + ) -> Generator<'a> { + Generator { + accepts_interactions: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + content_mode: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3.unwrap(), + description: self.__unsafe_private_named.4, + description_facets: self.__unsafe_private_named.5, + did: self.__unsafe_private_named.6.unwrap(), + display_name: self.__unsafe_private_named.7.unwrap(), + labels: self.__unsafe_private_named.8, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Generator<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, GeneratorRecord>, + 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 GeneratorGetRecordOutput<'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: Generator<'a>, +} + +impl From> for Generator<'_> { + fn from(output: GeneratorGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Generator<'_> { + const NSID: &'static str = "app.bsky.feed.generator"; + type Record = GeneratorRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct GeneratorRecord; +impl jacquard_common::xrpc::XrpcResp for GeneratorRecord { + const NSID: &'static str = "app.bsky.feed.generator"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GeneratorGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for GeneratorRecord { + const NSID: &'static str = "app.bsky.feed.generator"; + type Record = GeneratorRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Generator<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.generator" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_generator() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 3000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 300usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 300usize, + actual: count, + }); + } + } + } + { + let value = &self.display_name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 240usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "display_name", + ), + max: 240usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.display_name; + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 24usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "display_name", + ), + max: 24usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +fn lexicon_doc_app_bsky_feed_generator() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.generator"), + 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( + "Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("any")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("displayName"), + ::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( + "acceptsInteractions", + ), + ::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("avatar"), + ::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( + "contentMode", + ), + ::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( + "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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "descriptionFacets", + ), + ::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( + "app.bsky.richtext.facet", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(240usize), + min_graphemes: None, + max_graphemes: Some(24usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labels"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: Some( + ::jacquard_common::CowStr::new_static("Self-label values"), + ), + refs: vec![ + ::jacquard_common::CowStr::new_static("com.atproto.label.defs#selfLabels") + ], + closed: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_actor_feeds.rs b/crates/weaver-api/src/app_bsky/feed/get_actor_feeds.rs new file mode 100644 index 0000000..d6489c0 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_actor_feeds.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getActorFeeds +// +// 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 GetActorFeeds<'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_feeds_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 GetActorFeedsBuilder<'a, S: get_actor_feeds_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> GetActorFeeds<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorFeedsBuilder<'a, get_actor_feeds_state::Empty> { + GetActorFeedsBuilder::new() + } +} + +impl<'a> GetActorFeedsBuilder<'a, get_actor_feeds_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorFeedsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorFeedsBuilder<'a, S> +where + S: get_actor_feeds_state::State, + S::Actor: get_actor_feeds_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorFeedsBuilder<'a, get_actor_feeds_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorFeedsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_actor_feeds_state::State> GetActorFeedsBuilder<'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_feeds_state::State> GetActorFeedsBuilder<'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> GetActorFeedsBuilder<'a, S> +where + S: get_actor_feeds_state::State, + S::Actor: get_actor_feeds_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorFeeds<'a> { + GetActorFeeds { + 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 GetActorFeedsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feeds: Vec>, +} + +/// Response type for +///app.bsky.feed.getActorFeeds +pub struct GetActorFeedsResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorFeedsResponse { + const NSID: &'static str = "app.bsky.feed.getActorFeeds"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorFeedsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorFeeds<'a> { + const NSID: &'static str = "app.bsky.feed.getActorFeeds"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorFeedsResponse; +} + +/// Endpoint type for +///app.bsky.feed.getActorFeeds +pub struct GetActorFeedsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorFeedsRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getActorFeeds"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorFeeds<'de>; + type Response = GetActorFeedsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_actor_likes.rs b/crates/weaver-api/src/app_bsky/feed/get_actor_likes.rs new file mode 100644 index 0000000..f24d3df --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_actor_likes.rs @@ -0,0 +1,239 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.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 feed: 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 GetActorLikesError<'a> { + #[serde(rename = "BlockedActor")] + BlockedActor(std::option::Option), + #[serde(rename = "BlockedByActor")] + BlockedByActor(std::option::Option), +} + +impl std::fmt::Display for GetActorLikesError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BlockedActor(msg) => { + write!(f, "BlockedActor")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::BlockedByActor(msg) => { + write!(f, "BlockedByActor")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.feed.getActorLikes +pub struct GetActorLikesResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorLikesResponse { + const NSID: &'static str = "app.bsky.feed.getActorLikes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorLikesOutput<'de>; + type Err<'de> = GetActorLikesError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorLikes<'a> { + const NSID: &'static str = "app.bsky.feed.getActorLikes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorLikesResponse; +} + +/// Endpoint type for +///app.bsky.feed.getActorLikes +pub struct GetActorLikesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorLikesRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.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/app_bsky/feed/get_author_feed.rs b/crates/weaver-api/src/app_bsky/feed/get_author_feed.rs new file mode 100644 index 0000000..28fe07c --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_author_feed.rs @@ -0,0 +1,279 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getAuthorFeed +// +// 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 GetAuthorFeed<'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: "posts_with_replies") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub filter: std::option::Option>, + /// (default: false) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_pins: 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_author_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 { + 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 GetAuthorFeedBuilder<'a, S: get_author_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> GetAuthorFeed<'a> { + /// Create a new builder for this type + pub fn new() -> GetAuthorFeedBuilder<'a, get_author_feed_state::Empty> { + GetAuthorFeedBuilder::new() + } +} + +impl<'a> GetAuthorFeedBuilder<'a, get_author_feed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetAuthorFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetAuthorFeedBuilder<'a, S> +where + S: get_author_feed_state::State, + S::Actor: get_author_feed_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetAuthorFeedBuilder<'a, get_author_feed_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetAuthorFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_author_feed_state::State> GetAuthorFeedBuilder<'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_author_feed_state::State> GetAuthorFeedBuilder<'a, S> { + /// Set the `filter` field (optional) + pub fn filter( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `filter` field to an Option value (optional) + pub fn maybe_filter(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_author_feed_state::State> GetAuthorFeedBuilder<'a, S> { + /// Set the `includePins` field (optional) + pub fn include_pins(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `includePins` field to an Option value (optional) + pub fn maybe_include_pins(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: get_author_feed_state::State> GetAuthorFeedBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S> GetAuthorFeedBuilder<'a, S> +where + S: get_author_feed_state::State, + S::Actor: get_author_feed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetAuthorFeed<'a> { + GetAuthorFeed { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + filter: self.__unsafe_private_named.2, + include_pins: self.__unsafe_private_named.3, + limit: 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 GetAuthorFeedOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feed: 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 GetAuthorFeedError<'a> { + #[serde(rename = "BlockedActor")] + BlockedActor(std::option::Option), + #[serde(rename = "BlockedByActor")] + BlockedByActor(std::option::Option), +} + +impl std::fmt::Display for GetAuthorFeedError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BlockedActor(msg) => { + write!(f, "BlockedActor")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::BlockedByActor(msg) => { + write!(f, "BlockedByActor")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.feed.getAuthorFeed +pub struct GetAuthorFeedResponse; +impl jacquard_common::xrpc::XrpcResp for GetAuthorFeedResponse { + const NSID: &'static str = "app.bsky.feed.getAuthorFeed"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetAuthorFeedOutput<'de>; + type Err<'de> = GetAuthorFeedError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetAuthorFeed<'a> { + const NSID: &'static str = "app.bsky.feed.getAuthorFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetAuthorFeedResponse; +} + +/// Endpoint type for +///app.bsky.feed.getAuthorFeed +pub struct GetAuthorFeedRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetAuthorFeedRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getAuthorFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetAuthorFeed<'de>; + type Response = GetAuthorFeedResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_feed.rs b/crates/weaver-api/src/app_bsky/feed/get_feed.rs new file mode 100644 index 0000000..1fa1cf1 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_feed.rs @@ -0,0 +1,230 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getFeed +// +// 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 GetFeed<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feed: 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_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 { + type Feed; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Feed = Unset; + } + ///State transition - sets the `feed` field to Set + pub struct SetFeed(PhantomData S>); + impl sealed::Sealed for SetFeed {} + impl State for SetFeed { + type Feed = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `feed` field + pub struct feed(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetFeedBuilder<'a, S: get_feed_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> GetFeed<'a> { + /// Create a new builder for this type + pub fn new() -> GetFeedBuilder<'a, get_feed_state::Empty> { + GetFeedBuilder::new() + } +} + +impl<'a> GetFeedBuilder<'a, get_feed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_feed_state::State> GetFeedBuilder<'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> GetFeedBuilder<'a, S> +where + S: get_feed_state::State, + S::Feed: get_feed_state::IsUnset, +{ + /// Set the `feed` field (required) + pub fn feed( + mut self, + value: impl Into>, + ) -> GetFeedBuilder<'a, get_feed_state::SetFeed> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_feed_state::State> GetFeedBuilder<'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> GetFeedBuilder<'a, S> +where + S: get_feed_state::State, + S::Feed: get_feed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetFeed<'a> { + GetFeed { + cursor: self.__unsafe_private_named.0, + feed: self.__unsafe_private_named.1.unwrap(), + 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 GetFeedOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feed: 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 GetFeedError<'a> { + #[serde(rename = "UnknownFeed")] + UnknownFeed(std::option::Option), +} + +impl std::fmt::Display for GetFeedError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::UnknownFeed(msg) => { + write!(f, "UnknownFeed")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.feed.getFeed +pub struct GetFeedResponse; +impl jacquard_common::xrpc::XrpcResp for GetFeedResponse { + const NSID: &'static str = "app.bsky.feed.getFeed"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetFeedOutput<'de>; + type Err<'de> = GetFeedError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetFeed<'a> { + const NSID: &'static str = "app.bsky.feed.getFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetFeedResponse; +} + +/// Endpoint type for +///app.bsky.feed.getFeed +pub struct GetFeedRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetFeedRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetFeed<'de>; + type Response = GetFeedResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_feed_generator.rs b/crates/weaver-api/src/app_bsky/feed/get_feed_generator.rs new file mode 100644 index 0000000..b049bff --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_feed_generator.rs @@ -0,0 +1,158 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getFeedGenerator +// +// 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 GetFeedGenerator<'a> { + #[serde(borrow)] + pub feed: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_feed_generator_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 Feed; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Feed = Unset; + } + ///State transition - sets the `feed` field to Set + pub struct SetFeed(PhantomData S>); + impl sealed::Sealed for SetFeed {} + impl State for SetFeed { + type Feed = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `feed` field + pub struct feed(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetFeedGeneratorBuilder<'a, S: get_feed_generator_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetFeedGenerator<'a> { + /// Create a new builder for this type + pub fn new() -> GetFeedGeneratorBuilder<'a, get_feed_generator_state::Empty> { + GetFeedGeneratorBuilder::new() + } +} + +impl<'a> GetFeedGeneratorBuilder<'a, get_feed_generator_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetFeedGeneratorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetFeedGeneratorBuilder<'a, S> +where + S: get_feed_generator_state::State, + S::Feed: get_feed_generator_state::IsUnset, +{ + /// Set the `feed` field (required) + pub fn feed( + mut self, + value: impl Into>, + ) -> GetFeedGeneratorBuilder<'a, get_feed_generator_state::SetFeed> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetFeedGeneratorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetFeedGeneratorBuilder<'a, S> +where + S: get_feed_generator_state::State, + S::Feed: get_feed_generator_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetFeedGenerator<'a> { + GetFeedGenerator { + feed: 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 GetFeedGeneratorOutput<'a> { + /// Indicates whether the feed generator service has been online recently, or else seems to be inactive. + pub is_online: bool, + /// Indicates whether the feed generator service is compatible with the record declaration. + pub is_valid: bool, + #[serde(borrow)] + pub view: crate::app_bsky::feed::GeneratorView<'a>, +} + +/// Response type for +///app.bsky.feed.getFeedGenerator +pub struct GetFeedGeneratorResponse; +impl jacquard_common::xrpc::XrpcResp for GetFeedGeneratorResponse { + const NSID: &'static str = "app.bsky.feed.getFeedGenerator"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetFeedGeneratorOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetFeedGenerator<'a> { + const NSID: &'static str = "app.bsky.feed.getFeedGenerator"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetFeedGeneratorResponse; +} + +/// Endpoint type for +///app.bsky.feed.getFeedGenerator +pub struct GetFeedGeneratorRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetFeedGeneratorRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getFeedGenerator"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetFeedGenerator<'de>; + type Response = GetFeedGeneratorResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_feed_generators.rs b/crates/weaver-api/src/app_bsky/feed/get_feed_generators.rs new file mode 100644 index 0000000..6ae23dc --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_feed_generators.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getFeedGenerators +// +// 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 GetFeedGenerators<'a> { + #[serde(borrow)] + pub feeds: Vec>, +} + +pub mod get_feed_generators_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 Feeds; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Feeds = Unset; + } + ///State transition - sets the `feeds` field to Set + pub struct SetFeeds(PhantomData S>); + impl sealed::Sealed for SetFeeds {} + impl State for SetFeeds { + type Feeds = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `feeds` field + pub struct feeds(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetFeedGeneratorsBuilder<'a, S: get_feed_generators_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetFeedGenerators<'a> { + /// Create a new builder for this type + pub fn new() -> GetFeedGeneratorsBuilder<'a, get_feed_generators_state::Empty> { + GetFeedGeneratorsBuilder::new() + } +} + +impl<'a> GetFeedGeneratorsBuilder<'a, get_feed_generators_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetFeedGeneratorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetFeedGeneratorsBuilder<'a, S> +where + S: get_feed_generators_state::State, + S::Feeds: get_feed_generators_state::IsUnset, +{ + /// Set the `feeds` field (required) + pub fn feeds( + mut self, + value: impl Into>>, + ) -> GetFeedGeneratorsBuilder<'a, get_feed_generators_state::SetFeeds> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetFeedGeneratorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetFeedGeneratorsBuilder<'a, S> +where + S: get_feed_generators_state::State, + S::Feeds: get_feed_generators_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetFeedGenerators<'a> { + GetFeedGenerators { + feeds: 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 GetFeedGeneratorsOutput<'a> { + #[serde(borrow)] + pub feeds: Vec>, +} + +/// Response type for +///app.bsky.feed.getFeedGenerators +pub struct GetFeedGeneratorsResponse; +impl jacquard_common::xrpc::XrpcResp for GetFeedGeneratorsResponse { + const NSID: &'static str = "app.bsky.feed.getFeedGenerators"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetFeedGeneratorsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetFeedGenerators<'a> { + const NSID: &'static str = "app.bsky.feed.getFeedGenerators"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetFeedGeneratorsResponse; +} + +/// Endpoint type for +///app.bsky.feed.getFeedGenerators +pub struct GetFeedGeneratorsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetFeedGeneratorsRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getFeedGenerators"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetFeedGenerators<'de>; + type Response = GetFeedGeneratorsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_feed_skeleton.rs b/crates/weaver-api/src/app_bsky/feed/get_feed_skeleton.rs new file mode 100644 index 0000000..07c98ac --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_feed_skeleton.rs @@ -0,0 +1,234 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getFeedSkeleton +// +// 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 GetFeedSkeleton<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feed: 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_feed_skeleton_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 Feed; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Feed = Unset; + } + ///State transition - sets the `feed` field to Set + pub struct SetFeed(PhantomData S>); + impl sealed::Sealed for SetFeed {} + impl State for SetFeed { + type Feed = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `feed` field + pub struct feed(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetFeedSkeletonBuilder<'a, S: get_feed_skeleton_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> GetFeedSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> GetFeedSkeletonBuilder<'a, get_feed_skeleton_state::Empty> { + GetFeedSkeletonBuilder::new() + } +} + +impl<'a> GetFeedSkeletonBuilder<'a, get_feed_skeleton_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetFeedSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_feed_skeleton_state::State> GetFeedSkeletonBuilder<'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> GetFeedSkeletonBuilder<'a, S> +where + S: get_feed_skeleton_state::State, + S::Feed: get_feed_skeleton_state::IsUnset, +{ + /// Set the `feed` field (required) + pub fn feed( + mut self, + value: impl Into>, + ) -> GetFeedSkeletonBuilder<'a, get_feed_skeleton_state::SetFeed> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetFeedSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_feed_skeleton_state::State> GetFeedSkeletonBuilder<'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> GetFeedSkeletonBuilder<'a, S> +where + S: get_feed_skeleton_state::State, + S::Feed: get_feed_skeleton_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetFeedSkeleton<'a> { + GetFeedSkeleton { + cursor: self.__unsafe_private_named.0, + feed: self.__unsafe_private_named.1.unwrap(), + 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 GetFeedSkeletonOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feed: Vec>, + /// Unique identifier per request that may be passed back alongside interactions. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub req_id: 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 GetFeedSkeletonError<'a> { + #[serde(rename = "UnknownFeed")] + UnknownFeed(std::option::Option), +} + +impl std::fmt::Display for GetFeedSkeletonError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::UnknownFeed(msg) => { + write!(f, "UnknownFeed")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.feed.getFeedSkeleton +pub struct GetFeedSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for GetFeedSkeletonResponse { + const NSID: &'static str = "app.bsky.feed.getFeedSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetFeedSkeletonOutput<'de>; + type Err<'de> = GetFeedSkeletonError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetFeedSkeleton<'a> { + const NSID: &'static str = "app.bsky.feed.getFeedSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetFeedSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.feed.getFeedSkeleton +pub struct GetFeedSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetFeedSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getFeedSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetFeedSkeleton<'de>; + type Response = GetFeedSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_likes.rs b/crates/weaver-api/src/app_bsky/feed/get_likes.rs new file mode 100644 index 0000000..e108641 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_likes.rs @@ -0,0 +1,609 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getLikes +// +// 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 Like<'a> { + #[serde(borrow)] + pub actor: crate::app_bsky::actor::ProfileView<'a>, + pub created_at: jacquard_common::types::string::Datetime, + pub indexed_at: jacquard_common::types::string::Datetime, +} + +pub mod like_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 IndexedAt; + type CreatedAt; + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type IndexedAt = Unset; + type CreatedAt = Unset; + type Actor = 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 CreatedAt = S::CreatedAt; + type Actor = S::Actor; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type IndexedAt = S::IndexedAt; + type CreatedAt = 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 IndexedAt = S::IndexedAt; + type CreatedAt = S::CreatedAt; + type Actor = 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 `created_at` field + pub struct created_at(()); + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LikeBuilder<'a, S: like_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> Like<'a> { + /// Create a new builder for this type + pub fn new() -> LikeBuilder<'a, like_state::Empty> { + LikeBuilder::new() + } +} + +impl<'a> LikeBuilder<'a, like_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LikeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LikeBuilder<'a, S> +where + S: like_state::State, + S::Actor: like_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> LikeBuilder<'a, like_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LikeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LikeBuilder<'a, S> +where + S: like_state::State, + S::CreatedAt: like_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> LikeBuilder<'a, like_state::SetCreatedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LikeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LikeBuilder<'a, S> +where + S: like_state::State, + S::IndexedAt: like_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> LikeBuilder<'a, like_state::SetIndexedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LikeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LikeBuilder<'a, S> +where + S: like_state::State, + S::IndexedAt: like_state::IsSet, + S::CreatedAt: like_state::IsSet, + S::Actor: like_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Like<'a> { + Like { + actor: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + indexed_at: 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>, + >, + ) -> Like<'a> { + Like { + actor: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_feed_getLikes() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.getLikes"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("like"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::jacquard_common::smol_str::SmolStr::new_static("actor") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("actor"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileView", + ), + }), + ); + 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( + "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("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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "CID of the subject record (aka, specific version of record), to filter likes.", + ), + ), + 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("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("uri"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "AT-URI of the subject (eg, a post record).", + ), + ), + 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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Like<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.getLikes" + } + fn def_name() -> &'static str { + "like" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_getLikes() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetLikes<'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>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_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 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 GetLikesBuilder<'a, S: get_likes_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> GetLikes<'a> { + /// Create a new builder for this type + pub fn new() -> GetLikesBuilder<'a, get_likes_state::Empty> { + GetLikesBuilder::new() + } +} + +impl<'a> GetLikesBuilder<'a, get_likes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetLikesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_likes_state::State> GetLikesBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_likes_state::State> GetLikesBuilder<'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_likes_state::State> GetLikesBuilder<'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> GetLikesBuilder<'a, S> +where + S: get_likes_state::State, + S::Uri: get_likes_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> GetLikesBuilder<'a, get_likes_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + GetLikesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetLikesBuilder<'a, S> +where + S: get_likes_state::State, + S::Uri: get_likes_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetLikes<'a> { + GetLikes { + cid: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + uri: 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 GetLikesOutput<'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 +///app.bsky.feed.getLikes +pub struct GetLikesResponse; +impl jacquard_common::xrpc::XrpcResp for GetLikesResponse { + const NSID: &'static str = "app.bsky.feed.getLikes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetLikesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetLikes<'a> { + const NSID: &'static str = "app.bsky.feed.getLikes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetLikesResponse; +} + +/// Endpoint type for +///app.bsky.feed.getLikes +pub struct GetLikesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetLikesRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getLikes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetLikes<'de>; + type Response = GetLikesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_list_feed.rs b/crates/weaver-api/src/app_bsky/feed/get_list_feed.rs new file mode 100644 index 0000000..bbafeb8 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_list_feed.rs @@ -0,0 +1,230 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getListFeed +// +// 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 GetListFeed<'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_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 { + 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 GetListFeedBuilder<'a, S: get_list_feed_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> GetListFeed<'a> { + /// Create a new builder for this type + pub fn new() -> GetListFeedBuilder<'a, get_list_feed_state::Empty> { + GetListFeedBuilder::new() + } +} + +impl<'a> GetListFeedBuilder<'a, get_list_feed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetListFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_list_feed_state::State> GetListFeedBuilder<'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_feed_state::State> GetListFeedBuilder<'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> GetListFeedBuilder<'a, S> +where + S: get_list_feed_state::State, + S::List: get_list_feed_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into>, + ) -> GetListFeedBuilder<'a, get_list_feed_state::SetList> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetListFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetListFeedBuilder<'a, S> +where + S: get_list_feed_state::State, + S::List: get_list_feed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetListFeed<'a> { + GetListFeed { + 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 GetListFeedOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feed: 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 GetListFeedError<'a> { + #[serde(rename = "UnknownList")] + UnknownList(std::option::Option), +} + +impl std::fmt::Display for GetListFeedError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::UnknownList(msg) => { + write!(f, "UnknownList")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.feed.getListFeed +pub struct GetListFeedResponse; +impl jacquard_common::xrpc::XrpcResp for GetListFeedResponse { + const NSID: &'static str = "app.bsky.feed.getListFeed"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetListFeedOutput<'de>; + type Err<'de> = GetListFeedError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetListFeed<'a> { + const NSID: &'static str = "app.bsky.feed.getListFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetListFeedResponse; +} + +/// Endpoint type for +///app.bsky.feed.getListFeed +pub struct GetListFeedRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetListFeedRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getListFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetListFeed<'de>; + type Response = GetListFeedResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_post_thread.rs b/crates/weaver-api/src/app_bsky/feed/get_post_thread.rs new file mode 100644 index 0000000..4a88095 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_post_thread.rs @@ -0,0 +1,248 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getPostThread +// +// 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 GetPostThread<'a> { + ///(default: 6, min: 0, max: 1000) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub depth: std::option::Option, + ///(default: 80, min: 0, max: 1000) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub parent_height: std::option::Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_post_thread_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 GetPostThreadBuilder<'a, S: get_post_thread_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> GetPostThread<'a> { + /// Create a new builder for this type + pub fn new() -> GetPostThreadBuilder<'a, get_post_thread_state::Empty> { + GetPostThreadBuilder::new() + } +} + +impl<'a> GetPostThreadBuilder<'a, get_post_thread_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetPostThreadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_post_thread_state::State> GetPostThreadBuilder<'a, S> { + /// Set the `depth` field (optional) + pub fn depth(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `depth` field to an Option value (optional) + pub fn maybe_depth(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_post_thread_state::State> GetPostThreadBuilder<'a, S> { + /// Set the `parentHeight` field (optional) + pub fn parent_height(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `parentHeight` field to an Option value (optional) + pub fn maybe_parent_height(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetPostThreadBuilder<'a, S> +where + S: get_post_thread_state::State, + S::Uri: get_post_thread_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> GetPostThreadBuilder<'a, get_post_thread_state::SetUri> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetPostThreadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetPostThreadBuilder<'a, S> +where + S: get_post_thread_state::State, + S::Uri: get_post_thread_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetPostThread<'a> { + GetPostThread { + depth: self.__unsafe_private_named.0, + parent_height: self.__unsafe_private_named.1, + uri: 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 GetPostThreadOutput<'a> { + #[serde(borrow)] + pub thread: GetPostThreadOutputThread<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub threadgate: 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 GetPostThreadOutputThread<'a> { + #[serde(rename = "app.bsky.feed.defs#threadViewPost")] + ThreadViewPost(Box>), + #[serde(rename = "app.bsky.feed.defs#notFoundPost")] + NotFoundPost(Box>), + #[serde(rename = "app.bsky.feed.defs#blockedPost")] + BlockedPost(Box>), +} + +#[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 GetPostThreadError<'a> { + #[serde(rename = "NotFound")] + NotFound(std::option::Option), +} + +impl std::fmt::Display for GetPostThreadError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::NotFound(msg) => { + write!(f, "NotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.feed.getPostThread +pub struct GetPostThreadResponse; +impl jacquard_common::xrpc::XrpcResp for GetPostThreadResponse { + const NSID: &'static str = "app.bsky.feed.getPostThread"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPostThreadOutput<'de>; + type Err<'de> = GetPostThreadError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetPostThread<'a> { + const NSID: &'static str = "app.bsky.feed.getPostThread"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPostThreadResponse; +} + +/// Endpoint type for +///app.bsky.feed.getPostThread +pub struct GetPostThreadRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetPostThreadRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getPostThread"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPostThread<'de>; + type Response = GetPostThreadResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_posts.rs b/crates/weaver-api/src/app_bsky/feed/get_posts.rs new file mode 100644 index 0000000..8a7ec34 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_posts.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getPosts +// +// 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 GetPosts<'a> { + #[serde(borrow)] + pub uris: Vec>, +} + +pub mod get_posts_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 GetPostsBuilder<'a, S: get_posts_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetPosts<'a> { + /// Create a new builder for this type + pub fn new() -> GetPostsBuilder<'a, get_posts_state::Empty> { + GetPostsBuilder::new() + } +} + +impl<'a> GetPostsBuilder<'a, get_posts_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetPostsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetPostsBuilder<'a, S> +where + S: get_posts_state::State, + S::Uris: get_posts_state::IsUnset, +{ + /// Set the `uris` field (required) + pub fn uris( + mut self, + value: impl Into>>, + ) -> GetPostsBuilder<'a, get_posts_state::SetUris> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetPostsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetPostsBuilder<'a, S> +where + S: get_posts_state::State, + S::Uris: get_posts_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetPosts<'a> { + GetPosts { + 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 GetPostsOutput<'a> { + #[serde(borrow)] + pub posts: Vec>, +} + +/// Response type for +///app.bsky.feed.getPosts +pub struct GetPostsResponse; +impl jacquard_common::xrpc::XrpcResp for GetPostsResponse { + const NSID: &'static str = "app.bsky.feed.getPosts"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPostsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetPosts<'a> { + const NSID: &'static str = "app.bsky.feed.getPosts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPostsResponse; +} + +/// Endpoint type for +///app.bsky.feed.getPosts +pub struct GetPostsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetPostsRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getPosts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPosts<'de>; + type Response = GetPostsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_quotes.rs b/crates/weaver-api/src/app_bsky/feed/get_quotes.rs new file mode 100644 index 0000000..ae88884 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_quotes.rs @@ -0,0 +1,225 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getQuotes +// +// 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 GetQuotes<'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>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_quotes_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 GetQuotesBuilder<'a, S: get_quotes_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> GetQuotes<'a> { + /// Create a new builder for this type + pub fn new() -> GetQuotesBuilder<'a, get_quotes_state::Empty> { + GetQuotesBuilder::new() + } +} + +impl<'a> GetQuotesBuilder<'a, get_quotes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetQuotesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_quotes_state::State> GetQuotesBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_quotes_state::State> GetQuotesBuilder<'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_quotes_state::State> GetQuotesBuilder<'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> GetQuotesBuilder<'a, S> +where + S: get_quotes_state::State, + S::Uri: get_quotes_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> GetQuotesBuilder<'a, get_quotes_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + GetQuotesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetQuotesBuilder<'a, S> +where + S: get_quotes_state::State, + S::Uri: get_quotes_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetQuotes<'a> { + GetQuotes { + cid: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + uri: 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 GetQuotesOutput<'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 posts: Vec>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +/// Response type for +///app.bsky.feed.getQuotes +pub struct GetQuotesResponse; +impl jacquard_common::xrpc::XrpcResp for GetQuotesResponse { + const NSID: &'static str = "app.bsky.feed.getQuotes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetQuotesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetQuotes<'a> { + const NSID: &'static str = "app.bsky.feed.getQuotes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetQuotesResponse; +} + +/// Endpoint type for +///app.bsky.feed.getQuotes +pub struct GetQuotesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetQuotesRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getQuotes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetQuotes<'de>; + type Response = GetQuotesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_reposted_by.rs b/crates/weaver-api/src/app_bsky/feed/get_reposted_by.rs new file mode 100644 index 0000000..24686f6 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_reposted_by.rs @@ -0,0 +1,225 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getRepostedBy +// +// 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 GetRepostedBy<'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>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_reposted_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 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 GetRepostedByBuilder<'a, S: get_reposted_by_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> GetRepostedBy<'a> { + /// Create a new builder for this type + pub fn new() -> GetRepostedByBuilder<'a, get_reposted_by_state::Empty> { + GetRepostedByBuilder::new() + } +} + +impl<'a> GetRepostedByBuilder<'a, get_reposted_by_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRepostedByBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_reposted_by_state::State> GetRepostedByBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_reposted_by_state::State> GetRepostedByBuilder<'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_reposted_by_state::State> GetRepostedByBuilder<'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> GetRepostedByBuilder<'a, S> +where + S: get_reposted_by_state::State, + S::Uri: get_reposted_by_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> GetRepostedByBuilder<'a, get_reposted_by_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + GetRepostedByBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRepostedByBuilder<'a, S> +where + S: get_reposted_by_state::State, + S::Uri: get_reposted_by_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRepostedBy<'a> { + GetRepostedBy { + cid: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + uri: 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 GetRepostedByOutput<'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 reposted_by: Vec>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +/// Response type for +///app.bsky.feed.getRepostedBy +pub struct GetRepostedByResponse; +impl jacquard_common::xrpc::XrpcResp for GetRepostedByResponse { + const NSID: &'static str = "app.bsky.feed.getRepostedBy"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetRepostedByOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRepostedBy<'a> { + const NSID: &'static str = "app.bsky.feed.getRepostedBy"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRepostedByResponse; +} + +/// Endpoint type for +///app.bsky.feed.getRepostedBy +pub struct GetRepostedByRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRepostedByRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getRepostedBy"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRepostedBy<'de>; + type Response = GetRepostedByResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_suggested_feeds.rs b/crates/weaver-api/src/app_bsky/feed/get_suggested_feeds.rs new file mode 100644 index 0000000..11b72d0 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_suggested_feeds.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getSuggestedFeeds +// +// 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 GetSuggestedFeeds<'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_suggested_feeds_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 GetSuggestedFeedsBuilder<'a, S: get_suggested_feeds_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSuggestedFeeds<'a> { + /// Create a new builder for this type + pub fn new() -> GetSuggestedFeedsBuilder<'a, get_suggested_feeds_state::Empty> { + GetSuggestedFeedsBuilder::new() + } +} + +impl<'a> GetSuggestedFeedsBuilder<'a, get_suggested_feeds_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedFeedsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_suggested_feeds_state::State> GetSuggestedFeedsBuilder<'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_suggested_feeds_state::State> GetSuggestedFeedsBuilder<'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> GetSuggestedFeedsBuilder<'a, S> +where + S: get_suggested_feeds_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedFeeds<'a> { + GetSuggestedFeeds { + 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 GetSuggestedFeedsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feeds: Vec>, +} + +/// Response type for +///app.bsky.feed.getSuggestedFeeds +pub struct GetSuggestedFeedsResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedFeedsResponse { + const NSID: &'static str = "app.bsky.feed.getSuggestedFeeds"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedFeedsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSuggestedFeeds<'a> { + const NSID: &'static str = "app.bsky.feed.getSuggestedFeeds"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedFeedsResponse; +} + +/// Endpoint type for +///app.bsky.feed.getSuggestedFeeds +pub struct GetSuggestedFeedsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedFeedsRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getSuggestedFeeds"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedFeeds<'de>; + type Response = GetSuggestedFeedsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/get_timeline.rs b/crates/weaver-api/src/app_bsky/feed/get_timeline.rs new file mode 100644 index 0000000..77dc6cc --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/get_timeline.rs @@ -0,0 +1,183 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.getTimeline +// +// 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 GetTimeline<'a> { + #[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>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_timeline_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 GetTimelineBuilder<'a, S: get_timeline_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> GetTimeline<'a> { + /// Create a new builder for this type + pub fn new() -> GetTimelineBuilder<'a, get_timeline_state::Empty> { + GetTimelineBuilder::new() + } +} + +impl<'a> GetTimelineBuilder<'a, get_timeline_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetTimelineBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_timeline_state::State> GetTimelineBuilder<'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_timeline_state::State> GetTimelineBuilder<'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_timeline_state::State> GetTimelineBuilder<'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> GetTimelineBuilder<'a, S> +where + S: get_timeline_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetTimeline<'a> { + GetTimeline { + algorithm: self.__unsafe_private_named.0, + 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 GetTimelineOutput<'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 +///app.bsky.feed.getTimeline +pub struct GetTimelineResponse; +impl jacquard_common::xrpc::XrpcResp for GetTimelineResponse { + const NSID: &'static str = "app.bsky.feed.getTimeline"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetTimelineOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetTimeline<'a> { + const NSID: &'static str = "app.bsky.feed.getTimeline"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetTimelineResponse; +} + +/// Endpoint type for +///app.bsky.feed.getTimeline +pub struct GetTimelineRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetTimelineRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.getTimeline"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetTimeline<'de>; + type Response = GetTimelineResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/like.rs b/crates/weaver-api/src/app_bsky/feed/like.rs new file mode 100644 index 0000000..96dac6f --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/like.rs @@ -0,0 +1,343 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.like +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record declaring a 'like' of a piece of subject content. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Like<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub via: Option>, +} + +pub mod like_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 CreatedAt; + } + /// 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; + } + ///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 `subject` field + pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LikeBuilder<'a, S: like_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> Like<'a> { + /// Create a new builder for this type + pub fn new() -> LikeBuilder<'a, like_state::Empty> { + LikeBuilder::new() + } +} + +impl<'a> LikeBuilder<'a, like_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LikeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LikeBuilder<'a, S> +where + S: like_state::State, + S::CreatedAt: like_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> LikeBuilder<'a, like_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LikeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LikeBuilder<'a, S> +where + S: like_state::State, + S::Subject: like_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> LikeBuilder<'a, like_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LikeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: like_state::State> LikeBuilder<'a, S> { + /// Set the `via` field (optional) + pub fn via( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `via` field to an Option value (optional) + pub fn maybe_via( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> LikeBuilder<'a, S> +where + S: like_state::State, + S::Subject: like_state::IsSet, + S::CreatedAt: like_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Like<'a> { + Like { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + via: 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>, + >, + ) -> Like<'a> { + Like { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + via: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Like<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, LikeRecord>, + 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 LikeGetRecordOutput<'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: Like<'a>, +} + +impl From> for Like<'_> { + fn from(output: LikeGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Like<'_> { + const NSID: &'static str = "app.bsky.feed.like"; + type Record = LikeRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct LikeRecord; +impl jacquard_common::xrpc::XrpcResp for LikeRecord { + const NSID: &'static str = "app.bsky.feed.like"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = LikeGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for LikeRecord { + const NSID: &'static str = "app.bsky.feed.like"; + type Record = LikeRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Like<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.like" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_like() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_feed_like() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.like"), + 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( + "Record declaring a 'like' of a piece of subject content.", + ), + ), + 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("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("via"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/post.rs b/crates/weaver-api/src/app_bsky/feed/post.rs new file mode 100644 index 0000000..96d8e43 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/post.rs @@ -0,0 +1,1440 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.post +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Deprecated: use facets instead. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Entity<'a> { + #[serde(borrow)] + pub index: crate::app_bsky::feed::post::TextSlice<'a>, + /// Expected values are 'mention' and 'link'. + #[serde(borrow)] + pub r#type: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub value: jacquard_common::CowStr<'a>, +} + +pub mod entity_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 Index; + type Type; + type Value; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Index = Unset; + type Type = Unset; + type Value = 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 Type = S::Type; + type Value = S::Value; + } + ///State transition - sets the `type` field to Set + pub struct SetType(PhantomData S>); + impl sealed::Sealed for SetType {} + impl State for SetType { + type Index = S::Index; + type Type = 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 Index = S::Index; + type Type = S::Type; + type Value = 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 `type` field + pub struct r#type(()); + ///Marker type for the `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EntityBuilder<'a, S: entity_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> Entity<'a> { + /// Create a new builder for this type + pub fn new() -> EntityBuilder<'a, entity_state::Empty> { + EntityBuilder::new() + } +} + +impl<'a> EntityBuilder<'a, entity_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EntityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntityBuilder<'a, S> +where + S: entity_state::State, + S::Index: entity_state::IsUnset, +{ + /// Set the `index` field (required) + pub fn index( + mut self, + value: impl Into>, + ) -> EntityBuilder<'a, entity_state::SetIndex> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EntityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntityBuilder<'a, S> +where + S: entity_state::State, + S::Type: entity_state::IsUnset, +{ + /// Set the `type` field (required) + pub fn r#type( + mut self, + value: impl Into>, + ) -> EntityBuilder<'a, entity_state::SetType> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + EntityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntityBuilder<'a, S> +where + S: entity_state::State, + S::Value: entity_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> EntityBuilder<'a, entity_state::SetValue> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + EntityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntityBuilder<'a, S> +where + S: entity_state::State, + S::Index: entity_state::IsSet, + S::Type: entity_state::IsSet, + S::Value: entity_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Entity<'a> { + Entity { + index: self.__unsafe_private_named.0.unwrap(), + r#type: self.__unsafe_private_named.1.unwrap(), + value: 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>, + >, + ) -> Entity<'a> { + Entity { + index: self.__unsafe_private_named.0.unwrap(), + r#type: self.__unsafe_private_named.1.unwrap(), + value: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_feed_post() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.post"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entity"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Deprecated: use facets instead.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("index"), + ::jacquard_common::smol_str::SmolStr::new_static("type"), + ::jacquard_common::smol_str::SmolStr::new_static("value") + ], + ), + 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::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#textSlice"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("type"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Expected values are 'mention' and 'link'.", + ), + ), + 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("value"), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Record containing a Bluesky post.", + ), + ), + 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("text"), + ::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: Some( + ::jacquard_common::CowStr::new_static( + "Client-declared timestamp when this post was originally created.", + ), + ), + 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("embed"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.images"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.video"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.external"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.record"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.recordWithMedia") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "entities", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "DEPRECATED: replaced by app.bsky.richtext.facet.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#entity"), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("facets"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Annotations of text (mentions, URLs, hashtags, etc)", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.richtext.facet", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labels"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: Some( + ::jacquard_common::CowStr::new_static( + "Self-label values for this post. Effectively content warnings.", + ), + ), + refs: vec![ + ::jacquard_common::CowStr::new_static("com.atproto.label.defs#selfLabels") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("langs"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Indicates human language of post primary text content.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Language, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: Some(3usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reply"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#replyRef"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tags"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Additional hashtags, in addition to any included in post text and facets.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: Some(8usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("text"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The primary post content. May be an empty string, if there are embeds.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("replyRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("root"), + ::jacquard_common::smol_str::SmolStr::new_static("parent") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("parent"), + ::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("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("textSlice"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("start"), + ::jacquard_common::smol_str::SmolStr::new_static("end") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("end"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("start"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Entity<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.post" + } + fn def_name() -> &'static str { + "entity" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_post() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Record containing a Bluesky post. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Post<'a> { + /// Client-declared timestamp when this post was originally created. + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embed: Option>, + /// DEPRECATED: replaced by app.bsky.richtext.facet. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entities: Option>>, + /// Annotations of text (mentions, URLs, hashtags, etc) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub facets: Option>>, + /// Self-label values for this post. Effectively content warnings. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>, + /// Indicates human language of post primary text content. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub langs: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reply: Option>, + /// Additional hashtags, in addition to any included in post text and facets. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: Option>>, + /// The primary post content. May be an empty string, if there are embeds. + #[serde(borrow)] + pub text: jacquard_common::CowStr<'a>, +} + +pub mod post_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 Text; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Text = Unset; + 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 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 `text` field + pub struct text(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PostBuilder<'a, S: post_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> Post<'a> { + /// Create a new builder for this type + pub fn new() -> PostBuilder<'a, post_state::Empty> { + PostBuilder::new() + } +} + +impl<'a> PostBuilder<'a, post_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PostBuilder<'a, S> +where + S: post_state::State, + S::CreatedAt: post_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> PostBuilder<'a, post_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: post_state::State> PostBuilder<'a, S> { + /// Set the `embed` field (optional) + pub fn embed(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `embed` field to an Option value (optional) + pub fn maybe_embed(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: post_state::State> PostBuilder<'a, S> { + /// Set the `entities` field (optional) + pub fn entities( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `entities` field to an Option value (optional) + pub fn maybe_entities( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: post_state::State> PostBuilder<'a, S> { + /// Set the `facets` field (optional) + pub fn facets( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `facets` field to an Option value (optional) + pub fn maybe_facets( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: post_state::State> PostBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S: post_state::State> PostBuilder<'a, S> { + /// Set the `langs` field (optional) + pub fn langs( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `langs` field to an Option value (optional) + pub fn maybe_langs( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: post_state::State> PostBuilder<'a, S> { + /// Set the `reply` field (optional) + pub fn reply( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `reply` field to an Option value (optional) + pub fn maybe_reply( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: post_state::State> PostBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.7 = 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.7 = value; + self + } +} + +impl<'a, S> PostBuilder<'a, S> +where + S: post_state::State, + S::Text: post_state::IsUnset, +{ + /// Set the `text` field (required) + pub fn text( + mut self, + value: impl Into>, + ) -> PostBuilder<'a, post_state::SetText> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + PostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PostBuilder<'a, S> +where + S: post_state::State, + S::Text: post_state::IsSet, + S::CreatedAt: post_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Post<'a> { + Post { + created_at: self.__unsafe_private_named.0.unwrap(), + embed: self.__unsafe_private_named.1, + entities: self.__unsafe_private_named.2, + facets: self.__unsafe_private_named.3, + labels: self.__unsafe_private_named.4, + langs: self.__unsafe_private_named.5, + reply: self.__unsafe_private_named.6, + tags: self.__unsafe_private_named.7, + text: 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>, + >, + ) -> Post<'a> { + Post { + created_at: self.__unsafe_private_named.0.unwrap(), + embed: self.__unsafe_private_named.1, + entities: self.__unsafe_private_named.2, + facets: self.__unsafe_private_named.3, + labels: self.__unsafe_private_named.4, + langs: self.__unsafe_private_named.5, + reply: self.__unsafe_private_named.6, + tags: self.__unsafe_private_named.7, + text: self.__unsafe_private_named.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Post<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, PostRecord>, + jacquard_common::types::uri::UriError, + > { + jacquard_common::types::uri::RecordUri::try_from_uri( + jacquard_common::types::string::AtUri::new_cow(uri.into())?, + ) + } +} + +#[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 PostEmbed<'a> { + #[serde(rename = "app.bsky.embed.images")] + Images(Box>), + #[serde(rename = "app.bsky.embed.video")] + Video(Box>), + #[serde(rename = "app.bsky.embed.external")] + External(Box>), + #[serde(rename = "app.bsky.embed.record")] + Record(Box>), + #[serde(rename = "app.bsky.embed.recordWithMedia")] + RecordWithMedia(Box>), +} + +/// 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 PostGetRecordOutput<'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: Post<'a>, +} + +impl From> for Post<'_> { + fn from(output: PostGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Post<'_> { + const NSID: &'static str = "app.bsky.feed.post"; + type Record = PostRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct PostRecord; +impl jacquard_common::xrpc::XrpcResp for PostRecord { + const NSID: &'static str = "app.bsky.feed.post"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = PostGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for PostRecord { + const NSID: &'static str = "app.bsky.feed.post"; + type Record = PostRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Post<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.post" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_post() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.langs { + #[allow(unused_comparisons)] + if value.len() > 3usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "langs", + ), + max: 3usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.tags { + #[allow(unused_comparisons)] + if value.len() > 8usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "tags", + ), + max: 8usize, + actual: value.len(), + }); + } + } + { + let value = &self.text; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "text", + ), + max: 3000usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.text; + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 300usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "text", + ), + max: 300usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ReplyRef<'a> { + #[serde(borrow)] + pub parent: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + #[serde(borrow)] + pub root: crate::com_atproto::repo::strong_ref::StrongRef<'a>, +} + +pub mod reply_ref_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 Root; + type Parent; + } + /// 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; + } + ///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 `root` field + pub struct root(()); + ///Marker type for the `parent` field + pub struct parent(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReplyRefBuilder<'a, S: reply_ref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ReplyRef<'a> { + /// Create a new builder for this type + pub fn new() -> ReplyRefBuilder<'a, reply_ref_state::Empty> { + ReplyRefBuilder::new() + } +} + +impl<'a> ReplyRefBuilder<'a, reply_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReplyRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReplyRefBuilder<'a, S> +where + S: reply_ref_state::State, + S::Parent: reply_ref_state::IsUnset, +{ + /// Set the `parent` field (required) + pub fn parent( + mut self, + value: impl Into>, + ) -> ReplyRefBuilder<'a, reply_ref_state::SetParent> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ReplyRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReplyRefBuilder<'a, S> +where + S: reply_ref_state::State, + S::Root: reply_ref_state::IsUnset, +{ + /// Set the `root` field (required) + pub fn root( + mut self, + value: impl Into>, + ) -> ReplyRefBuilder<'a, reply_ref_state::SetRoot> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ReplyRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReplyRefBuilder<'a, S> +where + S: reply_ref_state::State, + S::Root: reply_ref_state::IsSet, + S::Parent: reply_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ReplyRef<'a> { + ReplyRef { + parent: self.__unsafe_private_named.0.unwrap(), + root: 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>, + >, + ) -> ReplyRef<'a> { + ReplyRef { + parent: self.__unsafe_private_named.0.unwrap(), + root: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReplyRef<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.post" + } + fn def_name() -> &'static str { + "replyRef" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_post() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct TextSlice<'a> { + pub end: i64, + pub start: i64, +} + +pub mod text_slice_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 Start; + type End; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct TextSliceBuilder<'a, S: text_slice_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> TextSlice<'a> { + /// Create a new builder for this type + pub fn new() -> TextSliceBuilder<'a, text_slice_state::Empty> { + TextSliceBuilder::new() + } +} + +impl<'a> TextSliceBuilder<'a, text_slice_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + TextSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TextSliceBuilder<'a, S> +where + S: text_slice_state::State, + S::End: text_slice_state::IsUnset, +{ + /// Set the `end` field (required) + pub fn end( + mut self, + value: impl Into, + ) -> TextSliceBuilder<'a, text_slice_state::SetEnd> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + TextSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TextSliceBuilder<'a, S> +where + S: text_slice_state::State, + S::Start: text_slice_state::IsUnset, +{ + /// Set the `start` field (required) + pub fn start( + mut self, + value: impl Into, + ) -> TextSliceBuilder<'a, text_slice_state::SetStart> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + TextSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TextSliceBuilder<'a, S> +where + S: text_slice_state::State, + S::Start: text_slice_state::IsSet, + S::End: text_slice_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> TextSlice<'a> { + TextSlice { + end: self.__unsafe_private_named.0.unwrap(), + start: 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>, + >, + ) -> TextSlice<'a> { + TextSlice { + end: self.__unsafe_private_named.0.unwrap(), + start: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TextSlice<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.post" + } + fn def_name() -> &'static str { + "textSlice" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_post() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.end; + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "end", + ), + min: 0i64, + actual: *value, + }); + } + } + { + let value = &self.start; + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "start", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/postgate.rs b/crates/weaver-api/src/app_bsky/feed/postgate.rs new file mode 100644 index 0000000..dfdeb3b --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/postgate.rs @@ -0,0 +1,497 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.postgate +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Disables embedding of this post. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DisableRule<'a> {} +fn lexicon_doc_app_bsky_feed_postgate() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.postgate"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("disableRule"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Disables embedding of this post.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + 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( + "Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository.", + ), + ), + 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("post"), + ::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( + "detachedEmbeddingUris", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "List of AT-URIs embedding this post that the author has detached from.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: Some(50usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "embeddingRules", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#disableRule") + ], + closed: None, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("post"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference (AT-URI) to the post record.", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DisableRule<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.postgate" + } + fn def_name() -> &'static str { + "disableRule" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_postgate() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Postgate<'a> { + pub created_at: jacquard_common::types::string::Datetime, + /// List of AT-URIs embedding this post that the author has detached from. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub detached_embedding_uris: Option>>, + /// List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embedding_rules: Option>>, + /// Reference (AT-URI) to the post record. + #[serde(borrow)] + pub post: jacquard_common::types::string::AtUri<'a>, +} + +pub mod postgate_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 Post; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Post = Unset; + type CreatedAt = Unset; + } + ///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 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 Post = S::Post; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `post` field + pub struct post(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PostgateBuilder<'a, S: postgate_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> Postgate<'a> { + /// Create a new builder for this type + pub fn new() -> PostgateBuilder<'a, postgate_state::Empty> { + PostgateBuilder::new() + } +} + +impl<'a> PostgateBuilder<'a, postgate_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PostgateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PostgateBuilder<'a, S> +where + S: postgate_state::State, + S::CreatedAt: postgate_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> PostgateBuilder<'a, postgate_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PostgateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: postgate_state::State> PostgateBuilder<'a, S> { + /// Set the `detachedEmbeddingUris` field (optional) + pub fn detached_embedding_uris( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `detachedEmbeddingUris` field to an Option value (optional) + pub fn maybe_detached_embedding_uris( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: postgate_state::State> PostgateBuilder<'a, S> { + /// Set the `embeddingRules` field (optional) + pub fn embedding_rules( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `embeddingRules` field to an Option value (optional) + pub fn maybe_embedding_rules( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> PostgateBuilder<'a, S> +where + S: postgate_state::State, + S::Post: postgate_state::IsUnset, +{ + /// Set the `post` field (required) + pub fn post( + mut self, + value: impl Into>, + ) -> PostgateBuilder<'a, postgate_state::SetPost> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + PostgateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PostgateBuilder<'a, S> +where + S: postgate_state::State, + S::Post: postgate_state::IsSet, + S::CreatedAt: postgate_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Postgate<'a> { + Postgate { + created_at: self.__unsafe_private_named.0.unwrap(), + detached_embedding_uris: self.__unsafe_private_named.1, + embedding_rules: self.__unsafe_private_named.2, + post: 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>, + >, + ) -> Postgate<'a> { + Postgate { + created_at: self.__unsafe_private_named.0.unwrap(), + detached_embedding_uris: self.__unsafe_private_named.1, + embedding_rules: self.__unsafe_private_named.2, + post: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Postgate<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, PostgateRecord>, + 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 PostgateGetRecordOutput<'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: Postgate<'a>, +} + +impl From> for Postgate<'_> { + fn from(output: PostgateGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Postgate<'_> { + const NSID: &'static str = "app.bsky.feed.postgate"; + type Record = PostgateRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct PostgateRecord; +impl jacquard_common::xrpc::XrpcResp for PostgateRecord { + const NSID: &'static str = "app.bsky.feed.postgate"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = PostgateGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for PostgateRecord { + const NSID: &'static str = "app.bsky.feed.postgate"; + type Record = PostgateRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Postgate<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.postgate" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_postgate() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.detached_embedding_uris { + #[allow(unused_comparisons)] + if value.len() > 50usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "detached_embedding_uris", + ), + max: 50usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.embedding_rules { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "embedding_rules", + ), + max: 5usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/repost.rs b/crates/weaver-api/src/app_bsky/feed/repost.rs new file mode 100644 index 0000000..e1c9207 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/repost.rs @@ -0,0 +1,345 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.repost +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record representing a 'repost' of an existing Bluesky post. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Repost<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub via: Option>, +} + +pub mod repost_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 CreatedAt; + } + /// 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; + } + ///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 `subject` field + pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepostBuilder<'a, S: repost_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> Repost<'a> { + /// Create a new builder for this type + pub fn new() -> RepostBuilder<'a, repost_state::Empty> { + RepostBuilder::new() + } +} + +impl<'a> RepostBuilder<'a, repost_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepostBuilder<'a, S> +where + S: repost_state::State, + S::CreatedAt: repost_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> RepostBuilder<'a, repost_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RepostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepostBuilder<'a, S> +where + S: repost_state::State, + S::Subject: repost_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> RepostBuilder<'a, repost_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RepostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repost_state::State> RepostBuilder<'a, S> { + /// Set the `via` field (optional) + pub fn via( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `via` field to an Option value (optional) + pub fn maybe_via( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> RepostBuilder<'a, S> +where + S: repost_state::State, + S::Subject: repost_state::IsSet, + S::CreatedAt: repost_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Repost<'a> { + Repost { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + via: 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>, + >, + ) -> Repost<'a> { + Repost { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + via: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Repost<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, RepostRecord>, + 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 RepostGetRecordOutput<'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: Repost<'a>, +} + +impl From> for Repost<'_> { + fn from(output: RepostGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Repost<'_> { + const NSID: &'static str = "app.bsky.feed.repost"; + type Record = RepostRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct RepostRecord; +impl jacquard_common::xrpc::XrpcResp for RepostRecord { + const NSID: &'static str = "app.bsky.feed.repost"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RepostGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for RepostRecord { + const NSID: &'static str = "app.bsky.feed.repost"; + type Record = RepostRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Repost<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.repost" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_repost() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_feed_repost() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.repost"), + 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( + "Record representing a 'repost' of an existing Bluesky post.", + ), + ), + 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("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("via"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/search_posts.rs b/crates/weaver-api/src/app_bsky/feed/search_posts.rs new file mode 100644 index 0000000..8c23c04 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/search_posts.rs @@ -0,0 +1,447 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.searchPosts +// +// 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 SearchPosts<'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>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub domain: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub lang: std::option::Option, + ///(default: 25, 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 mentions: std::option::Option>, + #[serde(borrow)] + pub q: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub since: std::option::Option>, + ///(default: "latest") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tag: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub until: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub url: std::option::Option>, +} + +pub mod search_posts_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 SearchPostsBuilder<'a, S: search_posts_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SearchPosts<'a> { + /// Create a new builder for this type + pub fn new() -> SearchPostsBuilder<'a, search_posts_state::Empty> { + SearchPostsBuilder::new() + } +} + +impl<'a> SearchPostsBuilder<'a, search_posts_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchPostsBuilder { + _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: search_posts_state::State> SearchPostsBuilder<'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_posts_state::State> SearchPostsBuilder<'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_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `domain` field (optional) + pub fn domain( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `domain` field to an Option value (optional) + pub fn maybe_domain(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: search_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `lang` field (optional) + pub fn lang( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `lang` field to an Option value (optional) + pub fn maybe_lang( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: search_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S: search_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `mentions` field (optional) + pub fn mentions( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `mentions` field to an Option value (optional) + pub fn maybe_mentions( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> SearchPostsBuilder<'a, S> +where + S: search_posts_state::State, + S::Q: search_posts_state::IsUnset, +{ + /// Set the `q` field (required) + pub fn q( + mut self, + value: impl Into>, + ) -> SearchPostsBuilder<'a, search_posts_state::SetQ> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + SearchPostsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `since` field (optional) + pub fn since( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = 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.7 = value; + self + } +} + +impl<'a, S: search_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `sort` field (optional) + pub fn sort( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = value; + self + } +} + +impl<'a, S: search_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `tag` field (optional) + pub fn tag( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `tag` field to an Option value (optional) + pub fn maybe_tag(mut self, value: Option>>) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: search_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `until` field (optional) + pub fn until( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `until` field to an Option value (optional) + pub fn maybe_until(mut self, value: Option>) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: search_posts_state::State> SearchPostsBuilder<'a, S> { + /// Set the `url` field (optional) + pub fn url( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `url` field to an Option value (optional) + pub fn maybe_url( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S> SearchPostsBuilder<'a, S> +where + S: search_posts_state::State, + S::Q: search_posts_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchPosts<'a> { + SearchPosts { + author: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + domain: self.__unsafe_private_named.2, + lang: self.__unsafe_private_named.3, + limit: self.__unsafe_private_named.4, + mentions: self.__unsafe_private_named.5, + q: self.__unsafe_private_named.6.unwrap(), + since: self.__unsafe_private_named.7, + sort: self.__unsafe_private_named.8, + tag: self.__unsafe_private_named.9, + until: self.__unsafe_private_named.10, + url: self.__unsafe_private_named.11, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SearchPostsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hits_total: std::option::Option, + #[serde(borrow)] + pub posts: 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 SearchPostsError<'a> { + #[serde(rename = "BadQueryString")] + BadQueryString(std::option::Option), +} + +impl std::fmt::Display for SearchPostsError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BadQueryString(msg) => { + write!(f, "BadQueryString")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.feed.searchPosts +pub struct SearchPostsResponse; +impl jacquard_common::xrpc::XrpcResp for SearchPostsResponse { + const NSID: &'static str = "app.bsky.feed.searchPosts"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchPostsOutput<'de>; + type Err<'de> = SearchPostsError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchPosts<'a> { + const NSID: &'static str = "app.bsky.feed.searchPosts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchPostsResponse; +} + +/// Endpoint type for +///app.bsky.feed.searchPosts +pub struct SearchPostsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchPostsRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.searchPosts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchPosts<'de>; + type Response = SearchPostsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/send_interactions.rs b/crates/weaver-api/src/app_bsky/feed/send_interactions.rs new file mode 100644 index 0000000..86c077e --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/send_interactions.rs @@ -0,0 +1,170 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.sendInteractions +// +// 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 SendInteractions<'a> { + #[serde(borrow)] + pub interactions: Vec>, +} + +pub mod send_interactions_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 Interactions; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Interactions = Unset; + } + ///State transition - sets the `interactions` field to Set + pub struct SetInteractions(PhantomData S>); + impl sealed::Sealed for SetInteractions {} + impl State for SetInteractions { + type Interactions = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `interactions` field + pub struct interactions(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SendInteractionsBuilder<'a, S: send_interactions_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SendInteractions<'a> { + /// Create a new builder for this type + pub fn new() -> SendInteractionsBuilder<'a, send_interactions_state::Empty> { + SendInteractionsBuilder::new() + } +} + +impl<'a> SendInteractionsBuilder<'a, send_interactions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SendInteractionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendInteractionsBuilder<'a, S> +where + S: send_interactions_state::State, + S::Interactions: send_interactions_state::IsUnset, +{ + /// Set the `interactions` field (required) + pub fn interactions( + mut self, + value: impl Into>>, + ) -> SendInteractionsBuilder<'a, send_interactions_state::SetInteractions> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SendInteractionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendInteractionsBuilder<'a, S> +where + S: send_interactions_state::State, + S::Interactions: send_interactions_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SendInteractions<'a> { + SendInteractions { + interactions: 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>, + >, + ) -> SendInteractions<'a> { + SendInteractions { + interactions: 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 SendInteractionsOutput<'a> {} +/// Response type for +///app.bsky.feed.sendInteractions +pub struct SendInteractionsResponse; +impl jacquard_common::xrpc::XrpcResp for SendInteractionsResponse { + const NSID: &'static str = "app.bsky.feed.sendInteractions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SendInteractionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SendInteractions<'a> { + const NSID: &'static str = "app.bsky.feed.sendInteractions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = SendInteractionsResponse; +} + +/// Endpoint type for +///app.bsky.feed.sendInteractions +pub struct SendInteractionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SendInteractionsRequest { + const PATH: &'static str = "/xrpc/app.bsky.feed.sendInteractions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = SendInteractions<'de>; + type Response = SendInteractionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/feed/threadgate.rs b/crates/weaver-api/src/app_bsky/feed/threadgate.rs new file mode 100644 index 0000000..fb19c71 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/feed/threadgate.rs @@ -0,0 +1,789 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.feed.threadgate +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Allow replies from actors who follow you. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct FollowerRule<'a> {} +fn lexicon_doc_app_bsky_feed_threadgate() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.feed.threadgate"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("followerRule"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Allow replies from actors who follow you.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("followingRule"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Allow replies from actors you follow.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("listRule"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Allow replies from actors on a list.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("list")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("list"), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.", + ), + ), + 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("post"), + ::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("allow"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#mentionRule"), + ::jacquard_common::CowStr::new_static("#followerRule"), + ::jacquard_common::CowStr::new_static("#followingRule"), + ::jacquard_common::CowStr::new_static("#listRule") + ], + closed: None, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + 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( + "hiddenReplies", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "List of hidden reply URIs.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: Some(300usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("post"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference (AT-URI) to the post record.", + ), + ), + 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("mentionRule"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Allow replies from actors mentioned in your post.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FollowerRule<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.threadgate" + } + fn def_name() -> &'static str { + "followerRule" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_threadgate() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Allow replies from actors you follow. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct FollowingRule<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FollowingRule<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.threadgate" + } + fn def_name() -> &'static str { + "followingRule" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_threadgate() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Allow replies from actors on a list. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListRule<'a> { + #[serde(borrow)] + pub list: jacquard_common::types::string::AtUri<'a>, +} + +pub mod list_rule_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 ListRuleBuilder<'a, S: list_rule_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListRule<'a> { + /// Create a new builder for this type + pub fn new() -> ListRuleBuilder<'a, list_rule_state::Empty> { + ListRuleBuilder::new() + } +} + +impl<'a> ListRuleBuilder<'a, list_rule_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListRuleBuilder<'a, S> +where + S: list_rule_state::State, + S::List: list_rule_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into>, + ) -> ListRuleBuilder<'a, list_rule_state::SetList> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ListRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListRuleBuilder<'a, S> +where + S: list_rule_state::State, + S::List: list_rule_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListRule<'a> { + ListRule { + list: 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>, + >, + ) -> ListRule<'a> { + ListRule { + list: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListRule<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.threadgate" + } + fn def_name() -> &'static str { + "listRule" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_threadgate() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Threadgate<'a> { + /// List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub allow: Option>>, + pub created_at: jacquard_common::types::string::Datetime, + /// List of hidden reply URIs. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub hidden_replies: Option>>, + /// Reference (AT-URI) to the post record. + #[serde(borrow)] + pub post: jacquard_common::types::string::AtUri<'a>, +} + +pub mod threadgate_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 Post; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Post = Unset; + type CreatedAt = Unset; + } + ///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 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 Post = S::Post; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `post` field + pub struct post(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ThreadgateBuilder<'a, S: threadgate_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> Threadgate<'a> { + /// Create a new builder for this type + pub fn new() -> ThreadgateBuilder<'a, threadgate_state::Empty> { + ThreadgateBuilder::new() + } +} + +impl<'a> ThreadgateBuilder<'a, threadgate_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ThreadgateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: threadgate_state::State> ThreadgateBuilder<'a, S> { + /// Set the `allow` field (optional) + pub fn allow( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `allow` field to an Option value (optional) + pub fn maybe_allow(mut self, value: Option>>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ThreadgateBuilder<'a, S> +where + S: threadgate_state::State, + S::CreatedAt: threadgate_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ThreadgateBuilder<'a, threadgate_state::SetCreatedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ThreadgateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: threadgate_state::State> ThreadgateBuilder<'a, S> { + /// Set the `hiddenReplies` field (optional) + pub fn hidden_replies( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `hiddenReplies` field to an Option value (optional) + pub fn maybe_hidden_replies( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ThreadgateBuilder<'a, S> +where + S: threadgate_state::State, + S::Post: threadgate_state::IsUnset, +{ + /// Set the `post` field (required) + pub fn post( + mut self, + value: impl Into>, + ) -> ThreadgateBuilder<'a, threadgate_state::SetPost> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ThreadgateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadgateBuilder<'a, S> +where + S: threadgate_state::State, + S::Post: threadgate_state::IsSet, + S::CreatedAt: threadgate_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Threadgate<'a> { + Threadgate { + allow: self.__unsafe_private_named.0, + created_at: self.__unsafe_private_named.1.unwrap(), + hidden_replies: self.__unsafe_private_named.2, + post: 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>, + >, + ) -> Threadgate<'a> { + Threadgate { + allow: self.__unsafe_private_named.0, + created_at: self.__unsafe_private_named.1.unwrap(), + hidden_replies: self.__unsafe_private_named.2, + post: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Threadgate<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ThreadgateRecord>, + jacquard_common::types::uri::UriError, + > { + jacquard_common::types::uri::RecordUri::try_from_uri( + jacquard_common::types::string::AtUri::new_cow(uri.into())?, + ) + } +} + +#[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 ThreadgateAllowItem<'a> { + #[serde(rename = "app.bsky.feed.threadgate#mentionRule")] + MentionRule(Box>), + #[serde(rename = "app.bsky.feed.threadgate#followerRule")] + FollowerRule(Box>), + #[serde(rename = "app.bsky.feed.threadgate#followingRule")] + FollowingRule(Box>), + #[serde(rename = "app.bsky.feed.threadgate#listRule")] + ListRule(Box>), +} + +/// 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 ThreadgateGetRecordOutput<'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: Threadgate<'a>, +} + +impl From> for Threadgate<'_> { + fn from(output: ThreadgateGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Threadgate<'_> { + const NSID: &'static str = "app.bsky.feed.threadgate"; + type Record = ThreadgateRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ThreadgateRecord; +impl jacquard_common::xrpc::XrpcResp for ThreadgateRecord { + const NSID: &'static str = "app.bsky.feed.threadgate"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ThreadgateGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ThreadgateRecord { + const NSID: &'static str = "app.bsky.feed.threadgate"; + type Record = ThreadgateRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Threadgate<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.threadgate" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_threadgate() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.allow { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "allow", + ), + max: 5usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.hidden_replies { + #[allow(unused_comparisons)] + if value.len() > 300usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "hidden_replies", + ), + max: 300usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +/// Allow replies from actors mentioned in your post. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct MentionRule<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MentionRule<'a> { + fn nsid() -> &'static str { + "app.bsky.feed.threadgate" + } + fn def_name() -> &'static str { + "mentionRule" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_feed_threadgate() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph.rs b/crates/weaver-api/src/app_bsky/graph.rs new file mode 100644 index 0000000..d1a8297 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph.rs @@ -0,0 +1,3563 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod block; +pub mod follow; +pub mod get_actor_starter_packs; +pub mod get_blocks; +pub mod get_followers; +pub mod get_follows; +pub mod get_known_followers; +pub mod get_list; +pub mod get_list_blocks; +pub mod get_list_mutes; +pub mod get_lists; +pub mod get_lists_with_membership; +pub mod get_mutes; +pub mod get_relationships; +pub mod get_starter_pack; +pub mod get_starter_packs; +pub mod get_starter_packs_with_membership; +pub mod get_suggested_follows_by_actor; +pub mod list; +pub mod listblock; +pub mod listitem; +pub mod mute_actor; +pub mod mute_actor_list; +pub mod mute_thread; +pub mod search_starter_packs; +pub mod starterpack; +pub mod unmute_actor; +pub mod unmute_actor_list; +pub mod unmute_thread; +pub mod verification; + +/// A list of actors used for curation purposes such as list feeds or interaction gating. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct Curatelist; +impl std::fmt::Display for Curatelist { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "curatelist") + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListItemView<'a> { + #[serde(borrow)] + pub subject: crate::app_bsky::actor::ProfileView<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod list_item_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 Uri; + type Subject; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + 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 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 `uri` field + pub struct uri(()); + ///Marker type for the `subject` field + pub struct subject(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListItemViewBuilder<'a, S: list_item_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListItemView<'a> { + /// Create a new builder for this type + pub fn new() -> ListItemViewBuilder<'a, list_item_view_state::Empty> { + ListItemViewBuilder::new() + } +} + +impl<'a> ListItemViewBuilder<'a, list_item_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListItemViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListItemViewBuilder<'a, S> +where + S: list_item_view_state::State, + S::Subject: list_item_view_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> ListItemViewBuilder<'a, list_item_view_state::SetSubject> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ListItemViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListItemViewBuilder<'a, S> +where + S: list_item_view_state::State, + S::Uri: list_item_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ListItemViewBuilder<'a, list_item_view_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ListItemViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListItemViewBuilder<'a, S> +where + S: list_item_view_state::State, + S::Uri: list_item_view_state::IsSet, + S::Subject: list_item_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListItemView<'a> { + ListItemView { + subject: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> ListItemView<'a> { + ListItemView { + subject: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_graph_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.graph.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("curatelist"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("listItemView"), + ::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("subject") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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( + "app.bsky.actor.defs#profileView", + ), + }), + ); + 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("listPurpose"), + ::jacquard_lexicon::lexicon::LexUserType::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("listView"), + ::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("creator"), + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_common::smol_str::SmolStr::new_static("purpose"), + ::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("avatar"), + ::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("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("creator"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "descriptionFacets", + ), + ::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( + "app.bsky.richtext.facet", + ), + }), + min_length: None, + max_length: 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "listItemCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: Some(1usize), + max_length: Some(64usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("purpose"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#listPurpose"), + }), + ); + 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("viewer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#listViewerState", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("listViewBasic"), + ::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("name"), + ::jacquard_common::smol_str::SmolStr::new_static("purpose") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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("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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "listItemCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: Some(1usize), + max_length: Some(64usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("purpose"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#listPurpose"), + }), + ); + 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("viewer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#listViewerState", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("listViewerState"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + 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("muted"), + ::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("modlist"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notFoundActor"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "indicates that a handle or DID could not be resolved", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("actor"), + ::jacquard_common::smol_str::SmolStr::new_static("notFound") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("actor"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, + ), + 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("notFound"), + ::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("referencelist"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("relationship"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "if the actor is followed by this DID, contains the AT-URI of the follow record", + ), + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "if the actor follows this DID, this is the AT-URI of the follow record", + ), + ), + 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("starterPackView"), + ::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("record"), + ::jacquard_common::smol_str::SmolStr::new_static("creator"), + ::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, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("creator"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feeds"), + ::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( + "app.bsky.feed.defs#generatorView", + ), + }), + min_length: None, + max_length: Some(3usize), + }), + ); + 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( + "joinedAllTimeCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "joinedWeekCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("list"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#listViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "listItemsSample", + ), + ::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( + "#listItemView", + ), + }), + min_length: None, + max_length: Some(12usize), + }), + ); + 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("starterPackViewBasic"), + ::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("record"), + ::jacquard_common::smol_str::SmolStr::new_static("creator"), + ::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, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("creator"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.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.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "joinedAllTimeCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "joinedWeekCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "listItemCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListItemView<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.defs" + } + fn def_name() -> &'static str { + "listItemView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ListPurpose<'a> { + AppBskyGraphDefsModlist, + AppBskyGraphDefsCuratelist, + AppBskyGraphDefsReferencelist, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> ListPurpose<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::AppBskyGraphDefsModlist => "app.bsky.graph.defs#modlist", + Self::AppBskyGraphDefsCuratelist => "app.bsky.graph.defs#curatelist", + Self::AppBskyGraphDefsReferencelist => "app.bsky.graph.defs#referencelist", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for ListPurpose<'a> { + fn from(s: &'a str) -> Self { + match s { + "app.bsky.graph.defs#modlist" => Self::AppBskyGraphDefsModlist, + "app.bsky.graph.defs#curatelist" => Self::AppBskyGraphDefsCuratelist, + "app.bsky.graph.defs#referencelist" => Self::AppBskyGraphDefsReferencelist, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for ListPurpose<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "app.bsky.graph.defs#modlist" => Self::AppBskyGraphDefsModlist, + "app.bsky.graph.defs#curatelist" => Self::AppBskyGraphDefsCuratelist, + "app.bsky.graph.defs#referencelist" => Self::AppBskyGraphDefsReferencelist, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for ListPurpose<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for ListPurpose<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for ListPurpose<'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 ListPurpose<'_> { + type Output = ListPurpose<'static>; + fn into_static(self) -> Self::Output { + match self { + ListPurpose::AppBskyGraphDefsModlist => ListPurpose::AppBskyGraphDefsModlist, + ListPurpose::AppBskyGraphDefsCuratelist => { + ListPurpose::AppBskyGraphDefsCuratelist + } + ListPurpose::AppBskyGraphDefsReferencelist => { + ListPurpose::AppBskyGraphDefsReferencelist + } + ListPurpose::Other(v) => ListPurpose::Other(v.into_static()), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub creator: crate::app_bsky::actor::ProfileView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description_facets: Option>>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub list_item_count: Option, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub purpose: crate::app_bsky::graph::ListPurpose<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod list_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 Uri; + type Cid; + type Creator; + type Name; + type Purpose; + 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 Cid = Unset; + type Creator = Unset; + type Name = Unset; + type Purpose = 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; + type Cid = S::Cid; + type Creator = S::Creator; + type Name = S::Name; + type Purpose = S::Purpose; + 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 Cid = Set; + type Creator = S::Creator; + type Name = S::Name; + type Purpose = S::Purpose; + 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 Cid = S::Cid; + type Creator = Set; + type Name = S::Name; + type Purpose = S::Purpose; + 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 Uri = S::Uri; + type Cid = S::Cid; + type Creator = S::Creator; + type Name = Set; + type Purpose = S::Purpose; + 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 Uri = S::Uri; + type Cid = S::Cid; + type Creator = S::Creator; + type Name = S::Name; + type Purpose = 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 Uri = S::Uri; + type Cid = S::Cid; + type Creator = S::Creator; + type Name = S::Name; + type Purpose = S::Purpose; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `purpose` field + pub struct purpose(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListViewBuilder<'a, S: list_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListView<'a> { + /// Create a new builder for this type + pub fn new() -> ListViewBuilder<'a, list_view_state::Empty> { + ListViewBuilder::new() + } +} + +impl<'a> ListViewBuilder<'a, list_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListViewBuilder { + _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: list_view_state::State> ListViewBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ListViewBuilder<'a, S> +where + S: list_view_state::State, + S::Cid: list_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> ListViewBuilder<'a, list_view_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ListViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListViewBuilder<'a, S> +where + S: list_view_state::State, + S::Creator: list_view_state::IsUnset, +{ + /// Set the `creator` field (required) + pub fn creator( + mut self, + value: impl Into>, + ) -> ListViewBuilder<'a, list_view_state::SetCreator> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ListViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { + /// Set the `descriptionFacets` field (optional) + pub fn description_facets( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `descriptionFacets` field to an Option value (optional) + pub fn maybe_description_facets( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ListViewBuilder<'a, S> +where + S: list_view_state::State, + S::IndexedAt: list_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> ListViewBuilder<'a, list_view_state::SetIndexedAt> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + ListViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_view_state::State> ListViewBuilder<'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: list_view_state::State> ListViewBuilder<'a, S> { + /// Set the `listItemCount` field (optional) + pub fn list_item_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `listItemCount` field to an Option value (optional) + pub fn maybe_list_item_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> ListViewBuilder<'a, S> +where + S: list_view_state::State, + S::Name: list_view_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> ListViewBuilder<'a, list_view_state::SetName> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + ListViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListViewBuilder<'a, S> +where + S: list_view_state::State, + S::Purpose: list_view_state::IsUnset, +{ + /// Set the `purpose` field (required) + pub fn purpose( + mut self, + value: impl Into>, + ) -> ListViewBuilder<'a, list_view_state::SetPurpose> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + ListViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListViewBuilder<'a, S> +where + S: list_view_state::State, + S::Uri: list_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ListViewBuilder<'a, list_view_state::SetUri> { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + ListViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = 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.11 = value; + self + } +} + +impl<'a, S> ListViewBuilder<'a, S> +where + S: list_view_state::State, + S::Uri: list_view_state::IsSet, + S::Cid: list_view_state::IsSet, + S::Creator: list_view_state::IsSet, + S::Name: list_view_state::IsSet, + S::Purpose: list_view_state::IsSet, + S::IndexedAt: list_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListView<'a> { + ListView { + avatar: self.__unsafe_private_named.0, + cid: self.__unsafe_private_named.1.unwrap(), + creator: self.__unsafe_private_named.2.unwrap(), + description: self.__unsafe_private_named.3, + description_facets: self.__unsafe_private_named.4, + indexed_at: self.__unsafe_private_named.5.unwrap(), + labels: self.__unsafe_private_named.6, + list_item_count: self.__unsafe_private_named.7, + name: self.__unsafe_private_named.8.unwrap(), + purpose: self.__unsafe_private_named.9.unwrap(), + uri: self.__unsafe_private_named.10.unwrap(), + viewer: self.__unsafe_private_named.11, + 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>, + >, + ) -> ListView<'a> { + ListView { + avatar: self.__unsafe_private_named.0, + cid: self.__unsafe_private_named.1.unwrap(), + creator: self.__unsafe_private_named.2.unwrap(), + description: self.__unsafe_private_named.3, + description_facets: self.__unsafe_private_named.4, + indexed_at: self.__unsafe_private_named.5.unwrap(), + labels: self.__unsafe_private_named.6, + list_item_count: self.__unsafe_private_named.7, + name: self.__unsafe_private_named.8.unwrap(), + purpose: self.__unsafe_private_named.9.unwrap(), + uri: self.__unsafe_private_named.10.unwrap(), + viewer: self.__unsafe_private_named.11, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListView<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.defs" + } + fn def_name() -> &'static str { + "listView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 3000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 300usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 300usize, + actual: count, + }); + } + } + } + if let Some(ref value) = self.list_item_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "list_item_count", + ), + min: 0i64, + actual: *value, + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 64usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 64usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 1usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + min: 1usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListViewBasic<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub indexed_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub list_item_count: Option, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub purpose: crate::app_bsky::graph::ListPurpose<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod list_view_basic_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 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 Uri = Unset; + type Cid = Unset; + type Name = Unset; + type Purpose = 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 Name = S::Name; + type Purpose = S::Purpose; + } + ///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 Name = S::Name; + type Purpose = S::Purpose; + } + ///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; + } + ///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 Name = S::Name; + type Purpose = 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 `name` field + pub struct name(()); + ///Marker type for the `purpose` field + pub struct purpose(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListViewBasicBuilder<'a, S: list_view_basic_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> ListViewBasic<'a> { + /// Create a new builder for this type + pub fn new() -> ListViewBasicBuilder<'a, list_view_basic_state::Empty> { + ListViewBasicBuilder::new() + } +} + +impl<'a> ListViewBasicBuilder<'a, list_view_basic_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ListViewBasicBuilder<'a, S> +where + S: list_view_basic_state::State, + S::Cid: list_view_basic_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ListViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> { + /// Set the `indexedAt` field (optional) + pub fn indexed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = 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.3 = value; + self + } +} + +impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> { + /// Set the `listItemCount` field (optional) + pub fn list_item_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `listItemCount` field to an Option value (optional) + pub fn maybe_list_item_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ListViewBasicBuilder<'a, S> +where + S: list_view_basic_state::State, + S::Name: list_view_basic_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetName> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + ListViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListViewBasicBuilder<'a, S> +where + S: list_view_basic_state::State, + S::Purpose: list_view_basic_state::IsUnset, +{ + /// Set the `purpose` field (required) + pub fn purpose( + mut self, + value: impl Into>, + ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetPurpose> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + ListViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListViewBasicBuilder<'a, S> +where + S: list_view_basic_state::State, + S::Uri: list_view_basic_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetUri> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + ListViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = value; + self + } +} + +impl<'a, S> ListViewBasicBuilder<'a, S> +where + S: list_view_basic_state::State, + 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> { + ListViewBasic { + avatar: self.__unsafe_private_named.0, + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2, + labels: self.__unsafe_private_named.3, + list_item_count: self.__unsafe_private_named.4, + name: self.__unsafe_private_named.5.unwrap(), + purpose: self.__unsafe_private_named.6.unwrap(), + uri: self.__unsafe_private_named.7.unwrap(), + viewer: self.__unsafe_private_named.8, + 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>, + >, + ) -> ListViewBasic<'a> { + ListViewBasic { + avatar: self.__unsafe_private_named.0, + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2, + labels: self.__unsafe_private_named.3, + list_item_count: self.__unsafe_private_named.4, + name: self.__unsafe_private_named.5.unwrap(), + purpose: self.__unsafe_private_named.6.unwrap(), + uri: self.__unsafe_private_named.7.unwrap(), + viewer: self.__unsafe_private_named.8, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListViewBasic<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.defs" + } + fn def_name() -> &'static str { + "listViewBasic" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.list_item_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "list_item_count", + ), + min: 0i64, + actual: *value, + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 64usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 64usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 1usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + min: 1usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ListViewerState<'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 muted: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListViewerState<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.defs" + } + fn def_name() -> &'static str { + "listViewerState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// A list of actors to apply an aggregate moderation action (mute/block) on. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct Modlist; +impl std::fmt::Display for Modlist { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "modlist") + } +} + +/// indicates that a handle or DID could not be resolved +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct NotFoundActor<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + pub not_found: bool, +} + +pub mod not_found_actor_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 NotFound; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + type NotFound = 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 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 Actor = S::Actor; + type NotFound = 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 `not_found` field + pub struct not_found(()); + } +} + +/// Builder for constructing an instance of this type +pub struct NotFoundActorBuilder<'a, S: not_found_actor_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> NotFoundActor<'a> { + /// Create a new builder for this type + pub fn new() -> NotFoundActorBuilder<'a, not_found_actor_state::Empty> { + NotFoundActorBuilder::new() + } +} + +impl<'a> NotFoundActorBuilder<'a, not_found_actor_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NotFoundActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotFoundActorBuilder<'a, S> +where + S: not_found_actor_state::State, + S::Actor: not_found_actor_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> NotFoundActorBuilder<'a, not_found_actor_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NotFoundActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotFoundActorBuilder<'a, S> +where + S: not_found_actor_state::State, + S::NotFound: not_found_actor_state::IsUnset, +{ + /// Set the `notFound` field (required) + pub fn not_found( + mut self, + value: impl Into, + ) -> NotFoundActorBuilder<'a, not_found_actor_state::SetNotFound> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + NotFoundActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotFoundActorBuilder<'a, S> +where + S: not_found_actor_state::State, + S::Actor: not_found_actor_state::IsSet, + S::NotFound: not_found_actor_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> NotFoundActor<'a> { + NotFoundActor { + actor: self.__unsafe_private_named.0.unwrap(), + not_found: 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>, + >, + ) -> NotFoundActor<'a> { + NotFoundActor { + actor: self.__unsafe_private_named.0.unwrap(), + not_found: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotFoundActor<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.defs" + } + fn def_name() -> &'static str { + "notFoundActor" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// A list of actors used for only for reference purposes such as within a starter pack. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct Referencelist; +impl std::fmt::Display for Referencelist { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "referencelist") + } +} + +/// lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Relationship<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// if the actor is followed by this DID, contains the AT-URI of the follow record + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub followed_by: Option>, + /// if the actor follows this DID, this is the AT-URI of the follow record + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub following: Option>, +} + +pub mod relationship_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RelationshipBuilder<'a, S: relationship_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> Relationship<'a> { + /// Create a new builder for this type + pub fn new() -> RelationshipBuilder<'a, relationship_state::Empty> { + RelationshipBuilder::new() + } +} + +impl<'a> RelationshipBuilder<'a, relationship_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RelationshipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RelationshipBuilder<'a, S> +where + S: relationship_state::State, + S::Did: relationship_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> RelationshipBuilder<'a, relationship_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RelationshipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> { + /// Set the `followedBy` field (optional) + pub fn followed_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `followedBy` field to an Option value (optional) + pub fn maybe_followed_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> { + /// Set the `following` field (optional) + pub fn following( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `following` field to an Option value (optional) + pub fn maybe_following( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> RelationshipBuilder<'a, S> +where + S: relationship_state::State, + S::Did: relationship_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Relationship<'a> { + Relationship { + did: self.__unsafe_private_named.0.unwrap(), + followed_by: self.__unsafe_private_named.1, + following: 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>, + >, + ) -> Relationship<'a> { + Relationship { + did: self.__unsafe_private_named.0.unwrap(), + followed_by: self.__unsafe_private_named.1, + following: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Relationship<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.defs" + } + fn def_name() -> &'static str { + "relationship" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_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 StarterPackView<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub creator: crate::app_bsky::actor::ProfileViewBasic<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub feeds: Option>>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub joined_all_time_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub joined_week_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub list: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub list_items_sample: Option>>, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod starter_pack_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 Uri; + type Cid; + type Record; + type Creator; + 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 Cid = Unset; + type Record = Unset; + type Creator = 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; + type Cid = S::Cid; + type Record = S::Record; + type Creator = S::Creator; + 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 Cid = Set; + type Record = S::Record; + type Creator = S::Creator; + 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 Cid = S::Cid; + type Record = 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 { + type Uri = S::Uri; + type Cid = S::Cid; + type Record = S::Record; + type Creator = 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 Uri = S::Uri; + type Cid = S::Cid; + type Record = S::Record; + type Creator = S::Creator; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StarterPackViewBuilder<'a, S: starter_pack_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> StarterPackView<'a> { + /// Create a new builder for this type + pub fn new() -> StarterPackViewBuilder<'a, starter_pack_view_state::Empty> { + StarterPackViewBuilder::new() + } +} + +impl<'a> StarterPackViewBuilder<'a, starter_pack_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StarterPackViewBuilder { + _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> StarterPackViewBuilder<'a, S> +where + S: starter_pack_view_state::State, + S::Cid: starter_pack_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + StarterPackViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackViewBuilder<'a, S> +where + S: starter_pack_view_state::State, + S::Creator: starter_pack_view_state::IsUnset, +{ + /// Set the `creator` field (required) + pub fn creator( + mut self, + value: impl Into>, + ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetCreator> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + StarterPackViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> { + /// Set the `feeds` field (optional) + pub fn feeds( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `feeds` field to an Option value (optional) + pub fn maybe_feeds( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> StarterPackViewBuilder<'a, S> +where + S: starter_pack_view_state::State, + S::IndexedAt: starter_pack_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetIndexedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + StarterPackViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> { + /// Set the `joinedAllTimeCount` field (optional) + pub fn joined_all_time_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `joinedAllTimeCount` field to an Option value (optional) + pub fn maybe_joined_all_time_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> { + /// Set the `joinedWeekCount` field (optional) + pub fn joined_week_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `joinedWeekCount` field to an Option value (optional) + pub fn maybe_joined_week_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'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: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> { + /// Set the `list` field (optional) + pub fn list( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `list` field to an Option value (optional) + pub fn maybe_list( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> { + /// Set the `listItemsSample` field (optional) + pub fn list_items_sample( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `listItemsSample` field to an Option value (optional) + pub fn maybe_list_items_sample( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> StarterPackViewBuilder<'a, S> +where + S: starter_pack_view_state::State, + S::Record: starter_pack_view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetRecord> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + StarterPackViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackViewBuilder<'a, S> +where + S: starter_pack_view_state::State, + S::Uri: starter_pack_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetUri> { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + StarterPackViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackViewBuilder<'a, S> +where + S: starter_pack_view_state::State, + S::Uri: starter_pack_view_state::IsSet, + S::Cid: starter_pack_view_state::IsSet, + S::Record: starter_pack_view_state::IsSet, + S::Creator: starter_pack_view_state::IsSet, + S::IndexedAt: starter_pack_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> StarterPackView<'a> { + StarterPackView { + cid: self.__unsafe_private_named.0.unwrap(), + creator: self.__unsafe_private_named.1.unwrap(), + feeds: self.__unsafe_private_named.2, + indexed_at: self.__unsafe_private_named.3.unwrap(), + joined_all_time_count: self.__unsafe_private_named.4, + joined_week_count: self.__unsafe_private_named.5, + labels: self.__unsafe_private_named.6, + list: self.__unsafe_private_named.7, + list_items_sample: self.__unsafe_private_named.8, + record: self.__unsafe_private_named.9.unwrap(), + uri: self.__unsafe_private_named.10.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>, + >, + ) -> StarterPackView<'a> { + StarterPackView { + cid: self.__unsafe_private_named.0.unwrap(), + creator: self.__unsafe_private_named.1.unwrap(), + feeds: self.__unsafe_private_named.2, + indexed_at: self.__unsafe_private_named.3.unwrap(), + joined_all_time_count: self.__unsafe_private_named.4, + joined_week_count: self.__unsafe_private_named.5, + labels: self.__unsafe_private_named.6, + list: self.__unsafe_private_named.7, + list_items_sample: self.__unsafe_private_named.8, + record: self.__unsafe_private_named.9.unwrap(), + uri: self.__unsafe_private_named.10.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StarterPackView<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.defs" + } + fn def_name() -> &'static str { + "starterPackView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.feeds { + #[allow(unused_comparisons)] + if value.len() > 3usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "feeds", + ), + max: 3usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.joined_all_time_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "joined_all_time_count", + ), + min: 0i64, + actual: *value, + }); + } + } + if let Some(ref value) = self.joined_week_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "joined_week_count", + ), + min: 0i64, + actual: *value, + }); + } + } + if let Some(ref value) = self.list_items_sample { + #[allow(unused_comparisons)] + if value.len() > 12usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "list_items_sample", + ), + max: 12usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct StarterPackViewBasic<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub creator: crate::app_bsky::actor::ProfileViewBasic<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub joined_all_time_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub joined_week_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub list_item_count: Option, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod starter_pack_view_basic_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 Cid; + type Record; + type Creator; + 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 Cid = Unset; + type Record = Unset; + type Creator = 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; + type Cid = S::Cid; + type Record = S::Record; + type Creator = S::Creator; + 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 Cid = Set; + type Record = S::Record; + type Creator = S::Creator; + 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 Cid = S::Cid; + type Record = 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 { + type Uri = S::Uri; + type Cid = S::Cid; + type Record = S::Record; + type Creator = 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 Uri = S::Uri; + type Cid = S::Cid; + type Record = S::Record; + type Creator = S::Creator; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StarterPackViewBasicBuilder<'a, S: starter_pack_view_basic_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> StarterPackViewBasic<'a> { + /// Create a new builder for this type + pub fn new() -> StarterPackViewBasicBuilder< + 'a, + starter_pack_view_basic_state::Empty, + > { + StarterPackViewBasicBuilder::new() + } +} + +impl<'a> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StarterPackViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackViewBasicBuilder<'a, S> +where + S: starter_pack_view_basic_state::State, + S::Cid: starter_pack_view_basic_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + StarterPackViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackViewBasicBuilder<'a, S> +where + S: starter_pack_view_basic_state::State, + S::Creator: starter_pack_view_basic_state::IsUnset, +{ + /// Set the `creator` field (required) + pub fn creator( + mut self, + value: impl Into>, + ) -> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::SetCreator> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + StarterPackViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackViewBasicBuilder<'a, S> +where + S: starter_pack_view_basic_state::State, + S::IndexedAt: starter_pack_view_basic_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> StarterPackViewBasicBuilder< + 'a, + starter_pack_view_basic_state::SetIndexedAt, + > { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + StarterPackViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> { + /// Set the `joinedAllTimeCount` field (optional) + pub fn joined_all_time_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `joinedAllTimeCount` field to an Option value (optional) + pub fn maybe_joined_all_time_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> { + /// Set the `joinedWeekCount` field (optional) + pub fn joined_week_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `joinedWeekCount` field to an Option value (optional) + pub fn maybe_joined_week_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.5 = 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.5 = value; + self + } +} + +impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> { + /// Set the `listItemCount` field (optional) + pub fn list_item_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `listItemCount` field to an Option value (optional) + pub fn maybe_list_item_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> StarterPackViewBasicBuilder<'a, S> +where + S: starter_pack_view_basic_state::State, + S::Record: starter_pack_view_basic_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::SetRecord> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + StarterPackViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackViewBasicBuilder<'a, S> +where + S: starter_pack_view_basic_state::State, + S::Uri: starter_pack_view_basic_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::SetUri> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + StarterPackViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackViewBasicBuilder<'a, S> +where + S: starter_pack_view_basic_state::State, + 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::Creator: starter_pack_view_basic_state::IsSet, + S::IndexedAt: starter_pack_view_basic_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> StarterPackViewBasic<'a> { + StarterPackViewBasic { + cid: self.__unsafe_private_named.0.unwrap(), + creator: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + joined_all_time_count: self.__unsafe_private_named.3, + joined_week_count: self.__unsafe_private_named.4, + labels: self.__unsafe_private_named.5, + list_item_count: self.__unsafe_private_named.6, + record: 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>, + >, + ) -> StarterPackViewBasic<'a> { + StarterPackViewBasic { + cid: self.__unsafe_private_named.0.unwrap(), + creator: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + joined_all_time_count: self.__unsafe_private_named.3, + joined_week_count: self.__unsafe_private_named.4, + labels: self.__unsafe_private_named.5, + list_item_count: self.__unsafe_private_named.6, + record: 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 StarterPackViewBasic<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.defs" + } + fn def_name() -> &'static str { + "starterPackViewBasic" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.joined_all_time_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "joined_all_time_count", + ), + min: 0i64, + actual: *value, + }); + } + } + if let Some(ref value) = self.joined_week_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "joined_week_count", + ), + min: 0i64, + actual: *value, + }); + } + } + if let Some(ref value) = self.list_item_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "list_item_count", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/block.rs b/crates/weaver-api/src/app_bsky/graph/block.rs new file mode 100644 index 0000000..e7fceb5 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/block.rs @@ -0,0 +1,324 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.block +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Block<'a> { + pub created_at: jacquard_common::types::string::Datetime, + /// DID of the account to be blocked. + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +pub mod block_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 CreatedAt; + } + /// 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; + } + ///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 `subject` field + pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BlockBuilder<'a, S: block_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Block<'a> { + /// Create a new builder for this type + pub fn new() -> BlockBuilder<'a, block_state::Empty> { + BlockBuilder::new() + } +} + +impl<'a> BlockBuilder<'a, block_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BlockBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlockBuilder<'a, S> +where + S: block_state::State, + S::CreatedAt: block_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> BlockBuilder<'a, block_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BlockBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlockBuilder<'a, S> +where + S: block_state::State, + S::Subject: block_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> BlockBuilder<'a, block_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + BlockBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlockBuilder<'a, S> +where + S: block_state::State, + S::Subject: block_state::IsSet, + S::CreatedAt: block_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Block<'a> { + Block { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: 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>, + >, + ) -> Block<'a> { + Block { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Block<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, BlockRecord>, + 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 BlockGetRecordOutput<'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: Block<'a>, +} + +impl From> for Block<'_> { + fn from(output: BlockGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Block<'_> { + const NSID: &'static str = "app.bsky.graph.block"; + type Record = BlockRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct BlockRecord; +impl jacquard_common::xrpc::XrpcResp for BlockRecord { + const NSID: &'static str = "app.bsky.graph.block"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = BlockGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for BlockRecord { + const NSID: &'static str = "app.bsky.graph.block"; + type Record = BlockRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Block<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.block" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_block() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_graph_block() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.graph.block"), + 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( + "Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details.", + ), + ), + 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("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::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the account to be blocked.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/follow.rs b/crates/weaver-api/src/app_bsky/graph/follow.rs new file mode 100644 index 0000000..318b51b --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/follow.rs @@ -0,0 +1,353 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.follow +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Follow<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub via: Option>, +} + +pub mod follow_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 CreatedAt; + } + /// 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; + } + ///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 `subject` field + pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FollowBuilder<'a, S: follow_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> Follow<'a> { + /// Create a new builder for this type + pub fn new() -> FollowBuilder<'a, follow_state::Empty> { + FollowBuilder::new() + } +} + +impl<'a> FollowBuilder<'a, follow_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FollowBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FollowBuilder<'a, S> +where + S: follow_state::State, + S::CreatedAt: follow_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> FollowBuilder<'a, follow_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FollowBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FollowBuilder<'a, S> +where + S: follow_state::State, + S::Subject: follow_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> FollowBuilder<'a, follow_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FollowBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: follow_state::State> FollowBuilder<'a, S> { + /// Set the `via` field (optional) + pub fn via( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `via` field to an Option value (optional) + pub fn maybe_via( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> FollowBuilder<'a, S> +where + S: follow_state::State, + S::Subject: follow_state::IsSet, + S::CreatedAt: follow_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Follow<'a> { + Follow { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + via: 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>, + >, + ) -> Follow<'a> { + Follow { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + via: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Follow<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, FollowRecord>, + 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 FollowGetRecordOutput<'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: Follow<'a>, +} + +impl From> for Follow<'_> { + fn from(output: FollowGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Follow<'_> { + const NSID: &'static str = "app.bsky.graph.follow"; + type Record = FollowRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct FollowRecord; +impl jacquard_common::xrpc::XrpcResp for FollowRecord { + const NSID: &'static str = "app.bsky.graph.follow"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = FollowGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for FollowRecord { + const NSID: &'static str = "app.bsky.graph.follow"; + type Record = FollowRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Follow<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.follow" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_follow() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_graph_follow() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.graph.follow"), + 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( + "Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView.", + ), + ), + 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("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::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("via"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_actor_starter_packs.rs b/crates/weaver-api/src/app_bsky/graph/get_actor_starter_packs.rs new file mode 100644 index 0000000..050d626 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_actor_starter_packs.rs @@ -0,0 +1,199 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getActorStarterPacks +// +// 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 GetActorStarterPacks<'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_starter_packs_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 GetActorStarterPacksBuilder<'a, S: get_actor_starter_packs_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> GetActorStarterPacks<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorStarterPacksBuilder< + 'a, + get_actor_starter_packs_state::Empty, + > { + GetActorStarterPacksBuilder::new() + } +} + +impl<'a> GetActorStarterPacksBuilder<'a, get_actor_starter_packs_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorStarterPacksBuilder<'a, S> +where + S: get_actor_starter_packs_state::State, + S::Actor: get_actor_starter_packs_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorStarterPacksBuilder<'a, get_actor_starter_packs_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_actor_starter_packs_state::State> GetActorStarterPacksBuilder<'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_starter_packs_state::State> GetActorStarterPacksBuilder<'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> GetActorStarterPacksBuilder<'a, S> +where + S: get_actor_starter_packs_state::State, + S::Actor: get_actor_starter_packs_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorStarterPacks<'a> { + GetActorStarterPacks { + 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 GetActorStarterPacksOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub starter_packs: Vec>, +} + +/// Response type for +///app.bsky.graph.getActorStarterPacks +pub struct GetActorStarterPacksResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorStarterPacksResponse { + const NSID: &'static str = "app.bsky.graph.getActorStarterPacks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorStarterPacksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorStarterPacks<'a> { + const NSID: &'static str = "app.bsky.graph.getActorStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorStarterPacksResponse; +} + +/// Endpoint type for +///app.bsky.graph.getActorStarterPacks +pub struct GetActorStarterPacksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorStarterPacksRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getActorStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorStarterPacks<'de>; + type Response = GetActorStarterPacksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_blocks.rs b/crates/weaver-api/src/app_bsky/graph/get_blocks.rs new file mode 100644 index 0000000..8992b9e --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_blocks.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getBlocks +// +// 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 GetBlocks<'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_blocks_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 GetBlocksBuilder<'a, S: get_blocks_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetBlocks<'a> { + /// Create a new builder for this type + pub fn new() -> GetBlocksBuilder<'a, get_blocks_state::Empty> { + GetBlocksBuilder::new() + } +} + +impl<'a> GetBlocksBuilder<'a, get_blocks_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetBlocksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_blocks_state::State> GetBlocksBuilder<'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_blocks_state::State> GetBlocksBuilder<'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> GetBlocksBuilder<'a, S> +where + S: get_blocks_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetBlocks<'a> { + GetBlocks { + 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 GetBlocksOutput<'a> { + #[serde(borrow)] + pub blocks: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///app.bsky.graph.getBlocks +pub struct GetBlocksResponse; +impl jacquard_common::xrpc::XrpcResp for GetBlocksResponse { + const NSID: &'static str = "app.bsky.graph.getBlocks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetBlocksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetBlocks<'a> { + const NSID: &'static str = "app.bsky.graph.getBlocks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetBlocksResponse; +} + +/// Endpoint type for +///app.bsky.graph.getBlocks +pub struct GetBlocksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetBlocksRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getBlocks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetBlocks<'de>; + type Response = GetBlocksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_followers.rs b/crates/weaver-api/src/app_bsky/graph/get_followers.rs new file mode 100644 index 0000000..1d73cdc --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_followers.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.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::app_bsky::actor::ProfileView<'a>, +} + +/// Response type for +///app.bsky.graph.getFollowers +pub struct GetFollowersResponse; +impl jacquard_common::xrpc::XrpcResp for GetFollowersResponse { + const NSID: &'static str = "app.bsky.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 = "app.bsky.graph.getFollowers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetFollowersResponse; +} + +/// Endpoint type for +///app.bsky.graph.getFollowers +pub struct GetFollowersRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetFollowersRequest { + const PATH: &'static str = "/xrpc/app.bsky.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/app_bsky/graph/get_follows.rs b/crates/weaver-api/src/app_bsky/graph/get_follows.rs new file mode 100644 index 0000000..eadbbfb --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_follows.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getFollows +// +// 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 GetFollows<'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_follows_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 GetFollowsBuilder<'a, S: get_follows_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> GetFollows<'a> { + /// Create a new builder for this type + pub fn new() -> GetFollowsBuilder<'a, get_follows_state::Empty> { + GetFollowsBuilder::new() + } +} + +impl<'a> GetFollowsBuilder<'a, get_follows_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetFollowsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetFollowsBuilder<'a, S> +where + S: get_follows_state::State, + S::Actor: get_follows_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetFollowsBuilder<'a, get_follows_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetFollowsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_follows_state::State> GetFollowsBuilder<'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_follows_state::State> GetFollowsBuilder<'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> GetFollowsBuilder<'a, S> +where + S: get_follows_state::State, + S::Actor: get_follows_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetFollows<'a> { + GetFollows { + 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 GetFollowsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub follows: Vec>, + #[serde(borrow)] + pub subject: crate::app_bsky::actor::ProfileView<'a>, +} + +/// Response type for +///app.bsky.graph.getFollows +pub struct GetFollowsResponse; +impl jacquard_common::xrpc::XrpcResp for GetFollowsResponse { + const NSID: &'static str = "app.bsky.graph.getFollows"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetFollowsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetFollows<'a> { + const NSID: &'static str = "app.bsky.graph.getFollows"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetFollowsResponse; +} + +/// Endpoint type for +///app.bsky.graph.getFollows +pub struct GetFollowsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetFollowsRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getFollows"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetFollows<'de>; + type Response = GetFollowsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_known_followers.rs b/crates/weaver-api/src/app_bsky/graph/get_known_followers.rs new file mode 100644 index 0000000..cccfd02 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_known_followers.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getKnownFollowers +// +// 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 GetKnownFollowers<'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_known_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 GetKnownFollowersBuilder<'a, S: get_known_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> GetKnownFollowers<'a> { + /// Create a new builder for this type + pub fn new() -> GetKnownFollowersBuilder<'a, get_known_followers_state::Empty> { + GetKnownFollowersBuilder::new() + } +} + +impl<'a> GetKnownFollowersBuilder<'a, get_known_followers_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetKnownFollowersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetKnownFollowersBuilder<'a, S> +where + S: get_known_followers_state::State, + S::Actor: get_known_followers_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetKnownFollowersBuilder<'a, get_known_followers_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetKnownFollowersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_known_followers_state::State> GetKnownFollowersBuilder<'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_known_followers_state::State> GetKnownFollowersBuilder<'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> GetKnownFollowersBuilder<'a, S> +where + S: get_known_followers_state::State, + S::Actor: get_known_followers_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetKnownFollowers<'a> { + GetKnownFollowers { + 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 GetKnownFollowersOutput<'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::app_bsky::actor::ProfileView<'a>, +} + +/// Response type for +///app.bsky.graph.getKnownFollowers +pub struct GetKnownFollowersResponse; +impl jacquard_common::xrpc::XrpcResp for GetKnownFollowersResponse { + const NSID: &'static str = "app.bsky.graph.getKnownFollowers"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetKnownFollowersOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetKnownFollowers<'a> { + const NSID: &'static str = "app.bsky.graph.getKnownFollowers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetKnownFollowersResponse; +} + +/// Endpoint type for +///app.bsky.graph.getKnownFollowers +pub struct GetKnownFollowersRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetKnownFollowersRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getKnownFollowers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetKnownFollowers<'de>; + type Response = GetKnownFollowersResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_list.rs b/crates/weaver-api/src/app_bsky/graph/get_list.rs new file mode 100644 index 0000000..3c763c4 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_list.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.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: crate::app_bsky::graph::ListView<'a>, +} + +/// Response type for +///app.bsky.graph.getList +pub struct GetListResponse; +impl jacquard_common::xrpc::XrpcResp for GetListResponse { + const NSID: &'static str = "app.bsky.graph.getList"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetListOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetList<'a> { + const NSID: &'static str = "app.bsky.graph.getList"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetListResponse; +} + +/// Endpoint type for +///app.bsky.graph.getList +pub struct GetListRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetListRequest { + const PATH: &'static str = "/xrpc/app.bsky.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/app_bsky/graph/get_list_blocks.rs b/crates/weaver-api/src/app_bsky/graph/get_list_blocks.rs new file mode 100644 index 0000000..0069e28 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_list_blocks.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getListBlocks +// +// 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 GetListBlocks<'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_list_blocks_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 GetListBlocksBuilder<'a, S: get_list_blocks_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetListBlocks<'a> { + /// Create a new builder for this type + pub fn new() -> GetListBlocksBuilder<'a, get_list_blocks_state::Empty> { + GetListBlocksBuilder::new() + } +} + +impl<'a> GetListBlocksBuilder<'a, get_list_blocks_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetListBlocksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_list_blocks_state::State> GetListBlocksBuilder<'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_blocks_state::State> GetListBlocksBuilder<'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> GetListBlocksBuilder<'a, S> +where + S: get_list_blocks_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetListBlocks<'a> { + GetListBlocks { + 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 GetListBlocksOutput<'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 +///app.bsky.graph.getListBlocks +pub struct GetListBlocksResponse; +impl jacquard_common::xrpc::XrpcResp for GetListBlocksResponse { + const NSID: &'static str = "app.bsky.graph.getListBlocks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetListBlocksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetListBlocks<'a> { + const NSID: &'static str = "app.bsky.graph.getListBlocks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetListBlocksResponse; +} + +/// Endpoint type for +///app.bsky.graph.getListBlocks +pub struct GetListBlocksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetListBlocksRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getListBlocks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetListBlocks<'de>; + type Response = GetListBlocksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_list_mutes.rs b/crates/weaver-api/src/app_bsky/graph/get_list_mutes.rs new file mode 100644 index 0000000..60beabe --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_list_mutes.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getListMutes +// +// 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 GetListMutes<'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_list_mutes_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 GetListMutesBuilder<'a, S: get_list_mutes_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetListMutes<'a> { + /// Create a new builder for this type + pub fn new() -> GetListMutesBuilder<'a, get_list_mutes_state::Empty> { + GetListMutesBuilder::new() + } +} + +impl<'a> GetListMutesBuilder<'a, get_list_mutes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetListMutesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_list_mutes_state::State> GetListMutesBuilder<'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_mutes_state::State> GetListMutesBuilder<'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> GetListMutesBuilder<'a, S> +where + S: get_list_mutes_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetListMutes<'a> { + GetListMutes { + 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 GetListMutesOutput<'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 +///app.bsky.graph.getListMutes +pub struct GetListMutesResponse; +impl jacquard_common::xrpc::XrpcResp for GetListMutesResponse { + const NSID: &'static str = "app.bsky.graph.getListMutes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetListMutesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetListMutes<'a> { + const NSID: &'static str = "app.bsky.graph.getListMutes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetListMutesResponse; +} + +/// Endpoint type for +///app.bsky.graph.getListMutes +pub struct GetListMutesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetListMutesRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getListMutes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetListMutes<'de>; + type Response = GetListMutesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_lists.rs b/crates/weaver-api/src/app_bsky/graph/get_lists.rs new file mode 100644 index 0000000..b746848 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_lists.rs @@ -0,0 +1,220 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getLists +// +// 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 GetLists<'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 purposes: std::option::Option>>, +} + +pub mod get_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 GetListsBuilder<'a, S: get_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> GetLists<'a> { + /// Create a new builder for this type + pub fn new() -> GetListsBuilder<'a, get_lists_state::Empty> { + GetListsBuilder::new() + } +} + +impl<'a> GetListsBuilder<'a, get_lists_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetListsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetListsBuilder<'a, S> +where + S: get_lists_state::State, + S::Actor: get_lists_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetListsBuilder<'a, get_lists_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetListsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_lists_state::State> GetListsBuilder<'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_lists_state::State> GetListsBuilder<'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_lists_state::State> GetListsBuilder<'a, S> { + /// Set the `purposes` field (optional) + pub fn purposes( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `purposes` field to an Option value (optional) + pub fn maybe_purposes( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> GetListsBuilder<'a, S> +where + S: get_lists_state::State, + S::Actor: get_lists_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetLists<'a> { + GetLists { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + purposes: 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 GetListsOutput<'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 +///app.bsky.graph.getLists +pub struct GetListsResponse; +impl jacquard_common::xrpc::XrpcResp for GetListsResponse { + const NSID: &'static str = "app.bsky.graph.getLists"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetListsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetLists<'a> { + const NSID: &'static str = "app.bsky.graph.getLists"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetListsResponse; +} + +/// Endpoint type for +///app.bsky.graph.getLists +pub struct GetListsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetListsRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getLists"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetLists<'de>; + type Response = GetListsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_lists_with_membership.rs b/crates/weaver-api/src/app_bsky/graph/get_lists_with_membership.rs new file mode 100644 index 0000000..3c8b0f5 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_lists_with_membership.rs @@ -0,0 +1,547 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getListsWithMembership +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A list and an optional list item indicating membership of a target user to that list. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListWithMembership<'a> { + #[serde(borrow)] + pub list: crate::app_bsky::graph::ListView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub list_item: Option>, +} + +pub mod list_with_membership_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 ListWithMembershipBuilder<'a, S: list_with_membership_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListWithMembership<'a> { + /// Create a new builder for this type + pub fn new() -> ListWithMembershipBuilder<'a, list_with_membership_state::Empty> { + ListWithMembershipBuilder::new() + } +} + +impl<'a> ListWithMembershipBuilder<'a, list_with_membership_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListWithMembershipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListWithMembershipBuilder<'a, S> +where + S: list_with_membership_state::State, + S::List: list_with_membership_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into>, + ) -> ListWithMembershipBuilder<'a, list_with_membership_state::SetList> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ListWithMembershipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_with_membership_state::State> ListWithMembershipBuilder<'a, S> { + /// Set the `listItem` field (optional) + pub fn list_item( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `listItem` field to an Option value (optional) + pub fn maybe_list_item( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ListWithMembershipBuilder<'a, S> +where + S: list_with_membership_state::State, + S::List: list_with_membership_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListWithMembership<'a> { + ListWithMembership { + list: self.__unsafe_private_named.0.unwrap(), + list_item: 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>, + >, + ) -> ListWithMembership<'a> { + ListWithMembership { + list: self.__unsafe_private_named.0.unwrap(), + list_item: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_graph_getListsWithMembership() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.getListsWithMembership", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("listWithMembership"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A list and an optional list item indicating membership of a target user to that list.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("list")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("list"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.defs#listView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("listItem"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.defs#listItemView", + ), + }), + ); + map + }, + }), + ); + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("actor") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("actor"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The account (actor) to check for membership.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, + ), + 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("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( + "purposes", + ), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Array(::jacquard_lexicon::lexicon::LexPrimitiveArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexPrimitiveArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ), + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ListWithMembership<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.getListsWithMembership" + } + fn def_name() -> &'static str { + "listWithMembership" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_getListsWithMembership() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetListsWithMembership<'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 purposes: std::option::Option>>, +} + +pub mod get_lists_with_membership_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 GetListsWithMembershipBuilder<'a, S: get_lists_with_membership_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> GetListsWithMembership<'a> { + /// Create a new builder for this type + pub fn new() -> GetListsWithMembershipBuilder< + 'a, + get_lists_with_membership_state::Empty, + > { + GetListsWithMembershipBuilder::new() + } +} + +impl<'a> GetListsWithMembershipBuilder<'a, get_lists_with_membership_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetListsWithMembershipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetListsWithMembershipBuilder<'a, S> +where + S: get_lists_with_membership_state::State, + S::Actor: get_lists_with_membership_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetListsWithMembershipBuilder< + 'a, + get_lists_with_membership_state::SetActor, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetListsWithMembershipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: get_lists_with_membership_state::State, +> GetListsWithMembershipBuilder<'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_lists_with_membership_state::State, +> GetListsWithMembershipBuilder<'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_lists_with_membership_state::State, +> GetListsWithMembershipBuilder<'a, S> { + /// Set the `purposes` field (optional) + pub fn purposes( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `purposes` field to an Option value (optional) + pub fn maybe_purposes( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> GetListsWithMembershipBuilder<'a, S> +where + S: get_lists_with_membership_state::State, + S::Actor: get_lists_with_membership_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetListsWithMembership<'a> { + GetListsWithMembership { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + purposes: 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 GetListsWithMembershipOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub lists_with_membership: Vec< + crate::app_bsky::graph::get_lists_with_membership::ListWithMembership<'a>, + >, +} + +/// Response type for +///app.bsky.graph.getListsWithMembership +pub struct GetListsWithMembershipResponse; +impl jacquard_common::xrpc::XrpcResp for GetListsWithMembershipResponse { + const NSID: &'static str = "app.bsky.graph.getListsWithMembership"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetListsWithMembershipOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetListsWithMembership<'a> { + const NSID: &'static str = "app.bsky.graph.getListsWithMembership"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetListsWithMembershipResponse; +} + +/// Endpoint type for +///app.bsky.graph.getListsWithMembership +pub struct GetListsWithMembershipRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetListsWithMembershipRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getListsWithMembership"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetListsWithMembership<'de>; + type Response = GetListsWithMembershipResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_mutes.rs b/crates/weaver-api/src/app_bsky/graph/get_mutes.rs new file mode 100644 index 0000000..3f3bed3 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_mutes.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getMutes +// +// 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 GetMutes<'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_mutes_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 GetMutesBuilder<'a, S: get_mutes_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetMutes<'a> { + /// Create a new builder for this type + pub fn new() -> GetMutesBuilder<'a, get_mutes_state::Empty> { + GetMutesBuilder::new() + } +} + +impl<'a> GetMutesBuilder<'a, get_mutes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetMutesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_mutes_state::State> GetMutesBuilder<'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_mutes_state::State> GetMutesBuilder<'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> GetMutesBuilder<'a, S> +where + S: get_mutes_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetMutes<'a> { + GetMutes { + 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 GetMutesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub mutes: Vec>, +} + +/// Response type for +///app.bsky.graph.getMutes +pub struct GetMutesResponse; +impl jacquard_common::xrpc::XrpcResp for GetMutesResponse { + const NSID: &'static str = "app.bsky.graph.getMutes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetMutesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetMutes<'a> { + const NSID: &'static str = "app.bsky.graph.getMutes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetMutesResponse; +} + +/// Endpoint type for +///app.bsky.graph.getMutes +pub struct GetMutesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetMutesRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getMutes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetMutes<'de>; + type Response = GetMutesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_relationships.rs b/crates/weaver-api/src/app_bsky/graph/get_relationships.rs new file mode 100644 index 0000000..ef5ac12 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_relationships.rs @@ -0,0 +1,237 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getRelationships +// +// 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 GetRelationships<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub others: std::option::Option< + Vec>, + >, +} + +pub mod get_relationships_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 GetRelationshipsBuilder<'a, S: get_relationships_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRelationships<'a> { + /// Create a new builder for this type + pub fn new() -> GetRelationshipsBuilder<'a, get_relationships_state::Empty> { + GetRelationshipsBuilder::new() + } +} + +impl<'a> GetRelationshipsBuilder<'a, get_relationships_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRelationshipsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRelationshipsBuilder<'a, S> +where + S: get_relationships_state::State, + S::Actor: get_relationships_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetRelationshipsBuilder<'a, get_relationships_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetRelationshipsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_relationships_state::State> GetRelationshipsBuilder<'a, S> { + /// Set the `others` field (optional) + pub fn others( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `others` field to an Option value (optional) + pub fn maybe_others( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetRelationshipsBuilder<'a, S> +where + S: get_relationships_state::State, + S::Actor: get_relationships_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRelationships<'a> { + GetRelationships { + actor: self.__unsafe_private_named.0.unwrap(), + others: 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 GetRelationshipsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub actor: std::option::Option>, + #[serde(borrow)] + pub relationships: Vec>, +} + +#[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 GetRelationshipsOutputRelationshipsItem<'a> { + #[serde(rename = "app.bsky.graph.defs#relationship")] + Relationship(Box>), + #[serde(rename = "app.bsky.graph.defs#notFoundActor")] + NotFoundActor(Box>), +} + +#[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 GetRelationshipsError<'a> { + /// the primary actor at-identifier could not be resolved + #[serde(rename = "ActorNotFound")] + ActorNotFound(std::option::Option), +} + +impl std::fmt::Display for GetRelationshipsError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ActorNotFound(msg) => { + write!(f, "ActorNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.graph.getRelationships +pub struct GetRelationshipsResponse; +impl jacquard_common::xrpc::XrpcResp for GetRelationshipsResponse { + const NSID: &'static str = "app.bsky.graph.getRelationships"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetRelationshipsOutput<'de>; + type Err<'de> = GetRelationshipsError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRelationships<'a> { + const NSID: &'static str = "app.bsky.graph.getRelationships"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRelationshipsResponse; +} + +/// Endpoint type for +///app.bsky.graph.getRelationships +pub struct GetRelationshipsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRelationshipsRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getRelationships"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRelationships<'de>; + type Response = GetRelationshipsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_starter_pack.rs b/crates/weaver-api/src/app_bsky/graph/get_starter_pack.rs new file mode 100644 index 0000000..9f5ba5c --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_starter_pack.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getStarterPack +// +// 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 GetStarterPack<'a> { + #[serde(borrow)] + pub starter_pack: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_starter_pack_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 StarterPack; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type StarterPack = Unset; + } + ///State transition - sets the `starter_pack` field to Set + pub struct SetStarterPack(PhantomData S>); + impl sealed::Sealed for SetStarterPack {} + impl State for SetStarterPack { + type StarterPack = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `starter_pack` field + pub struct starter_pack(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetStarterPackBuilder<'a, S: get_starter_pack_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetStarterPack<'a> { + /// Create a new builder for this type + pub fn new() -> GetStarterPackBuilder<'a, get_starter_pack_state::Empty> { + GetStarterPackBuilder::new() + } +} + +impl<'a> GetStarterPackBuilder<'a, get_starter_pack_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetStarterPackBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetStarterPackBuilder<'a, S> +where + S: get_starter_pack_state::State, + S::StarterPack: get_starter_pack_state::IsUnset, +{ + /// Set the `starterPack` field (required) + pub fn starter_pack( + mut self, + value: impl Into>, + ) -> GetStarterPackBuilder<'a, get_starter_pack_state::SetStarterPack> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetStarterPackBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetStarterPackBuilder<'a, S> +where + S: get_starter_pack_state::State, + S::StarterPack: get_starter_pack_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetStarterPack<'a> { + GetStarterPack { + starter_pack: 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 GetStarterPackOutput<'a> { + #[serde(borrow)] + pub starter_pack: crate::app_bsky::graph::StarterPackView<'a>, +} + +/// Response type for +///app.bsky.graph.getStarterPack +pub struct GetStarterPackResponse; +impl jacquard_common::xrpc::XrpcResp for GetStarterPackResponse { + const NSID: &'static str = "app.bsky.graph.getStarterPack"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetStarterPackOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetStarterPack<'a> { + const NSID: &'static str = "app.bsky.graph.getStarterPack"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetStarterPackResponse; +} + +/// Endpoint type for +///app.bsky.graph.getStarterPack +pub struct GetStarterPackRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetStarterPackRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getStarterPack"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetStarterPack<'de>; + type Response = GetStarterPackResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_starter_packs.rs b/crates/weaver-api/src/app_bsky/graph/get_starter_packs.rs new file mode 100644 index 0000000..4b43570 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_starter_packs.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getStarterPacks +// +// 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 GetStarterPacks<'a> { + #[serde(borrow)] + pub uris: Vec>, +} + +pub mod get_starter_packs_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 GetStarterPacksBuilder<'a, S: get_starter_packs_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetStarterPacks<'a> { + /// Create a new builder for this type + pub fn new() -> GetStarterPacksBuilder<'a, get_starter_packs_state::Empty> { + GetStarterPacksBuilder::new() + } +} + +impl<'a> GetStarterPacksBuilder<'a, get_starter_packs_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetStarterPacksBuilder<'a, S> +where + S: get_starter_packs_state::State, + S::Uris: get_starter_packs_state::IsUnset, +{ + /// Set the `uris` field (required) + pub fn uris( + mut self, + value: impl Into>>, + ) -> GetStarterPacksBuilder<'a, get_starter_packs_state::SetUris> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetStarterPacksBuilder<'a, S> +where + S: get_starter_packs_state::State, + S::Uris: get_starter_packs_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetStarterPacks<'a> { + GetStarterPacks { + 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 GetStarterPacksOutput<'a> { + #[serde(borrow)] + pub starter_packs: Vec>, +} + +/// Response type for +///app.bsky.graph.getStarterPacks +pub struct GetStarterPacksResponse; +impl jacquard_common::xrpc::XrpcResp for GetStarterPacksResponse { + const NSID: &'static str = "app.bsky.graph.getStarterPacks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetStarterPacksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetStarterPacks<'a> { + const NSID: &'static str = "app.bsky.graph.getStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetStarterPacksResponse; +} + +/// Endpoint type for +///app.bsky.graph.getStarterPacks +pub struct GetStarterPacksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetStarterPacksRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetStarterPacks<'de>; + type Response = GetStarterPacksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_starter_packs_with_membership.rs b/crates/weaver-api/src/app_bsky/graph/get_starter_packs_with_membership.rs new file mode 100644 index 0000000..fbc0e1d --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_starter_packs_with_membership.rs @@ -0,0 +1,528 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getStarterPacksWithMembership +// +// 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 GetStarterPacksWithMembership<'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_starter_packs_with_membership_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 GetStarterPacksWithMembershipBuilder< + 'a, + S: get_starter_packs_with_membership_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> GetStarterPacksWithMembership<'a> { + /// Create a new builder for this type + pub fn new() -> GetStarterPacksWithMembershipBuilder< + 'a, + get_starter_packs_with_membership_state::Empty, + > { + GetStarterPacksWithMembershipBuilder::new() + } +} + +impl< + 'a, +> GetStarterPacksWithMembershipBuilder< + 'a, + get_starter_packs_with_membership_state::Empty, +> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetStarterPacksWithMembershipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetStarterPacksWithMembershipBuilder<'a, S> +where + S: get_starter_packs_with_membership_state::State, + S::Actor: get_starter_packs_with_membership_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetStarterPacksWithMembershipBuilder< + 'a, + get_starter_packs_with_membership_state::SetActor, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetStarterPacksWithMembershipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: get_starter_packs_with_membership_state::State, +> GetStarterPacksWithMembershipBuilder<'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_starter_packs_with_membership_state::State, +> GetStarterPacksWithMembershipBuilder<'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> GetStarterPacksWithMembershipBuilder<'a, S> +where + S: get_starter_packs_with_membership_state::State, + S::Actor: get_starter_packs_with_membership_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetStarterPacksWithMembership<'a> { + GetStarterPacksWithMembership { + 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 GetStarterPacksWithMembershipOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub starter_packs_with_membership: Vec< + crate::app_bsky::graph::get_starter_packs_with_membership::StarterPackWithMembership< + 'a, + >, + >, +} + +/// Response type for +///app.bsky.graph.getStarterPacksWithMembership +pub struct GetStarterPacksWithMembershipResponse; +impl jacquard_common::xrpc::XrpcResp for GetStarterPacksWithMembershipResponse { + const NSID: &'static str = "app.bsky.graph.getStarterPacksWithMembership"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetStarterPacksWithMembershipOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetStarterPacksWithMembership<'a> { + const NSID: &'static str = "app.bsky.graph.getStarterPacksWithMembership"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetStarterPacksWithMembershipResponse; +} + +/// Endpoint type for +///app.bsky.graph.getStarterPacksWithMembership +pub struct GetStarterPacksWithMembershipRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetStarterPacksWithMembershipRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getStarterPacksWithMembership"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetStarterPacksWithMembership<'de>; + type Response = GetStarterPacksWithMembershipResponse; +} + +/// A starter pack and an optional list item indicating membership of a target user to that starter pack. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct StarterPackWithMembership<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub list_item: Option>, + #[serde(borrow)] + pub starter_pack: crate::app_bsky::graph::StarterPackView<'a>, +} + +pub mod starter_pack_with_membership_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 StarterPack; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type StarterPack = Unset; + } + ///State transition - sets the `starter_pack` field to Set + pub struct SetStarterPack(PhantomData S>); + impl sealed::Sealed for SetStarterPack {} + impl State for SetStarterPack { + type StarterPack = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `starter_pack` field + pub struct starter_pack(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StarterPackWithMembershipBuilder< + 'a, + S: starter_pack_with_membership_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> StarterPackWithMembership<'a> { + /// Create a new builder for this type + pub fn new() -> StarterPackWithMembershipBuilder< + 'a, + starter_pack_with_membership_state::Empty, + > { + StarterPackWithMembershipBuilder::new() + } +} + +impl< + 'a, +> StarterPackWithMembershipBuilder<'a, starter_pack_with_membership_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StarterPackWithMembershipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: starter_pack_with_membership_state::State, +> StarterPackWithMembershipBuilder<'a, S> { + /// Set the `listItem` field (optional) + pub fn list_item( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `listItem` field to an Option value (optional) + pub fn maybe_list_item( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> StarterPackWithMembershipBuilder<'a, S> +where + S: starter_pack_with_membership_state::State, + S::StarterPack: starter_pack_with_membership_state::IsUnset, +{ + /// Set the `starterPack` field (required) + pub fn starter_pack( + mut self, + value: impl Into>, + ) -> StarterPackWithMembershipBuilder< + 'a, + starter_pack_with_membership_state::SetStarterPack, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + StarterPackWithMembershipBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterPackWithMembershipBuilder<'a, S> +where + S: starter_pack_with_membership_state::State, + S::StarterPack: starter_pack_with_membership_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> StarterPackWithMembership<'a> { + StarterPackWithMembership { + list_item: self.__unsafe_private_named.0, + starter_pack: 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>, + >, + ) -> StarterPackWithMembership<'a> { + StarterPackWithMembership { + list_item: self.__unsafe_private_named.0, + starter_pack: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_graph_getStarterPacksWithMembership() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.getStarterPacksWithMembership", + ), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("actor") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("actor"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The account (actor) to check for membership.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, + ), + 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("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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "starterPackWithMembership", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A starter pack and an optional list item indicating membership of a target user to that starter pack.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("starterPack") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("listItem"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.defs#listItemView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "starterPack", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.defs#starterPackView", + ), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StarterPackWithMembership<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.getStarterPacksWithMembership" + } + fn def_name() -> &'static str { + "starterPackWithMembership" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_getStarterPacksWithMembership() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/get_suggested_follows_by_actor.rs b/crates/weaver-api/src/app_bsky/graph/get_suggested_follows_by_actor.rs new file mode 100644 index 0000000..02971fd --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/get_suggested_follows_by_actor.rs @@ -0,0 +1,171 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.getSuggestedFollowsByActor +// +// 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 GetSuggestedFollowsByActor<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod get_suggested_follows_by_actor_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 GetSuggestedFollowsByActorBuilder< + 'a, + S: get_suggested_follows_by_actor_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSuggestedFollowsByActor<'a> { + /// Create a new builder for this type + pub fn new() -> GetSuggestedFollowsByActorBuilder< + 'a, + get_suggested_follows_by_actor_state::Empty, + > { + GetSuggestedFollowsByActorBuilder::new() + } +} + +impl< + 'a, +> GetSuggestedFollowsByActorBuilder<'a, get_suggested_follows_by_actor_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedFollowsByActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetSuggestedFollowsByActorBuilder<'a, S> +where + S: get_suggested_follows_by_actor_state::State, + S::Actor: get_suggested_follows_by_actor_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetSuggestedFollowsByActorBuilder< + 'a, + get_suggested_follows_by_actor_state::SetActor, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetSuggestedFollowsByActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetSuggestedFollowsByActorBuilder<'a, S> +where + S: get_suggested_follows_by_actor_state::State, + S::Actor: get_suggested_follows_by_actor_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedFollowsByActor<'a> { + GetSuggestedFollowsByActor { + actor: 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 GetSuggestedFollowsByActorOutput<'a> { + /// If true, response has fallen-back to generic results, and is not scoped using relativeToDid + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub is_fallback: std::option::Option, + /// Snowflake for this recommendation, use when submitting recommendation events. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub rec_id: std::option::Option, + #[serde(borrow)] + pub suggestions: Vec>, +} + +/// Response type for +///app.bsky.graph.getSuggestedFollowsByActor +pub struct GetSuggestedFollowsByActorResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedFollowsByActorResponse { + const NSID: &'static str = "app.bsky.graph.getSuggestedFollowsByActor"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedFollowsByActorOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSuggestedFollowsByActor<'a> { + const NSID: &'static str = "app.bsky.graph.getSuggestedFollowsByActor"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedFollowsByActorResponse; +} + +/// Endpoint type for +///app.bsky.graph.getSuggestedFollowsByActor +pub struct GetSuggestedFollowsByActorRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedFollowsByActorRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.getSuggestedFollowsByActor"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedFollowsByActor<'de>; + type Response = GetSuggestedFollowsByActorResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/list.rs b/crates/weaver-api/src/app_bsky/graph/list.rs new file mode 100644 index 0000000..30815ed --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/list.rs @@ -0,0 +1,579 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.list +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct List<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description_facets: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>, + /// Display name for list; can not be empty. + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + /// Defines the purpose of the list (aka, moderation-oriented or curration-oriented) + #[serde(borrow)] + pub purpose: crate::app_bsky::graph::ListPurpose<'a>, +} + +pub mod 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 Name; + type Purpose; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Name = Unset; + type Purpose = Unset; + 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 Name = Set; + type Purpose = S::Purpose; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Name = S::Name; + type Purpose = 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 Purpose = S::Purpose; + 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 `purpose` field + pub struct purpose(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListBuilder<'a, S: list_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> List<'a> { + /// Create a new builder for this type + pub fn new() -> ListBuilder<'a, list_state::Empty> { + ListBuilder::new() + } +} + +impl<'a> ListBuilder<'a, list_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_state::State> ListBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ListBuilder<'a, S> +where + S: list_state::State, + S::CreatedAt: list_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ListBuilder<'a, list_state::SetCreatedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_state::State> ListBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: list_state::State> ListBuilder<'a, S> { + /// Set the `descriptionFacets` field (optional) + pub fn description_facets( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `descriptionFacets` field to an Option value (optional) + pub fn maybe_description_facets( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: list_state::State> ListBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S> ListBuilder<'a, S> +where + S: list_state::State, + S::Name: list_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> ListBuilder<'a, list_state::SetName> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + ListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListBuilder<'a, S> +where + S: list_state::State, + S::Purpose: list_state::IsUnset, +{ + /// Set the `purpose` field (required) + pub fn purpose( + mut self, + value: impl Into>, + ) -> ListBuilder<'a, list_state::SetPurpose> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + ListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListBuilder<'a, S> +where + S: list_state::State, + S::Name: list_state::IsSet, + S::Purpose: list_state::IsSet, + S::CreatedAt: list_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> List<'a> { + List { + avatar: self.__unsafe_private_named.0, + created_at: self.__unsafe_private_named.1.unwrap(), + description: self.__unsafe_private_named.2, + description_facets: self.__unsafe_private_named.3, + labels: self.__unsafe_private_named.4, + name: self.__unsafe_private_named.5.unwrap(), + purpose: 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>, + >, + ) -> List<'a> { + List { + avatar: self.__unsafe_private_named.0, + created_at: self.__unsafe_private_named.1.unwrap(), + description: self.__unsafe_private_named.2, + description_facets: self.__unsafe_private_named.3, + labels: self.__unsafe_private_named.4, + name: self.__unsafe_private_named.5.unwrap(), + purpose: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> List<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ListRecord>, + 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 ListGetRecordOutput<'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: List<'a>, +} + +impl From> for List<'_> { + fn from(output: ListGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for List<'_> { + const NSID: &'static str = "app.bsky.graph.list"; + type Record = ListRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ListRecord; +impl jacquard_common::xrpc::XrpcResp for ListRecord { + const NSID: &'static str = "app.bsky.graph.list"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ListRecord { + const NSID: &'static str = "app.bsky.graph.list"; + type Record = ListRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for List<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.list" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_list() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 3000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 300usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 300usize, + actual: count, + }); + } + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 64usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 64usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 1usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + min: 1usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +fn lexicon_doc_app_bsky_graph_list() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.graph.list"), + 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( + "Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists.", + ), + ), + 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("name"), + ::jacquard_common::smol_str::SmolStr::new_static("purpose"), + ::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("avatar"), + ::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( + "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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "descriptionFacets", + ), + ::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( + "app.bsky.richtext.facet", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labels"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("com.atproto.label.defs#selfLabels") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Display name for list; can not be empty.", + ), + ), + format: None, + default: None, + min_length: Some(1usize), + max_length: Some(64usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("purpose"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.graph.defs#listPurpose", + ), + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/listblock.rs b/crates/weaver-api/src/app_bsky/graph/listblock.rs new file mode 100644 index 0000000..9e2bb50 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/listblock.rs @@ -0,0 +1,324 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.listblock +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record representing a block relationship against an entire an entire list of accounts (actors). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Listblock<'a> { + pub created_at: jacquard_common::types::string::Datetime, + /// Reference (AT-URI) to the mod list record. + #[serde(borrow)] + pub subject: jacquard_common::types::string::AtUri<'a>, +} + +pub mod listblock_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 CreatedAt; + } + /// 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; + } + ///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 `subject` field + pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListblockBuilder<'a, S: listblock_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Listblock<'a> { + /// Create a new builder for this type + pub fn new() -> ListblockBuilder<'a, listblock_state::Empty> { + ListblockBuilder::new() + } +} + +impl<'a> ListblockBuilder<'a, listblock_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListblockBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListblockBuilder<'a, S> +where + S: listblock_state::State, + S::CreatedAt: listblock_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ListblockBuilder<'a, listblock_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ListblockBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListblockBuilder<'a, S> +where + S: listblock_state::State, + S::Subject: listblock_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> ListblockBuilder<'a, listblock_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ListblockBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListblockBuilder<'a, S> +where + S: listblock_state::State, + S::Subject: listblock_state::IsSet, + S::CreatedAt: listblock_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Listblock<'a> { + Listblock { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: 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>, + >, + ) -> Listblock<'a> { + Listblock { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Listblock<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ListblockRecord>, + 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 ListblockGetRecordOutput<'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: Listblock<'a>, +} + +impl From> for Listblock<'_> { + fn from(output: ListblockGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Listblock<'_> { + const NSID: &'static str = "app.bsky.graph.listblock"; + type Record = ListblockRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ListblockRecord; +impl jacquard_common::xrpc::XrpcResp for ListblockRecord { + const NSID: &'static str = "app.bsky.graph.listblock"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListblockGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ListblockRecord { + const NSID: &'static str = "app.bsky.graph.listblock"; + type Record = ListblockRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Listblock<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.listblock" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_listblock() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_graph_listblock() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.graph.listblock"), + 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( + "Record representing a block relationship against an entire an entire list of accounts (actors).", + ), + ), + 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("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::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference (AT-URI) to the mod list record.", + ), + ), + 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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/listitem.rs b/crates/weaver-api/src/app_bsky/graph/listitem.rs new file mode 100644 index 0000000..fa585a6 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/listitem.rs @@ -0,0 +1,386 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.listitem +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Listitem<'a> { + pub created_at: jacquard_common::types::string::Datetime, + /// Reference (AT-URI) to the list record (app.bsky.graph.list). + #[serde(borrow)] + pub list: jacquard_common::types::string::AtUri<'a>, + /// The account which is included on the list. + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +pub mod listitem_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 List; + 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 List = 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 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 Subject = S::Subject; + type List = 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 List = S::List; + 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 `list` field + pub struct list(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListitemBuilder<'a, S: listitem_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> Listitem<'a> { + /// Create a new builder for this type + pub fn new() -> ListitemBuilder<'a, listitem_state::Empty> { + ListitemBuilder::new() + } +} + +impl<'a> ListitemBuilder<'a, listitem_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListitemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListitemBuilder<'a, S> +where + S: listitem_state::State, + S::CreatedAt: listitem_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ListitemBuilder<'a, listitem_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ListitemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListitemBuilder<'a, S> +where + S: listitem_state::State, + S::List: listitem_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into>, + ) -> ListitemBuilder<'a, listitem_state::SetList> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ListitemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListitemBuilder<'a, S> +where + S: listitem_state::State, + S::Subject: listitem_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> ListitemBuilder<'a, listitem_state::SetSubject> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ListitemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListitemBuilder<'a, S> +where + S: listitem_state::State, + S::Subject: listitem_state::IsSet, + S::List: listitem_state::IsSet, + S::CreatedAt: listitem_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Listitem<'a> { + Listitem { + created_at: self.__unsafe_private_named.0.unwrap(), + list: self.__unsafe_private_named.1.unwrap(), + subject: 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>, + >, + ) -> Listitem<'a> { + Listitem { + created_at: self.__unsafe_private_named.0.unwrap(), + list: self.__unsafe_private_named.1.unwrap(), + subject: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Listitem<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ListitemRecord>, + 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 ListitemGetRecordOutput<'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: Listitem<'a>, +} + +impl From> for Listitem<'_> { + fn from(output: ListitemGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Listitem<'_> { + const NSID: &'static str = "app.bsky.graph.listitem"; + type Record = ListitemRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ListitemRecord; +impl jacquard_common::xrpc::XrpcResp for ListitemRecord { + const NSID: &'static str = "app.bsky.graph.listitem"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListitemGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ListitemRecord { + const NSID: &'static str = "app.bsky.graph.listitem"; + type Record = ListitemRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Listitem<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.listitem" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_listitem() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_graph_listitem() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.graph.listitem"), + 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( + "Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records.", + ), + ), + 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("list"), + ::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("list"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference (AT-URI) to the list record (app.bsky.graph.list).", + ), + ), + 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("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The account which is included on the list.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/mute_actor.rs b/crates/weaver-api/src/app_bsky/graph/mute_actor.rs new file mode 100644 index 0000000..9b92602 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/mute_actor.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.muteActor +// +// 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 MuteActor<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod mute_actor_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 MuteActorBuilder<'a, S: mute_actor_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> MuteActor<'a> { + /// Create a new builder for this type + pub fn new() -> MuteActorBuilder<'a, mute_actor_state::Empty> { + MuteActorBuilder::new() + } +} + +impl<'a> MuteActorBuilder<'a, mute_actor_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MuteActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MuteActorBuilder<'a, S> +where + S: mute_actor_state::State, + S::Actor: mute_actor_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> MuteActorBuilder<'a, mute_actor_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MuteActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MuteActorBuilder<'a, S> +where + S: mute_actor_state::State, + S::Actor: mute_actor_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> MuteActor<'a> { + MuteActor { + actor: 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>, + >, + ) -> MuteActor<'a> { + MuteActor { + actor: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.graph.muteActor +pub struct MuteActorResponse; +impl jacquard_common::xrpc::XrpcResp for MuteActorResponse { + const NSID: &'static str = "app.bsky.graph.muteActor"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for MuteActor<'a> { + const NSID: &'static str = "app.bsky.graph.muteActor"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = MuteActorResponse; +} + +/// Endpoint type for +///app.bsky.graph.muteActor +pub struct MuteActorRequest; +impl jacquard_common::xrpc::XrpcEndpoint for MuteActorRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.muteActor"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = MuteActor<'de>; + type Response = MuteActorResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/mute_actor_list.rs b/crates/weaver-api/src/app_bsky/graph/mute_actor_list.rs new file mode 100644 index 0000000..05a345d --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/mute_actor_list.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.muteActorList +// +// 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 MuteActorList<'a> { + #[serde(borrow)] + pub list: jacquard_common::types::string::AtUri<'a>, +} + +pub mod mute_actor_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 MuteActorListBuilder<'a, S: mute_actor_list_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> MuteActorList<'a> { + /// Create a new builder for this type + pub fn new() -> MuteActorListBuilder<'a, mute_actor_list_state::Empty> { + MuteActorListBuilder::new() + } +} + +impl<'a> MuteActorListBuilder<'a, mute_actor_list_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MuteActorListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MuteActorListBuilder<'a, S> +where + S: mute_actor_list_state::State, + S::List: mute_actor_list_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into>, + ) -> MuteActorListBuilder<'a, mute_actor_list_state::SetList> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MuteActorListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MuteActorListBuilder<'a, S> +where + S: mute_actor_list_state::State, + S::List: mute_actor_list_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> MuteActorList<'a> { + MuteActorList { + list: 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>, + >, + ) -> MuteActorList<'a> { + MuteActorList { + list: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.graph.muteActorList +pub struct MuteActorListResponse; +impl jacquard_common::xrpc::XrpcResp for MuteActorListResponse { + const NSID: &'static str = "app.bsky.graph.muteActorList"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for MuteActorList<'a> { + const NSID: &'static str = "app.bsky.graph.muteActorList"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = MuteActorListResponse; +} + +/// Endpoint type for +///app.bsky.graph.muteActorList +pub struct MuteActorListRequest; +impl jacquard_common::xrpc::XrpcEndpoint for MuteActorListRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.muteActorList"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = MuteActorList<'de>; + type Response = MuteActorListResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/mute_thread.rs b/crates/weaver-api/src/app_bsky/graph/mute_thread.rs new file mode 100644 index 0000000..c44da15 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/mute_thread.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.muteThread +// +// 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 MuteThread<'a> { + #[serde(borrow)] + pub root: jacquard_common::types::string::AtUri<'a>, +} + +pub mod mute_thread_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 Root; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Root = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `root` field + pub struct root(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MuteThreadBuilder<'a, S: mute_thread_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> MuteThread<'a> { + /// Create a new builder for this type + pub fn new() -> MuteThreadBuilder<'a, mute_thread_state::Empty> { + MuteThreadBuilder::new() + } +} + +impl<'a> MuteThreadBuilder<'a, mute_thread_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MuteThreadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MuteThreadBuilder<'a, S> +where + S: mute_thread_state::State, + S::Root: mute_thread_state::IsUnset, +{ + /// Set the `root` field (required) + pub fn root( + mut self, + value: impl Into>, + ) -> MuteThreadBuilder<'a, mute_thread_state::SetRoot> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MuteThreadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MuteThreadBuilder<'a, S> +where + S: mute_thread_state::State, + S::Root: mute_thread_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> MuteThread<'a> { + MuteThread { + root: 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>, + >, + ) -> MuteThread<'a> { + MuteThread { + root: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.graph.muteThread +pub struct MuteThreadResponse; +impl jacquard_common::xrpc::XrpcResp for MuteThreadResponse { + const NSID: &'static str = "app.bsky.graph.muteThread"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for MuteThread<'a> { + const NSID: &'static str = "app.bsky.graph.muteThread"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = MuteThreadResponse; +} + +/// Endpoint type for +///app.bsky.graph.muteThread +pub struct MuteThreadRequest; +impl jacquard_common::xrpc::XrpcEndpoint for MuteThreadRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.muteThread"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = MuteThread<'de>; + type Response = MuteThreadResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/search_starter_packs.rs b/crates/weaver-api/src/app_bsky/graph/search_starter_packs.rs new file mode 100644 index 0000000..b8e2a0f --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/search_starter_packs.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.searchStarterPacks +// +// 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 SearchStarterPacks<'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_starter_packs_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 SearchStarterPacksBuilder<'a, S: search_starter_packs_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> SearchStarterPacks<'a> { + /// Create a new builder for this type + pub fn new() -> SearchStarterPacksBuilder<'a, search_starter_packs_state::Empty> { + SearchStarterPacksBuilder::new() + } +} + +impl<'a> SearchStarterPacksBuilder<'a, search_starter_packs_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_starter_packs_state::State> SearchStarterPacksBuilder<'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_starter_packs_state::State> SearchStarterPacksBuilder<'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> SearchStarterPacksBuilder<'a, S> +where + S: search_starter_packs_state::State, + S::Q: search_starter_packs_state::IsUnset, +{ + /// Set the `q` field (required) + pub fn q( + mut self, + value: impl Into>, + ) -> SearchStarterPacksBuilder<'a, search_starter_packs_state::SetQ> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SearchStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SearchStarterPacksBuilder<'a, S> +where + S: search_starter_packs_state::State, + S::Q: search_starter_packs_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchStarterPacks<'a> { + SearchStarterPacks { + 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 SearchStarterPacksOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub starter_packs: Vec>, +} + +/// Response type for +///app.bsky.graph.searchStarterPacks +pub struct SearchStarterPacksResponse; +impl jacquard_common::xrpc::XrpcResp for SearchStarterPacksResponse { + const NSID: &'static str = "app.bsky.graph.searchStarterPacks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchStarterPacksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchStarterPacks<'a> { + const NSID: &'static str = "app.bsky.graph.searchStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchStarterPacksResponse; +} + +/// Endpoint type for +///app.bsky.graph.searchStarterPacks +pub struct SearchStarterPacksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchStarterPacksRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.searchStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchStarterPacks<'de>; + type Response = SearchStarterPacksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/starterpack.rs b/crates/weaver-api/src/app_bsky/graph/starterpack.rs new file mode 100644 index 0000000..14a4c04 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/starterpack.rs @@ -0,0 +1,761 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.starterpack +// +// 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 FeedItem<'a> { + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod feed_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 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 FeedItemBuilder<'a, S: feed_item_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> FeedItem<'a> { + /// Create a new builder for this type + pub fn new() -> FeedItemBuilder<'a, feed_item_state::Empty> { + FeedItemBuilder::new() + } +} + +impl<'a> FeedItemBuilder<'a, feed_item_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FeedItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FeedItemBuilder<'a, S> +where + S: feed_item_state::State, + S::Uri: feed_item_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> FeedItemBuilder<'a, feed_item_state::SetUri> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FeedItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FeedItemBuilder<'a, S> +where + S: feed_item_state::State, + S::Uri: feed_item_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FeedItem<'a> { + FeedItem { + uri: 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>, + >, + ) -> FeedItem<'a> { + FeedItem { + uri: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_graph_starterpack() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.graph.starterpack"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feedItem"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + 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("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("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Record defining a starter pack of actors and feeds for new users.", + ), + ), + 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("name"), + ::jacquard_common::smol_str::SmolStr::new_static("list"), + ::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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "descriptionFacets", + ), + ::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( + "app.bsky.richtext.facet", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feeds"), + ::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("#feedItem"), + }), + min_length: None, + max_length: Some(3usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("list"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference (AT-URI) to the list record.", + ), + ), + 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("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Display name for starter pack; can not be empty.", + ), + ), + format: None, + default: None, + min_length: Some(1usize), + max_length: Some(500usize), + min_graphemes: None, + max_graphemes: Some(50usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedItem<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.starterpack" + } + fn def_name() -> &'static str { + "feedItem" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_starterpack() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Record defining a starter pack of actors and feeds for new users. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Starterpack<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description_facets: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub feeds: Option>>, + /// Reference (AT-URI) to the list record. + #[serde(borrow)] + pub list: jacquard_common::types::string::AtUri<'a>, + /// Display name for starter pack; can not be empty. + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +pub mod starterpack_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 Name; + type List; + type CreatedAt; + } + /// 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; + } + ///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; + } + ///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 List = S::List; + 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StarterpackBuilder<'a, S: starterpack_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> Starterpack<'a> { + /// Create a new builder for this type + pub fn new() -> StarterpackBuilder<'a, starterpack_state::Empty> { + StarterpackBuilder::new() + } +} + +impl<'a> StarterpackBuilder<'a, starterpack_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StarterpackBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterpackBuilder<'a, S> +where + S: starterpack_state::State, + S::CreatedAt: starterpack_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> StarterpackBuilder<'a, starterpack_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + StarterpackBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: starterpack_state::State> StarterpackBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: starterpack_state::State> StarterpackBuilder<'a, S> { + /// Set the `descriptionFacets` field (optional) + pub fn description_facets( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `descriptionFacets` field to an Option value (optional) + pub fn maybe_description_facets( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: starterpack_state::State> StarterpackBuilder<'a, S> { + /// Set the `feeds` field (optional) + pub fn feeds( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `feeds` field to an Option value (optional) + pub fn maybe_feeds( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> StarterpackBuilder<'a, S> +where + S: starterpack_state::State, + S::List: starterpack_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into>, + ) -> StarterpackBuilder<'a, starterpack_state::SetList> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + StarterpackBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarterpackBuilder<'a, S> +where + S: starterpack_state::State, + S::Name: starterpack_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> StarterpackBuilder<'a, starterpack_state::SetName> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + StarterpackBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> Starterpack<'a> { + Starterpack { + created_at: self.__unsafe_private_named.0.unwrap(), + description: self.__unsafe_private_named.1, + description_facets: self.__unsafe_private_named.2, + feeds: self.__unsafe_private_named.3, + list: self.__unsafe_private_named.4.unwrap(), + name: 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>, + >, + ) -> Starterpack<'a> { + Starterpack { + created_at: self.__unsafe_private_named.0.unwrap(), + description: self.__unsafe_private_named.1, + description_facets: self.__unsafe_private_named.2, + feeds: self.__unsafe_private_named.3, + list: self.__unsafe_private_named.4.unwrap(), + name: self.__unsafe_private_named.5.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Starterpack<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, StarterpackRecord>, + 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 StarterpackGetRecordOutput<'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: Starterpack<'a>, +} + +impl From> for Starterpack<'_> { + fn from(output: StarterpackGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Starterpack<'_> { + const NSID: &'static str = "app.bsky.graph.starterpack"; + type Record = StarterpackRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct StarterpackRecord; +impl jacquard_common::xrpc::XrpcResp for StarterpackRecord { + const NSID: &'static str = "app.bsky.graph.starterpack"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = StarterpackGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for StarterpackRecord { + const NSID: &'static str = "app.bsky.graph.starterpack"; + type Record = StarterpackRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Starterpack<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.starterpack" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_starterpack() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 3000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 3000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 300usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 300usize, + actual: count, + }); + } + } + } + if let Some(ref value) = self.feeds { + #[allow(unused_comparisons)] + if value.len() > 3usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "feeds", + ), + max: 3usize, + actual: value.len(), + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 500usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 500usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 1usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + min: 1usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 50usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 50usize, + actual: count, + }); + } + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/unmute_actor.rs b/crates/weaver-api/src/app_bsky/graph/unmute_actor.rs new file mode 100644 index 0000000..ecba3ec --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/unmute_actor.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.unmuteActor +// +// 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 UnmuteActor<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod unmute_actor_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 UnmuteActorBuilder<'a, S: unmute_actor_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UnmuteActor<'a> { + /// Create a new builder for this type + pub fn new() -> UnmuteActorBuilder<'a, unmute_actor_state::Empty> { + UnmuteActorBuilder::new() + } +} + +impl<'a> UnmuteActorBuilder<'a, unmute_actor_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UnmuteActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnmuteActorBuilder<'a, S> +where + S: unmute_actor_state::State, + S::Actor: unmute_actor_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> UnmuteActorBuilder<'a, unmute_actor_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UnmuteActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnmuteActorBuilder<'a, S> +where + S: unmute_actor_state::State, + S::Actor: unmute_actor_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UnmuteActor<'a> { + UnmuteActor { + actor: 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>, + >, + ) -> UnmuteActor<'a> { + UnmuteActor { + actor: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.graph.unmuteActor +pub struct UnmuteActorResponse; +impl jacquard_common::xrpc::XrpcResp for UnmuteActorResponse { + const NSID: &'static str = "app.bsky.graph.unmuteActor"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UnmuteActor<'a> { + const NSID: &'static str = "app.bsky.graph.unmuteActor"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UnmuteActorResponse; +} + +/// Endpoint type for +///app.bsky.graph.unmuteActor +pub struct UnmuteActorRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UnmuteActorRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.unmuteActor"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UnmuteActor<'de>; + type Response = UnmuteActorResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/unmute_actor_list.rs b/crates/weaver-api/src/app_bsky/graph/unmute_actor_list.rs new file mode 100644 index 0000000..9976e47 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/unmute_actor_list.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.unmuteActorList +// +// 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 UnmuteActorList<'a> { + #[serde(borrow)] + pub list: jacquard_common::types::string::AtUri<'a>, +} + +pub mod unmute_actor_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 UnmuteActorListBuilder<'a, S: unmute_actor_list_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UnmuteActorList<'a> { + /// Create a new builder for this type + pub fn new() -> UnmuteActorListBuilder<'a, unmute_actor_list_state::Empty> { + UnmuteActorListBuilder::new() + } +} + +impl<'a> UnmuteActorListBuilder<'a, unmute_actor_list_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UnmuteActorListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnmuteActorListBuilder<'a, S> +where + S: unmute_actor_list_state::State, + S::List: unmute_actor_list_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into>, + ) -> UnmuteActorListBuilder<'a, unmute_actor_list_state::SetList> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UnmuteActorListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnmuteActorListBuilder<'a, S> +where + S: unmute_actor_list_state::State, + S::List: unmute_actor_list_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UnmuteActorList<'a> { + UnmuteActorList { + list: 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>, + >, + ) -> UnmuteActorList<'a> { + UnmuteActorList { + list: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.graph.unmuteActorList +pub struct UnmuteActorListResponse; +impl jacquard_common::xrpc::XrpcResp for UnmuteActorListResponse { + const NSID: &'static str = "app.bsky.graph.unmuteActorList"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UnmuteActorList<'a> { + const NSID: &'static str = "app.bsky.graph.unmuteActorList"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UnmuteActorListResponse; +} + +/// Endpoint type for +///app.bsky.graph.unmuteActorList +pub struct UnmuteActorListRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UnmuteActorListRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.unmuteActorList"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UnmuteActorList<'de>; + type Response = UnmuteActorListResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/unmute_thread.rs b/crates/weaver-api/src/app_bsky/graph/unmute_thread.rs new file mode 100644 index 0000000..9ee7770 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/unmute_thread.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.unmuteThread +// +// 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 UnmuteThread<'a> { + #[serde(borrow)] + pub root: jacquard_common::types::string::AtUri<'a>, +} + +pub mod unmute_thread_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 Root; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Root = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `root` field + pub struct root(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UnmuteThreadBuilder<'a, S: unmute_thread_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UnmuteThread<'a> { + /// Create a new builder for this type + pub fn new() -> UnmuteThreadBuilder<'a, unmute_thread_state::Empty> { + UnmuteThreadBuilder::new() + } +} + +impl<'a> UnmuteThreadBuilder<'a, unmute_thread_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UnmuteThreadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnmuteThreadBuilder<'a, S> +where + S: unmute_thread_state::State, + S::Root: unmute_thread_state::IsUnset, +{ + /// Set the `root` field (required) + pub fn root( + mut self, + value: impl Into>, + ) -> UnmuteThreadBuilder<'a, unmute_thread_state::SetRoot> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UnmuteThreadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnmuteThreadBuilder<'a, S> +where + S: unmute_thread_state::State, + S::Root: unmute_thread_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UnmuteThread<'a> { + UnmuteThread { + root: 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>, + >, + ) -> UnmuteThread<'a> { + UnmuteThread { + root: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.graph.unmuteThread +pub struct UnmuteThreadResponse; +impl jacquard_common::xrpc::XrpcResp for UnmuteThreadResponse { + const NSID: &'static str = "app.bsky.graph.unmuteThread"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UnmuteThread<'a> { + const NSID: &'static str = "app.bsky.graph.unmuteThread"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UnmuteThreadResponse; +} + +/// Endpoint type for +///app.bsky.graph.unmuteThread +pub struct UnmuteThreadRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UnmuteThreadRequest { + const PATH: &'static str = "/xrpc/app.bsky.graph.unmuteThread"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UnmuteThread<'de>; + type Response = UnmuteThreadResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/graph/verification.rs b/crates/weaver-api/src/app_bsky/graph/verification.rs new file mode 100644 index 0000000..55ad99d --- /dev/null +++ b/crates/weaver-api/src/app_bsky/graph/verification.rs @@ -0,0 +1,455 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.graph.verification +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Verification<'a> { + /// Date of when the verification was created. + pub created_at: jacquard_common::types::string::Datetime, + /// Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying. + #[serde(borrow)] + pub display_name: jacquard_common::CowStr<'a>, + /// Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying. + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + /// DID of the subject the verification applies to. + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +pub mod verification_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 Handle; + type DisplayName; + 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 Handle = Unset; + type DisplayName = 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 Handle = S::Handle; + type DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + } + ///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 DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + } + ///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 DisplayName = 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 Handle = S::Handle; + type DisplayName = S::DisplayName; + 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 `handle` field + pub struct handle(()); + ///Marker type for the `display_name` field + pub struct display_name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VerificationBuilder<'a, S: verification_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> Verification<'a> { + /// Create a new builder for this type + pub fn new() -> VerificationBuilder<'a, verification_state::Empty> { + VerificationBuilder::new() + } +} + +impl<'a> VerificationBuilder<'a, verification_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VerificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationBuilder<'a, S> +where + S: verification_state::State, + S::CreatedAt: verification_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> VerificationBuilder<'a, verification_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + VerificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationBuilder<'a, S> +where + S: verification_state::State, + S::DisplayName: verification_state::IsUnset, +{ + /// Set the `displayName` field (required) + pub fn display_name( + mut self, + value: impl Into>, + ) -> VerificationBuilder<'a, verification_state::SetDisplayName> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + VerificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationBuilder<'a, S> +where + S: verification_state::State, + S::Handle: verification_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> VerificationBuilder<'a, verification_state::SetHandle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + VerificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationBuilder<'a, S> +where + S: verification_state::State, + S::Subject: verification_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> VerificationBuilder<'a, verification_state::SetSubject> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + VerificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationBuilder<'a, S> +where + S: verification_state::State, + S::Subject: verification_state::IsSet, + S::Handle: verification_state::IsSet, + S::DisplayName: verification_state::IsSet, + S::CreatedAt: verification_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Verification<'a> { + Verification { + created_at: self.__unsafe_private_named.0.unwrap(), + display_name: self.__unsafe_private_named.1.unwrap(), + handle: self.__unsafe_private_named.2.unwrap(), + subject: 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>, + >, + ) -> Verification<'a> { + Verification { + created_at: self.__unsafe_private_named.0.unwrap(), + display_name: self.__unsafe_private_named.1.unwrap(), + handle: self.__unsafe_private_named.2.unwrap(), + subject: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Verification<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, VerificationRecord>, + 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 VerificationGetRecordOutput<'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: Verification<'a>, +} + +impl From> for Verification<'_> { + fn from(output: VerificationGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Verification<'_> { + const NSID: &'static str = "app.bsky.graph.verification"; + type Record = VerificationRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct VerificationRecord; +impl jacquard_common::xrpc::XrpcResp for VerificationRecord { + const NSID: &'static str = "app.bsky.graph.verification"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = VerificationGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for VerificationRecord { + const NSID: &'static str = "app.bsky.graph.verification"; + type Record = VerificationRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Verification<'a> { + fn nsid() -> &'static str { + "app.bsky.graph.verification" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_graph_verification() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_graph_verification() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.graph.verification"), + 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( + "Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted.", + ), + ), + 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("handle"), + ::jacquard_common::smol_str::SmolStr::new_static("displayName"), + ::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: Some( + ::jacquard_common::CowStr::new_static( + "Date of when the verification was created.", + ), + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying.", + ), + ), + 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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the subject the verification applies to.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/labeler.rs b/crates/weaver-api/src/app_bsky/labeler.rs new file mode 100644 index 0000000..3f18949 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/labeler.rs @@ -0,0 +1,1428 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.labeler.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_services; +pub mod service; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct LabelerPolicies<'a> { + /// Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub label_value_definitions: Option< + Vec>, + >, + /// The label values which this labeler publishes. May include global or custom labels. + #[serde(borrow)] + pub label_values: Vec>, +} + +pub mod labeler_policies_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 LabelValues; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type LabelValues = Unset; + } + ///State transition - sets the `label_values` field to Set + pub struct SetLabelValues(PhantomData S>); + impl sealed::Sealed for SetLabelValues {} + impl State for SetLabelValues { + type LabelValues = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `label_values` field + pub struct label_values(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelerPoliciesBuilder<'a, S: labeler_policies_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> LabelerPolicies<'a> { + /// Create a new builder for this type + pub fn new() -> LabelerPoliciesBuilder<'a, labeler_policies_state::Empty> { + LabelerPoliciesBuilder::new() + } +} + +impl<'a> LabelerPoliciesBuilder<'a, labeler_policies_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelerPoliciesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: labeler_policies_state::State> LabelerPoliciesBuilder<'a, S> { + /// Set the `labelValueDefinitions` field (optional) + pub fn label_value_definitions( + mut self, + value: impl Into< + Option>>, + >, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `labelValueDefinitions` field to an Option value (optional) + pub fn maybe_label_value_definitions( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> LabelerPoliciesBuilder<'a, S> +where + S: labeler_policies_state::State, + S::LabelValues: labeler_policies_state::IsUnset, +{ + /// Set the `labelValues` field (required) + pub fn label_values( + mut self, + value: impl Into>>, + ) -> LabelerPoliciesBuilder<'a, labeler_policies_state::SetLabelValues> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LabelerPoliciesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelerPoliciesBuilder<'a, S> +where + S: labeler_policies_state::State, + S::LabelValues: labeler_policies_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LabelerPolicies<'a> { + LabelerPolicies { + label_value_definitions: self.__unsafe_private_named.0, + label_values: 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>, + >, + ) -> LabelerPolicies<'a> { + LabelerPolicies { + label_value_definitions: self.__unsafe_private_named.0, + label_values: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_labeler_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.labeler.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labelerPolicies"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("labelValues") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "labelValueDefinitions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.label.defs#labelValueDefinition", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "labelValues", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "The label values which this labeler publishes. May include global or custom labels.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.label.defs#labelValue", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labelerView"), + ::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("creator"), + ::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, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("creator"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileView", + ), + }), + ); + 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: 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: Some(0i64), + 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, + ), + 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("viewer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#labelerViewerState", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labelerViewDetailed"), + ::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("creator"), + ::jacquard_common::smol_str::SmolStr::new_static("policies"), + ::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, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("creator"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileView", + ), + }), + ); + 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: 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: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("policies"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.labeler.defs#labelerPolicies", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "reasonTypes", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.moderation.defs#reasonType", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectCollections", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectTypes", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "The set of subject types (account, record, etc) this service accepts reports on.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.moderation.defs#subjectType", + ), + }), + min_length: None, + max_length: 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.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( + "#labelerViewerState", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labelerViewerState"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("like"), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelerPolicies<'a> { + fn nsid() -> &'static str { + "app.bsky.labeler.defs" + } + fn def_name() -> &'static str { + "labelerPolicies" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_labeler_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 LabelerView<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub creator: crate::app_bsky::actor::ProfileView<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub like_count: Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod labeler_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 Uri; + type Cid; + type Creator; + 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 Cid = Unset; + type Creator = 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; + type Cid = S::Cid; + type Creator = S::Creator; + 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 Cid = 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 { + type Uri = S::Uri; + type Cid = S::Cid; + type Creator = 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 Uri = S::Uri; + type Cid = S::Cid; + type Creator = S::Creator; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelerViewBuilder<'a, S: labeler_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> LabelerView<'a> { + /// Create a new builder for this type + pub fn new() -> LabelerViewBuilder<'a, labeler_view_state::Empty> { + LabelerViewBuilder::new() + } +} + +impl<'a> LabelerViewBuilder<'a, labeler_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelerViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelerViewBuilder<'a, S> +where + S: labeler_view_state::State, + S::Cid: labeler_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> LabelerViewBuilder<'a, labeler_view_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LabelerViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelerViewBuilder<'a, S> +where + S: labeler_view_state::State, + S::Creator: labeler_view_state::IsUnset, +{ + /// Set the `creator` field (required) + pub fn creator( + mut self, + value: impl Into>, + ) -> LabelerViewBuilder<'a, labeler_view_state::SetCreator> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LabelerViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelerViewBuilder<'a, S> +where + S: labeler_view_state::State, + S::IndexedAt: labeler_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> LabelerViewBuilder<'a, labeler_view_state::SetIndexedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LabelerViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = 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.3 = value; + self + } +} + +impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'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> LabelerViewBuilder<'a, S> +where + S: labeler_view_state::State, + S::Uri: labeler_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> LabelerViewBuilder<'a, labeler_view_state::SetUri> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + LabelerViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'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> LabelerViewBuilder<'a, S> +where + S: labeler_view_state::State, + S::Uri: labeler_view_state::IsSet, + S::Cid: labeler_view_state::IsSet, + S::Creator: labeler_view_state::IsSet, + S::IndexedAt: labeler_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LabelerView<'a> { + LabelerView { + cid: self.__unsafe_private_named.0.unwrap(), + creator: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + labels: self.__unsafe_private_named.3, + like_count: self.__unsafe_private_named.4, + uri: self.__unsafe_private_named.5.unwrap(), + viewer: 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>, + >, + ) -> LabelerView<'a> { + LabelerView { + cid: self.__unsafe_private_named.0.unwrap(), + creator: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + labels: self.__unsafe_private_named.3, + like_count: self.__unsafe_private_named.4, + uri: self.__unsafe_private_named.5.unwrap(), + viewer: self.__unsafe_private_named.6, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelerView<'a> { + fn nsid() -> &'static str { + "app.bsky.labeler.defs" + } + fn def_name() -> &'static str { + "labelerView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_labeler_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.like_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "like_count", + ), + 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 LabelerViewDetailed<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub creator: crate::app_bsky::actor::ProfileView<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub like_count: Option, + #[serde(borrow)] + pub policies: crate::app_bsky::labeler::LabelerPolicies<'a>, + /// The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason_types: Option>>, + /// Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_collections: Option>>, + /// The set of subject types (account, record, etc) this service accepts reports on. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_types: Option>>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod labeler_view_detailed_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 Cid; + type Creator; + type Policies; + 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 Cid = Unset; + type Creator = Unset; + type Policies = 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; + type Cid = S::Cid; + type Creator = S::Creator; + type Policies = S::Policies; + 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 Cid = 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 Cid = S::Cid; + type Creator = Set; + type Policies = S::Policies; + type IndexedAt = S::IndexedAt; + } + ///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 Cid = S::Cid; + type Creator = S::Creator; + type Policies = 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 Uri = S::Uri; + type Cid = S::Cid; + type Creator = S::Creator; + type Policies = S::Policies; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `policies` field + pub struct policies(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelerViewDetailedBuilder<'a, S: labeler_view_detailed_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> LabelerViewDetailed<'a> { + /// Create a new builder for this type + pub fn new() -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::Empty> { + LabelerViewDetailedBuilder::new() + } +} + +impl<'a> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelerViewDetailedBuilder { + _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> LabelerViewDetailedBuilder<'a, S> +where + S: labeler_view_detailed_state::State, + S::Cid: labeler_view_detailed_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LabelerViewDetailedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelerViewDetailedBuilder<'a, S> +where + S: labeler_view_detailed_state::State, + S::Creator: labeler_view_detailed_state::IsUnset, +{ + /// Set the `creator` field (required) + pub fn creator( + mut self, + value: impl Into>, + ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetCreator> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LabelerViewDetailedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelerViewDetailedBuilder<'a, S> +where + S: labeler_view_detailed_state::State, + S::IndexedAt: labeler_view_detailed_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetIndexedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LabelerViewDetailedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = 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.3 = value; + self + } +} + +impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'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> LabelerViewDetailedBuilder<'a, S> +where + S: labeler_view_detailed_state::State, + S::Policies: labeler_view_detailed_state::IsUnset, +{ + /// Set the `policies` field (required) + pub fn policies( + mut self, + value: impl Into>, + ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetPolicies> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + LabelerViewDetailedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { + /// Set the `reasonTypes` field (optional) + pub fn reason_types( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `reasonTypes` field to an Option value (optional) + pub fn maybe_reason_types( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { + /// Set the `subjectCollections` field (optional) + pub fn subject_collections( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `subjectCollections` field to an Option value (optional) + pub fn maybe_subject_collections( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { + /// Set the `subjectTypes` field (optional) + pub fn subject_types( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `subjectTypes` field to an Option value (optional) + pub fn maybe_subject_types( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> LabelerViewDetailedBuilder<'a, S> +where + S: labeler_view_detailed_state::State, + S::Uri: labeler_view_detailed_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetUri> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + LabelerViewDetailedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = 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.10 = value; + self + } +} + +impl<'a, S> LabelerViewDetailedBuilder<'a, S> +where + S: labeler_view_detailed_state::State, + S::Uri: labeler_view_detailed_state::IsSet, + S::Cid: labeler_view_detailed_state::IsSet, + S::Creator: labeler_view_detailed_state::IsSet, + S::Policies: labeler_view_detailed_state::IsSet, + S::IndexedAt: labeler_view_detailed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LabelerViewDetailed<'a> { + LabelerViewDetailed { + cid: self.__unsafe_private_named.0.unwrap(), + creator: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + labels: self.__unsafe_private_named.3, + like_count: self.__unsafe_private_named.4, + policies: self.__unsafe_private_named.5.unwrap(), + reason_types: self.__unsafe_private_named.6, + subject_collections: self.__unsafe_private_named.7, + subject_types: self.__unsafe_private_named.8, + uri: self.__unsafe_private_named.9.unwrap(), + viewer: 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>, + >, + ) -> LabelerViewDetailed<'a> { + LabelerViewDetailed { + cid: self.__unsafe_private_named.0.unwrap(), + creator: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + labels: self.__unsafe_private_named.3, + like_count: self.__unsafe_private_named.4, + policies: self.__unsafe_private_named.5.unwrap(), + reason_types: self.__unsafe_private_named.6, + subject_collections: self.__unsafe_private_named.7, + subject_types: self.__unsafe_private_named.8, + uri: self.__unsafe_private_named.9.unwrap(), + viewer: self.__unsafe_private_named.10, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelerViewDetailed<'a> { + fn nsid() -> &'static str { + "app.bsky.labeler.defs" + } + fn def_name() -> &'static str { + "labelerViewDetailed" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_labeler_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.like_count { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "like_count", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct LabelerViewerState<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub like: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelerViewerState<'a> { + fn nsid() -> &'static str { + "app.bsky.labeler.defs" + } + fn def_name() -> &'static str { + "labelerViewerState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_labeler_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/app_bsky/labeler/get_services.rs b/crates/weaver-api/src/app_bsky/labeler/get_services.rs new file mode 100644 index 0000000..26d30fb --- /dev/null +++ b/crates/weaver-api/src/app_bsky/labeler/get_services.rs @@ -0,0 +1,191 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.labeler.getServices +// +// 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 GetServices<'a> { + /// (default: false) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub detailed: std::option::Option, + #[serde(borrow)] + pub dids: Vec>, +} + +pub mod get_services_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 Dids; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Dids = Unset; + } + ///State transition - sets the `dids` field to Set + pub struct SetDids(PhantomData S>); + impl sealed::Sealed for SetDids {} + impl State for SetDids { + type Dids = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `dids` field + pub struct dids(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetServicesBuilder<'a, S: get_services_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetServices<'a> { + /// Create a new builder for this type + pub fn new() -> GetServicesBuilder<'a, get_services_state::Empty> { + GetServicesBuilder::new() + } +} + +impl<'a> GetServicesBuilder<'a, get_services_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetServicesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_services_state::State> GetServicesBuilder<'a, S> { + /// Set the `detailed` field (optional) + pub fn detailed(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `detailed` field to an Option value (optional) + pub fn maybe_detailed(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> GetServicesBuilder<'a, S> +where + S: get_services_state::State, + S::Dids: get_services_state::IsUnset, +{ + /// Set the `dids` field (required) + pub fn dids( + mut self, + value: impl Into>>, + ) -> GetServicesBuilder<'a, get_services_state::SetDids> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetServicesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetServicesBuilder<'a, S> +where + S: get_services_state::State, + S::Dids: get_services_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetServices<'a> { + GetServices { + detailed: self.__unsafe_private_named.0, + dids: 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 GetServicesOutput<'a> { + #[serde(borrow)] + pub views: Vec>, +} + +#[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 GetServicesOutputViewsItem<'a> { + #[serde(rename = "app.bsky.labeler.defs#labelerView")] + LabelerView(Box>), + #[serde(rename = "app.bsky.labeler.defs#labelerViewDetailed")] + LabelerViewDetailed(Box>), +} + +/// Response type for +///app.bsky.labeler.getServices +pub struct GetServicesResponse; +impl jacquard_common::xrpc::XrpcResp for GetServicesResponse { + const NSID: &'static str = "app.bsky.labeler.getServices"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetServicesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetServices<'a> { + const NSID: &'static str = "app.bsky.labeler.getServices"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetServicesResponse; +} + +/// Endpoint type for +///app.bsky.labeler.getServices +pub struct GetServicesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetServicesRequest { + const PATH: &'static str = "/xrpc/app.bsky.labeler.getServices"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetServices<'de>; + type Response = GetServicesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/labeler/service.rs b/crates/weaver-api/src/app_bsky/labeler/service.rs new file mode 100644 index 0000000..66b897b --- /dev/null +++ b/crates/weaver-api/src/app_bsky/labeler/service.rs @@ -0,0 +1,494 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.labeler.service +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A declaration of the existence of labeler service. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Service<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>, + #[serde(borrow)] + pub policies: crate::app_bsky::labeler::LabelerPolicies<'a>, + /// The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason_types: Option>>, + /// Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_collections: Option>>, + /// The set of subject types (account, record, etc) this service accepts reports on. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_types: Option>>, +} + +pub mod service_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 Policies; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Policies = Unset; + type CreatedAt = Unset; + } + ///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 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 Policies = S::Policies; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `policies` field + pub struct policies(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ServiceBuilder<'a, S: service_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> Service<'a> { + /// Create a new builder for this type + pub fn new() -> ServiceBuilder<'a, service_state::Empty> { + ServiceBuilder::new() + } +} + +impl<'a> ServiceBuilder<'a, service_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ServiceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ServiceBuilder<'a, S> +where + S: service_state::State, + S::CreatedAt: service_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ServiceBuilder<'a, service_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ServiceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: service_state::State> ServiceBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>, + ) -> Self { + 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.1 = value; + self + } +} + +impl<'a, S> ServiceBuilder<'a, S> +where + S: service_state::State, + S::Policies: service_state::IsUnset, +{ + /// Set the `policies` field (required) + pub fn policies( + mut self, + value: impl Into>, + ) -> ServiceBuilder<'a, service_state::SetPolicies> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ServiceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: service_state::State> ServiceBuilder<'a, S> { + /// Set the `reasonTypes` field (optional) + pub fn reason_types( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `reasonTypes` field to an Option value (optional) + pub fn maybe_reason_types( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: service_state::State> ServiceBuilder<'a, S> { + /// Set the `subjectCollections` field (optional) + pub fn subject_collections( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `subjectCollections` field to an Option value (optional) + pub fn maybe_subject_collections( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: service_state::State> ServiceBuilder<'a, S> { + /// Set the `subjectTypes` field (optional) + pub fn subject_types( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `subjectTypes` field to an Option value (optional) + pub fn maybe_subject_types( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> ServiceBuilder<'a, S> +where + S: service_state::State, + S::Policies: service_state::IsSet, + S::CreatedAt: service_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Service<'a> { + Service { + created_at: self.__unsafe_private_named.0.unwrap(), + labels: self.__unsafe_private_named.1, + policies: self.__unsafe_private_named.2.unwrap(), + reason_types: self.__unsafe_private_named.3, + subject_collections: self.__unsafe_private_named.4, + subject_types: self.__unsafe_private_named.5, + 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>, + >, + ) -> Service<'a> { + Service { + created_at: self.__unsafe_private_named.0.unwrap(), + labels: self.__unsafe_private_named.1, + policies: self.__unsafe_private_named.2.unwrap(), + reason_types: self.__unsafe_private_named.3, + subject_collections: self.__unsafe_private_named.4, + subject_types: self.__unsafe_private_named.5, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Service<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ServiceRecord>, + 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 ServiceGetRecordOutput<'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: Service<'a>, +} + +impl From> for Service<'_> { + fn from(output: ServiceGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Service<'_> { + const NSID: &'static str = "app.bsky.labeler.service"; + type Record = ServiceRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ServiceRecord; +impl jacquard_common::xrpc::XrpcResp for ServiceRecord { + const NSID: &'static str = "app.bsky.labeler.service"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ServiceGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ServiceRecord { + const NSID: &'static str = "app.bsky.labeler.service"; + type Record = ServiceRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Service<'a> { + fn nsid() -> &'static str { + "app.bsky.labeler.service" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_labeler_service() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_labeler_service() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.labeler.service"), + 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( + "A declaration of the existence of labeler service.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("policies"), + ::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("labels"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("com.atproto.label.defs#selfLabels") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "policies", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.labeler.defs#labelerPolicies", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "reasonTypes", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.moderation.defs#reasonType", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectCollections", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectTypes", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "The set of subject types (account, record, etc) this service accepts reports on.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.moderation.defs#subjectType", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification.rs b/crates/weaver-api/src/app_bsky/notification.rs new file mode 100644 index 0000000..908c18b --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification.rs @@ -0,0 +1,2079 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod declaration; +pub mod get_preferences; +pub mod get_unread_count; +pub mod list_activity_subscriptions; +pub mod list_notifications; +pub mod put_activity_subscription; +pub mod put_preferences; +pub mod put_preferences_v2; +pub mod register_push; +pub mod unregister_push; +pub mod update_seen; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ActivitySubscription<'a> { + pub post: bool, + pub reply: bool, +} + +pub mod activity_subscription_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 Post; + type Reply; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Post = Unset; + 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 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 `post` field + pub struct post(()); + ///Marker type for the `reply` field + pub struct reply(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ActivitySubscriptionBuilder<'a, S: activity_subscription_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ActivitySubscription<'a> { + /// Create a new builder for this type + pub fn new() -> ActivitySubscriptionBuilder<'a, activity_subscription_state::Empty> { + ActivitySubscriptionBuilder::new() + } +} + +impl<'a> ActivitySubscriptionBuilder<'a, activity_subscription_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ActivitySubscriptionBuilder<'a, S> +where + S: activity_subscription_state::State, + S::Post: activity_subscription_state::IsUnset, +{ + /// Set the `post` field (required) + pub fn post( + mut self, + value: impl Into, + ) -> ActivitySubscriptionBuilder<'a, activity_subscription_state::SetPost> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ActivitySubscriptionBuilder<'a, S> +where + S: activity_subscription_state::State, + S::Reply: activity_subscription_state::IsUnset, +{ + /// Set the `reply` field (required) + pub fn reply( + mut self, + value: impl Into, + ) -> ActivitySubscriptionBuilder<'a, activity_subscription_state::SetReply> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ActivitySubscriptionBuilder<'a, S> +where + S: activity_subscription_state::State, + S::Post: activity_subscription_state::IsSet, + S::Reply: activity_subscription_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ActivitySubscription<'a> { + ActivitySubscription { + post: self.__unsafe_private_named.0.unwrap(), + reply: 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>, + >, + ) -> ActivitySubscription<'a> { + ActivitySubscription { + post: self.__unsafe_private_named.0.unwrap(), + reply: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_notification_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.notification.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("activitySubscription"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("post"), + ::jacquard_common::smol_str::SmolStr::new_static("reply") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("post"), + ::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("reply"), + ::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("chatPreference"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("include"), + ::jacquard_common::smol_str::SmolStr::new_static("push") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("include"), + ::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("push"), + ::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("filterablePreference"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("include"), + ::jacquard_common::smol_str::SmolStr::new_static("list"), + ::jacquard_common::smol_str::SmolStr::new_static("push") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("include"), + ::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("list"), + ::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("push"), + ::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("preference"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("list"), + ::jacquard_common::smol_str::SmolStr::new_static("push") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("list"), + ::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("push"), + ::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("preferences"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("chat"), + ::jacquard_common::smol_str::SmolStr::new_static("follow"), + ::jacquard_common::smol_str::SmolStr::new_static("like"), + ::jacquard_common::smol_str::SmolStr::new_static("likeViaRepost"), + ::jacquard_common::smol_str::SmolStr::new_static("mention"), + ::jacquard_common::smol_str::SmolStr::new_static("quote"), + ::jacquard_common::smol_str::SmolStr::new_static("reply"), + ::jacquard_common::smol_str::SmolStr::new_static("repost"), + ::jacquard_common::smol_str::SmolStr::new_static("repostViaRepost"), + ::jacquard_common::smol_str::SmolStr::new_static("starterpackJoined"), + ::jacquard_common::smol_str::SmolStr::new_static("subscribedPost"), + ::jacquard_common::smol_str::SmolStr::new_static("unverified"), + ::jacquard_common::smol_str::SmolStr::new_static("verified") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("chat"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#chatPreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("follow"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#filterablePreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("like"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#filterablePreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "likeViaRepost", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#filterablePreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("mention"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#filterablePreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("quote"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#filterablePreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reply"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#filterablePreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repost"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#filterablePreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "repostViaRepost", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#filterablePreference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "starterpackJoined", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#preference"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subscribedPost", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#preference"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "unverified", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#preference"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("verified"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#preference"), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("recordDeleted"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectActivitySubscription", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Object used to store activity subscription data in stash.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("activitySubscription") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "activitySubscription", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#activitySubscription", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ActivitySubscription<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.defs" + } + fn def_name() -> &'static str { + "activitySubscription" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_notification_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 ChatPreference<'a> { + #[serde(borrow)] + pub include: jacquard_common::CowStr<'a>, + pub push: bool, +} + +pub mod chat_preference_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 Include; + type Push; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ChatPreferenceBuilder<'a, S: chat_preference_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ChatPreference<'a> { + /// Create a new builder for this type + pub fn new() -> ChatPreferenceBuilder<'a, chat_preference_state::Empty> { + ChatPreferenceBuilder::new() + } +} + +impl<'a> ChatPreferenceBuilder<'a, chat_preference_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ChatPreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ChatPreferenceBuilder<'a, S> +where + S: chat_preference_state::State, + S::Include: chat_preference_state::IsUnset, +{ + /// Set the `include` field (required) + pub fn include( + mut self, + value: impl Into>, + ) -> ChatPreferenceBuilder<'a, chat_preference_state::SetInclude> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ChatPreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ChatPreferenceBuilder<'a, S> +where + S: chat_preference_state::State, + S::Push: chat_preference_state::IsUnset, +{ + /// Set the `push` field (required) + pub fn push( + mut self, + value: impl Into, + ) -> ChatPreferenceBuilder<'a, chat_preference_state::SetPush> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ChatPreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ChatPreferenceBuilder<'a, S> +where + S: chat_preference_state::State, + S::Include: chat_preference_state::IsSet, + S::Push: chat_preference_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ChatPreference<'a> { + ChatPreference { + include: self.__unsafe_private_named.0.unwrap(), + push: 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>, + >, + ) -> ChatPreference<'a> { + ChatPreference { + include: self.__unsafe_private_named.0.unwrap(), + push: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChatPreference<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.defs" + } + fn def_name() -> &'static str { + "chatPreference" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_notification_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 FilterablePreference<'a> { + #[serde(borrow)] + pub include: jacquard_common::CowStr<'a>, + pub list: bool, + pub push: bool, +} + +pub mod filterable_preference_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 Include; + type List; + type Push; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Include = Unset; + type List = 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 List = S::List; + type Push = S::Push; + } + ///State transition - sets the `list` field to Set + pub struct SetList(PhantomData S>); + impl sealed::Sealed for SetList {} + impl State for SetList { + type Include = S::Include; + type List = Set; + type Push = S::Push; + } + ///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 List = S::List; + type Push = 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 `list` field + pub struct list(()); + ///Marker type for the `push` field + pub struct push(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FilterablePreferenceBuilder<'a, S: filterable_preference_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> FilterablePreference<'a> { + /// Create a new builder for this type + pub fn new() -> FilterablePreferenceBuilder<'a, filterable_preference_state::Empty> { + FilterablePreferenceBuilder::new() + } +} + +impl<'a> FilterablePreferenceBuilder<'a, filterable_preference_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FilterablePreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FilterablePreferenceBuilder<'a, S> +where + S: filterable_preference_state::State, + S::Include: filterable_preference_state::IsUnset, +{ + /// Set the `include` field (required) + pub fn include( + mut self, + value: impl Into>, + ) -> FilterablePreferenceBuilder<'a, filterable_preference_state::SetInclude> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FilterablePreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FilterablePreferenceBuilder<'a, S> +where + S: filterable_preference_state::State, + S::List: filterable_preference_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into, + ) -> FilterablePreferenceBuilder<'a, filterable_preference_state::SetList> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FilterablePreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FilterablePreferenceBuilder<'a, S> +where + S: filterable_preference_state::State, + S::Push: filterable_preference_state::IsUnset, +{ + /// Set the `push` field (required) + pub fn push( + mut self, + value: impl Into, + ) -> FilterablePreferenceBuilder<'a, filterable_preference_state::SetPush> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + FilterablePreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FilterablePreferenceBuilder<'a, S> +where + S: filterable_preference_state::State, + S::Include: filterable_preference_state::IsSet, + S::List: filterable_preference_state::IsSet, + S::Push: filterable_preference_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FilterablePreference<'a> { + FilterablePreference { + include: self.__unsafe_private_named.0.unwrap(), + list: self.__unsafe_private_named.1.unwrap(), + push: 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>, + >, + ) -> FilterablePreference<'a> { + FilterablePreference { + include: self.__unsafe_private_named.0.unwrap(), + list: self.__unsafe_private_named.1.unwrap(), + push: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FilterablePreference<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.defs" + } + fn def_name() -> &'static str { + "filterablePreference" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_notification_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 Preference<'a> { + pub list: bool, + pub push: bool, +} + +pub mod preference_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; + type Push; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type List = Unset; + type Push = 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 Push = S::Push; + } + ///State transition - sets the `push` field to Set + pub struct SetPush(PhantomData S>); + impl sealed::Sealed for SetPush {} + impl State for SetPush { + type List = S::List; + type Push = 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 `push` field + pub struct push(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PreferenceBuilder<'a, S: preference_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Preference<'a> { + /// Create a new builder for this type + pub fn new() -> PreferenceBuilder<'a, preference_state::Empty> { + PreferenceBuilder::new() + } +} + +impl<'a> PreferenceBuilder<'a, preference_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferenceBuilder<'a, S> +where + S: preference_state::State, + S::List: preference_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into, + ) -> PreferenceBuilder<'a, preference_state::SetList> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferenceBuilder<'a, S> +where + S: preference_state::State, + S::Push: preference_state::IsUnset, +{ + /// Set the `push` field (required) + pub fn push( + mut self, + value: impl Into, + ) -> PreferenceBuilder<'a, preference_state::SetPush> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PreferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferenceBuilder<'a, S> +where + S: preference_state::State, + S::List: preference_state::IsSet, + S::Push: preference_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Preference<'a> { + Preference { + list: self.__unsafe_private_named.0.unwrap(), + push: 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>, + >, + ) -> Preference<'a> { + Preference { + list: self.__unsafe_private_named.0.unwrap(), + push: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Preference<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.defs" + } + fn def_name() -> &'static str { + "preference" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_notification_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 Preferences<'a> { + #[serde(borrow)] + pub chat: crate::app_bsky::notification::ChatPreference<'a>, + #[serde(borrow)] + pub follow: crate::app_bsky::notification::FilterablePreference<'a>, + #[serde(borrow)] + pub like: crate::app_bsky::notification::FilterablePreference<'a>, + #[serde(borrow)] + pub like_via_repost: crate::app_bsky::notification::FilterablePreference<'a>, + #[serde(borrow)] + pub mention: crate::app_bsky::notification::FilterablePreference<'a>, + #[serde(borrow)] + pub quote: crate::app_bsky::notification::FilterablePreference<'a>, + #[serde(borrow)] + pub reply: crate::app_bsky::notification::FilterablePreference<'a>, + #[serde(borrow)] + pub repost: crate::app_bsky::notification::FilterablePreference<'a>, + #[serde(borrow)] + pub repost_via_repost: crate::app_bsky::notification::FilterablePreference<'a>, + #[serde(borrow)] + pub starterpack_joined: crate::app_bsky::notification::Preference<'a>, + #[serde(borrow)] + pub subscribed_post: crate::app_bsky::notification::Preference<'a>, + #[serde(borrow)] + pub unverified: crate::app_bsky::notification::Preference<'a>, + #[serde(borrow)] + pub verified: crate::app_bsky::notification::Preference<'a>, +} + +pub mod preferences_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 Chat; + type Follow; + type Like; + type LikeViaRepost; + type Mention; + type Quote; + type Reply; + type Repost; + type RepostViaRepost; + type StarterpackJoined; + type SubscribedPost; + type Unverified; + type Verified; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Chat = Unset; + type Follow = Unset; + type Like = Unset; + type LikeViaRepost = Unset; + type Mention = Unset; + type Quote = Unset; + type Reply = Unset; + type Repost = Unset; + type RepostViaRepost = Unset; + type StarterpackJoined = Unset; + type SubscribedPost = Unset; + type Unverified = Unset; + type Verified = Unset; + } + ///State transition - sets the `chat` field to Set + pub struct SetChat(PhantomData S>); + impl sealed::Sealed for SetChat {} + impl State for SetChat { + type Chat = Set; + type Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///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 Follow = Set; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///State transition - sets the `like` field to Set + pub struct SetLike(PhantomData S>); + impl sealed::Sealed for SetLike {} + impl State for SetLike { + type Chat = S::Chat; + type Follow = S::Follow; + type Like = Set; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///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 Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = Set; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///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 Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = Set; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///State transition - sets the `quote` field to Set + pub struct SetQuote(PhantomData S>); + impl sealed::Sealed for SetQuote {} + impl State for SetQuote { + type Chat = S::Chat; + type Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = Set; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///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 Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = Set; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///State transition - sets the `repost` field to Set + pub struct SetRepost(PhantomData S>); + impl sealed::Sealed for SetRepost {} + impl State for SetRepost { + type Chat = S::Chat; + type Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = Set; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///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 Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = Set; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///State transition - sets the `starterpack_joined` field to Set + pub struct SetStarterpackJoined(PhantomData S>); + impl sealed::Sealed for SetStarterpackJoined {} + impl State for SetStarterpackJoined { + type Chat = S::Chat; + type Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = Set; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///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 Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = Set; + type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///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 Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = Set; + type Verified = S::Verified; + } + ///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 Follow = S::Follow; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Mention = S::Mention; + type Quote = S::Quote; + type Reply = S::Reply; + type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type StarterpackJoined = S::StarterpackJoined; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `chat` field + pub struct chat(()); + ///Marker type for the `follow` field + pub struct follow(()); + ///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 `mention` field + pub struct mention(()); + ///Marker type for the `quote` field + pub struct quote(()); + ///Marker type for the `reply` field + pub struct reply(()); + ///Marker type for the `repost` field + pub struct repost(()); + ///Marker type for the `repost_via_repost` field + pub struct repost_via_repost(()); + ///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 `unverified` field + pub struct unverified(()); + ///Marker type for the `verified` field + pub struct verified(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PreferencesBuilder<'a, S: preferences_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> Preferences<'a> { + /// Create a new builder for this type + pub fn new() -> PreferencesBuilder<'a, preferences_state::Empty> { + PreferencesBuilder::new() + } +} + +impl<'a> PreferencesBuilder<'a, preferences_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PreferencesBuilder { + _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> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Chat: preferences_state::IsUnset, +{ + /// Set the `chat` field (required) + pub fn chat( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetChat> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Follow: preferences_state::IsUnset, +{ + /// Set the `follow` field (required) + pub fn follow( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetFollow> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Like: preferences_state::IsUnset, +{ + /// Set the `like` field (required) + pub fn like( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetLike> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::LikeViaRepost: preferences_state::IsUnset, +{ + /// Set the `likeViaRepost` field (required) + pub fn like_via_repost( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetLikeViaRepost> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Mention: preferences_state::IsUnset, +{ + /// Set the `mention` field (required) + pub fn mention( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetMention> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Quote: preferences_state::IsUnset, +{ + /// Set the `quote` field (required) + pub fn quote( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetQuote> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Reply: preferences_state::IsUnset, +{ + /// Set the `reply` field (required) + pub fn reply( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetReply> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Repost: preferences_state::IsUnset, +{ + /// Set the `repost` field (required) + pub fn repost( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetRepost> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::RepostViaRepost: preferences_state::IsUnset, +{ + /// Set the `repostViaRepost` field (required) + pub fn repost_via_repost( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetRepostViaRepost> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::StarterpackJoined: preferences_state::IsUnset, +{ + /// Set the `starterpackJoined` field (required) + pub fn starterpack_joined( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetStarterpackJoined> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::SubscribedPost: preferences_state::IsUnset, +{ + /// Set the `subscribedPost` field (required) + pub fn subscribed_post( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetSubscribedPost> { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Unverified: preferences_state::IsUnset, +{ + /// Set the `unverified` field (required) + pub fn unverified( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetUnverified> { + self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Verified: preferences_state::IsUnset, +{ + /// Set the `verified` field (required) + pub fn verified( + mut self, + value: impl Into>, + ) -> PreferencesBuilder<'a, preferences_state::SetVerified> { + self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); + PreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PreferencesBuilder<'a, S> +where + S: preferences_state::State, + S::Chat: preferences_state::IsSet, + S::Follow: preferences_state::IsSet, + S::Like: preferences_state::IsSet, + S::LikeViaRepost: preferences_state::IsSet, + S::Mention: preferences_state::IsSet, + S::Quote: preferences_state::IsSet, + S::Reply: preferences_state::IsSet, + S::Repost: preferences_state::IsSet, + S::RepostViaRepost: preferences_state::IsSet, + S::StarterpackJoined: preferences_state::IsSet, + S::SubscribedPost: preferences_state::IsSet, + S::Unverified: preferences_state::IsSet, + S::Verified: preferences_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Preferences<'a> { + Preferences { + chat: self.__unsafe_private_named.0.unwrap(), + follow: self.__unsafe_private_named.1.unwrap(), + like: self.__unsafe_private_named.2.unwrap(), + like_via_repost: self.__unsafe_private_named.3.unwrap(), + mention: self.__unsafe_private_named.4.unwrap(), + quote: self.__unsafe_private_named.5.unwrap(), + reply: self.__unsafe_private_named.6.unwrap(), + repost: self.__unsafe_private_named.7.unwrap(), + repost_via_repost: self.__unsafe_private_named.8.unwrap(), + starterpack_joined: self.__unsafe_private_named.9.unwrap(), + subscribed_post: self.__unsafe_private_named.10.unwrap(), + unverified: self.__unsafe_private_named.11.unwrap(), + verified: 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>, + >, + ) -> Preferences<'a> { + Preferences { + chat: self.__unsafe_private_named.0.unwrap(), + follow: self.__unsafe_private_named.1.unwrap(), + like: self.__unsafe_private_named.2.unwrap(), + like_via_repost: self.__unsafe_private_named.3.unwrap(), + mention: self.__unsafe_private_named.4.unwrap(), + quote: self.__unsafe_private_named.5.unwrap(), + reply: self.__unsafe_private_named.6.unwrap(), + repost: self.__unsafe_private_named.7.unwrap(), + repost_via_repost: self.__unsafe_private_named.8.unwrap(), + starterpack_joined: self.__unsafe_private_named.9.unwrap(), + subscribed_post: self.__unsafe_private_named.10.unwrap(), + unverified: self.__unsafe_private_named.11.unwrap(), + verified: self.__unsafe_private_named.12.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Preferences<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.defs" + } + fn def_name() -> &'static str { + "preferences" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_notification_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RecordDeleted<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordDeleted<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.defs" + } + fn def_name() -> &'static str { + "recordDeleted" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_notification_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Object used to store activity subscription data in stash. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SubjectActivitySubscription<'a> { + #[serde(borrow)] + pub activity_subscription: crate::app_bsky::notification::ActivitySubscription<'a>, + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +pub mod subject_activity_subscription_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 ActivitySubscription; + } + /// 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; + } + ///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 `subject` field + pub struct subject(()); + ///Marker type for the `activity_subscription` field + pub struct activity_subscription(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SubjectActivitySubscriptionBuilder< + 'a, + S: subject_activity_subscription_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SubjectActivitySubscription<'a> { + /// Create a new builder for this type + pub fn new() -> SubjectActivitySubscriptionBuilder< + 'a, + subject_activity_subscription_state::Empty, + > { + SubjectActivitySubscriptionBuilder::new() + } +} + +impl< + 'a, +> SubjectActivitySubscriptionBuilder<'a, subject_activity_subscription_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubjectActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectActivitySubscriptionBuilder<'a, S> +where + S: subject_activity_subscription_state::State, + S::ActivitySubscription: subject_activity_subscription_state::IsUnset, +{ + /// Set the `activitySubscription` field (required) + pub fn activity_subscription( + mut self, + value: impl Into>, + ) -> SubjectActivitySubscriptionBuilder< + 'a, + subject_activity_subscription_state::SetActivitySubscription, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SubjectActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectActivitySubscriptionBuilder<'a, S> +where + S: subject_activity_subscription_state::State, + S::Subject: subject_activity_subscription_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> SubjectActivitySubscriptionBuilder< + 'a, + subject_activity_subscription_state::SetSubject, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SubjectActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectActivitySubscriptionBuilder<'a, S> +where + S: subject_activity_subscription_state::State, + S::Subject: subject_activity_subscription_state::IsSet, + S::ActivitySubscription: subject_activity_subscription_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SubjectActivitySubscription<'a> { + SubjectActivitySubscription { + activity_subscription: self.__unsafe_private_named.0.unwrap(), + subject: 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>, + >, + ) -> SubjectActivitySubscription<'a> { + SubjectActivitySubscription { + activity_subscription: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SubjectActivitySubscription<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.defs" + } + fn def_name() -> &'static str { + "subjectActivitySubscription" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_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/app_bsky/notification/declaration.rs b/crates/weaver-api/src/app_bsky/notification/declaration.rs new file mode 100644 index 0000000..32465b6 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/declaration.rs @@ -0,0 +1,266 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.declaration +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A declaration of the user's choices related to notifications that can be produced by them. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Declaration<'a> { + /// A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'. + #[serde(borrow)] + pub allow_subscriptions: jacquard_common::CowStr<'a>, +} + +pub mod declaration_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 AllowSubscriptions; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type AllowSubscriptions = Unset; + } + ///State transition - sets the `allow_subscriptions` field to Set + pub struct SetAllowSubscriptions(PhantomData S>); + impl sealed::Sealed for SetAllowSubscriptions {} + impl State for SetAllowSubscriptions { + type AllowSubscriptions = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `allow_subscriptions` field + pub struct allow_subscriptions(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeclarationBuilder<'a, S: declaration_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Declaration<'a> { + /// Create a new builder for this type + pub fn new() -> DeclarationBuilder<'a, declaration_state::Empty> { + DeclarationBuilder::new() + } +} + +impl<'a> DeclarationBuilder<'a, declaration_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeclarationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeclarationBuilder<'a, S> +where + S: declaration_state::State, + S::AllowSubscriptions: declaration_state::IsUnset, +{ + /// Set the `allowSubscriptions` field (required) + pub fn allow_subscriptions( + mut self, + value: impl Into>, + ) -> DeclarationBuilder<'a, declaration_state::SetAllowSubscriptions> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeclarationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeclarationBuilder<'a, S> +where + S: declaration_state::State, + S::AllowSubscriptions: declaration_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Declaration<'a> { + Declaration { + allow_subscriptions: 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>, + >, + ) -> Declaration<'a> { + Declaration { + allow_subscriptions: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Declaration<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, DeclarationRecord>, + 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 DeclarationGetRecordOutput<'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: Declaration<'a>, +} + +impl From> for Declaration<'_> { + fn from(output: DeclarationGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Declaration<'_> { + const NSID: &'static str = "app.bsky.notification.declaration"; + type Record = DeclarationRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct DeclarationRecord; +impl jacquard_common::xrpc::XrpcResp for DeclarationRecord { + const NSID: &'static str = "app.bsky.notification.declaration"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DeclarationGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for DeclarationRecord { + const NSID: &'static str = "app.bsky.notification.declaration"; + type Record = DeclarationRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Declaration<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.declaration" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_notification_declaration() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_app_bsky_notification_declaration() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.notification.declaration"), + 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( + "A declaration of the user's choices related to notifications that can be produced by them.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("allowSubscriptions") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "allowSubscriptions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'.", + ), + ), + 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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification/get_preferences.rs b/crates/weaver-api/src/app_bsky/notification/get_preferences.rs new file mode 100644 index 0000000..25ae1d9 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/get_preferences.rs @@ -0,0 +1,59 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.getPreferences +// +// 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 GetPreferences; +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPreferencesOutput<'a> { + #[serde(borrow)] + pub preferences: crate::app_bsky::notification::Preferences<'a>, +} + +/// Response type for +///app.bsky.notification.getPreferences +pub struct GetPreferencesResponse; +impl jacquard_common::xrpc::XrpcResp for GetPreferencesResponse { + const NSID: &'static str = "app.bsky.notification.getPreferences"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPreferencesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetPreferences { + const NSID: &'static str = "app.bsky.notification.getPreferences"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPreferencesResponse; +} + +/// Endpoint type for +///app.bsky.notification.getPreferences +pub struct GetPreferencesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetPreferencesRequest { + const PATH: &'static str = "/xrpc/app.bsky.notification.getPreferences"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPreferences; + type Response = GetPreferencesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification/get_unread_count.rs b/crates/weaver-api/src/app_bsky/notification/get_unread_count.rs new file mode 100644 index 0000000..3a1f4cd --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/get_unread_count.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.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 priority: std::option::Option, + #[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, + ::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, None), + } + } +} + +impl GetUnreadCountBuilder { + /// Set the `priority` field (optional) + pub fn priority(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `priority` field to an Option value (optional) + pub fn maybe_priority(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl GetUnreadCountBuilder { + /// Set the `seenAt` field (optional) + pub fn seen_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl GetUnreadCountBuilder +where + S: get_unread_count_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetUnreadCount { + GetUnreadCount { + priority: self.__unsafe_private_named.0, + seen_at: 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 GetUnreadCountOutput<'a> { + pub count: i64, +} + +/// Response type for +///app.bsky.notification.getUnreadCount +pub struct GetUnreadCountResponse; +impl jacquard_common::xrpc::XrpcResp for GetUnreadCountResponse { + const NSID: &'static str = "app.bsky.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 = "app.bsky.notification.getUnreadCount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetUnreadCountResponse; +} + +/// Endpoint type for +///app.bsky.notification.getUnreadCount +pub struct GetUnreadCountRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetUnreadCountRequest { + const PATH: &'static str = "/xrpc/app.bsky.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/app_bsky/notification/list_activity_subscriptions.rs b/crates/weaver-api/src/app_bsky/notification/list_activity_subscriptions.rs new file mode 100644 index 0000000..4d7f0f7 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/list_activity_subscriptions.rs @@ -0,0 +1,171 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.listActivitySubscriptions +// +// 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 ListActivitySubscriptions<'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 list_activity_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 {} + /// 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 ListActivitySubscriptionsBuilder< + 'a, + S: list_activity_subscriptions_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListActivitySubscriptions<'a> { + /// Create a new builder for this type + pub fn new() -> ListActivitySubscriptionsBuilder< + 'a, + list_activity_subscriptions_state::Empty, + > { + ListActivitySubscriptionsBuilder::new() + } +} + +impl<'a> ListActivitySubscriptionsBuilder<'a, list_activity_subscriptions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListActivitySubscriptionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: list_activity_subscriptions_state::State, +> ListActivitySubscriptionsBuilder<'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: list_activity_subscriptions_state::State, +> ListActivitySubscriptionsBuilder<'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> ListActivitySubscriptionsBuilder<'a, S> +where + S: list_activity_subscriptions_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListActivitySubscriptions<'a> { + ListActivitySubscriptions { + 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 ListActivitySubscriptionsOutput<'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 +///app.bsky.notification.listActivitySubscriptions +pub struct ListActivitySubscriptionsResponse; +impl jacquard_common::xrpc::XrpcResp for ListActivitySubscriptionsResponse { + const NSID: &'static str = "app.bsky.notification.listActivitySubscriptions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListActivitySubscriptionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListActivitySubscriptions<'a> { + const NSID: &'static str = "app.bsky.notification.listActivitySubscriptions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListActivitySubscriptionsResponse; +} + +/// Endpoint type for +///app.bsky.notification.listActivitySubscriptions +pub struct ListActivitySubscriptionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListActivitySubscriptionsRequest { + const PATH: &'static str = "/xrpc/app.bsky.notification.listActivitySubscriptions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListActivitySubscriptions<'de>; + type Response = ListActivitySubscriptionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification/list_notifications.rs b/crates/weaver-api/src/app_bsky/notification/list_notifications.rs new file mode 100644 index 0000000..26d77de --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/list_notifications.rs @@ -0,0 +1,942 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.listNotifications +// +// 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 ListNotifications<'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")] + pub priority: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reasons: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub seen_at: std::option::Option, +} + +pub mod list_notifications_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 ListNotificationsBuilder<'a, S: list_notifications_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> ListNotifications<'a> { + /// Create a new builder for this type + pub fn new() -> ListNotificationsBuilder<'a, list_notifications_state::Empty> { + ListNotificationsBuilder::new() + } +} + +impl<'a> ListNotificationsBuilder<'a, list_notifications_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListNotificationsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_notifications_state::State> ListNotificationsBuilder<'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: list_notifications_state::State> ListNotificationsBuilder<'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: list_notifications_state::State> ListNotificationsBuilder<'a, S> { + /// Set the `priority` field (optional) + pub fn priority(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `priority` field to an Option value (optional) + pub fn maybe_priority(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: list_notifications_state::State> ListNotificationsBuilder<'a, S> { + /// Set the `reasons` field (optional) + pub fn reasons( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `reasons` field to an Option value (optional) + pub fn maybe_reasons( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: list_notifications_state::State> ListNotificationsBuilder<'a, S> { + /// Set the `seenAt` field (optional) + pub fn seen_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S> ListNotificationsBuilder<'a, S> +where + S: list_notifications_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListNotifications<'a> { + ListNotifications { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + priority: self.__unsafe_private_named.2, + reasons: self.__unsafe_private_named.3, + seen_at: 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 ListNotificationsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub notifications: Vec< + crate::app_bsky::notification::list_notifications::Notification<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub priority: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub seen_at: std::option::Option, +} + +/// Response type for +///app.bsky.notification.listNotifications +pub struct ListNotificationsResponse; +impl jacquard_common::xrpc::XrpcResp for ListNotificationsResponse { + const NSID: &'static str = "app.bsky.notification.listNotifications"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListNotificationsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListNotifications<'a> { + const NSID: &'static str = "app.bsky.notification.listNotifications"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListNotificationsResponse; +} + +/// Endpoint type for +///app.bsky.notification.listNotifications +pub struct ListNotificationsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListNotificationsRequest { + const PATH: &'static str = "/xrpc/app.bsky.notification.listNotifications"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListNotifications<'de>; + type Response = ListNotificationsResponse; +} + +#[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::app_bsky::actor::ProfileView<'a>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + pub is_read: bool, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + /// The reason why this notification was delivered - e.g. your post was liked, or you received a new follower. + #[serde(borrow)] + pub reason: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason_subject: Option>, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[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 Uri; + type Cid; + type Author; + type Reason; + type Record; + type IsRead; + 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 Cid = Unset; + type Author = Unset; + type Reason = Unset; + type Record = Unset; + type IsRead = 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; + type Cid = S::Cid; + type Author = S::Author; + type Reason = S::Reason; + type Record = S::Record; + type IsRead = S::IsRead; + 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 Cid = Set; + type Author = S::Author; + type Reason = S::Reason; + type Record = S::Record; + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + } + ///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 Cid = S::Cid; + type Author = Set; + type Reason = S::Reason; + type Record = S::Record; + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + type Reason = Set; + type Record = S::Record; + type IsRead = S::IsRead; + 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 Cid = S::Cid; + type Author = S::Author; + type Reason = S::Reason; + type Record = Set; + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `is_read` field to Set + pub struct SetIsRead(PhantomData S>); + impl sealed::Sealed for SetIsRead {} + impl State for SetIsRead { + type Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + type Reason = S::Reason; + type Record = S::Record; + type IsRead = 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 Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + type Reason = S::Reason; + type Record = S::Record; + type IsRead = S::IsRead; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `is_read` field + pub struct is_read(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// 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>, + ::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, + 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: notification_state::State> NotificationBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +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.5 = ::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.6 = 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.6 = value; + self + } +} + +impl<'a, S> NotificationBuilder<'a, S> +where + S: notification_state::State, + S::Record: notification_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> NotificationBuilder<'a, notification_state::SetRecord> { + 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::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.8 = ::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::Uri: notification_state::IsSet, + S::Cid: notification_state::IsSet, + S::Author: notification_state::IsSet, + S::Reason: notification_state::IsSet, + S::Record: notification_state::IsSet, + S::IsRead: notification_state::IsSet, + S::IndexedAt: 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(), + labels: self.__unsafe_private_named.4, + reason: self.__unsafe_private_named.5.unwrap(), + reason_subject: self.__unsafe_private_named.6, + record: 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>, + >, + ) -> 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(), + labels: self.__unsafe_private_named.4, + reason: self.__unsafe_private_named.5.unwrap(), + reason_subject: self.__unsafe_private_named.6, + record: self.__unsafe_private_named.7.unwrap(), + uri: self.__unsafe_private_named.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_notification_listNotifications() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "app.bsky.notification.listNotifications", + ), + 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( + "priority", + ), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reasons"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Array(::jacquard_lexicon::lexicon::LexPrimitiveArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexPrimitiveArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "A reason that matches the reason property of #notification.", + ), + ), + 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, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("seenAt"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notification"), + ::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("author"), + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::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( + "app.bsky.actor.defs#profileView", + ), + }), + ); + 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The reason why this notification was delivered - e.g. your post was liked, or you received a new follower.", + ), + ), + 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( + "reasonSubject", + ), + ::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("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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Notification<'a> { + fn nsid() -> &'static str { + "app.bsky.notification.listNotifications" + } + fn def_name() -> &'static str { + "notification" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_notification_listNotifications() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file 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 new file mode 100644 index 0000000..7e167a9 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs @@ -0,0 +1,227 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.putActivitySubscription +// +// 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 PutActivitySubscription<'a> { + #[serde(borrow)] + pub activity_subscription: crate::app_bsky::notification::ActivitySubscription<'a>, + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +pub mod put_activity_subscription_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 ActivitySubscription; + } + /// 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; + } + ///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 `subject` field + pub struct subject(()); + ///Marker type for the `activity_subscription` field + pub struct activity_subscription(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PutActivitySubscriptionBuilder< + 'a, + S: put_activity_subscription_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PutActivitySubscription<'a> { + /// Create a new builder for this type + pub fn new() -> PutActivitySubscriptionBuilder< + 'a, + put_activity_subscription_state::Empty, + > { + PutActivitySubscriptionBuilder::new() + } +} + +impl<'a> PutActivitySubscriptionBuilder<'a, put_activity_subscription_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PutActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutActivitySubscriptionBuilder<'a, S> +where + S: put_activity_subscription_state::State, + S::ActivitySubscription: put_activity_subscription_state::IsUnset, +{ + /// Set the `activitySubscription` field (required) + pub fn activity_subscription( + mut self, + value: impl Into>, + ) -> PutActivitySubscriptionBuilder< + 'a, + put_activity_subscription_state::SetActivitySubscription, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PutActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutActivitySubscriptionBuilder<'a, S> +where + S: put_activity_subscription_state::State, + S::Subject: put_activity_subscription_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> PutActivitySubscriptionBuilder< + 'a, + put_activity_subscription_state::SetSubject, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PutActivitySubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> PutActivitySubscription<'a> { + PutActivitySubscription { + activity_subscription: self.__unsafe_private_named.0.unwrap(), + subject: 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>, + >, + ) -> PutActivitySubscription<'a> { + PutActivitySubscription { + activity_subscription: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + 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 PutActivitySubscriptionOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub activity_subscription: std::option::Option< + crate::app_bsky::notification::ActivitySubscription<'a>, + >, + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +/// Response type for +///app.bsky.notification.putActivitySubscription +pub struct PutActivitySubscriptionResponse; +impl jacquard_common::xrpc::XrpcResp for PutActivitySubscriptionResponse { + const NSID: &'static str = "app.bsky.notification.putActivitySubscription"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = PutActivitySubscriptionOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for PutActivitySubscription<'a> { + const NSID: &'static str = "app.bsky.notification.putActivitySubscription"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = PutActivitySubscriptionResponse; +} + +/// Endpoint type for +///app.bsky.notification.putActivitySubscription +pub struct PutActivitySubscriptionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for PutActivitySubscriptionRequest { + const PATH: &'static str = "/xrpc/app.bsky.notification.putActivitySubscription"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = PutActivitySubscription<'de>; + type Response = PutActivitySubscriptionResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification/put_preferences.rs b/crates/weaver-api/src/app_bsky/notification/put_preferences.rs new file mode 100644 index 0000000..dbaebf8 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/put_preferences.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.putPreferences +// +// 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 PutPreferences<'a> { + pub priority: bool, +} + +pub mod put_preferences_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 Priority; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Priority = Unset; + } + ///State transition - sets the `priority` field to Set + pub struct SetPriority(PhantomData S>); + impl sealed::Sealed for SetPriority {} + impl State for SetPriority { + type Priority = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `priority` field + pub struct priority(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PutPreferencesBuilder<'a, S: put_preferences_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PutPreferences<'a> { + /// Create a new builder for this type + pub fn new() -> PutPreferencesBuilder<'a, put_preferences_state::Empty> { + PutPreferencesBuilder::new() + } +} + +impl<'a> PutPreferencesBuilder<'a, put_preferences_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PutPreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutPreferencesBuilder<'a, S> +where + S: put_preferences_state::State, + S::Priority: put_preferences_state::IsUnset, +{ + /// Set the `priority` field (required) + pub fn priority( + mut self, + value: impl Into, + ) -> PutPreferencesBuilder<'a, put_preferences_state::SetPriority> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PutPreferencesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutPreferencesBuilder<'a, S> +where + S: put_preferences_state::State, + S::Priority: put_preferences_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PutPreferences<'a> { + PutPreferences { + priority: 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>, + >, + ) -> PutPreferences<'a> { + PutPreferences { + priority: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.notification.putPreferences +pub struct PutPreferencesResponse; +impl jacquard_common::xrpc::XrpcResp for PutPreferencesResponse { + const NSID: &'static str = "app.bsky.notification.putPreferences"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for PutPreferences<'a> { + const NSID: &'static str = "app.bsky.notification.putPreferences"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = PutPreferencesResponse; +} + +/// Endpoint type for +///app.bsky.notification.putPreferences +pub struct PutPreferencesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for PutPreferencesRequest { + const PATH: &'static str = "/xrpc/app.bsky.notification.putPreferences"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = PutPreferences<'de>; + type Response = PutPreferencesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification/put_preferences_v2.rs b/crates/weaver-api/src/app_bsky/notification/put_preferences_v2.rs new file mode 100644 index 0000000..5448e06 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/put_preferences_v2.rs @@ -0,0 +1,126 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.putPreferencesV2 +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct PutPreferencesV2<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub chat: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub follow: std::option::Option< + crate::app_bsky::notification::FilterablePreference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub like: std::option::Option< + crate::app_bsky::notification::FilterablePreference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub like_via_repost: std::option::Option< + crate::app_bsky::notification::FilterablePreference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub mention: std::option::Option< + crate::app_bsky::notification::FilterablePreference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub quote: std::option::Option< + crate::app_bsky::notification::FilterablePreference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reply: std::option::Option< + crate::app_bsky::notification::FilterablePreference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub repost: std::option::Option< + crate::app_bsky::notification::FilterablePreference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub repost_via_repost: std::option::Option< + crate::app_bsky::notification::FilterablePreference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub starterpack_joined: std::option::Option< + crate::app_bsky::notification::Preference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subscribed_post: std::option::Option< + crate::app_bsky::notification::Preference<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub unverified: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verified: std::option::Option>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct PutPreferencesV2Output<'a> { + #[serde(borrow)] + pub preferences: crate::app_bsky::notification::Preferences<'a>, +} + +/// Response type for +///app.bsky.notification.putPreferencesV2 +pub struct PutPreferencesV2Response; +impl jacquard_common::xrpc::XrpcResp for PutPreferencesV2Response { + const NSID: &'static str = "app.bsky.notification.putPreferencesV2"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = PutPreferencesV2Output<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for PutPreferencesV2<'a> { + const NSID: &'static str = "app.bsky.notification.putPreferencesV2"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = PutPreferencesV2Response; +} + +/// Endpoint type for +///app.bsky.notification.putPreferencesV2 +pub struct PutPreferencesV2Request; +impl jacquard_common::xrpc::XrpcEndpoint for PutPreferencesV2Request { + const PATH: &'static str = "/xrpc/app.bsky.notification.putPreferencesV2"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = PutPreferencesV2<'de>; + type Response = PutPreferencesV2Response; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification/register_push.rs b/crates/weaver-api/src/app_bsky/notification/register_push.rs new file mode 100644 index 0000000..c7c8ece --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/register_push.rs @@ -0,0 +1,293 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.registerPush +// +// 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 RegisterPush<'a> { + /// Set to true when the actor is age restricted + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub age_restricted: Option, + #[serde(borrow)] + pub app_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub platform: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub service_did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub token: jacquard_common::CowStr<'a>, +} + +pub mod register_push_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 ServiceDid; + type Token; + type Platform; + type AppId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ServiceDid = Unset; + type Token = Unset; + type Platform = Unset; + type AppId = Unset; + } + ///State transition - sets the `service_did` field to Set + pub struct SetServiceDid(PhantomData S>); + impl sealed::Sealed for SetServiceDid {} + impl State for SetServiceDid { + type ServiceDid = Set; + type Token = S::Token; + type Platform = S::Platform; + type AppId = S::AppId; + } + ///State transition - sets the `token` field to Set + pub struct SetToken(PhantomData S>); + impl sealed::Sealed for SetToken {} + impl State for SetToken { + type ServiceDid = S::ServiceDid; + type Token = Set; + type Platform = S::Platform; + type AppId = S::AppId; + } + ///State transition - sets the `platform` field to Set + pub struct SetPlatform(PhantomData S>); + impl sealed::Sealed for SetPlatform {} + impl State for SetPlatform { + type ServiceDid = S::ServiceDid; + type Token = S::Token; + type Platform = 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 ServiceDid = S::ServiceDid; + type Token = S::Token; + type Platform = S::Platform; + type AppId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `service_did` field + pub struct service_did(()); + ///Marker type for the `token` field + pub struct token(()); + ///Marker type for the `platform` field + pub struct platform(()); + ///Marker type for the `app_id` field + pub struct app_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RegisterPushBuilder<'a, S: register_push_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> RegisterPush<'a> { + /// Create a new builder for this type + pub fn new() -> RegisterPushBuilder<'a, register_push_state::Empty> { + RegisterPushBuilder::new() + } +} + +impl<'a> RegisterPushBuilder<'a, register_push_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RegisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: register_push_state::State> RegisterPushBuilder<'a, S> { + /// Set the `ageRestricted` field (optional) + pub fn age_restricted(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `ageRestricted` field to an Option value (optional) + pub fn maybe_age_restricted(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> RegisterPushBuilder<'a, S> +where + S: register_push_state::State, + S::AppId: register_push_state::IsUnset, +{ + /// Set the `appId` field (required) + pub fn app_id( + mut self, + value: impl Into>, + ) -> RegisterPushBuilder<'a, register_push_state::SetAppId> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RegisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RegisterPushBuilder<'a, S> +where + S: register_push_state::State, + S::Platform: register_push_state::IsUnset, +{ + /// Set the `platform` field (required) + pub fn platform( + mut self, + value: impl Into>, + ) -> RegisterPushBuilder<'a, register_push_state::SetPlatform> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RegisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RegisterPushBuilder<'a, S> +where + S: register_push_state::State, + S::ServiceDid: register_push_state::IsUnset, +{ + /// Set the `serviceDid` field (required) + pub fn service_did( + mut self, + value: impl Into>, + ) -> RegisterPushBuilder<'a, register_push_state::SetServiceDid> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + RegisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RegisterPushBuilder<'a, S> +where + S: register_push_state::State, + S::Token: register_push_state::IsUnset, +{ + /// Set the `token` field (required) + pub fn token( + mut self, + value: impl Into>, + ) -> RegisterPushBuilder<'a, register_push_state::SetToken> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + RegisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RegisterPushBuilder<'a, S> +where + S: register_push_state::State, + S::ServiceDid: register_push_state::IsSet, + S::Token: register_push_state::IsSet, + S::Platform: register_push_state::IsSet, + S::AppId: register_push_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RegisterPush<'a> { + RegisterPush { + age_restricted: self.__unsafe_private_named.0, + app_id: self.__unsafe_private_named.1.unwrap(), + platform: self.__unsafe_private_named.2.unwrap(), + service_did: self.__unsafe_private_named.3.unwrap(), + token: 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>, + >, + ) -> RegisterPush<'a> { + RegisterPush { + age_restricted: self.__unsafe_private_named.0, + app_id: self.__unsafe_private_named.1.unwrap(), + platform: self.__unsafe_private_named.2.unwrap(), + service_did: self.__unsafe_private_named.3.unwrap(), + token: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.notification.registerPush +pub struct RegisterPushResponse; +impl jacquard_common::xrpc::XrpcResp for RegisterPushResponse { + const NSID: &'static str = "app.bsky.notification.registerPush"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RegisterPush<'a> { + const NSID: &'static str = "app.bsky.notification.registerPush"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RegisterPushResponse; +} + +/// Endpoint type for +///app.bsky.notification.registerPush +pub struct RegisterPushRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RegisterPushRequest { + const PATH: &'static str = "/xrpc/app.bsky.notification.registerPush"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RegisterPush<'de>; + type Response = RegisterPushResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs new file mode 100644 index 0000000..75f5382 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs @@ -0,0 +1,274 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.notification.unregisterPush +// +// 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 UnregisterPush<'a> { + #[serde(borrow)] + pub app_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub platform: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub service_did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub token: jacquard_common::CowStr<'a>, +} + +pub mod unregister_push_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 ServiceDid; + type Token; + type Platform; + type AppId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ServiceDid = Unset; + type Token = Unset; + type Platform = Unset; + type AppId = Unset; + } + ///State transition - sets the `service_did` field to Set + pub struct SetServiceDid(PhantomData S>); + impl sealed::Sealed for SetServiceDid {} + impl State for SetServiceDid { + type ServiceDid = Set; + type Token = S::Token; + type Platform = S::Platform; + type AppId = S::AppId; + } + ///State transition - sets the `token` field to Set + pub struct SetToken(PhantomData S>); + impl sealed::Sealed for SetToken {} + impl State for SetToken { + type ServiceDid = S::ServiceDid; + type Token = Set; + type Platform = S::Platform; + type AppId = S::AppId; + } + ///State transition - sets the `platform` field to Set + pub struct SetPlatform(PhantomData S>); + impl sealed::Sealed for SetPlatform {} + impl State for SetPlatform { + type ServiceDid = S::ServiceDid; + type Token = S::Token; + type Platform = 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 ServiceDid = S::ServiceDid; + type Token = S::Token; + type Platform = S::Platform; + type AppId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `service_did` field + pub struct service_did(()); + ///Marker type for the `token` field + pub struct token(()); + ///Marker type for the `platform` field + pub struct platform(()); + ///Marker type for the `app_id` field + pub struct app_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UnregisterPushBuilder<'a, S: unregister_push_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> UnregisterPush<'a> { + /// Create a new builder for this type + pub fn new() -> UnregisterPushBuilder<'a, unregister_push_state::Empty> { + UnregisterPushBuilder::new() + } +} + +impl<'a> UnregisterPushBuilder<'a, unregister_push_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UnregisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnregisterPushBuilder<'a, S> +where + S: unregister_push_state::State, + S::AppId: unregister_push_state::IsUnset, +{ + /// Set the `appId` field (required) + pub fn app_id( + mut self, + value: impl Into>, + ) -> UnregisterPushBuilder<'a, unregister_push_state::SetAppId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UnregisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnregisterPushBuilder<'a, S> +where + S: unregister_push_state::State, + S::Platform: unregister_push_state::IsUnset, +{ + /// Set the `platform` field (required) + pub fn platform( + mut self, + value: impl Into>, + ) -> UnregisterPushBuilder<'a, unregister_push_state::SetPlatform> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UnregisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnregisterPushBuilder<'a, S> +where + S: unregister_push_state::State, + S::ServiceDid: unregister_push_state::IsUnset, +{ + /// Set the `serviceDid` field (required) + pub fn service_did( + mut self, + value: impl Into>, + ) -> UnregisterPushBuilder<'a, unregister_push_state::SetServiceDid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + UnregisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnregisterPushBuilder<'a, S> +where + S: unregister_push_state::State, + S::Token: unregister_push_state::IsUnset, +{ + /// Set the `token` field (required) + pub fn token( + mut self, + value: impl Into>, + ) -> UnregisterPushBuilder<'a, unregister_push_state::SetToken> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + UnregisterPushBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UnregisterPushBuilder<'a, S> +where + S: unregister_push_state::State, + S::ServiceDid: unregister_push_state::IsSet, + S::Token: unregister_push_state::IsSet, + S::Platform: unregister_push_state::IsSet, + S::AppId: unregister_push_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UnregisterPush<'a> { + UnregisterPush { + app_id: self.__unsafe_private_named.0.unwrap(), + platform: self.__unsafe_private_named.1.unwrap(), + service_did: self.__unsafe_private_named.2.unwrap(), + token: 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>, + >, + ) -> UnregisterPush<'a> { + UnregisterPush { + app_id: self.__unsafe_private_named.0.unwrap(), + platform: self.__unsafe_private_named.1.unwrap(), + service_did: self.__unsafe_private_named.2.unwrap(), + token: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///app.bsky.notification.unregisterPush +pub struct UnregisterPushResponse; +impl jacquard_common::xrpc::XrpcResp for UnregisterPushResponse { + const NSID: &'static str = "app.bsky.notification.unregisterPush"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UnregisterPush<'a> { + const NSID: &'static str = "app.bsky.notification.unregisterPush"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UnregisterPushResponse; +} + +/// Endpoint type for +///app.bsky.notification.unregisterPush +pub struct UnregisterPushRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UnregisterPushRequest { + const PATH: &'static str = "/xrpc/app.bsky.notification.unregisterPush"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UnregisterPush<'de>; + type Response = UnregisterPushResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/notification/update_seen.rs b/crates/weaver-api/src/app_bsky/notification/update_seen.rs new file mode 100644 index 0000000..fca5f89 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/notification/update_seen.rs @@ -0,0 +1,156 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.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), + } + } +} + +/// Response type for +///app.bsky.notification.updateSeen +pub struct UpdateSeenResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateSeenResponse { + const NSID: &'static str = "app.bsky.notification.updateSeen"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateSeen<'a> { + const NSID: &'static str = "app.bsky.notification.updateSeen"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateSeenResponse; +} + +/// Endpoint type for +///app.bsky.notification.updateSeen +pub struct UpdateSeenRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateSeenRequest { + const PATH: &'static str = "/xrpc/app.bsky.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/app_bsky/richtext.rs b/crates/weaver-api/src/app_bsky/richtext.rs new file mode 100644 index 0000000..b7b3177 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/richtext.rs @@ -0,0 +1,6 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod facet; \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/richtext/facet.rs b/crates/weaver-api/src/app_bsky/richtext/facet.rs new file mode 100644 index 0000000..46a7337 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/richtext/facet.rs @@ -0,0 +1,956 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.richtext.facet +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ByteSlice<'a> { + pub byte_end: i64, + pub byte_start: i64, +} + +pub mod byte_slice_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 ByteStart; + type ByteEnd; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ByteStart = Unset; + type ByteEnd = Unset; + } + ///State transition - sets the `byte_start` field to Set + pub struct SetByteStart(PhantomData S>); + impl sealed::Sealed for SetByteStart {} + impl State for SetByteStart { + type ByteStart = Set; + type ByteEnd = S::ByteEnd; + } + ///State transition - sets the `byte_end` field to Set + pub struct SetByteEnd(PhantomData S>); + impl sealed::Sealed for SetByteEnd {} + impl State for SetByteEnd { + type ByteStart = S::ByteStart; + type ByteEnd = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `byte_start` field + pub struct byte_start(()); + ///Marker type for the `byte_end` field + pub struct byte_end(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ByteSliceBuilder<'a, S: byte_slice_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ByteSlice<'a> { + /// Create a new builder for this type + pub fn new() -> ByteSliceBuilder<'a, byte_slice_state::Empty> { + ByteSliceBuilder::new() + } +} + +impl<'a> ByteSliceBuilder<'a, byte_slice_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ByteSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ByteSliceBuilder<'a, S> +where + S: byte_slice_state::State, + S::ByteEnd: byte_slice_state::IsUnset, +{ + /// Set the `byteEnd` field (required) + pub fn byte_end( + mut self, + value: impl Into, + ) -> ByteSliceBuilder<'a, byte_slice_state::SetByteEnd> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ByteSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ByteSliceBuilder<'a, S> +where + S: byte_slice_state::State, + S::ByteStart: byte_slice_state::IsUnset, +{ + /// Set the `byteStart` field (required) + pub fn byte_start( + mut self, + value: impl Into, + ) -> ByteSliceBuilder<'a, byte_slice_state::SetByteStart> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ByteSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ByteSliceBuilder<'a, S> +where + S: byte_slice_state::State, + S::ByteStart: byte_slice_state::IsSet, + S::ByteEnd: byte_slice_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ByteSlice<'a> { + ByteSlice { + byte_end: self.__unsafe_private_named.0.unwrap(), + byte_start: 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>, + >, + ) -> ByteSlice<'a> { + ByteSlice { + byte_end: self.__unsafe_private_named.0.unwrap(), + byte_start: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_richtext_facet() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.richtext.facet"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("byteSlice"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("byteStart"), + ::jacquard_common::smol_str::SmolStr::new_static("byteEnd") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("byteEnd"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "byteStart", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("link"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.", + ), + ), + 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("uri"), + ::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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Annotation of a sub-string within rich text.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("index"), + ::jacquard_common::smol_str::SmolStr::new_static("features") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("features"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#mention"), + ::jacquard_common::CowStr::new_static("#link"), + ::jacquard_common::CowStr::new_static("#tag") + ], + closed: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("index"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#byteSlice"), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("mention"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("tag"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("tag")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tag"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ByteSlice<'a> { + fn nsid() -> &'static str { + "app.bsky.richtext.facet" + } + fn def_name() -> &'static str { + "byteSlice" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.byte_end; + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "byte_end", + ), + min: 0i64, + actual: *value, + }); + } + } + { + let value = &self.byte_start; + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "byte_start", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} + +/// Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Link<'a> { + #[serde(borrow)] + pub uri: jacquard_common::types::string::Uri<'a>, +} + +pub mod link_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 LinkBuilder<'a, S: link_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Link<'a> { + /// Create a new builder for this type + pub fn new() -> LinkBuilder<'a, link_state::Empty> { + LinkBuilder::new() + } +} + +impl<'a> LinkBuilder<'a, link_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LinkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LinkBuilder<'a, S> +where + S: link_state::State, + S::Uri: link_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> LinkBuilder<'a, link_state::SetUri> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LinkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LinkBuilder<'a, S> +where + S: link_state::State, + S::Uri: link_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Link<'a> { + Link { + uri: 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>, + >, + ) -> Link<'a> { + Link { + uri: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Link<'a> { + fn nsid() -> &'static str { + "app.bsky.richtext.facet" + } + fn def_name() -> &'static str { + "link" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Annotation of a sub-string within rich text. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Facet<'a> { + #[serde(borrow)] + pub features: Vec>, + #[serde(borrow)] + pub index: crate::app_bsky::richtext::facet::ByteSlice<'a>, +} + +pub mod facet_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 Index; + type Features; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Index = Unset; + 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 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 `index` field + pub struct index(()); + ///Marker type for the `features` field + pub struct features(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FacetBuilder<'a, S: facet_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Facet<'a> { + /// Create a new builder for this type + pub fn new() -> FacetBuilder<'a, facet_state::Empty> { + FacetBuilder::new() + } +} + +impl<'a> FacetBuilder<'a, facet_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FacetBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FacetBuilder<'a, S> +where + S: facet_state::State, + S::Features: facet_state::IsUnset, +{ + /// Set the `features` field (required) + pub fn features( + mut self, + value: impl Into>>, + ) -> FacetBuilder<'a, facet_state::SetFeatures> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FacetBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FacetBuilder<'a, S> +where + S: facet_state::State, + S::Index: facet_state::IsUnset, +{ + /// Set the `index` field (required) + pub fn index( + mut self, + value: impl Into>, + ) -> FacetBuilder<'a, facet_state::SetIndex> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FacetBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FacetBuilder<'a, S> +where + S: facet_state::State, + S::Index: facet_state::IsSet, + S::Features: facet_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Facet<'a> { + Facet { + features: self.__unsafe_private_named.0.unwrap(), + index: 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>, + >, + ) -> Facet<'a> { + Facet { + features: self.__unsafe_private_named.0.unwrap(), + index: self.__unsafe_private_named.1.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 FacetFeaturesItem<'a> { + #[serde(rename = "app.bsky.richtext.facet#mention")] + Mention(Box>), + #[serde(rename = "app.bsky.richtext.facet#link")] + Link(Box>), + #[serde(rename = "app.bsky.richtext.facet#tag")] + Tag(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Facet<'a> { + fn nsid() -> &'static str { + "app.bsky.richtext.facet" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Mention<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod mention_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MentionBuilder<'a, S: mention_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Mention<'a> { + /// Create a new builder for this type + pub fn new() -> MentionBuilder<'a, mention_state::Empty> { + MentionBuilder::new() + } +} + +impl<'a> MentionBuilder<'a, mention_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MentionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MentionBuilder<'a, S> +where + S: mention_state::State, + S::Did: mention_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> MentionBuilder<'a, mention_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MentionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MentionBuilder<'a, S> +where + S: mention_state::State, + S::Did: mention_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Mention<'a> { + Mention { + did: 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>, + >, + ) -> Mention<'a> { + Mention { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Mention<'a> { + fn nsid() -> &'static str { + "app.bsky.richtext.facet" + } + fn def_name() -> &'static str { + "mention" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Tag<'a> { + #[serde(borrow)] + pub tag: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Tag<'a> { + fn nsid() -> &'static str { + "app.bsky.richtext.facet" + } + fn def_name() -> &'static str { + "tag" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.tag; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 640usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "tag", + ), + max: 640usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.tag; + { + 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( + "tag", + ), + max: 64usize, + actual: count, + }); + } + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced.rs b/crates/weaver-api/src/app_bsky/unspecced.rs new file mode 100644 index 0000000..7b159d7 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced.rs @@ -0,0 +1,3057 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_age_assurance_state; +pub mod get_config; +pub mod get_onboarding_suggested_starter_packs; +pub mod get_onboarding_suggested_starter_packs_skeleton; +pub mod get_popular_feed_generators; +pub mod get_post_thread_other_v2; +pub mod get_post_thread_v2; +pub mod get_suggested_feeds; +pub mod get_suggested_feeds_skeleton; +pub mod get_suggested_starter_packs; +pub mod get_suggested_starter_packs_skeleton; +pub mod get_suggested_users; +pub mod get_suggested_users_skeleton; +pub mod get_suggestions_skeleton; +pub mod get_tagged_suggestions; +pub mod get_trending_topics; +pub mod get_trends; +pub mod get_trends_skeleton; +pub mod init_age_assurance; +pub mod search_actors_skeleton; +pub mod search_posts_skeleton; +pub mod search_starter_packs_skeleton; + +/// Object used to store age assurance data in stash. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AgeAssuranceEvent<'a> { + /// The unique identifier for this instance of the age assurance flow, in UUID format. + #[serde(borrow)] + pub attempt_id: jacquard_common::CowStr<'a>, + /// The IP address used when completing the AA flow. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub complete_ip: Option>, + /// The user agent used when completing the AA flow. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub complete_ua: Option>, + /// The date and time of this write operation. + pub created_at: jacquard_common::types::string::Datetime, + /// The email used for AA. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: Option>, + /// The IP address used when initiating the AA flow. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub init_ip: Option>, + /// The user agent used when initiating the AA flow. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub init_ua: Option>, + /// The status of the age assurance process. + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, +} + +pub mod age_assurance_event_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 CreatedAt; + type Status; + 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 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; + 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AgeAssuranceEventBuilder<'a, S: age_assurance_event_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> AgeAssuranceEvent<'a> { + /// Create a new builder for this type + pub fn new() -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> { + AgeAssuranceEventBuilder::new() + } +} + +impl<'a> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AgeAssuranceEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AgeAssuranceEventBuilder<'a, S> +where + S: age_assurance_event_state::State, + S::AttemptId: age_assurance_event_state::IsUnset, +{ + /// Set the `attemptId` field (required) + pub fn attempt_id( + mut self, + value: impl Into>, + ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetAttemptId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AgeAssuranceEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `completeIp` field (optional) + pub fn complete_ip( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `completeIp` field to an Option value (optional) + pub fn maybe_complete_ip( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `completeUa` field (optional) + pub fn complete_ua( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `completeUa` field to an Option value (optional) + pub fn maybe_complete_ua( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> AgeAssuranceEventBuilder<'a, S> +where + S: age_assurance_event_state::State, + S::CreatedAt: age_assurance_event_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetCreatedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + AgeAssuranceEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `email` field (optional) + pub fn email( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `email` field to an Option value (optional) + pub fn maybe_email(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `initIp` field (optional) + pub fn init_ip( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `initIp` field to an Option value (optional) + pub fn maybe_init_ip(mut self, value: Option>) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `initUa` field (optional) + pub fn init_ua( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `initUa` field to an Option value (optional) + pub fn maybe_init_ua(mut self, value: Option>) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> AgeAssuranceEventBuilder<'a, S> +where + S: age_assurance_event_state::State, + S::Status: age_assurance_event_state::IsUnset, +{ + /// Set the `status` field (required) + pub fn status( + mut self, + value: impl Into>, + ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetStatus> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + AgeAssuranceEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> AgeAssuranceEvent<'a> { + AgeAssuranceEvent { + attempt_id: self.__unsafe_private_named.0.unwrap(), + complete_ip: self.__unsafe_private_named.1, + complete_ua: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3.unwrap(), + email: self.__unsafe_private_named.4, + init_ip: self.__unsafe_private_named.5, + init_ua: self.__unsafe_private_named.6, + status: 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>, + >, + ) -> AgeAssuranceEvent<'a> { + AgeAssuranceEvent { + attempt_id: self.__unsafe_private_named.0.unwrap(), + complete_ip: self.__unsafe_private_named.1, + complete_ua: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3.unwrap(), + email: self.__unsafe_private_named.4, + init_ip: self.__unsafe_private_named.5, + init_ua: self.__unsafe_private_named.6, + status: self.__unsafe_private_named.7.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_unspecced_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.unspecced.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("ageAssuranceEvent"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Object used to store age assurance data in stash.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_common::smol_str::SmolStr::new_static("attemptId") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "attemptId", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The unique identifier for this instance of the age assurance flow, in UUID format.", + ), + ), + 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( + "completeIp", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The IP address used when completing the AA flow.", + ), + ), + 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( + "completeUa", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user agent used when completing the AA flow.", + ), + ), + 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( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The date and time of this write operation.", + ), + ), + 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("email"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The email used for AA.", + ), + ), + 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("initIp"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The IP address used when initiating the AA flow.", + ), + ), + 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("initUa"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user agent used when initiating the AA flow.", + ), + ), + 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( + "The status of the age assurance process.", + ), + ), + 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("ageAssuranceState"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "The computed state of the age assurance process, returned to the user in question on certain authenticated requests.", + ), + ), + required: Some( + vec![::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( + "lastInitiatedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The timestamp when this state was last updated.", + ), + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "The status of the age assurance process.", + ), + ), + 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("skeletonSearchActor"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("skeletonSearchPost"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + 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("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( + "skeletonSearchStarterPack", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + 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("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("skeletonTrend"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("topic"), + ::jacquard_common::smol_str::SmolStr::new_static("displayName"), + ::jacquard_common::smol_str::SmolStr::new_static("link"), + ::jacquard_common::smol_str::SmolStr::new_static("startedAt"), + ::jacquard_common::smol_str::SmolStr::new_static("postCount"), + ::jacquard_common::smol_str::SmolStr::new_static("dids") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("category"), + ::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("dids"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "displayName", + ), + ::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("link"), + ::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( + "postCount", + ), + ::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( + "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.insert( + ::jacquard_common::smol_str::SmolStr::new_static("topic"), + ::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("threadItemBlocked"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("author")], + ), + 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( + "app.bsky.feed.defs#blockedAuthor", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "threadItemNoUnauthenticated", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("threadItemNotFound"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("threadItemPost"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("post"), + ::jacquard_common::smol_str::SmolStr::new_static("moreParents"), + ::jacquard_common::smol_str::SmolStr::new_static("moreReplies"), + ::jacquard_common::smol_str::SmolStr::new_static("opThread"), + ::jacquard_common::smol_str::SmolStr::new_static("hiddenByThreadgate"), + ::jacquard_common::smol_str::SmolStr::new_static("mutedByViewer") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "hiddenByThreadgate", + ), + ::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( + "moreParents", + ), + ::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( + "moreReplies", + ), + ::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( + "mutedByViewer", + ), + ::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("opThread"), + ::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("post"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.feed.defs#postView", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("trendView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("topic"), + ::jacquard_common::smol_str::SmolStr::new_static("displayName"), + ::jacquard_common::smol_str::SmolStr::new_static("link"), + ::jacquard_common::smol_str::SmolStr::new_static("startedAt"), + ::jacquard_common::smol_str::SmolStr::new_static("postCount"), + ::jacquard_common::smol_str::SmolStr::new_static("actors") + ], + ), + 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: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileViewBasic", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("category"), + ::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( + "displayName", + ), + ::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("link"), + ::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( + "postCount", + ), + ::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( + "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.insert( + ::jacquard_common::smol_str::SmolStr::new_static("topic"), + ::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("trendingTopic"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("topic"), + ::jacquard_common::smol_str::SmolStr::new_static("link") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::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( + "displayName", + ), + ::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("link"), + ::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("topic"), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AgeAssuranceEvent<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "ageAssuranceEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// The computed state of the age assurance process, returned to the user in question on certain authenticated requests. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AgeAssuranceState<'a> { + /// The timestamp when this state was last updated. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_initiated_at: std::option::Option, + /// The status of the age assurance process. + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AgeAssuranceState<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "ageAssuranceState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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 SkeletonSearchActor<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod skeleton_search_actor_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SkeletonSearchActorBuilder<'a, S: skeleton_search_actor_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SkeletonSearchActor<'a> { + /// Create a new builder for this type + pub fn new() -> SkeletonSearchActorBuilder<'a, skeleton_search_actor_state::Empty> { + SkeletonSearchActorBuilder::new() + } +} + +impl<'a> SkeletonSearchActorBuilder<'a, skeleton_search_actor_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SkeletonSearchActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonSearchActorBuilder<'a, S> +where + S: skeleton_search_actor_state::State, + S::Did: skeleton_search_actor_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> SkeletonSearchActorBuilder<'a, skeleton_search_actor_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SkeletonSearchActorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonSearchActorBuilder<'a, S> +where + S: skeleton_search_actor_state::State, + S::Did: skeleton_search_actor_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SkeletonSearchActor<'a> { + SkeletonSearchActor { + did: 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>, + >, + ) -> SkeletonSearchActor<'a> { + SkeletonSearchActor { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SkeletonSearchActor<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "skeletonSearchActor" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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 SkeletonSearchPost<'a> { + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod skeleton_search_post_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 SkeletonSearchPostBuilder<'a, S: skeleton_search_post_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SkeletonSearchPost<'a> { + /// Create a new builder for this type + pub fn new() -> SkeletonSearchPostBuilder<'a, skeleton_search_post_state::Empty> { + SkeletonSearchPostBuilder::new() + } +} + +impl<'a> SkeletonSearchPostBuilder<'a, skeleton_search_post_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SkeletonSearchPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonSearchPostBuilder<'a, S> +where + S: skeleton_search_post_state::State, + S::Uri: skeleton_search_post_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> SkeletonSearchPostBuilder<'a, skeleton_search_post_state::SetUri> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SkeletonSearchPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonSearchPostBuilder<'a, S> +where + S: skeleton_search_post_state::State, + S::Uri: skeleton_search_post_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SkeletonSearchPost<'a> { + SkeletonSearchPost { + uri: 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>, + >, + ) -> SkeletonSearchPost<'a> { + SkeletonSearchPost { + uri: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SkeletonSearchPost<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "skeletonSearchPost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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 SkeletonSearchStarterPack<'a> { + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod skeleton_search_starter_pack_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 SkeletonSearchStarterPackBuilder< + 'a, + S: skeleton_search_starter_pack_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SkeletonSearchStarterPack<'a> { + /// Create a new builder for this type + pub fn new() -> SkeletonSearchStarterPackBuilder< + 'a, + skeleton_search_starter_pack_state::Empty, + > { + SkeletonSearchStarterPackBuilder::new() + } +} + +impl< + 'a, +> SkeletonSearchStarterPackBuilder<'a, skeleton_search_starter_pack_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SkeletonSearchStarterPackBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonSearchStarterPackBuilder<'a, S> +where + S: skeleton_search_starter_pack_state::State, + S::Uri: skeleton_search_starter_pack_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> SkeletonSearchStarterPackBuilder< + 'a, + skeleton_search_starter_pack_state::SetUri, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SkeletonSearchStarterPackBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonSearchStarterPackBuilder<'a, S> +where + S: skeleton_search_starter_pack_state::State, + S::Uri: skeleton_search_starter_pack_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SkeletonSearchStarterPack<'a> { + SkeletonSearchStarterPack { + uri: 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>, + >, + ) -> SkeletonSearchStarterPack<'a> { + SkeletonSearchStarterPack { + uri: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SkeletonSearchStarterPack<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "skeletonSearchStarterPack" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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 SkeletonTrend<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub category: Option>, + #[serde(borrow)] + pub dids: Vec>, + #[serde(borrow)] + pub display_name: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub link: jacquard_common::CowStr<'a>, + pub post_count: i64, + pub started_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + #[serde(borrow)] + pub topic: jacquard_common::CowStr<'a>, +} + +pub mod skeleton_trend_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 Topic; + type DisplayName; + type Link; + type StartedAt; + type PostCount; + type Dids; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Topic = Unset; + type DisplayName = Unset; + type Link = Unset; + type StartedAt = Unset; + type PostCount = Unset; + type Dids = 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 DisplayName = S::DisplayName; + type Link = S::Link; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + type Dids = S::Dids; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type Topic = S::Topic; + type DisplayName = Set; + type Link = S::Link; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + type Dids = S::Dids; + } + ///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 DisplayName = S::DisplayName; + type Link = Set; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + type Dids = S::Dids; + } + ///State transition - sets the `started_at` field to Set + pub struct SetStartedAt(PhantomData S>); + impl sealed::Sealed for SetStartedAt {} + impl State for SetStartedAt { + type Topic = S::Topic; + type DisplayName = S::DisplayName; + type Link = S::Link; + type StartedAt = Set; + type PostCount = S::PostCount; + type Dids = S::Dids; + } + ///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; + type DisplayName = S::DisplayName; + type Link = S::Link; + type StartedAt = S::StartedAt; + type PostCount = Set; + type Dids = S::Dids; + } + ///State transition - sets the `dids` field to Set + pub struct SetDids(PhantomData S>); + impl sealed::Sealed for SetDids {} + impl State for SetDids { + type Topic = S::Topic; + type DisplayName = S::DisplayName; + type Link = S::Link; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + type Dids = 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 `display_name` field + pub struct display_name(()); + ///Marker type for the `link` field + pub struct link(()); + ///Marker type for the `started_at` field + pub struct started_at(()); + ///Marker type for the `post_count` field + pub struct post_count(()); + ///Marker type for the `dids` field + pub struct dids(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SkeletonTrendBuilder<'a, S: skeleton_trend_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> SkeletonTrend<'a> { + /// Create a new builder for this type + pub fn new() -> SkeletonTrendBuilder<'a, skeleton_trend_state::Empty> { + SkeletonTrendBuilder::new() + } +} + +impl<'a> SkeletonTrendBuilder<'a, skeleton_trend_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SkeletonTrendBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: skeleton_trend_state::State> SkeletonTrendBuilder<'a, S> { + /// Set the `category` field (optional) + pub fn category( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `category` field to an Option value (optional) + pub fn maybe_category(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> SkeletonTrendBuilder<'a, S> +where + S: skeleton_trend_state::State, + S::Dids: skeleton_trend_state::IsUnset, +{ + /// Set the `dids` field (required) + pub fn dids( + mut self, + value: impl Into>>, + ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetDids> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SkeletonTrendBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonTrendBuilder<'a, S> +where + S: skeleton_trend_state::State, + S::DisplayName: skeleton_trend_state::IsUnset, +{ + /// Set the `displayName` field (required) + pub fn display_name( + mut self, + value: impl Into>, + ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetDisplayName> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SkeletonTrendBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonTrendBuilder<'a, S> +where + S: skeleton_trend_state::State, + S::Link: skeleton_trend_state::IsUnset, +{ + /// Set the `link` field (required) + pub fn link( + mut self, + value: impl Into>, + ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetLink> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + SkeletonTrendBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonTrendBuilder<'a, S> +where + S: skeleton_trend_state::State, + S::PostCount: skeleton_trend_state::IsUnset, +{ + /// Set the `postCount` field (required) + pub fn post_count( + mut self, + value: impl Into, + ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetPostCount> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + SkeletonTrendBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonTrendBuilder<'a, S> +where + S: skeleton_trend_state::State, + S::StartedAt: skeleton_trend_state::IsUnset, +{ + /// Set the `startedAt` field (required) + pub fn started_at( + mut self, + value: impl Into, + ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetStartedAt> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + SkeletonTrendBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: skeleton_trend_state::State> SkeletonTrendBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = 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.6 = value; + self + } +} + +impl<'a, S> SkeletonTrendBuilder<'a, S> +where + S: skeleton_trend_state::State, + S::Topic: skeleton_trend_state::IsUnset, +{ + /// Set the `topic` field (required) + pub fn topic( + mut self, + value: impl Into>, + ) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetTopic> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + SkeletonTrendBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SkeletonTrendBuilder<'a, S> +where + S: skeleton_trend_state::State, + S::Topic: skeleton_trend_state::IsSet, + S::DisplayName: skeleton_trend_state::IsSet, + S::Link: skeleton_trend_state::IsSet, + S::StartedAt: skeleton_trend_state::IsSet, + S::PostCount: skeleton_trend_state::IsSet, + S::Dids: skeleton_trend_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SkeletonTrend<'a> { + SkeletonTrend { + category: self.__unsafe_private_named.0, + dids: self.__unsafe_private_named.1.unwrap(), + display_name: self.__unsafe_private_named.2.unwrap(), + link: self.__unsafe_private_named.3.unwrap(), + post_count: self.__unsafe_private_named.4.unwrap(), + started_at: self.__unsafe_private_named.5.unwrap(), + status: self.__unsafe_private_named.6, + topic: 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>, + >, + ) -> SkeletonTrend<'a> { + SkeletonTrend { + category: self.__unsafe_private_named.0, + dids: self.__unsafe_private_named.1.unwrap(), + display_name: self.__unsafe_private_named.2.unwrap(), + link: self.__unsafe_private_named.3.unwrap(), + post_count: self.__unsafe_private_named.4.unwrap(), + started_at: self.__unsafe_private_named.5.unwrap(), + status: self.__unsafe_private_named.6, + topic: self.__unsafe_private_named.7.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SkeletonTrend<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "skeletonTrend" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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 ThreadItemBlocked<'a> { + #[serde(borrow)] + pub author: crate::app_bsky::feed::BlockedAuthor<'a>, +} + +pub mod thread_item_blocked_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 Author; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Author = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `author` field + pub struct author(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ThreadItemBlockedBuilder<'a, S: thread_item_blocked_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ThreadItemBlocked<'a> { + /// Create a new builder for this type + pub fn new() -> ThreadItemBlockedBuilder<'a, thread_item_blocked_state::Empty> { + ThreadItemBlockedBuilder::new() + } +} + +impl<'a> ThreadItemBlockedBuilder<'a, thread_item_blocked_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ThreadItemBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemBlockedBuilder<'a, S> +where + S: thread_item_blocked_state::State, + S::Author: thread_item_blocked_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> ThreadItemBlockedBuilder<'a, thread_item_blocked_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ThreadItemBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemBlockedBuilder<'a, S> +where + S: thread_item_blocked_state::State, + S::Author: thread_item_blocked_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ThreadItemBlocked<'a> { + ThreadItemBlocked { + author: 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>, + >, + ) -> ThreadItemBlocked<'a> { + ThreadItemBlocked { + author: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadItemBlocked<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "threadItemBlocked" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ThreadItemNoUnauthenticated<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadItemNoUnauthenticated<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "threadItemNoUnauthenticated" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ThreadItemNotFound<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadItemNotFound<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "threadItemNotFound" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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 ThreadItemPost<'a> { + /// The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread. + pub hidden_by_threadgate: bool, + /// This post has more parents that were not present in the response. This is just a boolean, without the number of parents. + pub more_parents: bool, + /// This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate. + pub more_replies: i64, + /// This is by an account muted by the viewer requesting it. + pub muted_by_viewer: bool, + /// This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread. + pub op_thread: bool, + #[serde(borrow)] + pub post: crate::app_bsky::feed::PostView<'a>, +} + +pub mod thread_item_post_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 Post; + type MoreParents; + type MoreReplies; + type OpThread; + type HiddenByThreadgate; + type MutedByViewer; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Post = Unset; + type MoreParents = Unset; + type MoreReplies = Unset; + type OpThread = Unset; + type HiddenByThreadgate = Unset; + type MutedByViewer = Unset; + } + ///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 MoreParents = S::MoreParents; + type MoreReplies = S::MoreReplies; + type OpThread = S::OpThread; + type HiddenByThreadgate = S::HiddenByThreadgate; + 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 Post = S::Post; + type MoreParents = Set; + type MoreReplies = S::MoreReplies; + type OpThread = S::OpThread; + type HiddenByThreadgate = S::HiddenByThreadgate; + 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 Post = S::Post; + type MoreParents = S::MoreParents; + type MoreReplies = Set; + type OpThread = S::OpThread; + type HiddenByThreadgate = S::HiddenByThreadgate; + 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 MoreParents = S::MoreParents; + type MoreReplies = S::MoreReplies; + type OpThread = Set; + type HiddenByThreadgate = S::HiddenByThreadgate; + 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 MoreParents = S::MoreParents; + type MoreReplies = S::MoreReplies; + type OpThread = S::OpThread; + type HiddenByThreadgate = Set; + type MutedByViewer = S::MutedByViewer; + } + ///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 MoreParents = S::MoreParents; + type MoreReplies = S::MoreReplies; + type OpThread = S::OpThread; + type HiddenByThreadgate = S::HiddenByThreadgate; + type MutedByViewer = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `post` field + pub struct post(()); + ///Marker type for the `more_parents` field + pub struct more_parents(()); + ///Marker type for the `more_replies` field + pub struct more_replies(()); + ///Marker type for the `op_thread` field + pub struct op_thread(()); + ///Marker type for the `hidden_by_threadgate` field + pub struct hidden_by_threadgate(()); + ///Marker type for the `muted_by_viewer` field + pub struct muted_by_viewer(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ThreadItemPostBuilder<'a, S: thread_item_post_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> ThreadItemPost<'a> { + /// Create a new builder for this type + pub fn new() -> ThreadItemPostBuilder<'a, thread_item_post_state::Empty> { + ThreadItemPostBuilder::new() + } +} + +impl<'a> ThreadItemPostBuilder<'a, thread_item_post_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ThreadItemPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemPostBuilder<'a, S> +where + S: thread_item_post_state::State, + S::HiddenByThreadgate: thread_item_post_state::IsUnset, +{ + /// Set the `hiddenByThreadgate` field (required) + pub fn hidden_by_threadgate( + mut self, + value: impl Into, + ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetHiddenByThreadgate> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ThreadItemPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemPostBuilder<'a, S> +where + S: thread_item_post_state::State, + S::MoreParents: thread_item_post_state::IsUnset, +{ + /// Set the `moreParents` field (required) + pub fn more_parents( + mut self, + value: impl Into, + ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMoreParents> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ThreadItemPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemPostBuilder<'a, S> +where + S: thread_item_post_state::State, + S::MoreReplies: thread_item_post_state::IsUnset, +{ + /// Set the `moreReplies` field (required) + pub fn more_replies( + mut self, + value: impl Into, + ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMoreReplies> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ThreadItemPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemPostBuilder<'a, S> +where + S: thread_item_post_state::State, + S::MutedByViewer: thread_item_post_state::IsUnset, +{ + /// Set the `mutedByViewer` field (required) + pub fn muted_by_viewer( + mut self, + value: impl Into, + ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMutedByViewer> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ThreadItemPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemPostBuilder<'a, S> +where + S: thread_item_post_state::State, + S::OpThread: thread_item_post_state::IsUnset, +{ + /// Set the `opThread` field (required) + pub fn op_thread( + mut self, + value: impl Into, + ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetOpThread> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ThreadItemPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemPostBuilder<'a, S> +where + S: thread_item_post_state::State, + S::Post: thread_item_post_state::IsUnset, +{ + /// Set the `post` field (required) + pub fn post( + mut self, + value: impl Into>, + ) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetPost> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + ThreadItemPostBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemPostBuilder<'a, S> +where + S: thread_item_post_state::State, + S::Post: thread_item_post_state::IsSet, + S::MoreParents: thread_item_post_state::IsSet, + S::MoreReplies: thread_item_post_state::IsSet, + S::OpThread: thread_item_post_state::IsSet, + S::HiddenByThreadgate: thread_item_post_state::IsSet, + S::MutedByViewer: thread_item_post_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ThreadItemPost<'a> { + ThreadItemPost { + hidden_by_threadgate: self.__unsafe_private_named.0.unwrap(), + more_parents: self.__unsafe_private_named.1.unwrap(), + more_replies: self.__unsafe_private_named.2.unwrap(), + muted_by_viewer: self.__unsafe_private_named.3.unwrap(), + op_thread: self.__unsafe_private_named.4.unwrap(), + post: 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>, + >, + ) -> ThreadItemPost<'a> { + ThreadItemPost { + hidden_by_threadgate: self.__unsafe_private_named.0.unwrap(), + more_parents: self.__unsafe_private_named.1.unwrap(), + more_replies: self.__unsafe_private_named.2.unwrap(), + muted_by_viewer: self.__unsafe_private_named.3.unwrap(), + op_thread: self.__unsafe_private_named.4.unwrap(), + post: self.__unsafe_private_named.5.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadItemPost<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "threadItemPost" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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 TrendView<'a> { + #[serde(borrow)] + pub actors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub category: Option>, + #[serde(borrow)] + pub display_name: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub link: jacquard_common::CowStr<'a>, + pub post_count: i64, + pub started_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + #[serde(borrow)] + pub topic: jacquard_common::CowStr<'a>, +} + +pub mod trend_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 Topic; + type DisplayName; + type Link; + type StartedAt; + type PostCount; + type Actors; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Topic = Unset; + type DisplayName = Unset; + type Link = Unset; + type StartedAt = Unset; + type PostCount = 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 DisplayName = S::DisplayName; + type Link = S::Link; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + type Actors = S::Actors; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type Topic = S::Topic; + type DisplayName = Set; + type Link = S::Link; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + 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 DisplayName = S::DisplayName; + type Link = Set; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + type Actors = S::Actors; + } + ///State transition - sets the `started_at` field to Set + pub struct SetStartedAt(PhantomData S>); + impl sealed::Sealed for SetStartedAt {} + impl State for SetStartedAt { + type Topic = S::Topic; + type DisplayName = S::DisplayName; + type Link = S::Link; + type StartedAt = Set; + type PostCount = S::PostCount; + 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; + type DisplayName = S::DisplayName; + type Link = S::Link; + type StartedAt = S::StartedAt; + type PostCount = Set; + type Actors = S::Actors; + } + ///State transition - sets the `actors` field to Set + pub struct SetActors(PhantomData S>); + impl sealed::Sealed for SetActors {} + impl State for SetActors { + type Topic = S::Topic; + type DisplayName = S::DisplayName; + type Link = S::Link; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + 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 `display_name` field + pub struct display_name(()); + ///Marker type for the `link` field + pub struct link(()); + ///Marker type for the `started_at` field + pub struct started_at(()); + ///Marker type for the `post_count` field + pub struct post_count(()); + ///Marker type for the `actors` field + pub struct actors(()); + } +} + +/// Builder for constructing an instance of this type +pub struct TrendViewBuilder<'a, S: trend_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> TrendView<'a> { + /// Create a new builder for this type + pub fn new() -> TrendViewBuilder<'a, trend_view_state::Empty> { + TrendViewBuilder::new() + } +} + +impl<'a> TrendViewBuilder<'a, trend_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + TrendViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TrendViewBuilder<'a, S> +where + S: trend_view_state::State, + S::Actors: trend_view_state::IsUnset, +{ + /// Set the `actors` field (required) + pub fn actors( + mut self, + value: impl Into>>, + ) -> TrendViewBuilder<'a, trend_view_state::SetActors> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + TrendViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: trend_view_state::State> TrendViewBuilder<'a, S> { + /// Set the `category` field (optional) + pub fn category( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `category` field to an Option value (optional) + pub fn maybe_category(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> TrendViewBuilder<'a, S> +where + S: trend_view_state::State, + S::DisplayName: trend_view_state::IsUnset, +{ + /// Set the `displayName` field (required) + pub fn display_name( + mut self, + value: impl Into>, + ) -> TrendViewBuilder<'a, trend_view_state::SetDisplayName> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + TrendViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TrendViewBuilder<'a, S> +where + S: trend_view_state::State, + S::Link: trend_view_state::IsUnset, +{ + /// Set the `link` field (required) + pub fn link( + mut self, + value: impl Into>, + ) -> TrendViewBuilder<'a, trend_view_state::SetLink> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + TrendViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TrendViewBuilder<'a, S> +where + S: trend_view_state::State, + S::PostCount: trend_view_state::IsUnset, +{ + /// Set the `postCount` field (required) + pub fn post_count( + mut self, + value: impl Into, + ) -> TrendViewBuilder<'a, trend_view_state::SetPostCount> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + TrendViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TrendViewBuilder<'a, S> +where + S: trend_view_state::State, + S::StartedAt: trend_view_state::IsUnset, +{ + /// Set the `startedAt` field (required) + pub fn started_at( + mut self, + value: impl Into, + ) -> TrendViewBuilder<'a, trend_view_state::SetStartedAt> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + TrendViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: trend_view_state::State> TrendViewBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = 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.6 = value; + self + } +} + +impl<'a, S> TrendViewBuilder<'a, S> +where + S: trend_view_state::State, + S::Topic: trend_view_state::IsUnset, +{ + /// Set the `topic` field (required) + pub fn topic( + mut self, + value: impl Into>, + ) -> TrendViewBuilder<'a, trend_view_state::SetTopic> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + TrendViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TrendViewBuilder<'a, S> +where + S: trend_view_state::State, + S::Topic: trend_view_state::IsSet, + S::DisplayName: trend_view_state::IsSet, + S::Link: trend_view_state::IsSet, + S::StartedAt: trend_view_state::IsSet, + S::PostCount: trend_view_state::IsSet, + S::Actors: trend_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> TrendView<'a> { + TrendView { + actors: self.__unsafe_private_named.0.unwrap(), + category: self.__unsafe_private_named.1, + display_name: self.__unsafe_private_named.2.unwrap(), + link: self.__unsafe_private_named.3.unwrap(), + post_count: self.__unsafe_private_named.4.unwrap(), + started_at: self.__unsafe_private_named.5.unwrap(), + status: self.__unsafe_private_named.6, + topic: 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>, + >, + ) -> TrendView<'a> { + TrendView { + actors: self.__unsafe_private_named.0.unwrap(), + category: self.__unsafe_private_named.1, + display_name: self.__unsafe_private_named.2.unwrap(), + link: self.__unsafe_private_named.3.unwrap(), + post_count: self.__unsafe_private_named.4.unwrap(), + started_at: self.__unsafe_private_named.5.unwrap(), + status: self.__unsafe_private_named.6, + topic: self.__unsafe_private_named.7.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TrendView<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "trendView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct TrendingTopic<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: std::option::Option>, + #[serde(borrow)] + pub link: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub topic: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TrendingTopic<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.defs" + } + fn def_name() -> &'static str { + "trendingTopic" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_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/app_bsky/unspecced/get_age_assurance_state.rs b/crates/weaver-api/src/app_bsky/unspecced/get_age_assurance_state.rs new file mode 100644 index 0000000..4ed7423 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_age_assurance_state.rs @@ -0,0 +1,61 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getAgeAssuranceState +// +// 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 GetAgeAssuranceStateOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::app_bsky::unspecced::AgeAssuranceState<'a>, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct GetAgeAssuranceState; +/// Response type for +///app.bsky.unspecced.getAgeAssuranceState +pub struct GetAgeAssuranceStateResponse; +impl jacquard_common::xrpc::XrpcResp for GetAgeAssuranceStateResponse { + const NSID: &'static str = "app.bsky.unspecced.getAgeAssuranceState"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetAgeAssuranceStateOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetAgeAssuranceState { + const NSID: &'static str = "app.bsky.unspecced.getAgeAssuranceState"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetAgeAssuranceStateResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getAgeAssuranceState +pub struct GetAgeAssuranceStateRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetAgeAssuranceStateRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getAgeAssuranceState"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetAgeAssuranceState; + type Response = GetAgeAssuranceStateResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_config.rs b/crates/weaver-api/src/app_bsky/unspecced/get_config.rs new file mode 100644 index 0000000..93b7596 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_config.rs @@ -0,0 +1,320 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getConfig +// +// 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 LiveNowConfig<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub domains: Vec>, +} + +pub mod live_now_config_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 Did; + type Domains; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + 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 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 `did` field + pub struct did(()); + ///Marker type for the `domains` field + pub struct domains(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LiveNowConfigBuilder<'a, S: live_now_config_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> LiveNowConfig<'a> { + /// Create a new builder for this type + pub fn new() -> LiveNowConfigBuilder<'a, live_now_config_state::Empty> { + LiveNowConfigBuilder::new() + } +} + +impl<'a> LiveNowConfigBuilder<'a, live_now_config_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LiveNowConfigBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LiveNowConfigBuilder<'a, S> +where + S: live_now_config_state::State, + S::Did: live_now_config_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> LiveNowConfigBuilder<'a, live_now_config_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LiveNowConfigBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LiveNowConfigBuilder<'a, S> +where + S: live_now_config_state::State, + S::Domains: live_now_config_state::IsUnset, +{ + /// Set the `domains` field (required) + pub fn domains( + mut self, + value: impl Into>>, + ) -> LiveNowConfigBuilder<'a, live_now_config_state::SetDomains> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LiveNowConfigBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LiveNowConfigBuilder<'a, S> +where + S: live_now_config_state::State, + S::Did: live_now_config_state::IsSet, + S::Domains: live_now_config_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LiveNowConfig<'a> { + LiveNowConfig { + did: self.__unsafe_private_named.0.unwrap(), + domains: 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>, + >, + ) -> LiveNowConfig<'a> { + LiveNowConfig { + did: self.__unsafe_private_named.0.unwrap(), + domains: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_unspecced_getConfig() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.unspecced.getConfig"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("liveNowConfig"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("domains") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("domains"), + ::jacquard_lexicon::lexicon::LexObjectProperty::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: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { + description: None, + parameters: None, + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LiveNowConfig<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.getConfig" + } + fn def_name() -> &'static str { + "liveNowConfig" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_getConfig() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct GetConfigOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub check_email_confirmed: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub live_now: std::option::Option< + Vec>, + >, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct GetConfig; +/// Response type for +///app.bsky.unspecced.getConfig +pub struct GetConfigResponse; +impl jacquard_common::xrpc::XrpcResp for GetConfigResponse { + const NSID: &'static str = "app.bsky.unspecced.getConfig"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetConfigOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetConfig { + const NSID: &'static str = "app.bsky.unspecced.getConfig"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetConfigResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getConfig +pub struct GetConfigRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetConfigRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getConfig"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetConfig; + type Response = GetConfigResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs.rs b/crates/weaver-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs.rs new file mode 100644 index 0000000..2583060 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs.rs @@ -0,0 +1,139 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getOnboardingSuggestedStarterPacks +// +// 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 GetOnboardingSuggestedStarterPacks { + ///(default: 10, min: 1, max: 25) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_onboarding_suggested_starter_packs_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 GetOnboardingSuggestedStarterPacksBuilder< + S: get_onboarding_suggested_starter_packs_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl GetOnboardingSuggestedStarterPacks { + /// Create a new builder for this type + pub fn new() -> GetOnboardingSuggestedStarterPacksBuilder< + get_onboarding_suggested_starter_packs_state::Empty, + > { + GetOnboardingSuggestedStarterPacksBuilder::new() + } +} + +impl GetOnboardingSuggestedStarterPacksBuilder< + get_onboarding_suggested_starter_packs_state::Empty, +> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetOnboardingSuggestedStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl< + S: get_onboarding_suggested_starter_packs_state::State, +> GetOnboardingSuggestedStarterPacksBuilder { + /// 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 GetOnboardingSuggestedStarterPacksBuilder +where + S: get_onboarding_suggested_starter_packs_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetOnboardingSuggestedStarterPacks { + GetOnboardingSuggestedStarterPacks { + 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 GetOnboardingSuggestedStarterPacksOutput<'a> { + #[serde(borrow)] + pub starter_packs: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getOnboardingSuggestedStarterPacks +pub struct GetOnboardingSuggestedStarterPacksResponse; +impl jacquard_common::xrpc::XrpcResp for GetOnboardingSuggestedStarterPacksResponse { + const NSID: &'static str = "app.bsky.unspecced.getOnboardingSuggestedStarterPacks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetOnboardingSuggestedStarterPacksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetOnboardingSuggestedStarterPacks { + const NSID: &'static str = "app.bsky.unspecced.getOnboardingSuggestedStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetOnboardingSuggestedStarterPacksResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getOnboardingSuggestedStarterPacks +pub struct GetOnboardingSuggestedStarterPacksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetOnboardingSuggestedStarterPacksRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getOnboardingSuggestedStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetOnboardingSuggestedStarterPacks; + type Response = GetOnboardingSuggestedStarterPacksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs_skeleton.rs new file mode 100644 index 0000000..eec17ce --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs_skeleton.rs @@ -0,0 +1,179 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton +// +// 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 GetOnboardingSuggestedStarterPacksSkeleton<'a> { + ///(default: 10, min: 1, max: 25) + #[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 viewer: std::option::Option>, +} + +pub mod get_onboarding_suggested_starter_packs_skeleton_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 GetOnboardingSuggestedStarterPacksSkeletonBuilder< + 'a, + S: get_onboarding_suggested_starter_packs_skeleton_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetOnboardingSuggestedStarterPacksSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> GetOnboardingSuggestedStarterPacksSkeletonBuilder< + 'a, + get_onboarding_suggested_starter_packs_skeleton_state::Empty, + > { + GetOnboardingSuggestedStarterPacksSkeletonBuilder::new() + } +} + +impl< + 'a, +> GetOnboardingSuggestedStarterPacksSkeletonBuilder< + 'a, + get_onboarding_suggested_starter_packs_skeleton_state::Empty, +> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetOnboardingSuggestedStarterPacksSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: get_onboarding_suggested_starter_packs_skeleton_state::State, +> GetOnboardingSuggestedStarterPacksSkeletonBuilder<'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: get_onboarding_suggested_starter_packs_skeleton_state::State, +> GetOnboardingSuggestedStarterPacksSkeletonBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S> GetOnboardingSuggestedStarterPacksSkeletonBuilder<'a, S> +where + S: get_onboarding_suggested_starter_packs_skeleton_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetOnboardingSuggestedStarterPacksSkeleton<'a> { + GetOnboardingSuggestedStarterPacksSkeleton { + limit: self.__unsafe_private_named.0, + viewer: 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 GetOnboardingSuggestedStarterPacksSkeletonOutput<'a> { + #[serde(borrow)] + pub starter_packs: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton +pub struct GetOnboardingSuggestedStarterPacksSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp +for GetOnboardingSuggestedStarterPacksSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetOnboardingSuggestedStarterPacksSkeletonOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest +for GetOnboardingSuggestedStarterPacksSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetOnboardingSuggestedStarterPacksSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton +pub struct GetOnboardingSuggestedStarterPacksSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint +for GetOnboardingSuggestedStarterPacksSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetOnboardingSuggestedStarterPacksSkeleton<'de>; + type Response = GetOnboardingSuggestedStarterPacksSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_popular_feed_generators.rs b/crates/weaver-api/src/app_bsky/unspecced/get_popular_feed_generators.rs new file mode 100644 index 0000000..2af7ee8 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_popular_feed_generators.rs @@ -0,0 +1,195 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getPopularFeedGenerators +// +// 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 GetPopularFeedGenerators<'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 query: std::option::Option>, +} + +pub mod get_popular_feed_generators_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 GetPopularFeedGeneratorsBuilder< + 'a, + S: get_popular_feed_generators_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> GetPopularFeedGenerators<'a> { + /// Create a new builder for this type + pub fn new() -> GetPopularFeedGeneratorsBuilder< + 'a, + get_popular_feed_generators_state::Empty, + > { + GetPopularFeedGeneratorsBuilder::new() + } +} + +impl<'a> GetPopularFeedGeneratorsBuilder<'a, get_popular_feed_generators_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetPopularFeedGeneratorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: get_popular_feed_generators_state::State, +> GetPopularFeedGeneratorsBuilder<'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_feed_generators_state::State, +> GetPopularFeedGeneratorsBuilder<'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_popular_feed_generators_state::State, +> GetPopularFeedGeneratorsBuilder<'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> GetPopularFeedGeneratorsBuilder<'a, S> +where + S: get_popular_feed_generators_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetPopularFeedGenerators<'a> { + GetPopularFeedGenerators { + cursor: 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 GetPopularFeedGeneratorsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feeds: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getPopularFeedGenerators +pub struct GetPopularFeedGeneratorsResponse; +impl jacquard_common::xrpc::XrpcResp for GetPopularFeedGeneratorsResponse { + const NSID: &'static str = "app.bsky.unspecced.getPopularFeedGenerators"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPopularFeedGeneratorsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetPopularFeedGenerators<'a> { + const NSID: &'static str = "app.bsky.unspecced.getPopularFeedGenerators"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPopularFeedGeneratorsResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getPopularFeedGenerators +pub struct GetPopularFeedGeneratorsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetPopularFeedGeneratorsRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getPopularFeedGenerators"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPopularFeedGenerators<'de>; + type Response = GetPopularFeedGeneratorsResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..3fc1d1f --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs @@ -0,0 +1,520 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getPostThreadOtherV2 +// +// 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 GetPostThreadOtherV2<'a> { + #[serde(borrow)] + pub anchor: jacquard_common::types::string::AtUri<'a>, + /// (default: false) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub prioritize_followed_users: std::option::Option, +} + +pub mod get_post_thread_other_v2_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 Anchor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Anchor = Unset; + } + ///State transition - sets the `anchor` field to Set + pub struct SetAnchor(PhantomData S>); + impl sealed::Sealed for SetAnchor {} + impl State for SetAnchor { + type Anchor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `anchor` field + pub struct anchor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetPostThreadOtherV2Builder<'a, S: get_post_thread_other_v2_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetPostThreadOtherV2<'a> { + /// Create a new builder for this type + pub fn new() -> GetPostThreadOtherV2Builder< + 'a, + get_post_thread_other_v2_state::Empty, + > { + GetPostThreadOtherV2Builder::new() + } +} + +impl<'a> GetPostThreadOtherV2Builder<'a, get_post_thread_other_v2_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetPostThreadOtherV2Builder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetPostThreadOtherV2Builder<'a, S> +where + S: get_post_thread_other_v2_state::State, + S::Anchor: get_post_thread_other_v2_state::IsUnset, +{ + /// Set the `anchor` field (required) + pub fn anchor( + mut self, + value: impl Into>, + ) -> GetPostThreadOtherV2Builder<'a, get_post_thread_other_v2_state::SetAnchor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetPostThreadOtherV2Builder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_post_thread_other_v2_state::State> GetPostThreadOtherV2Builder<'a, S> { + /// Set the `prioritizeFollowedUsers` field (optional) + pub fn prioritize_followed_users(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `prioritizeFollowedUsers` field to an Option value (optional) + pub fn maybe_prioritize_followed_users(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetPostThreadOtherV2Builder<'a, S> +where + S: get_post_thread_other_v2_state::State, + S::Anchor: get_post_thread_other_v2_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetPostThreadOtherV2<'a> { + GetPostThreadOtherV2 { + anchor: self.__unsafe_private_named.0.unwrap(), + prioritize_followed_users: 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 GetPostThreadOtherV2Output<'a> { + /// A flat list of other thread items. The depth of each item is indicated by the depth property inside the item. + #[serde(borrow)] + pub thread: Vec< + crate::app_bsky::unspecced::get_post_thread_other_v2::ThreadItem<'a>, + >, +} + +/// Response type for +///app.bsky.unspecced.getPostThreadOtherV2 +pub struct GetPostThreadOtherV2Response; +impl jacquard_common::xrpc::XrpcResp for GetPostThreadOtherV2Response { + const NSID: &'static str = "app.bsky.unspecced.getPostThreadOtherV2"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPostThreadOtherV2Output<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetPostThreadOtherV2<'a> { + const NSID: &'static str = "app.bsky.unspecced.getPostThreadOtherV2"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPostThreadOtherV2Response; +} + +/// Endpoint type for +///app.bsky.unspecced.getPostThreadOtherV2 +pub struct GetPostThreadOtherV2Request; +impl jacquard_common::xrpc::XrpcEndpoint for GetPostThreadOtherV2Request { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getPostThreadOtherV2"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPostThreadOtherV2<'de>; + type Response = GetPostThreadOtherV2Response; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ThreadItem<'a> { + /// The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. + pub depth: i64, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: crate::app_bsky::unspecced::ThreadItemPost<'a>, +} + +pub mod thread_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 Uri; + type Depth; + 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 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 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 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 `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ThreadItemBuilder<'a, S: thread_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> ThreadItem<'a> { + /// Create a new builder for this type + pub fn new() -> ThreadItemBuilder<'a, thread_item_state::Empty> { + ThreadItemBuilder::new() + } +} + +impl<'a> ThreadItemBuilder<'a, thread_item_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ThreadItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemBuilder<'a, S> +where + S: thread_item_state::State, + S::Depth: thread_item_state::IsUnset, +{ + /// Set the `depth` field (required) + pub fn depth( + mut self, + value: impl Into, + ) -> ThreadItemBuilder<'a, thread_item_state::SetDepth> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ThreadItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemBuilder<'a, S> +where + S: thread_item_state::State, + S::Uri: thread_item_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ThreadItemBuilder<'a, thread_item_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ThreadItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemBuilder<'a, S> +where + S: thread_item_state::State, + S::Value: thread_item_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> ThreadItemBuilder<'a, thread_item_state::SetValue> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ThreadItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> ThreadItem<'a> { + ThreadItem { + depth: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + value: 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>, + >, + ) -> ThreadItem<'a> { + ThreadItem { + depth: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + value: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_unspecced_getPostThreadOtherV2() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "app.bsky.unspecced.getPostThreadOtherV2", + ), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("anchor") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("anchor"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference (AT-URI) to post record. This is the anchor post.", + ), + ), + 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( + "prioritizeFollowedUsers", + ), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("threadItem"), + ::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("depth"), + ::jacquard_common::smol_str::SmolStr::new_static("value") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("depth"), + ::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, + ), + 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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.unspecced.defs#threadItemPost") + ], + closed: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadItem<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.getPostThreadOtherV2" + } + fn def_name() -> &'static str { + "threadItem" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_getPostThreadOtherV2() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file 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 new file mode 100644 index 0000000..e554a06 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs @@ -0,0 +1,673 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getPostThreadV2 +// +// 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 GetPostThreadV2<'a> { + /// (default: true) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub above: std::option::Option, + #[serde(borrow)] + pub anchor: jacquard_common::types::string::AtUri<'a>, + ///(default: 6, min: 0, max: 20) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub below: std::option::Option, + ///(default: 10, min: 0, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub branching_factor: std::option::Option, + /// (default: false) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub prioritize_followed_users: std::option::Option, + ///(default: "oldest") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort: std::option::Option>, +} + +pub mod get_post_thread_v2_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 Anchor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Anchor = Unset; + } + ///State transition - sets the `anchor` field to Set + pub struct SetAnchor(PhantomData S>); + impl sealed::Sealed for SetAnchor {} + impl State for SetAnchor { + type Anchor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `anchor` field + pub struct anchor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetPostThreadV2Builder<'a, S: get_post_thread_v2_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> GetPostThreadV2<'a> { + /// Create a new builder for this type + pub fn new() -> GetPostThreadV2Builder<'a, get_post_thread_v2_state::Empty> { + GetPostThreadV2Builder::new() + } +} + +impl<'a> GetPostThreadV2Builder<'a, get_post_thread_v2_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetPostThreadV2Builder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_post_thread_v2_state::State> GetPostThreadV2Builder<'a, S> { + /// Set the `above` field (optional) + pub fn above(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `above` field to an Option value (optional) + pub fn maybe_above(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> GetPostThreadV2Builder<'a, S> +where + S: get_post_thread_v2_state::State, + S::Anchor: get_post_thread_v2_state::IsUnset, +{ + /// Set the `anchor` field (required) + pub fn anchor( + mut self, + value: impl Into>, + ) -> GetPostThreadV2Builder<'a, get_post_thread_v2_state::SetAnchor> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetPostThreadV2Builder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_post_thread_v2_state::State> GetPostThreadV2Builder<'a, S> { + /// Set the `below` field (optional) + pub fn below(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `below` field to an Option value (optional) + pub fn maybe_below(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_post_thread_v2_state::State> GetPostThreadV2Builder<'a, S> { + /// Set the `branchingFactor` field (optional) + pub fn branching_factor(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `branchingFactor` field to an Option value (optional) + pub fn maybe_branching_factor(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: get_post_thread_v2_state::State> GetPostThreadV2Builder<'a, S> { + /// Set the `prioritizeFollowedUsers` field (optional) + pub fn prioritize_followed_users(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `prioritizeFollowedUsers` field to an Option value (optional) + pub fn maybe_prioritize_followed_users(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: get_post_thread_v2_state::State> GetPostThreadV2Builder<'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> GetPostThreadV2Builder<'a, S> +where + S: get_post_thread_v2_state::State, + S::Anchor: get_post_thread_v2_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetPostThreadV2<'a> { + GetPostThreadV2 { + above: self.__unsafe_private_named.0, + anchor: self.__unsafe_private_named.1.unwrap(), + below: self.__unsafe_private_named.2, + branching_factor: self.__unsafe_private_named.3, + prioritize_followed_users: self.__unsafe_private_named.4, + sort: self.__unsafe_private_named.5, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPostThreadV2Output<'a> { + /// Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. + pub has_other_replies: bool, + /// A flat list of thread items. The depth of each item is indicated by the depth property inside the item. + #[serde(borrow)] + pub thread: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub threadgate: std::option::Option>, +} + +/// Response type for +///app.bsky.unspecced.getPostThreadV2 +pub struct GetPostThreadV2Response; +impl jacquard_common::xrpc::XrpcResp for GetPostThreadV2Response { + const NSID: &'static str = "app.bsky.unspecced.getPostThreadV2"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPostThreadV2Output<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetPostThreadV2<'a> { + const NSID: &'static str = "app.bsky.unspecced.getPostThreadV2"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPostThreadV2Response; +} + +/// Endpoint type for +///app.bsky.unspecced.getPostThreadV2 +pub struct GetPostThreadV2Request; +impl jacquard_common::xrpc::XrpcEndpoint for GetPostThreadV2Request { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getPostThreadV2"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPostThreadV2<'de>; + type Response = GetPostThreadV2Response; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ThreadItem<'a> { + /// The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. + pub depth: i64, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: ThreadItemValue<'a>, +} + +pub mod thread_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 Uri; + type Depth; + 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 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 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 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 `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ThreadItemBuilder<'a, S: thread_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> ThreadItem<'a> { + /// Create a new builder for this type + pub fn new() -> ThreadItemBuilder<'a, thread_item_state::Empty> { + ThreadItemBuilder::new() + } +} + +impl<'a> ThreadItemBuilder<'a, thread_item_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ThreadItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemBuilder<'a, S> +where + S: thread_item_state::State, + S::Depth: thread_item_state::IsUnset, +{ + /// Set the `depth` field (required) + pub fn depth( + mut self, + value: impl Into, + ) -> ThreadItemBuilder<'a, thread_item_state::SetDepth> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ThreadItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemBuilder<'a, S> +where + S: thread_item_state::State, + S::Uri: thread_item_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ThreadItemBuilder<'a, thread_item_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ThreadItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ThreadItemBuilder<'a, S> +where + S: thread_item_state::State, + S::Value: thread_item_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> ThreadItemBuilder<'a, thread_item_state::SetValue> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ThreadItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> ThreadItem<'a> { + ThreadItem { + depth: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + value: 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>, + >, + ) -> ThreadItem<'a> { + ThreadItem { + depth: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + value: self.__unsafe_private_named.2.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 ThreadItemValue<'a> { + #[serde(rename = "app.bsky.unspecced.defs#threadItemPost")] + ThreadItemPost(Box>), + #[serde(rename = "app.bsky.unspecced.defs#threadItemNoUnauthenticated")] + ThreadItemNoUnauthenticated( + Box>, + ), + #[serde(rename = "app.bsky.unspecced.defs#threadItemNotFound")] + ThreadItemNotFound(Box>), + #[serde(rename = "app.bsky.unspecced.defs#threadItemBlocked")] + ThreadItemBlocked(Box>), +} + +fn lexicon_doc_app_bsky_unspecced_getPostThreadV2() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.unspecced.getPostThreadV2"), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("anchor") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("above"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("anchor"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post.", + ), + ), + 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("below"), + ::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( + "branchingFactor", + ), + ::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( + "prioritizeFollowedUsers", + ), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("sort"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Sorting for the thread replies.", + ), + ), + 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("threadItem"), + ::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("depth"), + ::jacquard_common::smol_str::SmolStr::new_static("value") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("depth"), + ::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, + ), + 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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.unspecced.defs#threadItemPost"), + ::jacquard_common::CowStr::new_static("app.bsky.unspecced.defs#threadItemNoUnauthenticated"), + ::jacquard_common::CowStr::new_static("app.bsky.unspecced.defs#threadItemNotFound"), + ::jacquard_common::CowStr::new_static("app.bsky.unspecced.defs#threadItemBlocked") + ], + closed: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreadItem<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.getPostThreadV2" + } + fn def_name() -> &'static str { + "threadItem" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_getPostThreadV2() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_suggested_feeds.rs b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_feeds.rs new file mode 100644 index 0000000..00980e6 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_feeds.rs @@ -0,0 +1,131 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getSuggestedFeeds +// +// 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 GetSuggestedFeeds { + ///(default: 10, min: 1, max: 25) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_suggested_feeds_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 GetSuggestedFeedsBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl GetSuggestedFeeds { + /// Create a new builder for this type + pub fn new() -> GetSuggestedFeedsBuilder { + GetSuggestedFeedsBuilder::new() + } +} + +impl GetSuggestedFeedsBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedFeedsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl GetSuggestedFeedsBuilder { + /// 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 GetSuggestedFeedsBuilder +where + S: get_suggested_feeds_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedFeeds { + GetSuggestedFeeds { + 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 GetSuggestedFeedsOutput<'a> { + #[serde(borrow)] + pub feeds: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getSuggestedFeeds +pub struct GetSuggestedFeedsResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedFeedsResponse { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedFeeds"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedFeedsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetSuggestedFeeds { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedFeeds"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedFeedsResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getSuggestedFeeds +pub struct GetSuggestedFeedsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedFeedsRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getSuggestedFeeds"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedFeeds; + type Response = GetSuggestedFeedsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_suggested_feeds_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_feeds_skeleton.rs new file mode 100644 index 0000000..03da144 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_feeds_skeleton.rs @@ -0,0 +1,173 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getSuggestedFeedsSkeleton +// +// 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 GetSuggestedFeedsSkeleton<'a> { + ///(default: 10, min: 1, max: 25) + #[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 viewer: std::option::Option>, +} + +pub mod get_suggested_feeds_skeleton_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 GetSuggestedFeedsSkeletonBuilder< + 'a, + S: get_suggested_feeds_skeleton_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSuggestedFeedsSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> GetSuggestedFeedsSkeletonBuilder< + 'a, + get_suggested_feeds_skeleton_state::Empty, + > { + GetSuggestedFeedsSkeletonBuilder::new() + } +} + +impl< + 'a, +> GetSuggestedFeedsSkeletonBuilder<'a, get_suggested_feeds_skeleton_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedFeedsSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: get_suggested_feeds_skeleton_state::State, +> GetSuggestedFeedsSkeletonBuilder<'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: get_suggested_feeds_skeleton_state::State, +> GetSuggestedFeedsSkeletonBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S> GetSuggestedFeedsSkeletonBuilder<'a, S> +where + S: get_suggested_feeds_skeleton_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedFeedsSkeleton<'a> { + GetSuggestedFeedsSkeleton { + limit: self.__unsafe_private_named.0, + viewer: 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 GetSuggestedFeedsSkeletonOutput<'a> { + #[serde(borrow)] + pub feeds: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getSuggestedFeedsSkeleton +pub struct GetSuggestedFeedsSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedFeedsSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedFeedsSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedFeedsSkeletonOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSuggestedFeedsSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedFeedsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedFeedsSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getSuggestedFeedsSkeleton +pub struct GetSuggestedFeedsSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedFeedsSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getSuggestedFeedsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedFeedsSkeleton<'de>; + type Response = GetSuggestedFeedsSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_suggested_starter_packs.rs b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_starter_packs.rs new file mode 100644 index 0000000..5d93ffc --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_starter_packs.rs @@ -0,0 +1,133 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getSuggestedStarterPacks +// +// 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 GetSuggestedStarterPacks { + ///(default: 10, min: 1, max: 25) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_suggested_starter_packs_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 GetSuggestedStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl GetSuggestedStarterPacks { + /// Create a new builder for this type + pub fn new() -> GetSuggestedStarterPacksBuilder< + get_suggested_starter_packs_state::Empty, + > { + GetSuggestedStarterPacksBuilder::new() + } +} + +impl GetSuggestedStarterPacksBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedStarterPacksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl GetSuggestedStarterPacksBuilder { + /// 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 GetSuggestedStarterPacksBuilder +where + S: get_suggested_starter_packs_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedStarterPacks { + GetSuggestedStarterPacks { + 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 GetSuggestedStarterPacksOutput<'a> { + #[serde(borrow)] + pub starter_packs: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getSuggestedStarterPacks +pub struct GetSuggestedStarterPacksResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedStarterPacksResponse { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedStarterPacks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedStarterPacksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetSuggestedStarterPacks { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedStarterPacksResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getSuggestedStarterPacks +pub struct GetSuggestedStarterPacksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedStarterPacksRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getSuggestedStarterPacks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedStarterPacks; + type Response = GetSuggestedStarterPacksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_suggested_starter_packs_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_starter_packs_skeleton.rs new file mode 100644 index 0000000..47b19bf --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_starter_packs_skeleton.rs @@ -0,0 +1,176 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getSuggestedStarterPacksSkeleton +// +// 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 GetSuggestedStarterPacksSkeleton<'a> { + ///(default: 10, min: 1, max: 25) + #[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 viewer: std::option::Option>, +} + +pub mod get_suggested_starter_packs_skeleton_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 GetSuggestedStarterPacksSkeletonBuilder< + 'a, + S: get_suggested_starter_packs_skeleton_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSuggestedStarterPacksSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> GetSuggestedStarterPacksSkeletonBuilder< + 'a, + get_suggested_starter_packs_skeleton_state::Empty, + > { + GetSuggestedStarterPacksSkeletonBuilder::new() + } +} + +impl< + 'a, +> GetSuggestedStarterPacksSkeletonBuilder< + 'a, + get_suggested_starter_packs_skeleton_state::Empty, +> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedStarterPacksSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: get_suggested_starter_packs_skeleton_state::State, +> GetSuggestedStarterPacksSkeletonBuilder<'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: get_suggested_starter_packs_skeleton_state::State, +> GetSuggestedStarterPacksSkeletonBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S> GetSuggestedStarterPacksSkeletonBuilder<'a, S> +where + S: get_suggested_starter_packs_skeleton_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedStarterPacksSkeleton<'a> { + GetSuggestedStarterPacksSkeleton { + limit: self.__unsafe_private_named.0, + viewer: 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 GetSuggestedStarterPacksSkeletonOutput<'a> { + #[serde(borrow)] + pub starter_packs: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getSuggestedStarterPacksSkeleton +pub struct GetSuggestedStarterPacksSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedStarterPacksSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedStarterPacksSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedStarterPacksSkeletonOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSuggestedStarterPacksSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedStarterPacksSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedStarterPacksSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getSuggestedStarterPacksSkeleton +pub struct GetSuggestedStarterPacksSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedStarterPacksSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getSuggestedStarterPacksSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedStarterPacksSkeleton<'de>; + type Response = GetSuggestedStarterPacksSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_suggested_users.rs b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_users.rs new file mode 100644 index 0000000..15dcc7e --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_users.rs @@ -0,0 +1,156 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getSuggestedUsers +// +// 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 GetSuggestedUsers<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub category: std::option::Option>, + ///(default: 25, min: 1, max: 50) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_suggested_users_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 GetSuggestedUsersBuilder<'a, S: get_suggested_users_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSuggestedUsers<'a> { + /// Create a new builder for this type + pub fn new() -> GetSuggestedUsersBuilder<'a, get_suggested_users_state::Empty> { + GetSuggestedUsersBuilder::new() + } +} + +impl<'a> GetSuggestedUsersBuilder<'a, get_suggested_users_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedUsersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_suggested_users_state::State> GetSuggestedUsersBuilder<'a, S> { + /// Set the `category` field (optional) + pub fn category( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `category` field to an Option value (optional) + pub fn maybe_category(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_suggested_users_state::State> GetSuggestedUsersBuilder<'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> GetSuggestedUsersBuilder<'a, S> +where + S: get_suggested_users_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedUsers<'a> { + GetSuggestedUsers { + category: 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 GetSuggestedUsersOutput<'a> { + #[serde(borrow)] + pub actors: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getSuggestedUsers +pub struct GetSuggestedUsersResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedUsersResponse { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedUsers"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedUsersOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSuggestedUsers<'a> { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedUsers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedUsersResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getSuggestedUsers +pub struct GetSuggestedUsersRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedUsersRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getSuggestedUsers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedUsers<'de>; + type Response = GetSuggestedUsersResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_suggested_users_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_users_skeleton.rs new file mode 100644 index 0000000..294eacc --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_suggested_users_skeleton.rs @@ -0,0 +1,197 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getSuggestedUsersSkeleton +// +// 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 GetSuggestedUsersSkeleton<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub category: std::option::Option>, + ///(default: 25, 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")] + #[serde(borrow)] + pub viewer: std::option::Option>, +} + +pub mod get_suggested_users_skeleton_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 GetSuggestedUsersSkeletonBuilder< + 'a, + S: get_suggested_users_skeleton_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> GetSuggestedUsersSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> GetSuggestedUsersSkeletonBuilder< + 'a, + get_suggested_users_skeleton_state::Empty, + > { + GetSuggestedUsersSkeletonBuilder::new() + } +} + +impl< + 'a, +> GetSuggestedUsersSkeletonBuilder<'a, get_suggested_users_skeleton_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedUsersSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: get_suggested_users_skeleton_state::State, +> GetSuggestedUsersSkeletonBuilder<'a, S> { + /// Set the `category` field (optional) + pub fn category( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `category` field to an Option value (optional) + pub fn maybe_category(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl< + 'a, + S: get_suggested_users_skeleton_state::State, +> GetSuggestedUsersSkeletonBuilder<'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_suggested_users_skeleton_state::State, +> GetSuggestedUsersSkeletonBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S> GetSuggestedUsersSkeletonBuilder<'a, S> +where + S: get_suggested_users_skeleton_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedUsersSkeleton<'a> { + GetSuggestedUsersSkeleton { + category: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + viewer: 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 GetSuggestedUsersSkeletonOutput<'a> { + #[serde(borrow)] + pub dids: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getSuggestedUsersSkeleton +pub struct GetSuggestedUsersSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedUsersSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedUsersSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedUsersSkeletonOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSuggestedUsersSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.getSuggestedUsersSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedUsersSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getSuggestedUsersSkeleton +pub struct GetSuggestedUsersSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedUsersSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getSuggestedUsersSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedUsersSkeleton<'de>; + type Response = GetSuggestedUsersSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_suggestions_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/get_suggestions_skeleton.rs new file mode 100644 index 0000000..74f15a1 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_suggestions_skeleton.rs @@ -0,0 +1,217 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getSuggestionsSkeleton +// +// 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 GetSuggestionsSkeleton<'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 relative_to_did: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: std::option::Option>, +} + +pub mod get_suggestions_skeleton_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 GetSuggestionsSkeletonBuilder<'a, S: get_suggestions_skeleton_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> GetSuggestionsSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> GetSuggestionsSkeletonBuilder< + 'a, + get_suggestions_skeleton_state::Empty, + > { + GetSuggestionsSkeletonBuilder::new() + } +} + +impl<'a> GetSuggestionsSkeletonBuilder<'a, get_suggestions_skeleton_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestionsSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_suggestions_skeleton_state::State> GetSuggestionsSkeletonBuilder<'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_suggestions_skeleton_state::State> GetSuggestionsSkeletonBuilder<'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_suggestions_skeleton_state::State> GetSuggestionsSkeletonBuilder<'a, S> { + /// Set the `relativeToDid` field (optional) + pub fn relative_to_did( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `relativeToDid` field to an Option value (optional) + pub fn maybe_relative_to_did( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_suggestions_skeleton_state::State> GetSuggestionsSkeletonBuilder<'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> GetSuggestionsSkeletonBuilder<'a, S> +where + S: get_suggestions_skeleton_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestionsSkeleton<'a> { + GetSuggestionsSkeleton { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + relative_to_did: self.__unsafe_private_named.2, + viewer: 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 GetSuggestionsSkeletonOutput<'a> { + #[serde(borrow)] + pub actors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Snowflake for this recommendation, use when submitting recommendation events. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub rec_id: std::option::Option, + /// DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub relative_to_did: std::option::Option>, +} + +/// Response type for +///app.bsky.unspecced.getSuggestionsSkeleton +pub struct GetSuggestionsSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestionsSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.getSuggestionsSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestionsSkeletonOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSuggestionsSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.getSuggestionsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestionsSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getSuggestionsSkeleton +pub struct GetSuggestionsSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestionsSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getSuggestionsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestionsSkeleton<'de>; + type Response = GetSuggestionsSkeletonResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..3bceb81 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs @@ -0,0 +1,379 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getTaggedSuggestions +// +// 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 GetTaggedSuggestions; +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetTaggedSuggestionsOutput<'a> { + #[serde(borrow)] + pub suggestions: Vec< + crate::app_bsky::unspecced::get_tagged_suggestions::Suggestion<'a>, + >, +} + +/// Response type for +///app.bsky.unspecced.getTaggedSuggestions +pub struct GetTaggedSuggestionsResponse; +impl jacquard_common::xrpc::XrpcResp for GetTaggedSuggestionsResponse { + const NSID: &'static str = "app.bsky.unspecced.getTaggedSuggestions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetTaggedSuggestionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetTaggedSuggestions { + const NSID: &'static str = "app.bsky.unspecced.getTaggedSuggestions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetTaggedSuggestionsResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getTaggedSuggestions +pub struct GetTaggedSuggestionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetTaggedSuggestionsRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getTaggedSuggestions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetTaggedSuggestions; + type Response = GetTaggedSuggestionsResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Suggestion<'a> { + #[serde(borrow)] + pub subject: jacquard_common::types::string::Uri<'a>, + #[serde(borrow)] + pub subject_type: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub tag: jacquard_common::CowStr<'a>, +} + +pub mod suggestion_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; + type SubjectType; + type Subject; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Tag = Unset; + type SubjectType = Unset; + type Subject = 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; + 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 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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SuggestionBuilder<'a, S: suggestion_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> Suggestion<'a> { + /// Create a new builder for this type + pub fn new() -> SuggestionBuilder<'a, suggestion_state::Empty> { + SuggestionBuilder::new() + } +} + +impl<'a> SuggestionBuilder<'a, suggestion_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SuggestionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SuggestionBuilder<'a, S> +where + S: suggestion_state::State, + S::Subject: suggestion_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> SuggestionBuilder<'a, suggestion_state::SetSubject> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SuggestionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SuggestionBuilder<'a, S> +where + S: suggestion_state::State, + S::SubjectType: suggestion_state::IsUnset, +{ + /// Set the `subjectType` field (required) + pub fn subject_type( + mut self, + value: impl Into>, + ) -> SuggestionBuilder<'a, suggestion_state::SetSubjectType> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SuggestionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SuggestionBuilder<'a, S> +where + S: suggestion_state::State, + S::Tag: suggestion_state::IsUnset, +{ + /// Set the `tag` field (required) + pub fn tag( + mut self, + value: impl Into>, + ) -> SuggestionBuilder<'a, suggestion_state::SetTag> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SuggestionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SuggestionBuilder<'a, S> +where + S: suggestion_state::State, + S::Tag: suggestion_state::IsSet, + S::SubjectType: suggestion_state::IsSet, + S::Subject: suggestion_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Suggestion<'a> { + Suggestion { + subject: self.__unsafe_private_named.0.unwrap(), + subject_type: 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>, + >, + ) -> Suggestion<'a> { + Suggestion { + subject: self.__unsafe_private_named.0.unwrap(), + subject_type: self.__unsafe_private_named.1.unwrap(), + tag: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_unspecced_getTaggedSuggestions() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "app.bsky.unspecced.getTaggedSuggestions", + ), + 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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("suggestion"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("tag"), + ::jacquard_common::smol_str::SmolStr::new_static("subjectType"), + ::jacquard_common::smol_str::SmolStr::new_static("subject") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::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( + "subjectType", + ), + ::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("tag"), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Suggestion<'a> { + fn nsid() -> &'static str { + "app.bsky.unspecced.getTaggedSuggestions" + } + fn def_name() -> &'static str { + "suggestion" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_unspecced_getTaggedSuggestions() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_trending_topics.rs b/crates/weaver-api/src/app_bsky/unspecced/get_trending_topics.rs new file mode 100644 index 0000000..455b8c8 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_trending_topics.rs @@ -0,0 +1,161 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getTrendingTopics +// +// 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 GetTrendingTopics<'a> { + ///(default: 10, min: 1, max: 25) + #[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 viewer: std::option::Option>, +} + +pub mod get_trending_topics_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 GetTrendingTopicsBuilder<'a, S: get_trending_topics_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetTrendingTopics<'a> { + /// Create a new builder for this type + pub fn new() -> GetTrendingTopicsBuilder<'a, get_trending_topics_state::Empty> { + GetTrendingTopicsBuilder::new() + } +} + +impl<'a> GetTrendingTopicsBuilder<'a, get_trending_topics_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetTrendingTopicsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_trending_topics_state::State> GetTrendingTopicsBuilder<'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: get_trending_topics_state::State> GetTrendingTopicsBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S> GetTrendingTopicsBuilder<'a, S> +where + S: get_trending_topics_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetTrendingTopics<'a> { + GetTrendingTopics { + limit: self.__unsafe_private_named.0, + viewer: 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 GetTrendingTopicsOutput<'a> { + #[serde(borrow)] + pub suggested: Vec>, + #[serde(borrow)] + pub topics: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getTrendingTopics +pub struct GetTrendingTopicsResponse; +impl jacquard_common::xrpc::XrpcResp for GetTrendingTopicsResponse { + const NSID: &'static str = "app.bsky.unspecced.getTrendingTopics"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetTrendingTopicsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetTrendingTopics<'a> { + const NSID: &'static str = "app.bsky.unspecced.getTrendingTopics"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetTrendingTopicsResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getTrendingTopics +pub struct GetTrendingTopicsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetTrendingTopicsRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getTrendingTopics"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetTrendingTopics<'de>; + type Response = GetTrendingTopicsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_trends.rs b/crates/weaver-api/src/app_bsky/unspecced/get_trends.rs new file mode 100644 index 0000000..aa8c4f6 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_trends.rs @@ -0,0 +1,131 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getTrends +// +// 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 GetTrends { + ///(default: 10, min: 1, max: 25) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_trends_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 GetTrendsBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl GetTrends { + /// Create a new builder for this type + pub fn new() -> GetTrendsBuilder { + GetTrendsBuilder::new() + } +} + +impl GetTrendsBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetTrendsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl GetTrendsBuilder { + /// 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 GetTrendsBuilder +where + S: get_trends_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetTrends { + GetTrends { + 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 GetTrendsOutput<'a> { + #[serde(borrow)] + pub trends: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getTrends +pub struct GetTrendsResponse; +impl jacquard_common::xrpc::XrpcResp for GetTrendsResponse { + const NSID: &'static str = "app.bsky.unspecced.getTrends"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetTrendsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetTrends { + const NSID: &'static str = "app.bsky.unspecced.getTrends"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetTrendsResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getTrends +pub struct GetTrendsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetTrendsRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getTrends"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetTrends; + type Response = GetTrendsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_trends_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/get_trends_skeleton.rs new file mode 100644 index 0000000..b3acbbc --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/get_trends_skeleton.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.getTrendsSkeleton +// +// 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 GetTrendsSkeleton<'a> { + ///(default: 10, min: 1, max: 25) + #[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 viewer: std::option::Option>, +} + +pub mod get_trends_skeleton_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 GetTrendsSkeletonBuilder<'a, S: get_trends_skeleton_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetTrendsSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> GetTrendsSkeletonBuilder<'a, get_trends_skeleton_state::Empty> { + GetTrendsSkeletonBuilder::new() + } +} + +impl<'a> GetTrendsSkeletonBuilder<'a, get_trends_skeleton_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetTrendsSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_trends_skeleton_state::State> GetTrendsSkeletonBuilder<'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: get_trends_skeleton_state::State> GetTrendsSkeletonBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S> GetTrendsSkeletonBuilder<'a, S> +where + S: get_trends_skeleton_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetTrendsSkeleton<'a> { + GetTrendsSkeleton { + limit: self.__unsafe_private_named.0, + viewer: 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 GetTrendsSkeletonOutput<'a> { + #[serde(borrow)] + pub trends: Vec>, +} + +/// Response type for +///app.bsky.unspecced.getTrendsSkeleton +pub struct GetTrendsSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for GetTrendsSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.getTrendsSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetTrendsSkeletonOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetTrendsSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.getTrendsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetTrendsSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.getTrendsSkeleton +pub struct GetTrendsSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetTrendsSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.getTrendsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetTrendsSkeleton<'de>; + type Response = GetTrendsSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/init_age_assurance.rs b/crates/weaver-api/src/app_bsky/unspecced/init_age_assurance.rs new file mode 100644 index 0000000..0c01af5 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/init_age_assurance.rs @@ -0,0 +1,129 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.initAgeAssurance +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct InitAgeAssurance<'a> { + /// An ISO 3166-1 alpha-2 code of the user's location. + #[serde(borrow)] + pub country_code: jacquard_common::CowStr<'a>, + /// The user's email address to receive assurance instructions. + #[serde(borrow)] + pub email: jacquard_common::CowStr<'a>, + /// The user's preferred language for communication during the assurance process. + #[serde(borrow)] + pub language: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct InitAgeAssuranceOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::app_bsky::unspecced::AgeAssuranceState<'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 InitAgeAssuranceError<'a> { + #[serde(rename = "InvalidEmail")] + InvalidEmail(std::option::Option), + #[serde(rename = "DidTooLong")] + DidTooLong(std::option::Option), + #[serde(rename = "InvalidInitiation")] + InvalidInitiation(std::option::Option), +} + +impl std::fmt::Display for InitAgeAssuranceError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidEmail(msg) => { + write!(f, "InvalidEmail")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::DidTooLong(msg) => { + write!(f, "DidTooLong")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidInitiation(msg) => { + write!(f, "InvalidInitiation")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.unspecced.initAgeAssurance +pub struct InitAgeAssuranceResponse; +impl jacquard_common::xrpc::XrpcResp for InitAgeAssuranceResponse { + const NSID: &'static str = "app.bsky.unspecced.initAgeAssurance"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = InitAgeAssuranceOutput<'de>; + type Err<'de> = InitAgeAssuranceError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for InitAgeAssurance<'a> { + const NSID: &'static str = "app.bsky.unspecced.initAgeAssurance"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = InitAgeAssuranceResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.initAgeAssurance +pub struct InitAgeAssuranceRequest; +impl jacquard_common::xrpc::XrpcEndpoint for InitAgeAssuranceRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.initAgeAssurance"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = InitAgeAssurance<'de>; + type Response = InitAgeAssuranceResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/search_actors_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/search_actors_skeleton.rs new file mode 100644 index 0000000..41a5d5a --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/search_actors_skeleton.rs @@ -0,0 +1,277 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.searchActorsSkeleton +// +// 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 SearchActorsSkeleton<'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>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub typeahead: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: std::option::Option>, +} + +pub mod search_actors_skeleton_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 SearchActorsSkeletonBuilder<'a, S: search_actors_skeleton_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> SearchActorsSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> SearchActorsSkeletonBuilder< + 'a, + search_actors_skeleton_state::Empty, + > { + SearchActorsSkeletonBuilder::new() + } +} + +impl<'a> SearchActorsSkeletonBuilder<'a, search_actors_skeleton_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchActorsSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_actors_skeleton_state::State> SearchActorsSkeletonBuilder<'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_skeleton_state::State> SearchActorsSkeletonBuilder<'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> SearchActorsSkeletonBuilder<'a, S> +where + S: search_actors_skeleton_state::State, + S::Q: search_actors_skeleton_state::IsUnset, +{ + /// Set the `q` field (required) + pub fn q( + mut self, + value: impl Into>, + ) -> SearchActorsSkeletonBuilder<'a, search_actors_skeleton_state::SetQ> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SearchActorsSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_actors_skeleton_state::State> SearchActorsSkeletonBuilder<'a, S> { + /// Set the `typeahead` field (optional) + pub fn typeahead(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `typeahead` field to an Option value (optional) + pub fn maybe_typeahead(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: search_actors_skeleton_state::State> SearchActorsSkeletonBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S> SearchActorsSkeletonBuilder<'a, S> +where + S: search_actors_skeleton_state::State, + S::Q: search_actors_skeleton_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchActorsSkeleton<'a> { + SearchActorsSkeleton { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + q: self.__unsafe_private_named.2.unwrap(), + typeahead: self.__unsafe_private_named.3, + viewer: 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 SearchActorsSkeletonOutput<'a> { + #[serde(borrow)] + pub actors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hits_total: 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 SearchActorsSkeletonError<'a> { + #[serde(rename = "BadQueryString")] + BadQueryString(std::option::Option), +} + +impl std::fmt::Display for SearchActorsSkeletonError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BadQueryString(msg) => { + write!(f, "BadQueryString")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.unspecced.searchActorsSkeleton +pub struct SearchActorsSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for SearchActorsSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.searchActorsSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchActorsSkeletonOutput<'de>; + type Err<'de> = SearchActorsSkeletonError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchActorsSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.searchActorsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchActorsSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.searchActorsSkeleton +pub struct SearchActorsSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchActorsSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.searchActorsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchActorsSkeleton<'de>; + type Response = SearchActorsSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/search_posts_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/search_posts_skeleton.rs new file mode 100644 index 0000000..2d4a608 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/search_posts_skeleton.rs @@ -0,0 +1,472 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.searchPostsSkeleton +// +// 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 SearchPostsSkeleton<'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>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub domain: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub lang: std::option::Option, + ///(default: 25, 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 mentions: std::option::Option>, + #[serde(borrow)] + pub q: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub since: std::option::Option>, + ///(default: "latest") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tag: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub until: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub url: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: std::option::Option>, +} + +pub mod search_posts_skeleton_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 SearchPostsSkeletonBuilder<'a, S: search_posts_skeleton_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> SearchPostsSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> SearchPostsSkeletonBuilder<'a, search_posts_skeleton_state::Empty> { + SearchPostsSkeletonBuilder::new() + } +} + +impl<'a> SearchPostsSkeletonBuilder<'a, search_posts_skeleton_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchPostsSkeletonBuilder { + _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: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'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_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'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_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `domain` field (optional) + pub fn domain( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `domain` field to an Option value (optional) + pub fn maybe_domain(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `lang` field (optional) + pub fn lang( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `lang` field to an Option value (optional) + pub fn maybe_lang( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `mentions` field (optional) + pub fn mentions( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `mentions` field to an Option value (optional) + pub fn maybe_mentions( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> SearchPostsSkeletonBuilder<'a, S> +where + S: search_posts_skeleton_state::State, + S::Q: search_posts_skeleton_state::IsUnset, +{ + /// Set the `q` field (required) + pub fn q( + mut self, + value: impl Into>, + ) -> SearchPostsSkeletonBuilder<'a, search_posts_skeleton_state::SetQ> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + SearchPostsSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `since` field (optional) + pub fn since( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = 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.7 = value; + self + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `sort` field (optional) + pub fn sort( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = value; + self + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `tag` field (optional) + pub fn tag( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `tag` field to an Option value (optional) + pub fn maybe_tag(mut self, value: Option>>) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `until` field (optional) + pub fn until( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `until` field to an Option value (optional) + pub fn maybe_until(mut self, value: Option>) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `url` field (optional) + pub fn url( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `url` field to an Option value (optional) + pub fn maybe_url( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S: search_posts_skeleton_state::State> SearchPostsSkeletonBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.12 = 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.12 = value; + self + } +} + +impl<'a, S> SearchPostsSkeletonBuilder<'a, S> +where + S: search_posts_skeleton_state::State, + S::Q: search_posts_skeleton_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchPostsSkeleton<'a> { + SearchPostsSkeleton { + author: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + domain: self.__unsafe_private_named.2, + lang: self.__unsafe_private_named.3, + limit: self.__unsafe_private_named.4, + mentions: self.__unsafe_private_named.5, + q: self.__unsafe_private_named.6.unwrap(), + since: self.__unsafe_private_named.7, + sort: self.__unsafe_private_named.8, + tag: self.__unsafe_private_named.9, + until: self.__unsafe_private_named.10, + url: self.__unsafe_private_named.11, + viewer: self.__unsafe_private_named.12, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SearchPostsSkeletonOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hits_total: std::option::Option, + #[serde(borrow)] + pub posts: 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 SearchPostsSkeletonError<'a> { + #[serde(rename = "BadQueryString")] + BadQueryString(std::option::Option), +} + +impl std::fmt::Display for SearchPostsSkeletonError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BadQueryString(msg) => { + write!(f, "BadQueryString")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.unspecced.searchPostsSkeleton +pub struct SearchPostsSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for SearchPostsSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.searchPostsSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchPostsSkeletonOutput<'de>; + type Err<'de> = SearchPostsSkeletonError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchPostsSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.searchPostsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchPostsSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.searchPostsSkeleton +pub struct SearchPostsSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchPostsSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.searchPostsSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchPostsSkeleton<'de>; + type Response = SearchPostsSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/unspecced/search_starter_packs_skeleton.rs b/crates/weaver-api/src/app_bsky/unspecced/search_starter_packs_skeleton.rs new file mode 100644 index 0000000..3799b4f --- /dev/null +++ b/crates/weaver-api/src/app_bsky/unspecced/search_starter_packs_skeleton.rs @@ -0,0 +1,277 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.unspecced.searchStarterPacksSkeleton +// +// 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 SearchStarterPacksSkeleton<'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>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: std::option::Option>, +} + +pub mod search_starter_packs_skeleton_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 SearchStarterPacksSkeletonBuilder< + 'a, + S: search_starter_packs_skeleton_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> SearchStarterPacksSkeleton<'a> { + /// Create a new builder for this type + pub fn new() -> SearchStarterPacksSkeletonBuilder< + 'a, + search_starter_packs_skeleton_state::Empty, + > { + SearchStarterPacksSkeletonBuilder::new() + } +} + +impl< + 'a, +> SearchStarterPacksSkeletonBuilder<'a, search_starter_packs_skeleton_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchStarterPacksSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: search_starter_packs_skeleton_state::State, +> SearchStarterPacksSkeletonBuilder<'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_starter_packs_skeleton_state::State, +> SearchStarterPacksSkeletonBuilder<'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> SearchStarterPacksSkeletonBuilder<'a, S> +where + S: search_starter_packs_skeleton_state::State, + S::Q: search_starter_packs_skeleton_state::IsUnset, +{ + /// Set the `q` field (required) + pub fn q( + mut self, + value: impl Into>, + ) -> SearchStarterPacksSkeletonBuilder< + 'a, + search_starter_packs_skeleton_state::SetQ, + > { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SearchStarterPacksSkeletonBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: search_starter_packs_skeleton_state::State, +> SearchStarterPacksSkeletonBuilder<'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> SearchStarterPacksSkeletonBuilder<'a, S> +where + S: search_starter_packs_skeleton_state::State, + S::Q: search_starter_packs_skeleton_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchStarterPacksSkeleton<'a> { + SearchStarterPacksSkeleton { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + q: self.__unsafe_private_named.2.unwrap(), + viewer: 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 SearchStarterPacksSkeletonOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hits_total: std::option::Option, + #[serde(borrow)] + pub starter_packs: 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 SearchStarterPacksSkeletonError<'a> { + #[serde(rename = "BadQueryString")] + BadQueryString(std::option::Option), +} + +impl std::fmt::Display for SearchStarterPacksSkeletonError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BadQueryString(msg) => { + write!(f, "BadQueryString")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///app.bsky.unspecced.searchStarterPacksSkeleton +pub struct SearchStarterPacksSkeletonResponse; +impl jacquard_common::xrpc::XrpcResp for SearchStarterPacksSkeletonResponse { + const NSID: &'static str = "app.bsky.unspecced.searchStarterPacksSkeleton"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchStarterPacksSkeletonOutput<'de>; + type Err<'de> = SearchStarterPacksSkeletonError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchStarterPacksSkeleton<'a> { + const NSID: &'static str = "app.bsky.unspecced.searchStarterPacksSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchStarterPacksSkeletonResponse; +} + +/// Endpoint type for +///app.bsky.unspecced.searchStarterPacksSkeleton +pub struct SearchStarterPacksSkeletonRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchStarterPacksSkeletonRequest { + const PATH: &'static str = "/xrpc/app.bsky.unspecced.searchStarterPacksSkeleton"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchStarterPacksSkeleton<'de>; + type Response = SearchStarterPacksSkeletonResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/video.rs b/crates/weaver-api/src/app_bsky/video.rs new file mode 100644 index 0000000..0227ef8 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/video.rs @@ -0,0 +1,469 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.video.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_job_status; +pub mod get_upload_limits; +pub mod upload_video; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct JobStatus<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub blob: Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub error: Option>, + #[serde(borrow)] + pub job_id: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub message: Option>, + /// Progress within the current processing state. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub progress: Option, + /// The state of the video processing job. All values not listed as a known value indicate that the job is in process. + #[serde(borrow)] + pub state: jacquard_common::CowStr<'a>, +} + +pub mod job_status_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 JobId; + type Did; + type State; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type JobId = Unset; + type Did = Unset; + type State = Unset; + } + ///State transition - sets the `job_id` field to Set + pub struct SetJobId(PhantomData S>); + impl sealed::Sealed for SetJobId {} + impl State for SetJobId { + type JobId = Set; + type Did = S::Did; + type State = S::State; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type JobId = S::JobId; + type Did = Set; + type State = S::State; + } + ///State transition - sets the `state` field to Set + pub struct SetState(PhantomData S>); + impl sealed::Sealed for SetState {} + impl State for SetState { + type JobId = S::JobId; + type Did = S::Did; + type State = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `job_id` field + pub struct job_id(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `state` field + pub struct state(()); + } +} + +/// Builder for constructing an instance of this type +pub struct JobStatusBuilder<'a, S: job_status_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> JobStatus<'a> { + /// Create a new builder for this type + pub fn new() -> JobStatusBuilder<'a, job_status_state::Empty> { + JobStatusBuilder::new() + } +} + +impl<'a> JobStatusBuilder<'a, job_status_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + JobStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: job_status_state::State> JobStatusBuilder<'a, S> { + /// Set the `blob` field (optional) + pub fn blob( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `blob` field to an Option value (optional) + pub fn maybe_blob( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> JobStatusBuilder<'a, S> +where + S: job_status_state::State, + S::Did: job_status_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> JobStatusBuilder<'a, job_status_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + JobStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: job_status_state::State> JobStatusBuilder<'a, S> { + /// Set the `error` field (optional) + pub fn error( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `error` field to an Option value (optional) + pub fn maybe_error(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> JobStatusBuilder<'a, S> +where + S: job_status_state::State, + S::JobId: job_status_state::IsUnset, +{ + /// Set the `jobId` field (required) + pub fn job_id( + mut self, + value: impl Into>, + ) -> JobStatusBuilder<'a, job_status_state::SetJobId> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + JobStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: job_status_state::State> JobStatusBuilder<'a, S> { + /// Set the `message` field (optional) + pub fn message( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S: job_status_state::State> JobStatusBuilder<'a, S> { + /// Set the `progress` field (optional) + pub fn progress(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `progress` field to an Option value (optional) + pub fn maybe_progress(mut self, value: Option) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> JobStatusBuilder<'a, S> +where + S: job_status_state::State, + S::State: job_status_state::IsUnset, +{ + /// Set the `state` field (required) + pub fn state( + mut self, + value: impl Into>, + ) -> JobStatusBuilder<'a, job_status_state::SetState> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + JobStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> JobStatusBuilder<'a, S> +where + S: job_status_state::State, + S::JobId: job_status_state::IsSet, + S::Did: job_status_state::IsSet, + S::State: job_status_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> JobStatus<'a> { + JobStatus { + blob: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + error: self.__unsafe_private_named.2, + job_id: self.__unsafe_private_named.3.unwrap(), + message: self.__unsafe_private_named.4, + progress: self.__unsafe_private_named.5, + state: 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>, + >, + ) -> JobStatus<'a> { + JobStatus { + blob: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + error: self.__unsafe_private_named.2, + job_id: self.__unsafe_private_named.3.unwrap(), + message: self.__unsafe_private_named.4, + progress: self.__unsafe_private_named.5, + state: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_app_bsky_video_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("app.bsky.video.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("jobStatus"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("jobId"), + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("state") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blob"), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("error"), + ::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("jobId"), + ::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("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("progress"), + ::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("state"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The state of the video processing job. All values not listed as a known value indicate that the job is in process.", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for JobStatus<'a> { + fn nsid() -> &'static str { + "app.bsky.video.defs" + } + fn def_name() -> &'static str { + "jobStatus" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_app_bsky_video_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.progress { + if *value > 100i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "progress", + ), + max: 100i64, + actual: *value, + }); + } + } + if let Some(ref value) = self.progress { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "progress", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/video/get_job_status.rs b/crates/weaver-api/src/app_bsky/video/get_job_status.rs new file mode 100644 index 0000000..99c281a --- /dev/null +++ b/crates/weaver-api/src/app_bsky/video/get_job_status.rs @@ -0,0 +1,152 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.video.getJobStatus +// +// 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 GetJobStatus<'a> { + #[serde(borrow)] + pub job_id: jacquard_common::CowStr<'a>, +} + +pub mod get_job_status_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 JobId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type JobId = Unset; + } + ///State transition - sets the `job_id` field to Set + pub struct SetJobId(PhantomData S>); + impl sealed::Sealed for SetJobId {} + impl State for SetJobId { + type JobId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `job_id` field + pub struct job_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetJobStatusBuilder<'a, S: get_job_status_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetJobStatus<'a> { + /// Create a new builder for this type + pub fn new() -> GetJobStatusBuilder<'a, get_job_status_state::Empty> { + GetJobStatusBuilder::new() + } +} + +impl<'a> GetJobStatusBuilder<'a, get_job_status_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetJobStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetJobStatusBuilder<'a, S> +where + S: get_job_status_state::State, + S::JobId: get_job_status_state::IsUnset, +{ + /// Set the `jobId` field (required) + pub fn job_id( + mut self, + value: impl Into>, + ) -> GetJobStatusBuilder<'a, get_job_status_state::SetJobId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetJobStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetJobStatusBuilder<'a, S> +where + S: get_job_status_state::State, + S::JobId: get_job_status_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetJobStatus<'a> { + GetJobStatus { + job_id: 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 GetJobStatusOutput<'a> { + #[serde(borrow)] + pub job_status: crate::app_bsky::video::JobStatus<'a>, +} + +/// Response type for +///app.bsky.video.getJobStatus +pub struct GetJobStatusResponse; +impl jacquard_common::xrpc::XrpcResp for GetJobStatusResponse { + const NSID: &'static str = "app.bsky.video.getJobStatus"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetJobStatusOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetJobStatus<'a> { + const NSID: &'static str = "app.bsky.video.getJobStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetJobStatusResponse; +} + +/// Endpoint type for +///app.bsky.video.getJobStatus +pub struct GetJobStatusRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetJobStatusRequest { + const PATH: &'static str = "/xrpc/app.bsky.video.getJobStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetJobStatus<'de>; + type Response = GetJobStatusResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/video/get_upload_limits.rs b/crates/weaver-api/src/app_bsky/video/get_upload_limits.rs new file mode 100644 index 0000000..2d87559 --- /dev/null +++ b/crates/weaver-api/src/app_bsky/video/get_upload_limits.rs @@ -0,0 +1,69 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.video.getUploadLimits +// +// 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 GetUploadLimitsOutput<'a> { + pub can_upload: bool, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub error: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub message: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub remaining_daily_bytes: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub remaining_daily_videos: std::option::Option, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct GetUploadLimits; +/// Response type for +///app.bsky.video.getUploadLimits +pub struct GetUploadLimitsResponse; +impl jacquard_common::xrpc::XrpcResp for GetUploadLimitsResponse { + const NSID: &'static str = "app.bsky.video.getUploadLimits"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetUploadLimitsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetUploadLimits { + const NSID: &'static str = "app.bsky.video.getUploadLimits"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetUploadLimitsResponse; +} + +/// Endpoint type for +///app.bsky.video.getUploadLimits +pub struct GetUploadLimitsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetUploadLimitsRequest { + const PATH: &'static str = "/xrpc/app.bsky.video.getUploadLimits"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetUploadLimits; + type Response = GetUploadLimitsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/video/upload_video.rs b/crates/weaver-api/src/app_bsky/video/upload_video.rs new file mode 100644 index 0000000..2c029af --- /dev/null +++ b/crates/weaver-api/src/app_bsky/video/upload_video.rs @@ -0,0 +1,81 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: app.bsky.video.uploadVideo +// +// 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 UploadVideo { + pub body: bytes::Bytes, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UploadVideoOutput<'a> { + #[serde(borrow)] + pub job_status: crate::app_bsky::video::JobStatus<'a>, +} + +/// Response type for +///app.bsky.video.uploadVideo +pub struct UploadVideoResponse; +impl jacquard_common::xrpc::XrpcResp for UploadVideoResponse { + const NSID: &'static str = "app.bsky.video.uploadVideo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UploadVideoOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for UploadVideo { + const NSID: &'static str = "app.bsky.video.uploadVideo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "video/mp4", + ); + type Response = UploadVideoResponse; + fn encode_body(&self) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(self.body.to_vec()) + } + fn decode_body<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self: serde::Deserialize<'de>, + { + Ok( + Box::new(Self { + body: bytes::Bytes::copy_from_slice(body), + }), + ) + } +} + +/// Endpoint type for +///app.bsky.video.uploadVideo +pub struct UploadVideoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UploadVideoRequest { + const PATH: &'static str = "/xrpc/app.bsky.video.uploadVideo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "video/mp4", + ); + type Request<'de> = UploadVideo; + type Response = UploadVideoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/builder_types.rs b/crates/weaver-api/src/builder_types.rs new file mode 100644 index 0000000..5deeb86 --- /dev/null +++ b/crates/weaver-api/src/builder_types.rs @@ -0,0 +1,43 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Marker type indicating a builder field has been set +pub struct Set(pub T); +impl Set { + /// Extract the inner value + #[inline] + pub fn into_inner(self) -> T { + self.0 + } +} + +/// Marker type indicating a builder field has not been set +pub struct Unset; +/// Trait indicating a builder field is set (has a value) +#[rustversion::attr( + since(1.78.0), + diagnostic::on_unimplemented( + message = "the field `{Self}` was not set, but this method requires it to be set", + label = "the field `{Self}` was not set" + ) +)] +pub trait IsSet: private::Sealed {} +/// Trait indicating a builder field is unset (no value yet) +#[rustversion::attr( + since(1.78.0), + diagnostic::on_unimplemented( + message = "the field `{Self}` was already set, but this method requires it to be unset", + label = "the field `{Self}` was already set" + ) +)] +pub trait IsUnset: private::Sealed {} +impl IsSet for Set {} +impl IsUnset for Unset {} +mod private { + /// Sealed trait to prevent external implementations + pub trait Sealed {} + impl Sealed for super::Set {} + impl Sealed for super::Unset {} +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky.rs b/crates/weaver-api/src/chat_bsky.rs new file mode 100644 index 0000000..a47a07d --- /dev/null +++ b/crates/weaver-api/src/chat_bsky.rs @@ -0,0 +1,8 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod actor; +pub mod convo; +pub mod moderation; \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/actor.rs b/crates/weaver-api/src/chat_bsky/actor.rs new file mode 100644 index 0000000..c4207a0 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/actor.rs @@ -0,0 +1,550 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.actor.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod declaration; +pub mod delete_account; +pub mod export_account_data; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileViewBasic<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub associated: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + /// Set to true when the actor cannot actively participate in conversations + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub chat_disabled: Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verification: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: Option>, +} + +pub mod profile_view_basic_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 Did; + type Handle; + } + /// 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; + } + ///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 `did` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_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> ProfileViewBasic<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { + ProfileViewBasicBuilder::new() + } +} + +impl<'a> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `associated` field (optional) + pub fn associated( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `associated` field to an Option value (optional) + pub fn maybe_associated( + 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 `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + 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 `chatDisabled` field (optional) + pub fn chat_disabled(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `chatDisabled` field to an Option value (optional) + pub fn maybe_chat_disabled(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ProfileViewBasicBuilder<'a, S> +where + S: profile_view_basic_state::State, + S::Did: profile_view_basic_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid> { + self.__unsafe_private_named.3 = ::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 `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +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.5 = ::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 `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 `verification` field (optional) + pub fn verification( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `verification` field to an Option value (optional) + pub fn maybe_verification( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = 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 { + associated: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + chat_disabled: self.__unsafe_private_named.2, + did: self.__unsafe_private_named.3.unwrap(), + display_name: self.__unsafe_private_named.4, + handle: self.__unsafe_private_named.5.unwrap(), + labels: self.__unsafe_private_named.6, + verification: self.__unsafe_private_named.7, + viewer: self.__unsafe_private_named.8, + 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 { + associated: self.__unsafe_private_named.0, + avatar: self.__unsafe_private_named.1, + chat_disabled: self.__unsafe_private_named.2, + did: self.__unsafe_private_named.3.unwrap(), + display_name: self.__unsafe_private_named.4, + handle: self.__unsafe_private_named.5.unwrap(), + labels: self.__unsafe_private_named.6, + verification: self.__unsafe_private_named.7, + viewer: self.__unsafe_private_named.8, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_chat_bsky_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("chat.bsky.actor.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profileViewBasic"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "associated", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileAssociated", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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( + "chatDisabled", + ), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "verification", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#verificationState", + ), + }), + ); + 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( + "app.bsky.actor.defs#viewerState", + ), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewBasic<'a> { + fn nsid() -> &'static str { + "chat.bsky.actor.defs" + } + fn def_name() -> &'static str { + "profileViewBasic" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_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(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/actor/declaration.rs b/crates/weaver-api/src/chat_bsky/actor/declaration.rs new file mode 100644 index 0000000..7bcbadc --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/actor/declaration.rs @@ -0,0 +1,261 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.actor.declaration +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A declaration of a Bluesky chat account. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Declaration<'a> { + #[serde(borrow)] + pub allow_incoming: jacquard_common::CowStr<'a>, +} + +pub mod declaration_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 AllowIncoming; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type AllowIncoming = Unset; + } + ///State transition - sets the `allow_incoming` field to Set + pub struct SetAllowIncoming(PhantomData S>); + impl sealed::Sealed for SetAllowIncoming {} + impl State for SetAllowIncoming { + type AllowIncoming = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `allow_incoming` field + pub struct allow_incoming(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeclarationBuilder<'a, S: declaration_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Declaration<'a> { + /// Create a new builder for this type + pub fn new() -> DeclarationBuilder<'a, declaration_state::Empty> { + DeclarationBuilder::new() + } +} + +impl<'a> DeclarationBuilder<'a, declaration_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeclarationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeclarationBuilder<'a, S> +where + S: declaration_state::State, + S::AllowIncoming: declaration_state::IsUnset, +{ + /// Set the `allowIncoming` field (required) + pub fn allow_incoming( + mut self, + value: impl Into>, + ) -> DeclarationBuilder<'a, declaration_state::SetAllowIncoming> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeclarationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeclarationBuilder<'a, S> +where + S: declaration_state::State, + S::AllowIncoming: declaration_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Declaration<'a> { + Declaration { + allow_incoming: 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>, + >, + ) -> Declaration<'a> { + Declaration { + allow_incoming: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Declaration<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, DeclarationRecord>, + 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 DeclarationGetRecordOutput<'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: Declaration<'a>, +} + +impl From> for Declaration<'_> { + fn from(output: DeclarationGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Declaration<'_> { + const NSID: &'static str = "chat.bsky.actor.declaration"; + type Record = DeclarationRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct DeclarationRecord; +impl jacquard_common::xrpc::XrpcResp for DeclarationRecord { + const NSID: &'static str = "chat.bsky.actor.declaration"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DeclarationGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for DeclarationRecord { + const NSID: &'static str = "chat.bsky.actor.declaration"; + type Record = DeclarationRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Declaration<'a> { + fn nsid() -> &'static str { + "chat.bsky.actor.declaration" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_actor_declaration() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_chat_bsky_actor_declaration() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("chat.bsky.actor.declaration"), + 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( + "A declaration of a Bluesky chat account.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("allowIncoming") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "allowIncoming", + ), + ::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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/actor/delete_account.rs b/crates/weaver-api/src/chat_bsky/actor/delete_account.rs new file mode 100644 index 0000000..ff9752b --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/actor/delete_account.rs @@ -0,0 +1,61 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.actor.deleteAccount +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DeleteAccountOutput<'a> {} +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct DeleteAccount; +/// Response type for +///chat.bsky.actor.deleteAccount +pub struct DeleteAccountResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteAccountResponse { + const NSID: &'static str = "chat.bsky.actor.deleteAccount"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DeleteAccountOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for DeleteAccount { + const NSID: &'static str = "chat.bsky.actor.deleteAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteAccountResponse; +} + +/// Endpoint type for +///chat.bsky.actor.deleteAccount +pub struct DeleteAccountRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteAccountRequest { + const PATH: &'static str = "/xrpc/chat.bsky.actor.deleteAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteAccount; + type Response = DeleteAccountResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/actor/export_account_data.rs b/crates/weaver-api/src/chat_bsky/actor/export_account_data.rs new file mode 100644 index 0000000..0f3ea27 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/actor/export_account_data.rs @@ -0,0 +1,73 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.actor.exportAccountData +// +// 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 ExportAccountDataOutput { + pub body: bytes::Bytes, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct ExportAccountData; +/// Response type for +///chat.bsky.actor.exportAccountData +pub struct ExportAccountDataResponse; +impl jacquard_common::xrpc::XrpcResp for ExportAccountDataResponse { + const NSID: &'static str = "chat.bsky.actor.exportAccountData"; + const ENCODING: &'static str = "application/jsonl"; + type Output<'de> = ExportAccountDataOutput; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; + fn encode_output( + output: &Self::Output<'_>, + ) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(output.body.to_vec()) + } + fn decode_output<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self::Output<'de>: serde::Deserialize<'de>, + { + Ok(ExportAccountDataOutput { + body: bytes::Bytes::copy_from_slice(body), + }) + } +} + +impl jacquard_common::xrpc::XrpcRequest for ExportAccountData { + const NSID: &'static str = "chat.bsky.actor.exportAccountData"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ExportAccountDataResponse; +} + +/// Endpoint type for +///chat.bsky.actor.exportAccountData +pub struct ExportAccountDataRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ExportAccountDataRequest { + const PATH: &'static str = "/xrpc/chat.bsky.actor.exportAccountData"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ExportAccountData; + type Response = ExportAccountDataResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo.rs b/crates/weaver-api/src/chat_bsky/convo.rs new file mode 100644 index 0000000..8193f9e --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo.rs @@ -0,0 +1,4663 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod accept_convo; +pub mod add_reaction; +pub mod delete_message_for_self; +pub mod get_convo; +pub mod get_convo_availability; +pub mod get_convo_for_members; +pub mod get_log; +pub mod get_messages; +pub mod leave_convo; +pub mod list_convos; +pub mod mute_convo; +pub mod remove_reaction; +pub mod send_message; +pub mod send_message_batch; +pub mod unmute_convo; +pub mod update_all_read; +pub mod update_read; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ConvoView<'a> { + #[serde(borrow)] + pub id: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub last_message: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub last_reaction: Option>, + #[serde(borrow)] + pub members: Vec>, + pub muted: bool, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + pub unread_count: i64, +} + +pub mod convo_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 Id; + type Rev; + type Members; + type Muted; + type UnreadCount; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Id = Unset; + type Rev = Unset; + type Members = Unset; + type Muted = Unset; + type UnreadCount = 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 Rev = S::Rev; + type Members = S::Members; + type Muted = S::Muted; + type UnreadCount = S::UnreadCount; + } + ///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 Rev = Set; + type Members = S::Members; + type Muted = S::Muted; + type UnreadCount = S::UnreadCount; + } + ///State transition - sets the `members` field to Set + pub struct SetMembers(PhantomData S>); + impl sealed::Sealed for SetMembers {} + impl State for SetMembers { + type Id = S::Id; + type Rev = S::Rev; + type Members = Set; + type Muted = S::Muted; + type UnreadCount = S::UnreadCount; + } + ///State transition - sets the `muted` field to Set + pub struct SetMuted(PhantomData S>); + impl sealed::Sealed for SetMuted {} + impl State for SetMuted { + type Id = S::Id; + type Rev = S::Rev; + type Members = S::Members; + type Muted = Set; + type UnreadCount = S::UnreadCount; + } + ///State transition - sets the `unread_count` field to Set + pub struct SetUnreadCount(PhantomData S>); + impl sealed::Sealed for SetUnreadCount {} + impl State for SetUnreadCount { + type Id = S::Id; + type Rev = S::Rev; + type Members = S::Members; + type Muted = S::Muted; + type UnreadCount = 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 `rev` field + pub struct rev(()); + ///Marker type for the `members` field + pub struct members(()); + ///Marker type for the `muted` field + pub struct muted(()); + ///Marker type for the `unread_count` field + pub struct unread_count(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ConvoViewBuilder<'a, S: convo_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> ConvoView<'a> { + /// Create a new builder for this type + pub fn new() -> ConvoViewBuilder<'a, convo_view_state::Empty> { + ConvoViewBuilder::new() + } +} + +impl<'a> ConvoViewBuilder<'a, convo_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ConvoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ConvoViewBuilder<'a, S> +where + S: convo_view_state::State, + S::Id: convo_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into>, + ) -> ConvoViewBuilder<'a, convo_view_state::SetId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ConvoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: convo_view_state::State> ConvoViewBuilder<'a, S> { + /// Set the `lastMessage` field (optional) + pub fn last_message( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `lastMessage` field to an Option value (optional) + pub fn maybe_last_message( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: convo_view_state::State> ConvoViewBuilder<'a, S> { + /// Set the `lastReaction` field (optional) + pub fn last_reaction( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `lastReaction` field to an Option value (optional) + pub fn maybe_last_reaction( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ConvoViewBuilder<'a, S> +where + S: convo_view_state::State, + S::Members: convo_view_state::IsUnset, +{ + /// Set the `members` field (required) + pub fn members( + mut self, + value: impl Into>>, + ) -> ConvoViewBuilder<'a, convo_view_state::SetMembers> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ConvoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ConvoViewBuilder<'a, S> +where + S: convo_view_state::State, + S::Muted: convo_view_state::IsUnset, +{ + /// Set the `muted` field (required) + pub fn muted( + mut self, + value: impl Into, + ) -> ConvoViewBuilder<'a, convo_view_state::SetMuted> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ConvoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ConvoViewBuilder<'a, S> +where + S: convo_view_state::State, + S::Rev: convo_view_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> ConvoViewBuilder<'a, convo_view_state::SetRev> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + ConvoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: convo_view_state::State> ConvoViewBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = 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.6 = value; + self + } +} + +impl<'a, S> ConvoViewBuilder<'a, S> +where + S: convo_view_state::State, + S::UnreadCount: convo_view_state::IsUnset, +{ + /// Set the `unreadCount` field (required) + pub fn unread_count( + mut self, + value: impl Into, + ) -> ConvoViewBuilder<'a, convo_view_state::SetUnreadCount> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + ConvoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ConvoViewBuilder<'a, S> +where + S: convo_view_state::State, + S::Id: convo_view_state::IsSet, + S::Rev: convo_view_state::IsSet, + S::Members: convo_view_state::IsSet, + S::Muted: convo_view_state::IsSet, + S::UnreadCount: convo_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ConvoView<'a> { + ConvoView { + id: self.__unsafe_private_named.0.unwrap(), + last_message: self.__unsafe_private_named.1, + last_reaction: self.__unsafe_private_named.2, + members: self.__unsafe_private_named.3.unwrap(), + muted: self.__unsafe_private_named.4.unwrap(), + rev: self.__unsafe_private_named.5.unwrap(), + status: self.__unsafe_private_named.6, + unread_count: 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>, + >, + ) -> ConvoView<'a> { + ConvoView { + id: self.__unsafe_private_named.0.unwrap(), + last_message: self.__unsafe_private_named.1, + last_reaction: self.__unsafe_private_named.2, + members: self.__unsafe_private_named.3.unwrap(), + muted: self.__unsafe_private_named.4.unwrap(), + rev: self.__unsafe_private_named.5.unwrap(), + status: self.__unsafe_private_named.6, + unread_count: self.__unsafe_private_named.7.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 ConvoViewLastMessage<'a> { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), +} + +fn lexicon_doc_chat_bsky_convo_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("chat.bsky.convo.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("members"), + ::jacquard_common::smol_str::SmolStr::new_static("muted"), + ::jacquard_common::smol_str::SmolStr::new_static("unreadCount") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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( + "lastMessage", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#messageView"), + ::jacquard_common::CowStr::new_static("#deletedMessageView") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "lastReaction", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#messageAndReactionView") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("members"), + ::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( + "chat.bsky.actor.defs#profileViewBasic", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("muted"), + ::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("rev"), + ::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( + "unreadCount", + ), + ::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("deletedMessageView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("sender"), + ::jacquard_common::smol_str::SmolStr::new_static("sentAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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("rev"), + ::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("sender"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#messageViewSender", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("sentAt"), + ::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("logAcceptConvo"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("rev"), + ::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("logAddReaction"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::jacquard_common::smol_str::SmolStr::new_static("message"), + ::jacquard_common::smol_str::SmolStr::new_static("reaction") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#messageView"), + ::jacquard_common::CowStr::new_static("#deletedMessageView") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reaction"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#reactionView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::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("logBeginConvo"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("rev"), + ::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("logCreateMessage"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::jacquard_common::smol_str::SmolStr::new_static("message") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#messageView"), + ::jacquard_common::CowStr::new_static("#deletedMessageView") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::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("logDeleteMessage"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::jacquard_common::smol_str::SmolStr::new_static("message") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#messageView"), + ::jacquard_common::CowStr::new_static("#deletedMessageView") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::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("logLeaveConvo"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("rev"), + ::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("logMuteConvo"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("rev"), + ::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("logReadMessage"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::jacquard_common::smol_str::SmolStr::new_static("message") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#messageView"), + ::jacquard_common::CowStr::new_static("#deletedMessageView") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::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("logRemoveReaction"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::jacquard_common::smol_str::SmolStr::new_static("message"), + ::jacquard_common::smol_str::SmolStr::new_static("reaction") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#messageView"), + ::jacquard_common::CowStr::new_static("#deletedMessageView") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reaction"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#reactionView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::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("logUnmuteConvo"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("rev"), + ::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( + "messageAndReactionView", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("message"), + ::jacquard_common::smol_str::SmolStr::new_static("reaction") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#messageView"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reaction"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#reactionView", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("messageInput"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("text")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("embed"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.record") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("facets"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Annotations of text (mentions, URLs, hashtags, etc)", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.richtext.facet", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("text"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(10000usize), + min_graphemes: None, + max_graphemes: Some(1000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("messageRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("messageId"), + ::jacquard_common::smol_str::SmolStr::new_static("convoId") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "messageId", + ), + ::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("messageView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("text"), + ::jacquard_common::smol_str::SmolStr::new_static("sender"), + ::jacquard_common::smol_str::SmolStr::new_static("sentAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("embed"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.record#view") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("facets"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Annotations of text (mentions, URLs, hashtags, etc)", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.richtext.facet", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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( + "reactions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reactions to this message, in ascending order of creation time.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#reactionView", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::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("sender"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#messageViewSender", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("sentAt"), + ::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("text"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(10000usize), + min_graphemes: None, + max_graphemes: Some(1000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("messageViewSender"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("reactionView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::jacquard_common::smol_str::SmolStr::new_static("sender"), + ::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("sender"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#reactionViewSender", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::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("reactionViewSender"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ConvoView<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "convoView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 DeletedMessageView<'a> { + #[serde(borrow)] + pub id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub sender: crate::chat_bsky::convo::MessageViewSender<'a>, + pub sent_at: jacquard_common::types::string::Datetime, +} + +pub mod deleted_message_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 Id; + 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 Id = Unset; + 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 Rev = S::Rev; + 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 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 = 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 Rev = S::Rev; + type Sender = S::Sender; + type SentAt = 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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeletedMessageViewBuilder<'a, S: deleted_message_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> DeletedMessageView<'a> { + /// Create a new builder for this type + pub fn new() -> DeletedMessageViewBuilder<'a, deleted_message_view_state::Empty> { + DeletedMessageViewBuilder::new() + } +} + +impl<'a> DeletedMessageViewBuilder<'a, deleted_message_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeletedMessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeletedMessageViewBuilder<'a, S> +where + S: deleted_message_view_state::State, + S::Id: deleted_message_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into>, + ) -> DeletedMessageViewBuilder<'a, deleted_message_view_state::SetId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeletedMessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeletedMessageViewBuilder<'a, S> +where + S: deleted_message_view_state::State, + S::Rev: deleted_message_view_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> DeletedMessageViewBuilder<'a, deleted_message_view_state::SetRev> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DeletedMessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeletedMessageViewBuilder<'a, S> +where + S: deleted_message_view_state::State, + S::Sender: deleted_message_view_state::IsUnset, +{ + /// Set the `sender` field (required) + pub fn sender( + mut self, + value: impl Into>, + ) -> DeletedMessageViewBuilder<'a, deleted_message_view_state::SetSender> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + DeletedMessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeletedMessageViewBuilder<'a, S> +where + S: deleted_message_view_state::State, + S::SentAt: deleted_message_view_state::IsUnset, +{ + /// Set the `sentAt` field (required) + pub fn sent_at( + mut self, + value: impl Into, + ) -> DeletedMessageViewBuilder<'a, deleted_message_view_state::SetSentAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + DeletedMessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeletedMessageViewBuilder<'a, S> +where + S: deleted_message_view_state::State, + S::Id: deleted_message_view_state::IsSet, + S::Rev: deleted_message_view_state::IsSet, + S::Sender: deleted_message_view_state::IsSet, + S::SentAt: deleted_message_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DeletedMessageView<'a> { + DeletedMessageView { + id: self.__unsafe_private_named.0.unwrap(), + rev: self.__unsafe_private_named.1.unwrap(), + sender: self.__unsafe_private_named.2.unwrap(), + sent_at: 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>, + >, + ) -> DeletedMessageView<'a> { + DeletedMessageView { + id: self.__unsafe_private_named.0.unwrap(), + rev: self.__unsafe_private_named.1.unwrap(), + sender: self.__unsafe_private_named.2.unwrap(), + sent_at: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DeletedMessageView<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "deletedMessageView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct LogAcceptConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogAcceptConvo<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logAcceptConvo" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 LogAddReaction<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message: LogAddReactionMessage<'a>, + #[serde(borrow)] + pub reaction: crate::chat_bsky::convo::ReactionView<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +pub mod log_add_reaction_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 Rev; + type ConvoId; + type Message; + type Reaction; + } + /// 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 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; + } + ///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 Reaction = S::Reaction; + } + ///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 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 Rev = S::Rev; + type ConvoId = S::ConvoId; + type Message = S::Message; + type Reaction = 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 `reaction` field + pub struct reaction(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LogAddReactionBuilder<'a, S: log_add_reaction_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> LogAddReaction<'a> { + /// Create a new builder for this type + pub fn new() -> LogAddReactionBuilder<'a, log_add_reaction_state::Empty> { + LogAddReactionBuilder::new() + } +} + +impl<'a> LogAddReactionBuilder<'a, log_add_reaction_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LogAddReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogAddReactionBuilder<'a, S> +where + S: log_add_reaction_state::State, + S::ConvoId: log_add_reaction_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> LogAddReactionBuilder<'a, log_add_reaction_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LogAddReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogAddReactionBuilder<'a, S> +where + S: log_add_reaction_state::State, + S::Message: log_add_reaction_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogAddReactionBuilder<'a, log_add_reaction_state::SetMessage> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LogAddReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogAddReactionBuilder<'a, S> +where + S: log_add_reaction_state::State, + S::Reaction: log_add_reaction_state::IsUnset, +{ + /// Set the `reaction` field (required) + pub fn reaction( + mut self, + value: impl Into>, + ) -> LogAddReactionBuilder<'a, log_add_reaction_state::SetReaction> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LogAddReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogAddReactionBuilder<'a, S> +where + S: log_add_reaction_state::State, + S::Rev: log_add_reaction_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> LogAddReactionBuilder<'a, log_add_reaction_state::SetRev> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + LogAddReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogAddReactionBuilder<'a, S> +where + S: log_add_reaction_state::State, + S::Rev: log_add_reaction_state::IsSet, + S::ConvoId: log_add_reaction_state::IsSet, + S::Message: log_add_reaction_state::IsSet, + S::Reaction: log_add_reaction_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LogAddReaction<'a> { + LogAddReaction { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + reaction: self.__unsafe_private_named.2.unwrap(), + rev: 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>, + >, + ) -> LogAddReaction<'a> { + LogAddReaction { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + reaction: self.__unsafe_private_named.2.unwrap(), + rev: self.__unsafe_private_named.3.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 LogAddReactionMessage<'a> { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogAddReaction<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logAddReaction" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct LogBeginConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogBeginConvo<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logBeginConvo" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 LogCreateMessage<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message: LogCreateMessageMessage<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +pub mod log_create_message_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 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 Rev = Unset; + type ConvoId = Unset; + 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 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; + } + ///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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LogCreateMessageBuilder<'a, S: log_create_message_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> LogCreateMessage<'a> { + /// Create a new builder for this type + pub fn new() -> LogCreateMessageBuilder<'a, log_create_message_state::Empty> { + LogCreateMessageBuilder::new() + } +} + +impl<'a> LogCreateMessageBuilder<'a, log_create_message_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LogCreateMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogCreateMessageBuilder<'a, S> +where + S: log_create_message_state::State, + S::ConvoId: log_create_message_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> LogCreateMessageBuilder<'a, log_create_message_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LogCreateMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogCreateMessageBuilder<'a, S> +where + S: log_create_message_state::State, + S::Message: log_create_message_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogCreateMessageBuilder<'a, log_create_message_state::SetMessage> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LogCreateMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogCreateMessageBuilder<'a, S> +where + S: log_create_message_state::State, + S::Rev: log_create_message_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> LogCreateMessageBuilder<'a, log_create_message_state::SetRev> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LogCreateMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> LogCreateMessage<'a> { + LogCreateMessage { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + rev: 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>, + >, + ) -> LogCreateMessage<'a> { + LogCreateMessage { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + rev: self.__unsafe_private_named.2.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 LogCreateMessageMessage<'a> { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogCreateMessage<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logCreateMessage" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 LogDeleteMessage<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message: LogDeleteMessageMessage<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +pub mod log_delete_message_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 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 Rev = Unset; + type ConvoId = Unset; + 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 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; + } + ///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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LogDeleteMessageBuilder<'a, S: log_delete_message_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> LogDeleteMessage<'a> { + /// Create a new builder for this type + pub fn new() -> LogDeleteMessageBuilder<'a, log_delete_message_state::Empty> { + LogDeleteMessageBuilder::new() + } +} + +impl<'a> LogDeleteMessageBuilder<'a, log_delete_message_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LogDeleteMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogDeleteMessageBuilder<'a, S> +where + S: log_delete_message_state::State, + S::ConvoId: log_delete_message_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> LogDeleteMessageBuilder<'a, log_delete_message_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LogDeleteMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogDeleteMessageBuilder<'a, S> +where + S: log_delete_message_state::State, + S::Message: log_delete_message_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogDeleteMessageBuilder<'a, log_delete_message_state::SetMessage> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LogDeleteMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogDeleteMessageBuilder<'a, S> +where + S: log_delete_message_state::State, + S::Rev: log_delete_message_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> LogDeleteMessageBuilder<'a, log_delete_message_state::SetRev> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LogDeleteMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> LogDeleteMessage<'a> { + LogDeleteMessage { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + rev: 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>, + >, + ) -> LogDeleteMessage<'a> { + LogDeleteMessage { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + rev: self.__unsafe_private_named.2.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 LogDeleteMessageMessage<'a> { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogDeleteMessage<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logDeleteMessage" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct LogLeaveConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogLeaveConvo<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logLeaveConvo" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct LogMuteConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogMuteConvo<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logMuteConvo" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 LogReadMessage<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message: LogReadMessageMessage<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +pub mod log_read_message_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 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 Rev = Unset; + type ConvoId = Unset; + 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 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; + } + ///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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LogReadMessageBuilder<'a, S: log_read_message_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> LogReadMessage<'a> { + /// Create a new builder for this type + pub fn new() -> LogReadMessageBuilder<'a, log_read_message_state::Empty> { + LogReadMessageBuilder::new() + } +} + +impl<'a> LogReadMessageBuilder<'a, log_read_message_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LogReadMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogReadMessageBuilder<'a, S> +where + S: log_read_message_state::State, + S::ConvoId: log_read_message_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> LogReadMessageBuilder<'a, log_read_message_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LogReadMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogReadMessageBuilder<'a, S> +where + S: log_read_message_state::State, + S::Message: log_read_message_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogReadMessageBuilder<'a, log_read_message_state::SetMessage> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LogReadMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogReadMessageBuilder<'a, S> +where + S: log_read_message_state::State, + S::Rev: log_read_message_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> LogReadMessageBuilder<'a, log_read_message_state::SetRev> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LogReadMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogReadMessageBuilder<'a, S> +where + S: log_read_message_state::State, + 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> { + LogReadMessage { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + rev: 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>, + >, + ) -> LogReadMessage<'a> { + LogReadMessage { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + rev: self.__unsafe_private_named.2.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 LogReadMessageMessage<'a> { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogReadMessage<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logReadMessage" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 LogRemoveReaction<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message: LogRemoveReactionMessage<'a>, + #[serde(borrow)] + pub reaction: crate::chat_bsky::convo::ReactionView<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +pub mod log_remove_reaction_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 Rev; + type ConvoId; + type Message; + type Reaction; + } + /// 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 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; + } + ///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 Reaction = S::Reaction; + } + ///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 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 Rev = S::Rev; + type ConvoId = S::ConvoId; + type Message = S::Message; + type Reaction = 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 `reaction` field + pub struct reaction(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LogRemoveReactionBuilder<'a, S: log_remove_reaction_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> LogRemoveReaction<'a> { + /// Create a new builder for this type + pub fn new() -> LogRemoveReactionBuilder<'a, log_remove_reaction_state::Empty> { + LogRemoveReactionBuilder::new() + } +} + +impl<'a> LogRemoveReactionBuilder<'a, log_remove_reaction_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LogRemoveReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogRemoveReactionBuilder<'a, S> +where + S: log_remove_reaction_state::State, + S::ConvoId: log_remove_reaction_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> LogRemoveReactionBuilder<'a, log_remove_reaction_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LogRemoveReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogRemoveReactionBuilder<'a, S> +where + S: log_remove_reaction_state::State, + S::Message: log_remove_reaction_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogRemoveReactionBuilder<'a, log_remove_reaction_state::SetMessage> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LogRemoveReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogRemoveReactionBuilder<'a, S> +where + S: log_remove_reaction_state::State, + S::Reaction: log_remove_reaction_state::IsUnset, +{ + /// Set the `reaction` field (required) + pub fn reaction( + mut self, + value: impl Into>, + ) -> LogRemoveReactionBuilder<'a, log_remove_reaction_state::SetReaction> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LogRemoveReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LogRemoveReactionBuilder<'a, S> +where + S: log_remove_reaction_state::State, + S::Rev: log_remove_reaction_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> LogRemoveReactionBuilder<'a, log_remove_reaction_state::SetRev> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + LogRemoveReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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::Reaction: log_remove_reaction_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LogRemoveReaction<'a> { + LogRemoveReaction { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + reaction: self.__unsafe_private_named.2.unwrap(), + rev: 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>, + >, + ) -> LogRemoveReaction<'a> { + LogRemoveReaction { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + reaction: self.__unsafe_private_named.2.unwrap(), + rev: self.__unsafe_private_named.3.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 LogRemoveReactionMessage<'a> { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogRemoveReaction<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logRemoveReaction" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct LogUnmuteConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogUnmuteConvo<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logUnmuteConvo" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 MessageAndReactionView<'a> { + #[serde(borrow)] + pub message: crate::chat_bsky::convo::MessageView<'a>, + #[serde(borrow)] + pub reaction: crate::chat_bsky::convo::ReactionView<'a>, +} + +pub mod message_and_reaction_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 Message; + 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 Reaction = 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 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; + 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 `reaction` field + pub struct reaction(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MessageAndReactionViewBuilder<'a, S: message_and_reaction_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> MessageAndReactionView<'a> { + /// Create a new builder for this type + pub fn new() -> MessageAndReactionViewBuilder< + 'a, + message_and_reaction_view_state::Empty, + > { + MessageAndReactionViewBuilder::new() + } +} + +impl<'a> MessageAndReactionViewBuilder<'a, message_and_reaction_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MessageAndReactionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageAndReactionViewBuilder<'a, S> +where + S: message_and_reaction_view_state::State, + S::Message: message_and_reaction_view_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> MessageAndReactionViewBuilder< + 'a, + message_and_reaction_view_state::SetMessage, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MessageAndReactionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageAndReactionViewBuilder<'a, S> +where + S: message_and_reaction_view_state::State, + S::Reaction: message_and_reaction_view_state::IsUnset, +{ + /// Set the `reaction` field (required) + pub fn reaction( + mut self, + value: impl Into>, + ) -> MessageAndReactionViewBuilder< + 'a, + message_and_reaction_view_state::SetReaction, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + MessageAndReactionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageAndReactionViewBuilder<'a, S> +where + S: message_and_reaction_view_state::State, + S::Message: message_and_reaction_view_state::IsSet, + S::Reaction: message_and_reaction_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> MessageAndReactionView<'a> { + MessageAndReactionView { + message: self.__unsafe_private_named.0.unwrap(), + reaction: 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>, + >, + ) -> MessageAndReactionView<'a> { + MessageAndReactionView { + message: self.__unsafe_private_named.0.unwrap(), + reaction: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MessageAndReactionView<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageAndReactionView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct MessageInput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embed: std::option::Option>, + /// Annotations of text (mentions, URLs, hashtags, etc) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub facets: std::option::Option>>, + #[serde(borrow)] + pub text: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MessageInput<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageInput" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.text; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "text", + ), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.text; + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "text", + ), + max: 1000usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct MessageRef<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub message_id: jacquard_common::CowStr<'a>, +} + +pub mod message_ref_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 Did; + type MessageId; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type MessageId = Unset; + type ConvoId = 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 MessageId = S::MessageId; + type ConvoId = S::ConvoId; + } + ///State transition - sets the `message_id` field to Set + pub struct SetMessageId(PhantomData S>); + impl sealed::Sealed for SetMessageId {} + impl State for SetMessageId { + type Did = S::Did; + type MessageId = 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 Did = S::Did; + type MessageId = S::MessageId; + type ConvoId = 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 `message_id` field + pub struct message_id(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MessageRefBuilder<'a, S: message_ref_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> MessageRef<'a> { + /// Create a new builder for this type + pub fn new() -> MessageRefBuilder<'a, message_ref_state::Empty> { + MessageRefBuilder::new() + } +} + +impl<'a> MessageRefBuilder<'a, message_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MessageRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageRefBuilder<'a, S> +where + S: message_ref_state::State, + S::ConvoId: message_ref_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> MessageRefBuilder<'a, message_ref_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MessageRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageRefBuilder<'a, S> +where + S: message_ref_state::State, + S::Did: message_ref_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> MessageRefBuilder<'a, message_ref_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + MessageRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageRefBuilder<'a, S> +where + S: message_ref_state::State, + S::MessageId: message_ref_state::IsUnset, +{ + /// Set the `messageId` field (required) + pub fn message_id( + mut self, + value: impl Into>, + ) -> MessageRefBuilder<'a, message_ref_state::SetMessageId> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + MessageRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageRefBuilder<'a, S> +where + S: message_ref_state::State, + S::Did: message_ref_state::IsSet, + S::MessageId: message_ref_state::IsSet, + S::ConvoId: message_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> MessageRef<'a> { + MessageRef { + convo_id: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + message_id: 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>, + >, + ) -> MessageRef<'a> { + MessageRef { + convo_id: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + message_id: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MessageRef<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageRef" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 MessageView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embed: Option>, + /// Annotations of text (mentions, URLs, hashtags, etc) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub facets: Option>>, + #[serde(borrow)] + pub id: jacquard_common::CowStr<'a>, + /// Reactions to this message, in ascending order of creation time. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reactions: Option>>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub sender: crate::chat_bsky::convo::MessageViewSender<'a>, + pub sent_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub text: jacquard_common::CowStr<'a>, +} + +pub mod message_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 Id; + type Rev; + type Text; + type Sender; + type SentAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Id = Unset; + type Rev = Unset; + type Text = 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 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 Rev = Set; + type Text = S::Text; + type Sender = S::Sender; + type SentAt = S::SentAt; + } + ///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 Rev = S::Rev; + type Text = 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 = S::Rev; + type Text = S::Text; + 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 Rev = S::Rev; + type Text = S::Text; + type Sender = S::Sender; + type SentAt = 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 `rev` field + pub struct rev(()); + ///Marker type for the `text` field + pub struct text(()); + ///Marker type for the `sender` field + pub struct sender(()); + ///Marker type for the `sent_at` field + pub struct sent_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MessageViewBuilder<'a, S: message_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> MessageView<'a> { + /// Create a new builder for this type + pub fn new() -> MessageViewBuilder<'a, message_view_state::Empty> { + MessageViewBuilder::new() + } +} + +impl<'a> MessageViewBuilder<'a, message_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: message_view_state::State> MessageViewBuilder<'a, S> { + /// Set the `embed` field (optional) + pub fn embed( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `embed` field to an Option value (optional) + pub fn maybe_embed( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: message_view_state::State> MessageViewBuilder<'a, S> { + /// Set the `facets` field (optional) + pub fn facets( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `facets` field to an Option value (optional) + pub fn maybe_facets( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> MessageViewBuilder<'a, S> +where + S: message_view_state::State, + S::Id: message_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into>, + ) -> MessageViewBuilder<'a, message_view_state::SetId> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + MessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: message_view_state::State> MessageViewBuilder<'a, S> { + /// Set the `reactions` field (optional) + pub fn reactions( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `reactions` field to an Option value (optional) + pub fn maybe_reactions( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> MessageViewBuilder<'a, S> +where + S: message_view_state::State, + S::Rev: message_view_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> MessageViewBuilder<'a, message_view_state::SetRev> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + MessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageViewBuilder<'a, S> +where + S: message_view_state::State, + S::Sender: message_view_state::IsUnset, +{ + /// Set the `sender` field (required) + pub fn sender( + mut self, + value: impl Into>, + ) -> MessageViewBuilder<'a, message_view_state::SetSender> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + MessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageViewBuilder<'a, S> +where + S: message_view_state::State, + S::SentAt: message_view_state::IsUnset, +{ + /// Set the `sentAt` field (required) + pub fn sent_at( + mut self, + value: impl Into, + ) -> MessageViewBuilder<'a, message_view_state::SetSentAt> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + MessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageViewBuilder<'a, S> +where + S: message_view_state::State, + S::Text: message_view_state::IsUnset, +{ + /// Set the `text` field (required) + pub fn text( + mut self, + value: impl Into>, + ) -> MessageViewBuilder<'a, message_view_state::SetText> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + MessageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageViewBuilder<'a, S> +where + S: message_view_state::State, + S::Id: message_view_state::IsSet, + S::Rev: message_view_state::IsSet, + S::Text: 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> { + MessageView { + embed: self.__unsafe_private_named.0, + facets: self.__unsafe_private_named.1, + id: self.__unsafe_private_named.2.unwrap(), + reactions: self.__unsafe_private_named.3, + rev: self.__unsafe_private_named.4.unwrap(), + sender: self.__unsafe_private_named.5.unwrap(), + sent_at: self.__unsafe_private_named.6.unwrap(), + text: 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>, + >, + ) -> MessageView<'a> { + MessageView { + embed: self.__unsafe_private_named.0, + facets: self.__unsafe_private_named.1, + id: self.__unsafe_private_named.2.unwrap(), + reactions: self.__unsafe_private_named.3, + rev: self.__unsafe_private_named.4.unwrap(), + sender: self.__unsafe_private_named.5.unwrap(), + sent_at: self.__unsafe_private_named.6.unwrap(), + text: self.__unsafe_private_named.7.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MessageView<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.text; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "text", + ), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.text; + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "text", + ), + max: 1000usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct MessageViewSender<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod message_view_sender_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MessageViewSenderBuilder<'a, S: message_view_sender_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> MessageViewSender<'a> { + /// Create a new builder for this type + pub fn new() -> MessageViewSenderBuilder<'a, message_view_sender_state::Empty> { + MessageViewSenderBuilder::new() + } +} + +impl<'a> MessageViewSenderBuilder<'a, message_view_sender_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MessageViewSenderBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageViewSenderBuilder<'a, S> +where + S: message_view_sender_state::State, + S::Did: message_view_sender_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> MessageViewSenderBuilder<'a, message_view_sender_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MessageViewSenderBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MessageViewSenderBuilder<'a, S> +where + S: message_view_sender_state::State, + S::Did: message_view_sender_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> MessageViewSender<'a> { + MessageViewSender { + did: 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>, + >, + ) -> MessageViewSender<'a> { + MessageViewSender { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MessageViewSender<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageViewSender" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 ReactionView<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub sender: crate::chat_bsky::convo::ReactionViewSender<'a>, + #[serde(borrow)] + pub value: jacquard_common::CowStr<'a>, +} + +pub mod reaction_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 Value; + type Sender; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Value = Unset; + type Sender = Unset; + type CreatedAt = 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 Sender = S::Sender; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `sender` field to Set + pub struct SetSender(PhantomData S>); + impl sealed::Sealed for SetSender {} + impl State for SetSender { + type Value = S::Value; + type Sender = 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 Value = S::Value; + type Sender = S::Sender; + type CreatedAt = 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 `sender` field + pub struct sender(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReactionViewBuilder<'a, S: reaction_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> ReactionView<'a> { + /// Create a new builder for this type + pub fn new() -> ReactionViewBuilder<'a, reaction_view_state::Empty> { + ReactionViewBuilder::new() + } +} + +impl<'a> ReactionViewBuilder<'a, reaction_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReactionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionViewBuilder<'a, S> +where + S: reaction_view_state::State, + S::CreatedAt: reaction_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ReactionViewBuilder<'a, reaction_view_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ReactionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionViewBuilder<'a, S> +where + S: reaction_view_state::State, + S::Sender: reaction_view_state::IsUnset, +{ + /// Set the `sender` field (required) + pub fn sender( + mut self, + value: impl Into>, + ) -> ReactionViewBuilder<'a, reaction_view_state::SetSender> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ReactionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionViewBuilder<'a, S> +where + S: reaction_view_state::State, + S::Value: reaction_view_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> ReactionViewBuilder<'a, reaction_view_state::SetValue> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ReactionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionViewBuilder<'a, S> +where + S: reaction_view_state::State, + S::Value: reaction_view_state::IsSet, + S::Sender: reaction_view_state::IsSet, + S::CreatedAt: reaction_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ReactionView<'a> { + ReactionView { + created_at: self.__unsafe_private_named.0.unwrap(), + sender: self.__unsafe_private_named.1.unwrap(), + value: 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>, + >, + ) -> ReactionView<'a> { + ReactionView { + created_at: self.__unsafe_private_named.0.unwrap(), + sender: self.__unsafe_private_named.1.unwrap(), + value: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReactionView<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "reactionView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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 ReactionViewSender<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod reaction_view_sender_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReactionViewSenderBuilder<'a, S: reaction_view_sender_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ReactionViewSender<'a> { + /// Create a new builder for this type + pub fn new() -> ReactionViewSenderBuilder<'a, reaction_view_sender_state::Empty> { + ReactionViewSenderBuilder::new() + } +} + +impl<'a> ReactionViewSenderBuilder<'a, reaction_view_sender_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReactionViewSenderBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionViewSenderBuilder<'a, S> +where + S: reaction_view_sender_state::State, + S::Did: reaction_view_sender_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ReactionViewSenderBuilder<'a, reaction_view_sender_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ReactionViewSenderBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionViewSenderBuilder<'a, S> +where + S: reaction_view_sender_state::State, + S::Did: reaction_view_sender_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ReactionViewSender<'a> { + ReactionViewSender { + did: 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>, + >, + ) -> ReactionViewSender<'a> { + ReactionViewSender { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReactionViewSender<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "reactionViewSender" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_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/chat_bsky/convo/accept_convo.rs b/crates/weaver-api/src/chat_bsky/convo/accept_convo.rs new file mode 100644 index 0000000..983144f --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/accept_convo.rs @@ -0,0 +1,72 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.acceptConvo +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AcceptConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AcceptConvoOutput<'a> { + /// Rev when the convo was accepted. If not present, the convo was already accepted. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub rev: std::option::Option>, +} + +/// Response type for +///chat.bsky.convo.acceptConvo +pub struct AcceptConvoResponse; +impl jacquard_common::xrpc::XrpcResp for AcceptConvoResponse { + const NSID: &'static str = "chat.bsky.convo.acceptConvo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = AcceptConvoOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for AcceptConvo<'a> { + const NSID: &'static str = "chat.bsky.convo.acceptConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = AcceptConvoResponse; +} + +/// Endpoint type for +///chat.bsky.convo.acceptConvo +pub struct AcceptConvoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for AcceptConvoRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.acceptConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = AcceptConvo<'de>; + type Response = AcceptConvoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/add_reaction.rs b/crates/weaver-api/src/chat_bsky/convo/add_reaction.rs new file mode 100644 index 0000000..2b69a60 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/add_reaction.rs @@ -0,0 +1,128 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.addReaction +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AddReaction<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub value: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AddReactionOutput<'a> { + #[serde(borrow)] + pub message: crate::chat_bsky::convo::MessageView<'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 AddReactionError<'a> { + /// Indicates that the message has been deleted and reactions can no longer be added/removed. + #[serde(rename = "ReactionMessageDeleted")] + ReactionMessageDeleted(std::option::Option), + /// Indicates that the message has the maximum number of reactions allowed for a single user, and the requested reaction wasn't yet present. If it was already present, the request will not fail since it is idempotent. + #[serde(rename = "ReactionLimitReached")] + ReactionLimitReached(std::option::Option), + /// Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji. + #[serde(rename = "ReactionInvalidValue")] + ReactionInvalidValue(std::option::Option), +} + +impl std::fmt::Display for AddReactionError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ReactionMessageDeleted(msg) => { + write!(f, "ReactionMessageDeleted")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ReactionLimitReached(msg) => { + write!(f, "ReactionLimitReached")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ReactionInvalidValue(msg) => { + write!(f, "ReactionInvalidValue")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///chat.bsky.convo.addReaction +pub struct AddReactionResponse; +impl jacquard_common::xrpc::XrpcResp for AddReactionResponse { + const NSID: &'static str = "chat.bsky.convo.addReaction"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = AddReactionOutput<'de>; + type Err<'de> = AddReactionError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for AddReaction<'a> { + const NSID: &'static str = "chat.bsky.convo.addReaction"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = AddReactionResponse; +} + +/// Endpoint type for +///chat.bsky.convo.addReaction +pub struct AddReactionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for AddReactionRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.addReaction"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = AddReaction<'de>; + type Response = AddReactionResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/delete_message_for_self.rs b/crates/weaver-api/src/chat_bsky/convo/delete_message_for_self.rs new file mode 100644 index 0000000..b5ad6b7 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/delete_message_for_self.rs @@ -0,0 +1,72 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.deleteMessageForSelf +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DeleteMessageForSelf<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message_id: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct DeleteMessageForSelfOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::chat_bsky::convo::DeletedMessageView<'a>, +} + +/// Response type for +///chat.bsky.convo.deleteMessageForSelf +pub struct DeleteMessageForSelfResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteMessageForSelfResponse { + const NSID: &'static str = "chat.bsky.convo.deleteMessageForSelf"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DeleteMessageForSelfOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteMessageForSelf<'a> { + const NSID: &'static str = "chat.bsky.convo.deleteMessageForSelf"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteMessageForSelfResponse; +} + +/// Endpoint type for +///chat.bsky.convo.deleteMessageForSelf +pub struct DeleteMessageForSelfRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteMessageForSelfRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.deleteMessageForSelf"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteMessageForSelf<'de>; + type Response = DeleteMessageForSelfResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/get_convo.rs b/crates/weaver-api/src/chat_bsky/convo/get_convo.rs new file mode 100644 index 0000000..37bdf48 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/get_convo.rs @@ -0,0 +1,152 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.getConvo +// +// 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 GetConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, +} + +pub mod get_convo_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 ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = 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 ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetConvoBuilder<'a, S: get_convo_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetConvo<'a> { + /// Create a new builder for this type + pub fn new() -> GetConvoBuilder<'a, get_convo_state::Empty> { + GetConvoBuilder::new() + } +} + +impl<'a> GetConvoBuilder<'a, get_convo_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetConvoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetConvoBuilder<'a, S> +where + S: get_convo_state::State, + S::ConvoId: get_convo_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> GetConvoBuilder<'a, get_convo_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetConvoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetConvoBuilder<'a, S> +where + S: get_convo_state::State, + S::ConvoId: get_convo_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetConvo<'a> { + GetConvo { + convo_id: 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 GetConvoOutput<'a> { + #[serde(borrow)] + pub convo: crate::chat_bsky::convo::ConvoView<'a>, +} + +/// Response type for +///chat.bsky.convo.getConvo +pub struct GetConvoResponse; +impl jacquard_common::xrpc::XrpcResp for GetConvoResponse { + const NSID: &'static str = "chat.bsky.convo.getConvo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetConvoOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetConvo<'a> { + const NSID: &'static str = "chat.bsky.convo.getConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetConvoResponse; +} + +/// Endpoint type for +///chat.bsky.convo.getConvo +pub struct GetConvoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetConvoRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.getConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetConvo<'de>; + type Response = GetConvoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/get_convo_availability.rs b/crates/weaver-api/src/chat_bsky/convo/get_convo_availability.rs new file mode 100644 index 0000000..e1fc27d --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/get_convo_availability.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.getConvoAvailability +// +// 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 GetConvoAvailability<'a> { + #[serde(borrow)] + pub members: Vec>, +} + +pub mod get_convo_availability_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 Members; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Members = Unset; + } + ///State transition - sets the `members` field to Set + pub struct SetMembers(PhantomData S>); + impl sealed::Sealed for SetMembers {} + impl State for SetMembers { + type Members = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `members` field + pub struct members(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetConvoAvailabilityBuilder<'a, S: get_convo_availability_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetConvoAvailability<'a> { + /// Create a new builder for this type + pub fn new() -> GetConvoAvailabilityBuilder< + 'a, + get_convo_availability_state::Empty, + > { + GetConvoAvailabilityBuilder::new() + } +} + +impl<'a> GetConvoAvailabilityBuilder<'a, get_convo_availability_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetConvoAvailabilityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetConvoAvailabilityBuilder<'a, S> +where + S: get_convo_availability_state::State, + S::Members: get_convo_availability_state::IsUnset, +{ + /// Set the `members` field (required) + pub fn members( + mut self, + value: impl Into>>, + ) -> GetConvoAvailabilityBuilder<'a, get_convo_availability_state::SetMembers> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetConvoAvailabilityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetConvoAvailabilityBuilder<'a, S> +where + S: get_convo_availability_state::State, + S::Members: get_convo_availability_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetConvoAvailability<'a> { + GetConvoAvailability { + members: 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 GetConvoAvailabilityOutput<'a> { + pub can_chat: bool, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub convo: std::option::Option>, +} + +/// Response type for +///chat.bsky.convo.getConvoAvailability +pub struct GetConvoAvailabilityResponse; +impl jacquard_common::xrpc::XrpcResp for GetConvoAvailabilityResponse { + const NSID: &'static str = "chat.bsky.convo.getConvoAvailability"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetConvoAvailabilityOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetConvoAvailability<'a> { + const NSID: &'static str = "chat.bsky.convo.getConvoAvailability"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetConvoAvailabilityResponse; +} + +/// Endpoint type for +///chat.bsky.convo.getConvoAvailability +pub struct GetConvoAvailabilityRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetConvoAvailabilityRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.getConvoAvailability"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetConvoAvailability<'de>; + type Response = GetConvoAvailabilityResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/get_convo_for_members.rs b/crates/weaver-api/src/chat_bsky/convo/get_convo_for_members.rs new file mode 100644 index 0000000..e57c6a6 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/get_convo_for_members.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.getConvoForMembers +// +// 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 GetConvoForMembers<'a> { + #[serde(borrow)] + pub members: Vec>, +} + +pub mod get_convo_for_members_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 Members; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Members = Unset; + } + ///State transition - sets the `members` field to Set + pub struct SetMembers(PhantomData S>); + impl sealed::Sealed for SetMembers {} + impl State for SetMembers { + type Members = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `members` field + pub struct members(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetConvoForMembersBuilder<'a, S: get_convo_for_members_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetConvoForMembers<'a> { + /// Create a new builder for this type + pub fn new() -> GetConvoForMembersBuilder<'a, get_convo_for_members_state::Empty> { + GetConvoForMembersBuilder::new() + } +} + +impl<'a> GetConvoForMembersBuilder<'a, get_convo_for_members_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetConvoForMembersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetConvoForMembersBuilder<'a, S> +where + S: get_convo_for_members_state::State, + S::Members: get_convo_for_members_state::IsUnset, +{ + /// Set the `members` field (required) + pub fn members( + mut self, + value: impl Into>>, + ) -> GetConvoForMembersBuilder<'a, get_convo_for_members_state::SetMembers> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetConvoForMembersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetConvoForMembersBuilder<'a, S> +where + S: get_convo_for_members_state::State, + S::Members: get_convo_for_members_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetConvoForMembers<'a> { + GetConvoForMembers { + members: 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 GetConvoForMembersOutput<'a> { + #[serde(borrow)] + pub convo: crate::chat_bsky::convo::ConvoView<'a>, +} + +/// Response type for +///chat.bsky.convo.getConvoForMembers +pub struct GetConvoForMembersResponse; +impl jacquard_common::xrpc::XrpcResp for GetConvoForMembersResponse { + const NSID: &'static str = "chat.bsky.convo.getConvoForMembers"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetConvoForMembersOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetConvoForMembers<'a> { + const NSID: &'static str = "chat.bsky.convo.getConvoForMembers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetConvoForMembersResponse; +} + +/// Endpoint type for +///chat.bsky.convo.getConvoForMembers +pub struct GetConvoForMembersRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetConvoForMembersRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.getConvoForMembers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetConvoForMembers<'de>; + type Response = GetConvoForMembersResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/get_log.rs b/crates/weaver-api/src/chat_bsky/convo/get_log.rs new file mode 100644 index 0000000..fe91fd7 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/get_log.rs @@ -0,0 +1,174 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.getLog +// +// 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 GetLog<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +pub mod get_log_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 GetLogBuilder<'a, S: get_log_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetLog<'a> { + /// Create a new builder for this type + pub fn new() -> GetLogBuilder<'a, get_log_state::Empty> { + GetLogBuilder::new() + } +} + +impl<'a> GetLogBuilder<'a, get_log_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetLogBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_log_state::State> GetLogBuilder<'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> GetLogBuilder<'a, S> +where + S: get_log_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetLog<'a> { + GetLog { + cursor: 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 GetLogOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub logs: Vec>, +} + +#[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 GetLogOutputLogsItem<'a> { + #[serde(rename = "chat.bsky.convo.defs#logBeginConvo")] + LogBeginConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#logAcceptConvo")] + LogAcceptConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#logLeaveConvo")] + LogLeaveConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#logMuteConvo")] + LogMuteConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#logUnmuteConvo")] + LogUnmuteConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#logCreateMessage")] + LogCreateMessage(Box>), + #[serde(rename = "chat.bsky.convo.defs#logDeleteMessage")] + LogDeleteMessage(Box>), + #[serde(rename = "chat.bsky.convo.defs#logReadMessage")] + LogReadMessage(Box>), + #[serde(rename = "chat.bsky.convo.defs#logAddReaction")] + LogAddReaction(Box>), + #[serde(rename = "chat.bsky.convo.defs#logRemoveReaction")] + LogRemoveReaction(Box>), +} + +/// Response type for +///chat.bsky.convo.getLog +pub struct GetLogResponse; +impl jacquard_common::xrpc::XrpcResp for GetLogResponse { + const NSID: &'static str = "chat.bsky.convo.getLog"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetLogOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetLog<'a> { + const NSID: &'static str = "chat.bsky.convo.getLog"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetLogResponse; +} + +/// Endpoint type for +///chat.bsky.convo.getLog +pub struct GetLogRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetLogRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.getLog"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetLog<'de>; + type Response = GetLogResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/get_messages.rs b/crates/weaver-api/src/chat_bsky/convo/get_messages.rs new file mode 100644 index 0000000..f903641 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/get_messages.rs @@ -0,0 +1,215 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.getMessages +// +// 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 GetMessages<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'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_messages_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 ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = 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 ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetMessagesBuilder<'a, S: get_messages_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> GetMessages<'a> { + /// Create a new builder for this type + pub fn new() -> GetMessagesBuilder<'a, get_messages_state::Empty> { + GetMessagesBuilder::new() + } +} + +impl<'a> GetMessagesBuilder<'a, get_messages_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetMessagesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetMessagesBuilder<'a, S> +where + S: get_messages_state::State, + S::ConvoId: get_messages_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> GetMessagesBuilder<'a, get_messages_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetMessagesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_messages_state::State> GetMessagesBuilder<'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_messages_state::State> GetMessagesBuilder<'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> GetMessagesBuilder<'a, S> +where + S: get_messages_state::State, + S::ConvoId: get_messages_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetMessages<'a> { + GetMessages { + convo_id: 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 GetMessagesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub messages: Vec>, +} + +#[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 GetMessagesOutputMessagesItem<'a> { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), +} + +/// Response type for +///chat.bsky.convo.getMessages +pub struct GetMessagesResponse; +impl jacquard_common::xrpc::XrpcResp for GetMessagesResponse { + const NSID: &'static str = "chat.bsky.convo.getMessages"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetMessagesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetMessages<'a> { + const NSID: &'static str = "chat.bsky.convo.getMessages"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetMessagesResponse; +} + +/// Endpoint type for +///chat.bsky.convo.getMessages +pub struct GetMessagesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetMessagesRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.getMessages"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetMessages<'de>; + type Response = GetMessagesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/leave_convo.rs b/crates/weaver-api/src/chat_bsky/convo/leave_convo.rs new file mode 100644 index 0000000..b389630 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/leave_convo.rs @@ -0,0 +1,72 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.leaveConvo +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct LeaveConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct LeaveConvoOutput<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, +} + +/// Response type for +///chat.bsky.convo.leaveConvo +pub struct LeaveConvoResponse; +impl jacquard_common::xrpc::XrpcResp for LeaveConvoResponse { + const NSID: &'static str = "chat.bsky.convo.leaveConvo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = LeaveConvoOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for LeaveConvo<'a> { + const NSID: &'static str = "chat.bsky.convo.leaveConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = LeaveConvoResponse; +} + +/// Endpoint type for +///chat.bsky.convo.leaveConvo +pub struct LeaveConvoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for LeaveConvoRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.leaveConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = LeaveConvo<'de>; + type Response = LeaveConvoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/list_convos.rs b/crates/weaver-api/src/chat_bsky/convo/list_convos.rs new file mode 100644 index 0000000..997aaa4 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/list_convos.rs @@ -0,0 +1,204 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.listConvos +// +// 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 ListConvos<'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 read_state: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: std::option::Option>, +} + +pub mod list_convos_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 ListConvosBuilder<'a, S: list_convos_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> ListConvos<'a> { + /// Create a new builder for this type + pub fn new() -> ListConvosBuilder<'a, list_convos_state::Empty> { + ListConvosBuilder::new() + } +} + +impl<'a> ListConvosBuilder<'a, list_convos_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListConvosBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_convos_state::State> ListConvosBuilder<'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: list_convos_state::State> ListConvosBuilder<'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: list_convos_state::State> ListConvosBuilder<'a, S> { + /// Set the `readState` field (optional) + pub fn read_state( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `readState` field to an Option value (optional) + pub fn maybe_read_state( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: list_convos_state::State> ListConvosBuilder<'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> ListConvosBuilder<'a, S> +where + S: list_convos_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListConvos<'a> { + ListConvos { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + read_state: self.__unsafe_private_named.2, + status: 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 ListConvosOutput<'a> { + #[serde(borrow)] + pub convos: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///chat.bsky.convo.listConvos +pub struct ListConvosResponse; +impl jacquard_common::xrpc::XrpcResp for ListConvosResponse { + const NSID: &'static str = "chat.bsky.convo.listConvos"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListConvosOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListConvos<'a> { + const NSID: &'static str = "chat.bsky.convo.listConvos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListConvosResponse; +} + +/// Endpoint type for +///chat.bsky.convo.listConvos +pub struct ListConvosRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListConvosRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.listConvos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListConvos<'de>; + type Response = ListConvosResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/mute_convo.rs b/crates/weaver-api/src/chat_bsky/convo/mute_convo.rs new file mode 100644 index 0000000..3722d7b --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/mute_convo.rs @@ -0,0 +1,69 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.muteConvo +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct MuteConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct MuteConvoOutput<'a> { + #[serde(borrow)] + pub convo: crate::chat_bsky::convo::ConvoView<'a>, +} + +/// Response type for +///chat.bsky.convo.muteConvo +pub struct MuteConvoResponse; +impl jacquard_common::xrpc::XrpcResp for MuteConvoResponse { + const NSID: &'static str = "chat.bsky.convo.muteConvo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = MuteConvoOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for MuteConvo<'a> { + const NSID: &'static str = "chat.bsky.convo.muteConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = MuteConvoResponse; +} + +/// Endpoint type for +///chat.bsky.convo.muteConvo +pub struct MuteConvoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for MuteConvoRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.muteConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = MuteConvo<'de>; + type Response = MuteConvoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/remove_reaction.rs b/crates/weaver-api/src/chat_bsky/convo/remove_reaction.rs new file mode 100644 index 0000000..6dd5e0c --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/remove_reaction.rs @@ -0,0 +1,118 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.removeReaction +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RemoveReaction<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub value: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RemoveReactionOutput<'a> { + #[serde(borrow)] + pub message: crate::chat_bsky::convo::MessageView<'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 RemoveReactionError<'a> { + /// Indicates that the message has been deleted and reactions can no longer be added/removed. + #[serde(rename = "ReactionMessageDeleted")] + ReactionMessageDeleted(std::option::Option), + /// Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji. + #[serde(rename = "ReactionInvalidValue")] + ReactionInvalidValue(std::option::Option), +} + +impl std::fmt::Display for RemoveReactionError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ReactionMessageDeleted(msg) => { + write!(f, "ReactionMessageDeleted")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ReactionInvalidValue(msg) => { + write!(f, "ReactionInvalidValue")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///chat.bsky.convo.removeReaction +pub struct RemoveReactionResponse; +impl jacquard_common::xrpc::XrpcResp for RemoveReactionResponse { + const NSID: &'static str = "chat.bsky.convo.removeReaction"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RemoveReactionOutput<'de>; + type Err<'de> = RemoveReactionError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RemoveReaction<'a> { + const NSID: &'static str = "chat.bsky.convo.removeReaction"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RemoveReactionResponse; +} + +/// Endpoint type for +///chat.bsky.convo.removeReaction +pub struct RemoveReactionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RemoveReactionRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.removeReaction"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RemoveReaction<'de>; + type Response = RemoveReactionResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/send_message.rs b/crates/weaver-api/src/chat_bsky/convo/send_message.rs new file mode 100644 index 0000000..5950b13 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/send_message.rs @@ -0,0 +1,211 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.sendMessage +// +// 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 SendMessage<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message: crate::chat_bsky::convo::MessageInput<'a>, +} + +pub mod send_message_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 ConvoId; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + 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 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 = S::ConvoId; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SendMessageBuilder<'a, S: send_message_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SendMessage<'a> { + /// Create a new builder for this type + pub fn new() -> SendMessageBuilder<'a, send_message_state::Empty> { + SendMessageBuilder::new() + } +} + +impl<'a> SendMessageBuilder<'a, send_message_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SendMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendMessageBuilder<'a, S> +where + S: send_message_state::State, + S::ConvoId: send_message_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> SendMessageBuilder<'a, send_message_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SendMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendMessageBuilder<'a, S> +where + S: send_message_state::State, + S::Message: send_message_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> SendMessageBuilder<'a, send_message_state::SetMessage> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SendMessageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendMessageBuilder<'a, S> +where + S: send_message_state::State, + S::ConvoId: send_message_state::IsSet, + S::Message: send_message_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SendMessage<'a> { + SendMessage { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: 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>, + >, + ) -> SendMessage<'a> { + SendMessage { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + 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 SendMessageOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::chat_bsky::convo::MessageView<'a>, +} + +/// Response type for +///chat.bsky.convo.sendMessage +pub struct SendMessageResponse; +impl jacquard_common::xrpc::XrpcResp for SendMessageResponse { + const NSID: &'static str = "chat.bsky.convo.sendMessage"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SendMessageOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SendMessage<'a> { + const NSID: &'static str = "chat.bsky.convo.sendMessage"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = SendMessageResponse; +} + +/// Endpoint type for +///chat.bsky.convo.sendMessage +pub struct SendMessageRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SendMessageRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.sendMessage"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = SendMessage<'de>; + type Response = SendMessageResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/send_message_batch.rs b/crates/weaver-api/src/chat_bsky/convo/send_message_batch.rs new file mode 100644 index 0000000..0cc7b4b --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/send_message_batch.rs @@ -0,0 +1,450 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.sendMessageBatch +// +// 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 BatchItem<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub message: crate::chat_bsky::convo::MessageInput<'a>, +} + +pub mod batch_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 ConvoId; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + 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 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 = S::ConvoId; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BatchItemBuilder<'a, S: batch_item_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> BatchItem<'a> { + /// Create a new builder for this type + pub fn new() -> BatchItemBuilder<'a, batch_item_state::Empty> { + BatchItemBuilder::new() + } +} + +impl<'a> BatchItemBuilder<'a, batch_item_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BatchItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BatchItemBuilder<'a, S> +where + S: batch_item_state::State, + S::ConvoId: batch_item_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into>, + ) -> BatchItemBuilder<'a, batch_item_state::SetConvoId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BatchItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BatchItemBuilder<'a, S> +where + S: batch_item_state::State, + S::Message: batch_item_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> BatchItemBuilder<'a, batch_item_state::SetMessage> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + BatchItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BatchItemBuilder<'a, S> +where + S: batch_item_state::State, + S::ConvoId: batch_item_state::IsSet, + S::Message: batch_item_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> BatchItem<'a> { + BatchItem { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: 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>, + >, + ) -> BatchItem<'a> { + BatchItem { + convo_id: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_chat_bsky_convo_sendMessageBatch() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("chat.bsky.convo.sendMessageBatch"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("batchItem"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::jacquard_common::smol_str::SmolStr::new_static("message") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convoId"), + ::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("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "chat.bsky.convo.defs#messageInput", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("items") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("items"), + ::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("#batchItem"), + }), + min_length: None, + max_length: Some(100usize), + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BatchItem<'a> { + fn nsid() -> &'static str { + "chat.bsky.convo.sendMessageBatch" + } + fn def_name() -> &'static str { + "batchItem" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_sendMessageBatch() + } + 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 SendMessageBatch<'a> { + #[serde(borrow)] + pub items: Vec>, +} + +pub mod send_message_batch_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 Items; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Items = Unset; + } + ///State transition - sets the `items` field to Set + pub struct SetItems(PhantomData S>); + impl sealed::Sealed for SetItems {} + impl State for SetItems { + type Items = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `items` field + pub struct items(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SendMessageBatchBuilder<'a, S: send_message_batch_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + Vec>, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SendMessageBatch<'a> { + /// Create a new builder for this type + pub fn new() -> SendMessageBatchBuilder<'a, send_message_batch_state::Empty> { + SendMessageBatchBuilder::new() + } +} + +impl<'a> SendMessageBatchBuilder<'a, send_message_batch_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SendMessageBatchBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendMessageBatchBuilder<'a, S> +where + S: send_message_batch_state::State, + S::Items: send_message_batch_state::IsUnset, +{ + /// Set the `items` field (required) + pub fn items( + mut self, + value: impl Into>>, + ) -> SendMessageBatchBuilder<'a, send_message_batch_state::SetItems> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SendMessageBatchBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendMessageBatchBuilder<'a, S> +where + S: send_message_batch_state::State, + S::Items: send_message_batch_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SendMessageBatch<'a> { + SendMessageBatch { + items: 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>, + >, + ) -> SendMessageBatch<'a> { + SendMessageBatch { + items: 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 +)] +#[serde(rename_all = "camelCase")] +pub struct SendMessageBatchOutput<'a> { + #[serde(borrow)] + pub items: Vec>, +} + +/// Response type for +///chat.bsky.convo.sendMessageBatch +pub struct SendMessageBatchResponse; +impl jacquard_common::xrpc::XrpcResp for SendMessageBatchResponse { + const NSID: &'static str = "chat.bsky.convo.sendMessageBatch"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SendMessageBatchOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SendMessageBatch<'a> { + const NSID: &'static str = "chat.bsky.convo.sendMessageBatch"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = SendMessageBatchResponse; +} + +/// Endpoint type for +///chat.bsky.convo.sendMessageBatch +pub struct SendMessageBatchRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SendMessageBatchRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.sendMessageBatch"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = SendMessageBatch<'de>; + type Response = SendMessageBatchResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/unmute_convo.rs b/crates/weaver-api/src/chat_bsky/convo/unmute_convo.rs new file mode 100644 index 0000000..809e824 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/unmute_convo.rs @@ -0,0 +1,69 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.unmuteConvo +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct UnmuteConvo<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UnmuteConvoOutput<'a> { + #[serde(borrow)] + pub convo: crate::chat_bsky::convo::ConvoView<'a>, +} + +/// Response type for +///chat.bsky.convo.unmuteConvo +pub struct UnmuteConvoResponse; +impl jacquard_common::xrpc::XrpcResp for UnmuteConvoResponse { + const NSID: &'static str = "chat.bsky.convo.unmuteConvo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UnmuteConvoOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UnmuteConvo<'a> { + const NSID: &'static str = "chat.bsky.convo.unmuteConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UnmuteConvoResponse; +} + +/// Endpoint type for +///chat.bsky.convo.unmuteConvo +pub struct UnmuteConvoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UnmuteConvoRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.unmuteConvo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UnmuteConvo<'de>; + type Response = UnmuteConvoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/update_all_read.rs b/crates/weaver-api/src/chat_bsky/convo/update_all_read.rs new file mode 100644 index 0000000..89cde43 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/update_all_read.rs @@ -0,0 +1,70 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.updateAllRead +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateAllRead<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: std::option::Option>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateAllReadOutput<'a> { + /// The count of updated convos. + pub updated_count: i64, +} + +/// Response type for +///chat.bsky.convo.updateAllRead +pub struct UpdateAllReadResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateAllReadResponse { + const NSID: &'static str = "chat.bsky.convo.updateAllRead"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpdateAllReadOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateAllRead<'a> { + const NSID: &'static str = "chat.bsky.convo.updateAllRead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateAllReadResponse; +} + +/// Endpoint type for +///chat.bsky.convo.updateAllRead +pub struct UpdateAllReadRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateAllReadRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.updateAllRead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateAllRead<'de>; + type Response = UpdateAllReadResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/convo/update_read.rs b/crates/weaver-api/src/chat_bsky/convo/update_read.rs new file mode 100644 index 0000000..d2a6dd5 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/convo/update_read.rs @@ -0,0 +1,72 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.convo.updateRead +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateRead<'a> { + #[serde(borrow)] + pub convo_id: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub message_id: std::option::Option>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateReadOutput<'a> { + #[serde(borrow)] + pub convo: crate::chat_bsky::convo::ConvoView<'a>, +} + +/// Response type for +///chat.bsky.convo.updateRead +pub struct UpdateReadResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateReadResponse { + const NSID: &'static str = "chat.bsky.convo.updateRead"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpdateReadOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateRead<'a> { + const NSID: &'static str = "chat.bsky.convo.updateRead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateReadResponse; +} + +/// Endpoint type for +///chat.bsky.convo.updateRead +pub struct UpdateReadRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateReadRequest { + const PATH: &'static str = "/xrpc/chat.bsky.convo.updateRead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateRead<'de>; + type Response = UpdateReadResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/moderation.rs b/crates/weaver-api/src/chat_bsky/moderation.rs new file mode 100644 index 0000000..6b847c8 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/moderation.rs @@ -0,0 +1,8 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_actor_metadata; +pub mod get_message_context; +pub mod update_actor_access; \ No newline at end of file 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 new file mode 100644 index 0000000..509ee39 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs @@ -0,0 +1,536 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.moderation.getActorMetadata +// +// 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 GetActorMetadata<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::string::Did<'a>, +} + +pub mod get_actor_metadata_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 GetActorMetadataBuilder<'a, S: get_actor_metadata_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetActorMetadata<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorMetadataBuilder<'a, get_actor_metadata_state::Empty> { + GetActorMetadataBuilder::new() + } +} + +impl<'a> GetActorMetadataBuilder<'a, get_actor_metadata_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorMetadataBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorMetadataBuilder<'a, S> +where + S: get_actor_metadata_state::State, + S::Actor: get_actor_metadata_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorMetadataBuilder<'a, get_actor_metadata_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorMetadataBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorMetadataBuilder<'a, S> +where + S: get_actor_metadata_state::State, + S::Actor: get_actor_metadata_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorMetadata<'a> { + GetActorMetadata { + actor: 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 GetActorMetadataOutput<'a> { + #[serde(borrow)] + pub all: crate::chat_bsky::moderation::get_actor_metadata::Metadata<'a>, + #[serde(borrow)] + pub day: crate::chat_bsky::moderation::get_actor_metadata::Metadata<'a>, + #[serde(borrow)] + pub month: crate::chat_bsky::moderation::get_actor_metadata::Metadata<'a>, +} + +/// Response type for +///chat.bsky.moderation.getActorMetadata +pub struct GetActorMetadataResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorMetadataResponse { + const NSID: &'static str = "chat.bsky.moderation.getActorMetadata"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorMetadataOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorMetadata<'a> { + const NSID: &'static str = "chat.bsky.moderation.getActorMetadata"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorMetadataResponse; +} + +/// Endpoint type for +///chat.bsky.moderation.getActorMetadata +pub struct GetActorMetadataRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorMetadataRequest { + const PATH: &'static str = "/xrpc/chat.bsky.moderation.getActorMetadata"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorMetadata<'de>; + type Response = GetActorMetadataResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Metadata<'a> { + pub convos: i64, + pub convos_started: i64, + pub messages_received: i64, + pub messages_sent: i64, +} + +pub mod metadata_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 MessagesSent; + type MessagesReceived; + type Convos; + type ConvosStarted; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type MessagesSent = Unset; + type MessagesReceived = Unset; + type Convos = Unset; + type ConvosStarted = Unset; + } + ///State transition - sets the `messages_sent` field to Set + pub struct SetMessagesSent(PhantomData S>); + impl sealed::Sealed for SetMessagesSent {} + impl State for SetMessagesSent { + type MessagesSent = Set; + type MessagesReceived = S::MessagesReceived; + type Convos = S::Convos; + type ConvosStarted = S::ConvosStarted; + } + ///State transition - sets the `messages_received` field to Set + pub struct SetMessagesReceived(PhantomData S>); + impl sealed::Sealed for SetMessagesReceived {} + impl State for SetMessagesReceived { + type MessagesSent = S::MessagesSent; + type MessagesReceived = Set; + type Convos = S::Convos; + type ConvosStarted = S::ConvosStarted; + } + ///State transition - sets the `convos` field to Set + pub struct SetConvos(PhantomData S>); + impl sealed::Sealed for SetConvos {} + impl State for SetConvos { + type MessagesSent = S::MessagesSent; + type MessagesReceived = S::MessagesReceived; + type Convos = Set; + type ConvosStarted = S::ConvosStarted; + } + ///State transition - sets the `convos_started` field to Set + pub struct SetConvosStarted(PhantomData S>); + impl sealed::Sealed for SetConvosStarted {} + impl State for SetConvosStarted { + type MessagesSent = S::MessagesSent; + type MessagesReceived = S::MessagesReceived; + type Convos = S::Convos; + type ConvosStarted = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `messages_sent` field + pub struct messages_sent(()); + ///Marker type for the `messages_received` field + pub struct messages_received(()); + ///Marker type for the `convos` field + pub struct convos(()); + ///Marker type for the `convos_started` field + pub struct convos_started(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MetadataBuilder<'a, S: metadata_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> Metadata<'a> { + /// Create a new builder for this type + pub fn new() -> MetadataBuilder<'a, metadata_state::Empty> { + MetadataBuilder::new() + } +} + +impl<'a> MetadataBuilder<'a, metadata_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MetadataBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MetadataBuilder<'a, S> +where + S: metadata_state::State, + S::Convos: metadata_state::IsUnset, +{ + /// Set the `convos` field (required) + pub fn convos( + mut self, + value: impl Into, + ) -> MetadataBuilder<'a, metadata_state::SetConvos> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + MetadataBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MetadataBuilder<'a, S> +where + S: metadata_state::State, + S::ConvosStarted: metadata_state::IsUnset, +{ + /// Set the `convosStarted` field (required) + pub fn convos_started( + mut self, + value: impl Into, + ) -> MetadataBuilder<'a, metadata_state::SetConvosStarted> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + MetadataBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MetadataBuilder<'a, S> +where + S: metadata_state::State, + S::MessagesReceived: metadata_state::IsUnset, +{ + /// Set the `messagesReceived` field (required) + pub fn messages_received( + mut self, + value: impl Into, + ) -> MetadataBuilder<'a, metadata_state::SetMessagesReceived> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + MetadataBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MetadataBuilder<'a, S> +where + S: metadata_state::State, + S::MessagesSent: metadata_state::IsUnset, +{ + /// Set the `messagesSent` field (required) + pub fn messages_sent( + mut self, + value: impl Into, + ) -> MetadataBuilder<'a, metadata_state::SetMessagesSent> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + MetadataBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> MetadataBuilder<'a, S> +where + S: metadata_state::State, + S::MessagesSent: metadata_state::IsSet, + S::MessagesReceived: metadata_state::IsSet, + S::Convos: metadata_state::IsSet, + S::ConvosStarted: metadata_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Metadata<'a> { + Metadata { + convos: self.__unsafe_private_named.0.unwrap(), + convos_started: self.__unsafe_private_named.1.unwrap(), + messages_received: self.__unsafe_private_named.2.unwrap(), + messages_sent: 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>, + >, + ) -> Metadata<'a> { + Metadata { + convos: self.__unsafe_private_named.0.unwrap(), + convos_started: self.__unsafe_private_named.1.unwrap(), + messages_received: self.__unsafe_private_named.2.unwrap(), + messages_sent: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_chat_bsky_moderation_getActorMetadata() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "chat.bsky.moderation.getActorMetadata", + ), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("actor") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("actor"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("metadata"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("messagesSent"), + ::jacquard_common::smol_str::SmolStr::new_static("messagesReceived"), + ::jacquard_common::smol_str::SmolStr::new_static("convos"), + ::jacquard_common::smol_str::SmolStr::new_static("convosStarted") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("convos"), + ::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( + "convosStarted", + ), + ::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( + "messagesReceived", + ), + ::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( + "messagesSent", + ), + ::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 Metadata<'a> { + fn nsid() -> &'static str { + "chat.bsky.moderation.getActorMetadata" + } + fn def_name() -> &'static str { + "metadata" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_chat_bsky_moderation_getActorMetadata() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/chat_bsky/moderation/get_message_context.rs b/crates/weaver-api/src/chat_bsky/moderation/get_message_context.rs new file mode 100644 index 0000000..cb41072 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/moderation/get_message_context.rs @@ -0,0 +1,230 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.moderation.getMessageContext +// +// 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 GetMessageContext<'a> { + ///(default: 5) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub after: std::option::Option, + ///(default: 5) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub before: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub convo_id: std::option::Option>, + #[serde(borrow)] + pub message_id: jacquard_common::CowStr<'a>, +} + +pub mod get_message_context_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 MessageId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type MessageId = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message_id` field + pub struct message_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetMessageContextBuilder<'a, S: get_message_context_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> GetMessageContext<'a> { + /// Create a new builder for this type + pub fn new() -> GetMessageContextBuilder<'a, get_message_context_state::Empty> { + GetMessageContextBuilder::new() + } +} + +impl<'a> GetMessageContextBuilder<'a, get_message_context_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetMessageContextBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_message_context_state::State> GetMessageContextBuilder<'a, S> { + /// Set the `after` field (optional) + pub fn after(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `after` field to an Option value (optional) + pub fn maybe_after(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_message_context_state::State> GetMessageContextBuilder<'a, S> { + /// Set the `before` field (optional) + pub fn before(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `before` field to an Option value (optional) + pub fn maybe_before(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_message_context_state::State> GetMessageContextBuilder<'a, S> { + /// Set the `convoId` field (optional) + pub fn convo_id( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `convoId` field to an Option value (optional) + pub fn maybe_convo_id(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetMessageContextBuilder<'a, S> +where + S: get_message_context_state::State, + S::MessageId: get_message_context_state::IsUnset, +{ + /// Set the `messageId` field (required) + pub fn message_id( + mut self, + value: impl Into>, + ) -> GetMessageContextBuilder<'a, get_message_context_state::SetMessageId> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + GetMessageContextBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetMessageContextBuilder<'a, S> +where + S: get_message_context_state::State, + S::MessageId: get_message_context_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetMessageContext<'a> { + GetMessageContext { + after: self.__unsafe_private_named.0, + before: self.__unsafe_private_named.1, + convo_id: self.__unsafe_private_named.2, + message_id: 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 GetMessageContextOutput<'a> { + #[serde(borrow)] + pub messages: Vec>, +} + +#[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 GetMessageContextOutputMessagesItem<'a> { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), +} + +/// Response type for +///chat.bsky.moderation.getMessageContext +pub struct GetMessageContextResponse; +impl jacquard_common::xrpc::XrpcResp for GetMessageContextResponse { + const NSID: &'static str = "chat.bsky.moderation.getMessageContext"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetMessageContextOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetMessageContext<'a> { + const NSID: &'static str = "chat.bsky.moderation.getMessageContext"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetMessageContextResponse; +} + +/// Endpoint type for +///chat.bsky.moderation.getMessageContext +pub struct GetMessageContextRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetMessageContextRequest { + const PATH: &'static str = "/xrpc/chat.bsky.moderation.getMessageContext"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetMessageContext<'de>; + type Response = GetMessageContextResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..ff019e8 --- /dev/null +++ b/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs @@ -0,0 +1,215 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: chat.bsky.moderation.updateActorAccess +// +// 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 UpdateActorAccess<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::string::Did<'a>, + pub allow_access: bool, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub r#ref: Option>, +} + +pub mod update_actor_access_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 AllowAccess; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateActorAccessBuilder<'a, S: update_actor_access_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> UpdateActorAccess<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateActorAccessBuilder<'a, update_actor_access_state::Empty> { + UpdateActorAccessBuilder::new() + } +} + +impl<'a> UpdateActorAccessBuilder<'a, update_actor_access_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateActorAccessBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateActorAccessBuilder<'a, S> +where + S: update_actor_access_state::State, + S::Actor: update_actor_access_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> UpdateActorAccessBuilder<'a, update_actor_access_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateActorAccessBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateActorAccessBuilder<'a, S> +where + S: update_actor_access_state::State, + S::AllowAccess: update_actor_access_state::IsUnset, +{ + /// Set the `allowAccess` field (required) + pub fn allow_access( + mut self, + value: impl Into, + ) -> UpdateActorAccessBuilder<'a, update_actor_access_state::SetAllowAccess> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateActorAccessBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: update_actor_access_state::State> UpdateActorAccessBuilder<'a, S> { + /// Set the `ref` field (optional) + pub fn r#ref( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `ref` field to an Option value (optional) + pub fn maybe_ref(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> UpdateActorAccess<'a> { + UpdateActorAccess { + actor: self.__unsafe_private_named.0.unwrap(), + allow_access: self.__unsafe_private_named.1.unwrap(), + r#ref: 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>, + >, + ) -> UpdateActorAccess<'a> { + UpdateActorAccess { + actor: self.__unsafe_private_named.0.unwrap(), + allow_access: self.__unsafe_private_named.1.unwrap(), + r#ref: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///chat.bsky.moderation.updateActorAccess +pub struct UpdateActorAccessResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateActorAccessResponse { + const NSID: &'static str = "chat.bsky.moderation.updateActorAccess"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateActorAccess<'a> { + const NSID: &'static str = "chat.bsky.moderation.updateActorAccess"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateActorAccessResponse; +} + +/// Endpoint type for +///chat.bsky.moderation.updateActorAccess +pub struct UpdateActorAccessRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateActorAccessRequest { + const PATH: &'static str = "/xrpc/chat.bsky.moderation.updateActorAccess"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateActorAccess<'de>; + type Response = UpdateActorAccessResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto.rs b/crates/weaver-api/src/com_atproto.rs new file mode 100644 index 0000000..871babe --- /dev/null +++ b/crates/weaver-api/src/com_atproto.rs @@ -0,0 +1,14 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod admin; +pub mod identity; +pub mod label; +pub mod lexicon; +pub mod moderation; +pub mod repo; +pub mod server; +pub mod sync; +pub mod temp; \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin.rs b/crates/weaver-api/src/com_atproto/admin.rs new file mode 100644 index 0000000..1bceff0 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin.rs @@ -0,0 +1,1404 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod delete_account; +pub mod disable_account_invites; +pub mod disable_invite_codes; +pub mod enable_account_invites; +pub mod get_account_info; +pub mod get_account_infos; +pub mod get_invite_codes; +pub mod get_subject_status; +pub mod search_accounts; +pub mod send_email; +pub mod update_account_email; +pub mod update_account_handle; +pub mod update_account_password; +pub mod update_account_signing_key; +pub mod update_subject_status; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AccountView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub deactivated_at: Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub email_confirmed_at: Option, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invite_note: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invited_by: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invites: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub invites_disabled: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub related_records: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub threat_signatures: Option>>, +} + +pub mod account_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 Did; + type Handle; + type IndexedAt; + } + /// 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; + 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 Did = 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 Did = S::Did; + 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 Handle = S::Handle; + type IndexedAt = 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 `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AccountViewBuilder<'a, S: account_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>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> AccountView<'a> { + /// Create a new builder for this type + pub fn new() -> AccountViewBuilder<'a, account_view_state::Empty> { + AccountViewBuilder::new() + } +} + +impl<'a> AccountViewBuilder<'a, account_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AccountViewBuilder { + _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: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `deactivatedAt` field (optional) + pub fn deactivated_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `deactivatedAt` field to an Option value (optional) + pub fn maybe_deactivated_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> AccountViewBuilder<'a, S> +where + S: account_view_state::State, + S::Did: account_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> AccountViewBuilder<'a, account_view_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AccountViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `email` field (optional) + pub fn email( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `email` field to an Option value (optional) + pub fn maybe_email(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `emailConfirmedAt` field (optional) + pub fn email_confirmed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `emailConfirmedAt` field to an Option value (optional) + pub fn maybe_email_confirmed_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> AccountViewBuilder<'a, S> +where + S: account_view_state::State, + S::Handle: account_view_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> AccountViewBuilder<'a, account_view_state::SetHandle> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + AccountViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountViewBuilder<'a, S> +where + S: account_view_state::State, + S::IndexedAt: account_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> AccountViewBuilder<'a, account_view_state::SetIndexedAt> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + AccountViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `inviteNote` field (optional) + pub fn invite_note( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `inviteNote` field to an Option value (optional) + pub fn maybe_invite_note( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `invitedBy` field (optional) + pub fn invited_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `invitedBy` field to an Option value (optional) + pub fn maybe_invited_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `invites` field (optional) + pub fn invites( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `invites` field to an Option value (optional) + pub fn maybe_invites( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `invitesDisabled` field (optional) + pub fn invites_disabled(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `invitesDisabled` field to an Option value (optional) + pub fn maybe_invites_disabled(mut self, value: Option) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `relatedRecords` field (optional) + pub fn related_records( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `relatedRecords` field to an Option value (optional) + pub fn maybe_related_records( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { + /// Set the `threatSignatures` field (optional) + pub fn threat_signatures( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `threatSignatures` field to an Option value (optional) + pub fn maybe_threat_signatures( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S> AccountViewBuilder<'a, S> +where + S: account_view_state::State, + S::Did: account_view_state::IsSet, + S::Handle: account_view_state::IsSet, + S::IndexedAt: account_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AccountView<'a> { + AccountView { + deactivated_at: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + email: self.__unsafe_private_named.2, + email_confirmed_at: self.__unsafe_private_named.3, + handle: self.__unsafe_private_named.4.unwrap(), + indexed_at: self.__unsafe_private_named.5.unwrap(), + invite_note: self.__unsafe_private_named.6, + invited_by: self.__unsafe_private_named.7, + invites: self.__unsafe_private_named.8, + invites_disabled: self.__unsafe_private_named.9, + related_records: self.__unsafe_private_named.10, + threat_signatures: self.__unsafe_private_named.11, + 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>, + >, + ) -> AccountView<'a> { + AccountView { + deactivated_at: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + email: self.__unsafe_private_named.2, + email_confirmed_at: self.__unsafe_private_named.3, + handle: self.__unsafe_private_named.4.unwrap(), + indexed_at: self.__unsafe_private_named.5.unwrap(), + invite_note: self.__unsafe_private_named.6, + invited_by: self.__unsafe_private_named.7, + invites: self.__unsafe_private_named.8, + invites_disabled: self.__unsafe_private_named.9, + related_records: self.__unsafe_private_named.10, + threat_signatures: self.__unsafe_private_named.11, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_admin_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.admin.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("accountView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::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( + "deactivatedAt", + ), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("email"), + ::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( + "emailConfirmedAt", + ), + ::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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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( + "inviteNote", + ), + ::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( + "invitedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.server.defs#inviteCode", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("invites"), + ::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( + "com.atproto.server.defs#inviteCode", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "invitesDisabled", + ), + ::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( + "relatedRecords", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "threatSignatures", + ), + ::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( + "#threatSignature", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repoBlobRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("cid") + ], + ), + 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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "recordUri", + ), + ::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("repoRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("statusAttr"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("applied")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("applied"), + ::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("ref"), + ::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("threatSignature"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("property"), + ::jacquard_common::smol_str::SmolStr::new_static("value") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("property"), + ::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("value"), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AccountView<'a> { + fn nsid() -> &'static str { + "com.atproto.admin.defs" + } + fn def_name() -> &'static str { + "accountView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_admin_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 RepoBlobRef<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub record_uri: Option>, +} + +pub mod repo_blob_ref_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 Did; + type Cid; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + 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 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 `did` field + pub struct did(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepoBlobRefBuilder<'a, S: repo_blob_ref_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> RepoBlobRef<'a> { + /// Create a new builder for this type + pub fn new() -> RepoBlobRefBuilder<'a, repo_blob_ref_state::Empty> { + RepoBlobRefBuilder::new() + } +} + +impl<'a> RepoBlobRefBuilder<'a, repo_blob_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepoBlobRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoBlobRefBuilder<'a, S> +where + S: repo_blob_ref_state::State, + S::Cid: repo_blob_ref_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> RepoBlobRefBuilder<'a, repo_blob_ref_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RepoBlobRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoBlobRefBuilder<'a, S> +where + S: repo_blob_ref_state::State, + S::Did: repo_blob_ref_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> RepoBlobRefBuilder<'a, repo_blob_ref_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RepoBlobRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_blob_ref_state::State> RepoBlobRefBuilder<'a, S> { + /// Set the `recordUri` field (optional) + pub fn record_uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `recordUri` field to an Option value (optional) + pub fn maybe_record_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> RepoBlobRefBuilder<'a, S> +where + S: repo_blob_ref_state::State, + S::Did: repo_blob_ref_state::IsSet, + S::Cid: repo_blob_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RepoBlobRef<'a> { + RepoBlobRef { + cid: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + record_uri: 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>, + >, + ) -> RepoBlobRef<'a> { + RepoBlobRef { + cid: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + record_uri: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RepoBlobRef<'a> { + fn nsid() -> &'static str { + "com.atproto.admin.defs" + } + fn def_name() -> &'static str { + "repoBlobRef" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_admin_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 RepoRef<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod repo_ref_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepoRefBuilder<'a, S: repo_ref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RepoRef<'a> { + /// Create a new builder for this type + pub fn new() -> RepoRefBuilder<'a, repo_ref_state::Empty> { + RepoRefBuilder::new() + } +} + +impl<'a> RepoRefBuilder<'a, repo_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepoRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoRefBuilder<'a, S> +where + S: repo_ref_state::State, + S::Did: repo_ref_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> RepoRefBuilder<'a, repo_ref_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RepoRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoRefBuilder<'a, S> +where + S: repo_ref_state::State, + S::Did: repo_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RepoRef<'a> { + RepoRef { + did: 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>, + >, + ) -> RepoRef<'a> { + RepoRef { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RepoRef<'a> { + fn nsid() -> &'static str { + "com.atproto.admin.defs" + } + fn def_name() -> &'static str { + "repoRef" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_admin_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 StatusAttr<'a> { + pub applied: bool, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub r#ref: Option>, +} + +pub mod status_attr_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 Applied; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Applied = Unset; + } + ///State transition - sets the `applied` field to Set + pub struct SetApplied(PhantomData S>); + impl sealed::Sealed for SetApplied {} + impl State for SetApplied { + type Applied = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `applied` field + pub struct applied(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StatusAttrBuilder<'a, S: status_attr_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> StatusAttr<'a> { + /// Create a new builder for this type + pub fn new() -> StatusAttrBuilder<'a, status_attr_state::Empty> { + StatusAttrBuilder::new() + } +} + +impl<'a> StatusAttrBuilder<'a, status_attr_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StatusAttrBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StatusAttrBuilder<'a, S> +where + S: status_attr_state::State, + S::Applied: status_attr_state::IsUnset, +{ + /// Set the `applied` field (required) + pub fn applied( + mut self, + value: impl Into, + ) -> StatusAttrBuilder<'a, status_attr_state::SetApplied> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + StatusAttrBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: status_attr_state::State> StatusAttrBuilder<'a, S> { + /// Set the `ref` field (optional) + pub fn r#ref( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `ref` field to an Option value (optional) + pub fn maybe_ref(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> StatusAttrBuilder<'a, S> +where + S: status_attr_state::State, + S::Applied: status_attr_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> StatusAttr<'a> { + StatusAttr { + applied: self.__unsafe_private_named.0.unwrap(), + r#ref: 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>, + >, + ) -> StatusAttr<'a> { + StatusAttr { + applied: self.__unsafe_private_named.0.unwrap(), + r#ref: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StatusAttr<'a> { + fn nsid() -> &'static str { + "com.atproto.admin.defs" + } + fn def_name() -> &'static str { + "statusAttr" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_admin_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ThreatSignature<'a> { + #[serde(borrow)] + pub property: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub value: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ThreatSignature<'a> { + fn nsid() -> &'static str { + "com.atproto.admin.defs" + } + fn def_name() -> &'static str { + "threatSignature" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_admin_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/com_atproto/admin/delete_account.rs b/crates/weaver-api/src/com_atproto/admin/delete_account.rs new file mode 100644 index 0000000..89d03cd --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/delete_account.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.deleteAccount +// +// 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 DeleteAccount<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod delete_account_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeleteAccountBuilder<'a, S: delete_account_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DeleteAccount<'a> { + /// Create a new builder for this type + pub fn new() -> DeleteAccountBuilder<'a, delete_account_state::Empty> { + DeleteAccountBuilder::new() + } +} + +impl<'a> DeleteAccountBuilder<'a, delete_account_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeleteAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteAccountBuilder<'a, S> +where + S: delete_account_state::State, + S::Did: delete_account_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> DeleteAccountBuilder<'a, delete_account_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeleteAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteAccountBuilder<'a, S> +where + S: delete_account_state::State, + S::Did: delete_account_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DeleteAccount<'a> { + DeleteAccount { + did: 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>, + >, + ) -> DeleteAccount<'a> { + DeleteAccount { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.admin.deleteAccount +pub struct DeleteAccountResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteAccountResponse { + const NSID: &'static str = "com.atproto.admin.deleteAccount"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteAccount<'a> { + const NSID: &'static str = "com.atproto.admin.deleteAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteAccountResponse; +} + +/// Endpoint type for +///com.atproto.admin.deleteAccount +pub struct DeleteAccountRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteAccountRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.deleteAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteAccount<'de>; + type Response = DeleteAccountResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/disable_account_invites.rs b/crates/weaver-api/src/com_atproto/admin/disable_account_invites.rs new file mode 100644 index 0000000..ea92e41 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/disable_account_invites.rs @@ -0,0 +1,183 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.disableAccountInvites +// +// 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 DisableAccountInvites<'a> { + #[serde(borrow)] + pub account: jacquard_common::types::string::Did<'a>, + /// Optional reason for disabled invites. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub note: Option>, +} + +pub mod disable_account_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 Account; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Account = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `account` field + pub struct account(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DisableAccountInvitesBuilder<'a, S: disable_account_invites_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DisableAccountInvites<'a> { + /// Create a new builder for this type + pub fn new() -> DisableAccountInvitesBuilder< + 'a, + disable_account_invites_state::Empty, + > { + DisableAccountInvitesBuilder::new() + } +} + +impl<'a> DisableAccountInvitesBuilder<'a, disable_account_invites_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DisableAccountInvitesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DisableAccountInvitesBuilder<'a, S> +where + S: disable_account_invites_state::State, + S::Account: disable_account_invites_state::IsUnset, +{ + /// Set the `account` field (required) + pub fn account( + mut self, + value: impl Into>, + ) -> DisableAccountInvitesBuilder<'a, disable_account_invites_state::SetAccount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DisableAccountInvitesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: disable_account_invites_state::State> DisableAccountInvitesBuilder<'a, S> { + /// Set the `note` field (optional) + pub fn note( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `note` field to an Option value (optional) + pub fn maybe_note(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> DisableAccountInvitesBuilder<'a, S> +where + S: disable_account_invites_state::State, + S::Account: disable_account_invites_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DisableAccountInvites<'a> { + DisableAccountInvites { + account: self.__unsafe_private_named.0.unwrap(), + note: 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>, + >, + ) -> DisableAccountInvites<'a> { + DisableAccountInvites { + account: self.__unsafe_private_named.0.unwrap(), + note: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.admin.disableAccountInvites +pub struct DisableAccountInvitesResponse; +impl jacquard_common::xrpc::XrpcResp for DisableAccountInvitesResponse { + const NSID: &'static str = "com.atproto.admin.disableAccountInvites"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DisableAccountInvites<'a> { + const NSID: &'static str = "com.atproto.admin.disableAccountInvites"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DisableAccountInvitesResponse; +} + +/// Endpoint type for +///com.atproto.admin.disableAccountInvites +pub struct DisableAccountInvitesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DisableAccountInvitesRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.disableAccountInvites"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DisableAccountInvites<'de>; + type Response = DisableAccountInvitesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/disable_invite_codes.rs b/crates/weaver-api/src/com_atproto/admin/disable_invite_codes.rs new file mode 100644 index 0000000..ab1b332 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/disable_invite_codes.rs @@ -0,0 +1,57 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.disableInviteCodes +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DisableInviteCodes<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub accounts: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub codes: std::option::Option>>, +} + +/// Response type for +///com.atproto.admin.disableInviteCodes +pub struct DisableInviteCodesResponse; +impl jacquard_common::xrpc::XrpcResp for DisableInviteCodesResponse { + const NSID: &'static str = "com.atproto.admin.disableInviteCodes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DisableInviteCodes<'a> { + const NSID: &'static str = "com.atproto.admin.disableInviteCodes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DisableInviteCodesResponse; +} + +/// Endpoint type for +///com.atproto.admin.disableInviteCodes +pub struct DisableInviteCodesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DisableInviteCodesRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.disableInviteCodes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DisableInviteCodes<'de>; + type Response = DisableInviteCodesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/enable_account_invites.rs b/crates/weaver-api/src/com_atproto/admin/enable_account_invites.rs new file mode 100644 index 0000000..f0c8a0f --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/enable_account_invites.rs @@ -0,0 +1,183 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.enableAccountInvites +// +// 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 EnableAccountInvites<'a> { + #[serde(borrow)] + pub account: jacquard_common::types::string::Did<'a>, + /// Optional reason for enabled invites. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub note: Option>, +} + +pub mod enable_account_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 Account; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Account = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `account` field + pub struct account(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EnableAccountInvitesBuilder<'a, S: enable_account_invites_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> EnableAccountInvites<'a> { + /// Create a new builder for this type + pub fn new() -> EnableAccountInvitesBuilder< + 'a, + enable_account_invites_state::Empty, + > { + EnableAccountInvitesBuilder::new() + } +} + +impl<'a> EnableAccountInvitesBuilder<'a, enable_account_invites_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EnableAccountInvitesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EnableAccountInvitesBuilder<'a, S> +where + S: enable_account_invites_state::State, + S::Account: enable_account_invites_state::IsUnset, +{ + /// Set the `account` field (required) + pub fn account( + mut self, + value: impl Into>, + ) -> EnableAccountInvitesBuilder<'a, enable_account_invites_state::SetAccount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EnableAccountInvitesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: enable_account_invites_state::State> EnableAccountInvitesBuilder<'a, S> { + /// Set the `note` field (optional) + pub fn note( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `note` field to an Option value (optional) + pub fn maybe_note(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> EnableAccountInvitesBuilder<'a, S> +where + S: enable_account_invites_state::State, + S::Account: enable_account_invites_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> EnableAccountInvites<'a> { + EnableAccountInvites { + account: self.__unsafe_private_named.0.unwrap(), + note: 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>, + >, + ) -> EnableAccountInvites<'a> { + EnableAccountInvites { + account: self.__unsafe_private_named.0.unwrap(), + note: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.admin.enableAccountInvites +pub struct EnableAccountInvitesResponse; +impl jacquard_common::xrpc::XrpcResp for EnableAccountInvitesResponse { + const NSID: &'static str = "com.atproto.admin.enableAccountInvites"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for EnableAccountInvites<'a> { + const NSID: &'static str = "com.atproto.admin.enableAccountInvites"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = EnableAccountInvitesResponse; +} + +/// Endpoint type for +///com.atproto.admin.enableAccountInvites +pub struct EnableAccountInvitesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for EnableAccountInvitesRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.enableAccountInvites"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = EnableAccountInvites<'de>; + type Response = EnableAccountInvitesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/get_account_info.rs b/crates/weaver-api/src/com_atproto/admin/get_account_info.rs new file mode 100644 index 0000000..8cd1c43 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/get_account_info.rs @@ -0,0 +1,155 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.getAccountInfo +// +// 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 GetAccountInfo<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_account_info_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetAccountInfoBuilder<'a, S: get_account_info_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetAccountInfo<'a> { + /// Create a new builder for this type + pub fn new() -> GetAccountInfoBuilder<'a, get_account_info_state::Empty> { + GetAccountInfoBuilder::new() + } +} + +impl<'a> GetAccountInfoBuilder<'a, get_account_info_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetAccountInfoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetAccountInfoBuilder<'a, S> +where + S: get_account_info_state::State, + S::Did: get_account_info_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetAccountInfoBuilder<'a, get_account_info_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetAccountInfoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetAccountInfoBuilder<'a, S> +where + S: get_account_info_state::State, + S::Did: get_account_info_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetAccountInfo<'a> { + GetAccountInfo { + did: 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 GetAccountInfoOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::com_atproto::admin::AccountView<'a>, +} + +/// Response type for +///com.atproto.admin.getAccountInfo +pub struct GetAccountInfoResponse; +impl jacquard_common::xrpc::XrpcResp for GetAccountInfoResponse { + const NSID: &'static str = "com.atproto.admin.getAccountInfo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetAccountInfoOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetAccountInfo<'a> { + const NSID: &'static str = "com.atproto.admin.getAccountInfo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetAccountInfoResponse; +} + +/// Endpoint type for +///com.atproto.admin.getAccountInfo +pub struct GetAccountInfoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetAccountInfoRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.getAccountInfo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetAccountInfo<'de>; + type Response = GetAccountInfoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/get_account_infos.rs b/crates/weaver-api/src/com_atproto/admin/get_account_infos.rs new file mode 100644 index 0000000..89e2046 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/get_account_infos.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.getAccountInfos +// +// 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 GetAccountInfos<'a> { + #[serde(borrow)] + pub dids: Vec>, +} + +pub mod get_account_infos_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 Dids; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Dids = Unset; + } + ///State transition - sets the `dids` field to Set + pub struct SetDids(PhantomData S>); + impl sealed::Sealed for SetDids {} + impl State for SetDids { + type Dids = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `dids` field + pub struct dids(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetAccountInfosBuilder<'a, S: get_account_infos_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetAccountInfos<'a> { + /// Create a new builder for this type + pub fn new() -> GetAccountInfosBuilder<'a, get_account_infos_state::Empty> { + GetAccountInfosBuilder::new() + } +} + +impl<'a> GetAccountInfosBuilder<'a, get_account_infos_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetAccountInfosBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetAccountInfosBuilder<'a, S> +where + S: get_account_infos_state::State, + S::Dids: get_account_infos_state::IsUnset, +{ + /// Set the `dids` field (required) + pub fn dids( + mut self, + value: impl Into>>, + ) -> GetAccountInfosBuilder<'a, get_account_infos_state::SetDids> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetAccountInfosBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetAccountInfosBuilder<'a, S> +where + S: get_account_infos_state::State, + S::Dids: get_account_infos_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetAccountInfos<'a> { + GetAccountInfos { + dids: 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 GetAccountInfosOutput<'a> { + #[serde(borrow)] + pub infos: Vec>, +} + +/// Response type for +///com.atproto.admin.getAccountInfos +pub struct GetAccountInfosResponse; +impl jacquard_common::xrpc::XrpcResp for GetAccountInfosResponse { + const NSID: &'static str = "com.atproto.admin.getAccountInfos"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetAccountInfosOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetAccountInfos<'a> { + const NSID: &'static str = "com.atproto.admin.getAccountInfos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetAccountInfosResponse; +} + +/// Endpoint type for +///com.atproto.admin.getAccountInfos +pub struct GetAccountInfosRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetAccountInfosRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.getAccountInfos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetAccountInfos<'de>; + type Response = GetAccountInfosResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/get_invite_codes.rs b/crates/weaver-api/src/com_atproto/admin/get_invite_codes.rs new file mode 100644 index 0000000..98e4ae5 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/get_invite_codes.rs @@ -0,0 +1,181 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.getInviteCodes +// +// 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 GetInviteCodes<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 100, min: 1, max: 500) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + ///(default: "recent") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort: std::option::Option>, +} + +pub mod get_invite_codes_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 GetInviteCodesBuilder<'a, S: get_invite_codes_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> GetInviteCodes<'a> { + /// Create a new builder for this type + pub fn new() -> GetInviteCodesBuilder<'a, get_invite_codes_state::Empty> { + GetInviteCodesBuilder::new() + } +} + +impl<'a> GetInviteCodesBuilder<'a, get_invite_codes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetInviteCodesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_invite_codes_state::State> GetInviteCodesBuilder<'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_invite_codes_state::State> GetInviteCodesBuilder<'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_invite_codes_state::State> GetInviteCodesBuilder<'a, S> { + /// Set the `sort` field (optional) + pub fn sort( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S> GetInviteCodesBuilder<'a, S> +where + S: get_invite_codes_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetInviteCodes<'a> { + GetInviteCodes { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + sort: 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 GetInviteCodesOutput<'a> { + #[serde(borrow)] + pub codes: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///com.atproto.admin.getInviteCodes +pub struct GetInviteCodesResponse; +impl jacquard_common::xrpc::XrpcResp for GetInviteCodesResponse { + const NSID: &'static str = "com.atproto.admin.getInviteCodes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetInviteCodesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetInviteCodes<'a> { + const NSID: &'static str = "com.atproto.admin.getInviteCodes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetInviteCodesResponse; +} + +/// Endpoint type for +///com.atproto.admin.getInviteCodes +pub struct GetInviteCodesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetInviteCodesRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.getInviteCodes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetInviteCodes<'de>; + type Response = GetInviteCodesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/get_subject_status.rs b/crates/weaver-api/src/com_atproto/admin/get_subject_status.rs new file mode 100644 index 0000000..f1a2368 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/get_subject_status.rs @@ -0,0 +1,216 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.getSubjectStatus +// +// 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 GetSubjectStatus<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub blob: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub did: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub uri: std::option::Option>, +} + +pub mod get_subject_status_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 GetSubjectStatusBuilder<'a, S: get_subject_status_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> GetSubjectStatus<'a> { + /// Create a new builder for this type + pub fn new() -> GetSubjectStatusBuilder<'a, get_subject_status_state::Empty> { + GetSubjectStatusBuilder::new() + } +} + +impl<'a> GetSubjectStatusBuilder<'a, get_subject_status_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSubjectStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_subject_status_state::State> GetSubjectStatusBuilder<'a, S> { + /// Set the `blob` field (optional) + pub fn blob( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `blob` field to an Option value (optional) + pub fn maybe_blob( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_subject_status_state::State> GetSubjectStatusBuilder<'a, S> { + /// Set the `did` field (optional) + pub fn did( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `did` field to an Option value (optional) + pub fn maybe_did( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_subject_status_state::State> GetSubjectStatusBuilder<'a, S> { + /// Set the `uri` field (optional) + pub fn uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `uri` field to an Option value (optional) + pub fn maybe_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetSubjectStatusBuilder<'a, S> +where + S: get_subject_status_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSubjectStatus<'a> { + GetSubjectStatus { + blob: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1, + uri: 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 GetSubjectStatusOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub deactivated: std::option::Option>, + #[serde(borrow)] + pub subject: GetSubjectStatusOutputSubject<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub takedown: 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 GetSubjectStatusOutputSubject<'a> { + #[serde(rename = "com.atproto.admin.defs#repoRef")] + RepoRef(Box>), + #[serde(rename = "com.atproto.repo.strongRef")] + StrongRef(Box>), + #[serde(rename = "com.atproto.admin.defs#repoBlobRef")] + RepoBlobRef(Box>), +} + +/// Response type for +///com.atproto.admin.getSubjectStatus +pub struct GetSubjectStatusResponse; +impl jacquard_common::xrpc::XrpcResp for GetSubjectStatusResponse { + const NSID: &'static str = "com.atproto.admin.getSubjectStatus"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSubjectStatusOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSubjectStatus<'a> { + const NSID: &'static str = "com.atproto.admin.getSubjectStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSubjectStatusResponse; +} + +/// Endpoint type for +///com.atproto.admin.getSubjectStatus +pub struct GetSubjectStatusRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSubjectStatusRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.getSubjectStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSubjectStatus<'de>; + type Response = GetSubjectStatusResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/search_accounts.rs b/crates/weaver-api/src/com_atproto/admin/search_accounts.rs new file mode 100644 index 0000000..eabfcbe --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/search_accounts.rs @@ -0,0 +1,180 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.searchAccounts +// +// 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 SearchAccounts<'a> { + #[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 email: 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 search_accounts_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 SearchAccountsBuilder<'a, S: search_accounts_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> SearchAccounts<'a> { + /// Create a new builder for this type + pub fn new() -> SearchAccountsBuilder<'a, search_accounts_state::Empty> { + SearchAccountsBuilder::new() + } +} + +impl<'a> SearchAccountsBuilder<'a, search_accounts_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchAccountsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_accounts_state::State> SearchAccountsBuilder<'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_accounts_state::State> SearchAccountsBuilder<'a, S> { + /// Set the `email` field (optional) + pub fn email( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `email` field to an Option value (optional) + pub fn maybe_email(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: search_accounts_state::State> SearchAccountsBuilder<'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> SearchAccountsBuilder<'a, S> +where + S: search_accounts_state::State, +{ + /// Build the final struct + pub fn build(self) -> SearchAccounts<'a> { + SearchAccounts { + cursor: self.__unsafe_private_named.0, + email: 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 SearchAccountsOutput<'a> { + #[serde(borrow)] + pub accounts: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///com.atproto.admin.searchAccounts +pub struct SearchAccountsResponse; +impl jacquard_common::xrpc::XrpcResp for SearchAccountsResponse { + const NSID: &'static str = "com.atproto.admin.searchAccounts"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchAccountsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchAccounts<'a> { + const NSID: &'static str = "com.atproto.admin.searchAccounts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchAccountsResponse; +} + +/// Endpoint type for +///com.atproto.admin.searchAccounts +pub struct SearchAccountsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchAccountsRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.searchAccounts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchAccounts<'de>; + type Response = SearchAccountsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/send_email.rs b/crates/weaver-api/src/com_atproto/admin/send_email.rs new file mode 100644 index 0000000..290ed23 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/send_email.rs @@ -0,0 +1,293 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.sendEmail +// +// 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 SendEmail<'a> { + /// Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + #[serde(borrow)] + pub content: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub recipient_did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub sender_did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject: Option>, +} + +pub mod send_email_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 RecipientDid; + type Content; + type SenderDid; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type RecipientDid = Unset; + type Content = Unset; + type SenderDid = Unset; + } + ///State transition - sets the `recipient_did` field to Set + pub struct SetRecipientDid(PhantomData S>); + impl sealed::Sealed for SetRecipientDid {} + impl State for SetRecipientDid { + type RecipientDid = Set; + type Content = S::Content; + type SenderDid = S::SenderDid; + } + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + type RecipientDid = S::RecipientDid; + type Content = Set; + type SenderDid = S::SenderDid; + } + ///State transition - sets the `sender_did` field to Set + pub struct SetSenderDid(PhantomData S>); + impl sealed::Sealed for SetSenderDid {} + impl State for SetSenderDid { + type RecipientDid = S::RecipientDid; + type Content = S::Content; + type SenderDid = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `recipient_did` field + pub struct recipient_did(()); + ///Marker type for the `content` field + pub struct content(()); + ///Marker type for the `sender_did` field + pub struct sender_did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SendEmailBuilder<'a, S: send_email_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> SendEmail<'a> { + /// Create a new builder for this type + pub fn new() -> SendEmailBuilder<'a, send_email_state::Empty> { + SendEmailBuilder::new() + } +} + +impl<'a> SendEmailBuilder<'a, send_email_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SendEmailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: send_email_state::State> SendEmailBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> SendEmailBuilder<'a, S> +where + S: send_email_state::State, + S::Content: send_email_state::IsUnset, +{ + /// Set the `content` field (required) + pub fn content( + mut self, + value: impl Into>, + ) -> SendEmailBuilder<'a, send_email_state::SetContent> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SendEmailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendEmailBuilder<'a, S> +where + S: send_email_state::State, + S::RecipientDid: send_email_state::IsUnset, +{ + /// Set the `recipientDid` field (required) + pub fn recipient_did( + mut self, + value: impl Into>, + ) -> SendEmailBuilder<'a, send_email_state::SetRecipientDid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SendEmailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SendEmailBuilder<'a, S> +where + S: send_email_state::State, + S::SenderDid: send_email_state::IsUnset, +{ + /// Set the `senderDid` field (required) + pub fn sender_did( + mut self, + value: impl Into>, + ) -> SendEmailBuilder<'a, send_email_state::SetSenderDid> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + SendEmailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: send_email_state::State> SendEmailBuilder<'a, S> { + /// Set the `subject` field (optional) + pub fn subject( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `subject` field to an Option value (optional) + pub fn maybe_subject(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> SendEmailBuilder<'a, S> +where + S: send_email_state::State, + S::RecipientDid: send_email_state::IsSet, + S::Content: send_email_state::IsSet, + S::SenderDid: send_email_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SendEmail<'a> { + SendEmail { + comment: self.__unsafe_private_named.0, + content: self.__unsafe_private_named.1.unwrap(), + recipient_did: self.__unsafe_private_named.2.unwrap(), + sender_did: self.__unsafe_private_named.3.unwrap(), + subject: self.__unsafe_private_named.4, + 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>, + >, + ) -> SendEmail<'a> { + SendEmail { + comment: self.__unsafe_private_named.0, + content: self.__unsafe_private_named.1.unwrap(), + recipient_did: self.__unsafe_private_named.2.unwrap(), + sender_did: self.__unsafe_private_named.3.unwrap(), + subject: self.__unsafe_private_named.4, + 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 SendEmailOutput<'a> { + pub sent: bool, +} + +/// Response type for +///com.atproto.admin.sendEmail +pub struct SendEmailResponse; +impl jacquard_common::xrpc::XrpcResp for SendEmailResponse { + const NSID: &'static str = "com.atproto.admin.sendEmail"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SendEmailOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SendEmail<'a> { + const NSID: &'static str = "com.atproto.admin.sendEmail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = SendEmailResponse; +} + +/// Endpoint type for +///com.atproto.admin.sendEmail +pub struct SendEmailRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SendEmailRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.sendEmail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = SendEmail<'de>; + type Response = SendEmailResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/update_account_email.rs b/crates/weaver-api/src/com_atproto/admin/update_account_email.rs new file mode 100644 index 0000000..cf27c63 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/update_account_email.rs @@ -0,0 +1,195 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.updateAccountEmail +// +// 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 UpdateAccountEmail<'a> { + /// The handle or DID of the repo. + #[serde(borrow)] + pub account: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(borrow)] + pub email: jacquard_common::CowStr<'a>, +} + +pub mod update_account_email_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 Account; + type Email; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Account = Unset; + type Email = 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 Email = S::Email; + } + ///State transition - sets the `email` field to Set + pub struct SetEmail(PhantomData S>); + impl sealed::Sealed for SetEmail {} + impl State for SetEmail { + type Account = S::Account; + type Email = 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 `email` field + pub struct email(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateAccountEmailBuilder<'a, S: update_account_email_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UpdateAccountEmail<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateAccountEmailBuilder<'a, update_account_email_state::Empty> { + UpdateAccountEmailBuilder::new() + } +} + +impl<'a> UpdateAccountEmailBuilder<'a, update_account_email_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateAccountEmailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountEmailBuilder<'a, S> +where + S: update_account_email_state::State, + S::Account: update_account_email_state::IsUnset, +{ + /// Set the `account` field (required) + pub fn account( + mut self, + value: impl Into>, + ) -> UpdateAccountEmailBuilder<'a, update_account_email_state::SetAccount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateAccountEmailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountEmailBuilder<'a, S> +where + S: update_account_email_state::State, + S::Email: update_account_email_state::IsUnset, +{ + /// Set the `email` field (required) + pub fn email( + mut self, + value: impl Into>, + ) -> UpdateAccountEmailBuilder<'a, update_account_email_state::SetEmail> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateAccountEmailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountEmailBuilder<'a, S> +where + S: update_account_email_state::State, + S::Account: update_account_email_state::IsSet, + S::Email: update_account_email_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpdateAccountEmail<'a> { + UpdateAccountEmail { + account: self.__unsafe_private_named.0.unwrap(), + email: 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>, + >, + ) -> UpdateAccountEmail<'a> { + UpdateAccountEmail { + account: self.__unsafe_private_named.0.unwrap(), + email: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.admin.updateAccountEmail +pub struct UpdateAccountEmailResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateAccountEmailResponse { + const NSID: &'static str = "com.atproto.admin.updateAccountEmail"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateAccountEmail<'a> { + const NSID: &'static str = "com.atproto.admin.updateAccountEmail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateAccountEmailResponse; +} + +/// Endpoint type for +///com.atproto.admin.updateAccountEmail +pub struct UpdateAccountEmailRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateAccountEmailRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.updateAccountEmail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateAccountEmail<'de>; + type Response = UpdateAccountEmailResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..021ff61 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs @@ -0,0 +1,194 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.updateAccountHandle +// +// 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 UpdateAccountHandle<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, +} + +pub mod update_account_handle_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 Did; + type Handle; + } + /// 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; + } + ///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 `did` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateAccountHandleBuilder<'a, S: update_account_handle_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UpdateAccountHandle<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateAccountHandleBuilder<'a, update_account_handle_state::Empty> { + UpdateAccountHandleBuilder::new() + } +} + +impl<'a> UpdateAccountHandleBuilder<'a, update_account_handle_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateAccountHandleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountHandleBuilder<'a, S> +where + S: update_account_handle_state::State, + S::Did: update_account_handle_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> UpdateAccountHandleBuilder<'a, update_account_handle_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateAccountHandleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountHandleBuilder<'a, S> +where + S: update_account_handle_state::State, + S::Handle: update_account_handle_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> UpdateAccountHandleBuilder<'a, update_account_handle_state::SetHandle> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateAccountHandleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> UpdateAccountHandle<'a> { + UpdateAccountHandle { + did: self.__unsafe_private_named.0.unwrap(), + handle: 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>, + >, + ) -> UpdateAccountHandle<'a> { + UpdateAccountHandle { + did: self.__unsafe_private_named.0.unwrap(), + handle: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.admin.updateAccountHandle +pub struct UpdateAccountHandleResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateAccountHandleResponse { + const NSID: &'static str = "com.atproto.admin.updateAccountHandle"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateAccountHandle<'a> { + const NSID: &'static str = "com.atproto.admin.updateAccountHandle"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateAccountHandleResponse; +} + +/// Endpoint type for +///com.atproto.admin.updateAccountHandle +pub struct UpdateAccountHandleRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateAccountHandleRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.updateAccountHandle"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateAccountHandle<'de>; + type Response = UpdateAccountHandleResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..fdf105f --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/update_account_password.rs @@ -0,0 +1,200 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.updateAccountPassword +// +// 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 UpdateAccountPassword<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub password: jacquard_common::CowStr<'a>, +} + +pub mod update_account_password_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 Did; + type Password; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateAccountPasswordBuilder<'a, S: update_account_password_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UpdateAccountPassword<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateAccountPasswordBuilder< + 'a, + update_account_password_state::Empty, + > { + UpdateAccountPasswordBuilder::new() + } +} + +impl<'a> UpdateAccountPasswordBuilder<'a, update_account_password_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateAccountPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountPasswordBuilder<'a, S> +where + S: update_account_password_state::State, + S::Did: update_account_password_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> UpdateAccountPasswordBuilder<'a, update_account_password_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateAccountPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountPasswordBuilder<'a, S> +where + S: update_account_password_state::State, + S::Password: update_account_password_state::IsUnset, +{ + /// Set the `password` field (required) + pub fn password( + mut self, + value: impl Into>, + ) -> UpdateAccountPasswordBuilder< + 'a, + update_account_password_state::SetPassword, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateAccountPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> UpdateAccountPassword<'a> { + UpdateAccountPassword { + did: self.__unsafe_private_named.0.unwrap(), + password: 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>, + >, + ) -> UpdateAccountPassword<'a> { + UpdateAccountPassword { + did: self.__unsafe_private_named.0.unwrap(), + password: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.admin.updateAccountPassword +pub struct UpdateAccountPasswordResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateAccountPasswordResponse { + const NSID: &'static str = "com.atproto.admin.updateAccountPassword"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateAccountPassword<'a> { + const NSID: &'static str = "com.atproto.admin.updateAccountPassword"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateAccountPasswordResponse; +} + +/// Endpoint type for +///com.atproto.admin.updateAccountPassword +pub struct UpdateAccountPasswordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateAccountPasswordRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.updateAccountPassword"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateAccountPassword<'de>; + type Response = UpdateAccountPasswordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs b/crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs new file mode 100644 index 0000000..aae1574 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/update_account_signing_key.rs @@ -0,0 +1,207 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.updateAccountSigningKey +// +// 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 UpdateAccountSigningKey<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// Did-key formatted public key + #[serde(borrow)] + pub signing_key: jacquard_common::types::string::Did<'a>, +} + +pub mod update_account_signing_key_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 Did; + type SigningKey; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type SigningKey = 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 SigningKey = S::SigningKey; + } + ///State transition - sets the `signing_key` field to Set + pub struct SetSigningKey(PhantomData S>); + impl sealed::Sealed for SetSigningKey {} + impl State for SetSigningKey { + type Did = S::Did; + type SigningKey = 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 `signing_key` field + pub struct signing_key(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateAccountSigningKeyBuilder< + 'a, + S: update_account_signing_key_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UpdateAccountSigningKey<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateAccountSigningKeyBuilder< + 'a, + update_account_signing_key_state::Empty, + > { + UpdateAccountSigningKeyBuilder::new() + } +} + +impl<'a> UpdateAccountSigningKeyBuilder<'a, update_account_signing_key_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateAccountSigningKeyBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountSigningKeyBuilder<'a, S> +where + S: update_account_signing_key_state::State, + S::Did: update_account_signing_key_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> UpdateAccountSigningKeyBuilder< + 'a, + update_account_signing_key_state::SetDid, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateAccountSigningKeyBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountSigningKeyBuilder<'a, S> +where + S: update_account_signing_key_state::State, + S::SigningKey: update_account_signing_key_state::IsUnset, +{ + /// Set the `signingKey` field (required) + pub fn signing_key( + mut self, + value: impl Into>, + ) -> UpdateAccountSigningKeyBuilder< + 'a, + update_account_signing_key_state::SetSigningKey, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateAccountSigningKeyBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateAccountSigningKeyBuilder<'a, S> +where + S: update_account_signing_key_state::State, + S::Did: update_account_signing_key_state::IsSet, + S::SigningKey: update_account_signing_key_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpdateAccountSigningKey<'a> { + UpdateAccountSigningKey { + did: self.__unsafe_private_named.0.unwrap(), + signing_key: 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>, + >, + ) -> UpdateAccountSigningKey<'a> { + UpdateAccountSigningKey { + did: self.__unsafe_private_named.0.unwrap(), + signing_key: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.admin.updateAccountSigningKey +pub struct UpdateAccountSigningKeyResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateAccountSigningKeyResponse { + const NSID: &'static str = "com.atproto.admin.updateAccountSigningKey"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateAccountSigningKey<'a> { + const NSID: &'static str = "com.atproto.admin.updateAccountSigningKey"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateAccountSigningKeyResponse; +} + +/// Endpoint type for +///com.atproto.admin.updateAccountSigningKey +pub struct UpdateAccountSigningKeyRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateAccountSigningKeyRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.updateAccountSigningKey"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateAccountSigningKey<'de>; + type Response = UpdateAccountSigningKeyResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/admin/update_subject_status.rs b/crates/weaver-api/src/com_atproto/admin/update_subject_status.rs new file mode 100644 index 0000000..141a2b0 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/admin/update_subject_status.rs @@ -0,0 +1,268 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.admin.updateSubjectStatus +// +// 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 UpdateSubjectStatus<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub deactivated: Option>, + #[serde(borrow)] + pub subject: UpdateSubjectStatusSubject<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub takedown: Option>, +} + +pub mod update_subject_status_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 UpdateSubjectStatusBuilder<'a, S: update_subject_status_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> UpdateSubjectStatus<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateSubjectStatusBuilder<'a, update_subject_status_state::Empty> { + UpdateSubjectStatusBuilder::new() + } +} + +impl<'a> UpdateSubjectStatusBuilder<'a, update_subject_status_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateSubjectStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: update_subject_status_state::State> UpdateSubjectStatusBuilder<'a, S> { + /// Set the `deactivated` field (optional) + pub fn deactivated( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `deactivated` field to an Option value (optional) + pub fn maybe_deactivated( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> UpdateSubjectStatusBuilder<'a, S> +where + S: update_subject_status_state::State, + S::Subject: update_subject_status_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> UpdateSubjectStatusBuilder<'a, update_subject_status_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateSubjectStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: update_subject_status_state::State> UpdateSubjectStatusBuilder<'a, S> { + /// Set the `takedown` field (optional) + pub fn takedown( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `takedown` field to an Option value (optional) + pub fn maybe_takedown( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> UpdateSubjectStatusBuilder<'a, S> +where + S: update_subject_status_state::State, + S::Subject: update_subject_status_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpdateSubjectStatus<'a> { + UpdateSubjectStatus { + deactivated: self.__unsafe_private_named.0, + subject: self.__unsafe_private_named.1.unwrap(), + takedown: 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>, + >, + ) -> UpdateSubjectStatus<'a> { + UpdateSubjectStatus { + deactivated: self.__unsafe_private_named.0, + subject: self.__unsafe_private_named.1.unwrap(), + takedown: self.__unsafe_private_named.2, + 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 UpdateSubjectStatusSubject<'a> { + #[serde(rename = "com.atproto.admin.defs#repoRef")] + RepoRef(Box>), + #[serde(rename = "com.atproto.repo.strongRef")] + StrongRef(Box>), + #[serde(rename = "com.atproto.admin.defs#repoBlobRef")] + RepoBlobRef(Box>), +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateSubjectStatusOutput<'a> { + #[serde(borrow)] + pub subject: UpdateSubjectStatusOutputSubject<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub takedown: 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 UpdateSubjectStatusOutputSubject<'a> { + #[serde(rename = "com.atproto.admin.defs#repoRef")] + RepoRef(Box>), + #[serde(rename = "com.atproto.repo.strongRef")] + StrongRef(Box>), + #[serde(rename = "com.atproto.admin.defs#repoBlobRef")] + RepoBlobRef(Box>), +} + +/// Response type for +///com.atproto.admin.updateSubjectStatus +pub struct UpdateSubjectStatusResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateSubjectStatusResponse { + const NSID: &'static str = "com.atproto.admin.updateSubjectStatus"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpdateSubjectStatusOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateSubjectStatus<'a> { + const NSID: &'static str = "com.atproto.admin.updateSubjectStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateSubjectStatusResponse; +} + +/// Endpoint type for +///com.atproto.admin.updateSubjectStatus +pub struct UpdateSubjectStatusRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateSubjectStatusRequest { + const PATH: &'static str = "/xrpc/com.atproto.admin.updateSubjectStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateSubjectStatus<'de>; + type Response = UpdateSubjectStatusResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity.rs b/crates/weaver-api/src/com_atproto/identity.rs new file mode 100644 index 0000000..6e752d0 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity.rs @@ -0,0 +1,310 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_recommended_did_credentials; +pub mod refresh_identity; +pub mod request_plc_operation_signature; +pub mod resolve_did; +pub mod resolve_handle; +pub mod resolve_identity; +pub mod sign_plc_operation; +pub mod submit_plc_operation; +pub mod update_handle; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct IdentityInfo<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// The complete DID document for the identity. + #[serde(borrow)] + pub did_doc: jacquard_common::types::value::Data<'a>, + /// The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document. + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, +} + +pub mod identity_info_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 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 Did = Unset; + type Handle = Unset; + 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 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 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` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + ///Marker type for the `did_doc` field + pub struct did_doc(()); + } +} + +/// Builder for constructing an instance of this type +pub struct IdentityInfoBuilder<'a, S: identity_info_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> IdentityInfo<'a> { + /// Create a new builder for this type + pub fn new() -> IdentityInfoBuilder<'a, identity_info_state::Empty> { + IdentityInfoBuilder::new() + } +} + +impl<'a> IdentityInfoBuilder<'a, identity_info_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + IdentityInfoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdentityInfoBuilder<'a, S> +where + S: identity_info_state::State, + S::Did: identity_info_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> IdentityInfoBuilder<'a, identity_info_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + IdentityInfoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdentityInfoBuilder<'a, S> +where + S: identity_info_state::State, + S::DidDoc: identity_info_state::IsUnset, +{ + /// Set the `didDoc` field (required) + pub fn did_doc( + mut self, + value: impl Into>, + ) -> IdentityInfoBuilder<'a, identity_info_state::SetDidDoc> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + IdentityInfoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdentityInfoBuilder<'a, S> +where + S: identity_info_state::State, + S::Handle: identity_info_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> IdentityInfoBuilder<'a, identity_info_state::SetHandle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + IdentityInfoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdentityInfoBuilder<'a, S> +where + S: identity_info_state::State, + 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> { + IdentityInfo { + did: self.__unsafe_private_named.0.unwrap(), + did_doc: self.__unsafe_private_named.1.unwrap(), + handle: 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>, + >, + ) -> IdentityInfo<'a> { + IdentityInfo { + did: self.__unsafe_private_named.0.unwrap(), + did_doc: self.__unsafe_private_named.1.unwrap(), + handle: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_identity_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.identity.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("identityInfo"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_common::smol_str::SmolStr::new_static("didDoc") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("didDoc"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for IdentityInfo<'a> { + fn nsid() -> &'static str { + "com.atproto.identity.defs" + } + fn def_name() -> &'static str { + "identityInfo" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_identity_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/com_atproto/identity/get_recommended_did_credentials.rs b/crates/weaver-api/src/com_atproto/identity/get_recommended_did_credentials.rs new file mode 100644 index 0000000..8c141ba --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/get_recommended_did_credentials.rs @@ -0,0 +1,74 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.getRecommendedDidCredentials +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct GetRecommendedDidCredentialsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub also_known_as: std::option::Option>>, + /// Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub rotation_keys: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub services: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verification_methods: std::option::Option< + jacquard_common::types::value::Data<'a>, + >, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct GetRecommendedDidCredentials; +/// Response type for +///com.atproto.identity.getRecommendedDidCredentials +pub struct GetRecommendedDidCredentialsResponse; +impl jacquard_common::xrpc::XrpcResp for GetRecommendedDidCredentialsResponse { + const NSID: &'static str = "com.atproto.identity.getRecommendedDidCredentials"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetRecommendedDidCredentialsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetRecommendedDidCredentials { + const NSID: &'static str = "com.atproto.identity.getRecommendedDidCredentials"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRecommendedDidCredentialsResponse; +} + +/// Endpoint type for +///com.atproto.identity.getRecommendedDidCredentials +pub struct GetRecommendedDidCredentialsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRecommendedDidCredentialsRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.getRecommendedDidCredentials"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRecommendedDidCredentials; + type Response = GetRecommendedDidCredentialsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity/refresh_identity.rs b/crates/weaver-api/src/com_atproto/identity/refresh_identity.rs new file mode 100644 index 0000000..e9f9fb1 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/refresh_identity.rs @@ -0,0 +1,229 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.refreshIdentity +// +// 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 RefreshIdentity<'a> { + #[serde(borrow)] + pub identifier: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod refresh_identity_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 Identifier; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Identifier = Unset; + } + ///State transition - sets the `identifier` field to Set + pub struct SetIdentifier(PhantomData S>); + impl sealed::Sealed for SetIdentifier {} + impl State for SetIdentifier { + type Identifier = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `identifier` field + pub struct identifier(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RefreshIdentityBuilder<'a, S: refresh_identity_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RefreshIdentity<'a> { + /// Create a new builder for this type + pub fn new() -> RefreshIdentityBuilder<'a, refresh_identity_state::Empty> { + RefreshIdentityBuilder::new() + } +} + +impl<'a> RefreshIdentityBuilder<'a, refresh_identity_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RefreshIdentityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RefreshIdentityBuilder<'a, S> +where + S: refresh_identity_state::State, + S::Identifier: refresh_identity_state::IsUnset, +{ + /// Set the `identifier` field (required) + pub fn identifier( + mut self, + value: impl Into>, + ) -> RefreshIdentityBuilder<'a, refresh_identity_state::SetIdentifier> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RefreshIdentityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RefreshIdentityBuilder<'a, S> +where + S: refresh_identity_state::State, + S::Identifier: refresh_identity_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RefreshIdentity<'a> { + RefreshIdentity { + identifier: 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>, + >, + ) -> RefreshIdentity<'a> { + RefreshIdentity { + identifier: 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 +)] +#[serde(rename_all = "camelCase")] +pub struct RefreshIdentityOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::com_atproto::identity::IdentityInfo<'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 RefreshIdentityError<'a> { + /// The resolution process confirmed that the handle does not resolve to any DID. + #[serde(rename = "HandleNotFound")] + HandleNotFound(std::option::Option), + /// The DID resolution process confirmed that there is no current DID. + #[serde(rename = "DidNotFound")] + DidNotFound(std::option::Option), + /// The DID previously existed, but has been deactivated. + #[serde(rename = "DidDeactivated")] + DidDeactivated(std::option::Option), +} + +impl std::fmt::Display for RefreshIdentityError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::HandleNotFound(msg) => { + write!(f, "HandleNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::DidNotFound(msg) => { + write!(f, "DidNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::DidDeactivated(msg) => { + write!(f, "DidDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.identity.refreshIdentity +pub struct RefreshIdentityResponse; +impl jacquard_common::xrpc::XrpcResp for RefreshIdentityResponse { + const NSID: &'static str = "com.atproto.identity.refreshIdentity"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RefreshIdentityOutput<'de>; + type Err<'de> = RefreshIdentityError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RefreshIdentity<'a> { + const NSID: &'static str = "com.atproto.identity.refreshIdentity"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RefreshIdentityResponse; +} + +/// Endpoint type for +///com.atproto.identity.refreshIdentity +pub struct RefreshIdentityRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RefreshIdentityRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.refreshIdentity"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RefreshIdentity<'de>; + type Response = RefreshIdentityResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity/request_plc_operation_signature.rs b/crates/weaver-api/src/com_atproto/identity/request_plc_operation_signature.rs new file mode 100644 index 0000000..9b242bc --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/request_plc_operation_signature.rs @@ -0,0 +1,48 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.requestPlcOperationSignature +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct RequestPlcOperationSignature; +/// Response type for +///com.atproto.identity.requestPlcOperationSignature +pub struct RequestPlcOperationSignatureResponse; +impl jacquard_common::xrpc::XrpcResp for RequestPlcOperationSignatureResponse { + const NSID: &'static str = "com.atproto.identity.requestPlcOperationSignature"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for RequestPlcOperationSignature { + const NSID: &'static str = "com.atproto.identity.requestPlcOperationSignature"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RequestPlcOperationSignatureResponse; +} + +/// Endpoint type for +///com.atproto.identity.requestPlcOperationSignature +pub struct RequestPlcOperationSignatureRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RequestPlcOperationSignatureRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.requestPlcOperationSignature"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RequestPlcOperationSignature; + type Response = RequestPlcOperationSignatureResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity/resolve_did.rs b/crates/weaver-api/src/com_atproto/identity/resolve_did.rs new file mode 100644 index 0000000..a244ee6 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/resolve_did.rs @@ -0,0 +1,200 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.resolveDid +// +// 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 ResolveDid<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod resolve_did_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResolveDidBuilder<'a, S: resolve_did_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResolveDid<'a> { + /// Create a new builder for this type + pub fn new() -> ResolveDidBuilder<'a, resolve_did_state::Empty> { + ResolveDidBuilder::new() + } +} + +impl<'a> ResolveDidBuilder<'a, resolve_did_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResolveDidBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveDidBuilder<'a, S> +where + S: resolve_did_state::State, + S::Did: resolve_did_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ResolveDidBuilder<'a, resolve_did_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResolveDidBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveDidBuilder<'a, S> +where + S: resolve_did_state::State, + S::Did: resolve_did_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResolveDid<'a> { + ResolveDid { + did: 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 ResolveDidOutput<'a> { + /// The complete DID document for the identity. + #[serde(borrow)] + pub did_doc: 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 ResolveDidError<'a> { + /// The DID resolution process confirmed that there is no current DID. + #[serde(rename = "DidNotFound")] + DidNotFound(std::option::Option), + /// The DID previously existed, but has been deactivated. + #[serde(rename = "DidDeactivated")] + DidDeactivated(std::option::Option), +} + +impl std::fmt::Display for ResolveDidError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::DidNotFound(msg) => { + write!(f, "DidNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::DidDeactivated(msg) => { + write!(f, "DidDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.identity.resolveDid +pub struct ResolveDidResponse; +impl jacquard_common::xrpc::XrpcResp for ResolveDidResponse { + const NSID: &'static str = "com.atproto.identity.resolveDid"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ResolveDidOutput<'de>; + type Err<'de> = ResolveDidError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveDid<'a> { + const NSID: &'static str = "com.atproto.identity.resolveDid"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ResolveDidResponse; +} + +/// Endpoint type for +///com.atproto.identity.resolveDid +pub struct ResolveDidRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResolveDidRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.resolveDid"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ResolveDid<'de>; + type Response = ResolveDidResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity/resolve_handle.rs b/crates/weaver-api/src/com_atproto/identity/resolve_handle.rs new file mode 100644 index 0000000..c0df85a --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/resolve_handle.rs @@ -0,0 +1,189 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.resolveHandle +// +// 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 ResolveHandle<'a> { + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, +} + +pub mod resolve_handle_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 Handle; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResolveHandleBuilder<'a, S: resolve_handle_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResolveHandle<'a> { + /// Create a new builder for this type + pub fn new() -> ResolveHandleBuilder<'a, resolve_handle_state::Empty> { + ResolveHandleBuilder::new() + } +} + +impl<'a> ResolveHandleBuilder<'a, resolve_handle_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResolveHandleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveHandleBuilder<'a, S> +where + S: resolve_handle_state::State, + S::Handle: resolve_handle_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> ResolveHandleBuilder<'a, resolve_handle_state::SetHandle> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResolveHandleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveHandleBuilder<'a, S> +where + S: resolve_handle_state::State, + S::Handle: resolve_handle_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResolveHandle<'a> { + ResolveHandle { + handle: 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 ResolveHandleOutput<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'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 ResolveHandleError<'a> { + /// The resolution process confirmed that the handle does not resolve to any DID. + #[serde(rename = "HandleNotFound")] + HandleNotFound(std::option::Option), +} + +impl std::fmt::Display for ResolveHandleError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::HandleNotFound(msg) => { + write!(f, "HandleNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.identity.resolveHandle +pub struct ResolveHandleResponse; +impl jacquard_common::xrpc::XrpcResp for ResolveHandleResponse { + const NSID: &'static str = "com.atproto.identity.resolveHandle"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ResolveHandleOutput<'de>; + type Err<'de> = ResolveHandleError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveHandle<'a> { + const NSID: &'static str = "com.atproto.identity.resolveHandle"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ResolveHandleResponse; +} + +/// Endpoint type for +///com.atproto.identity.resolveHandle +pub struct ResolveHandleRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResolveHandleRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.resolveHandle"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ResolveHandle<'de>; + type Response = ResolveHandleResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity/resolve_identity.rs b/crates/weaver-api/src/com_atproto/identity/resolve_identity.rs new file mode 100644 index 0000000..4945fa4 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/resolve_identity.rs @@ -0,0 +1,210 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.resolveIdentity +// +// 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 ResolveIdentity<'a> { + #[serde(borrow)] + pub identifier: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod resolve_identity_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 Identifier; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Identifier = Unset; + } + ///State transition - sets the `identifier` field to Set + pub struct SetIdentifier(PhantomData S>); + impl sealed::Sealed for SetIdentifier {} + impl State for SetIdentifier { + type Identifier = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `identifier` field + pub struct identifier(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResolveIdentityBuilder<'a, S: resolve_identity_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResolveIdentity<'a> { + /// Create a new builder for this type + pub fn new() -> ResolveIdentityBuilder<'a, resolve_identity_state::Empty> { + ResolveIdentityBuilder::new() + } +} + +impl<'a> ResolveIdentityBuilder<'a, resolve_identity_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResolveIdentityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveIdentityBuilder<'a, S> +where + S: resolve_identity_state::State, + S::Identifier: resolve_identity_state::IsUnset, +{ + /// Set the `identifier` field (required) + pub fn identifier( + mut self, + value: impl Into>, + ) -> ResolveIdentityBuilder<'a, resolve_identity_state::SetIdentifier> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResolveIdentityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveIdentityBuilder<'a, S> +where + S: resolve_identity_state::State, + S::Identifier: resolve_identity_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResolveIdentity<'a> { + ResolveIdentity { + identifier: 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 ResolveIdentityOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::com_atproto::identity::IdentityInfo<'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 ResolveIdentityError<'a> { + /// The resolution process confirmed that the handle does not resolve to any DID. + #[serde(rename = "HandleNotFound")] + HandleNotFound(std::option::Option), + /// The DID resolution process confirmed that there is no current DID. + #[serde(rename = "DidNotFound")] + DidNotFound(std::option::Option), + /// The DID previously existed, but has been deactivated. + #[serde(rename = "DidDeactivated")] + DidDeactivated(std::option::Option), +} + +impl std::fmt::Display for ResolveIdentityError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::HandleNotFound(msg) => { + write!(f, "HandleNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::DidNotFound(msg) => { + write!(f, "DidNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::DidDeactivated(msg) => { + write!(f, "DidDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.identity.resolveIdentity +pub struct ResolveIdentityResponse; +impl jacquard_common::xrpc::XrpcResp for ResolveIdentityResponse { + const NSID: &'static str = "com.atproto.identity.resolveIdentity"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ResolveIdentityOutput<'de>; + type Err<'de> = ResolveIdentityError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveIdentity<'a> { + const NSID: &'static str = "com.atproto.identity.resolveIdentity"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ResolveIdentityResponse; +} + +/// Endpoint type for +///com.atproto.identity.resolveIdentity +pub struct ResolveIdentityRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResolveIdentityRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.resolveIdentity"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ResolveIdentity<'de>; + type Response = ResolveIdentityResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity/sign_plc_operation.rs b/crates/weaver-api/src/com_atproto/identity/sign_plc_operation.rs new file mode 100644 index 0000000..71ccee4 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/sign_plc_operation.rs @@ -0,0 +1,86 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.signPlcOperation +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct SignPlcOperation<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub also_known_as: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub rotation_keys: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub services: std::option::Option>, + /// A token received through com.atproto.identity.requestPlcOperationSignature + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub token: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verification_methods: std::option::Option< + jacquard_common::types::value::Data<'a>, + >, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SignPlcOperationOutput<'a> { + /// A signed DID PLC operation. + #[serde(borrow)] + pub operation: jacquard_common::types::value::Data<'a>, +} + +/// Response type for +///com.atproto.identity.signPlcOperation +pub struct SignPlcOperationResponse; +impl jacquard_common::xrpc::XrpcResp for SignPlcOperationResponse { + const NSID: &'static str = "com.atproto.identity.signPlcOperation"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SignPlcOperationOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SignPlcOperation<'a> { + const NSID: &'static str = "com.atproto.identity.signPlcOperation"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = SignPlcOperationResponse; +} + +/// Endpoint type for +///com.atproto.identity.signPlcOperation +pub struct SignPlcOperationRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SignPlcOperationRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.signPlcOperation"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = SignPlcOperation<'de>; + type Response = SignPlcOperationResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity/submit_plc_operation.rs b/crates/weaver-api/src/com_atproto/identity/submit_plc_operation.rs new file mode 100644 index 0000000..70e28d8 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/submit_plc_operation.rs @@ -0,0 +1,157 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.submitPlcOperation +// +// 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 SubmitPlcOperation<'a> { + #[serde(borrow)] + pub operation: jacquard_common::types::value::Data<'a>, +} + +pub mod submit_plc_operation_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 Operation; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Operation = Unset; + } + ///State transition - sets the `operation` field to Set + pub struct SetOperation(PhantomData S>); + impl sealed::Sealed for SetOperation {} + impl State for SetOperation { + type Operation = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `operation` field + pub struct operation(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SubmitPlcOperationBuilder<'a, S: submit_plc_operation_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SubmitPlcOperation<'a> { + /// Create a new builder for this type + pub fn new() -> SubmitPlcOperationBuilder<'a, submit_plc_operation_state::Empty> { + SubmitPlcOperationBuilder::new() + } +} + +impl<'a> SubmitPlcOperationBuilder<'a, submit_plc_operation_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubmitPlcOperationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubmitPlcOperationBuilder<'a, S> +where + S: submit_plc_operation_state::State, + S::Operation: submit_plc_operation_state::IsUnset, +{ + /// Set the `operation` field (required) + pub fn operation( + mut self, + value: impl Into>, + ) -> SubmitPlcOperationBuilder<'a, submit_plc_operation_state::SetOperation> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SubmitPlcOperationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubmitPlcOperationBuilder<'a, S> +where + S: submit_plc_operation_state::State, + S::Operation: submit_plc_operation_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SubmitPlcOperation<'a> { + SubmitPlcOperation { + operation: 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>, + >, + ) -> SubmitPlcOperation<'a> { + SubmitPlcOperation { + operation: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.identity.submitPlcOperation +pub struct SubmitPlcOperationResponse; +impl jacquard_common::xrpc::XrpcResp for SubmitPlcOperationResponse { + const NSID: &'static str = "com.atproto.identity.submitPlcOperation"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SubmitPlcOperation<'a> { + const NSID: &'static str = "com.atproto.identity.submitPlcOperation"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = SubmitPlcOperationResponse; +} + +/// Endpoint type for +///com.atproto.identity.submitPlcOperation +pub struct SubmitPlcOperationRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SubmitPlcOperationRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.submitPlcOperation"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = SubmitPlcOperation<'de>; + type Response = SubmitPlcOperationResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/identity/update_handle.rs b/crates/weaver-api/src/com_atproto/identity/update_handle.rs new file mode 100644 index 0000000..2288498 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/identity/update_handle.rs @@ -0,0 +1,158 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.identity.updateHandle +// +// 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 UpdateHandle<'a> { + /// The new handle. + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, +} + +pub mod update_handle_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 Handle; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateHandleBuilder<'a, S: update_handle_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UpdateHandle<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateHandleBuilder<'a, update_handle_state::Empty> { + UpdateHandleBuilder::new() + } +} + +impl<'a> UpdateHandleBuilder<'a, update_handle_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateHandleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateHandleBuilder<'a, S> +where + S: update_handle_state::State, + S::Handle: update_handle_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> UpdateHandleBuilder<'a, update_handle_state::SetHandle> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateHandleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateHandleBuilder<'a, S> +where + S: update_handle_state::State, + S::Handle: update_handle_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpdateHandle<'a> { + UpdateHandle { + handle: 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>, + >, + ) -> UpdateHandle<'a> { + UpdateHandle { + handle: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.identity.updateHandle +pub struct UpdateHandleResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateHandleResponse { + const NSID: &'static str = "com.atproto.identity.updateHandle"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateHandle<'a> { + const NSID: &'static str = "com.atproto.identity.updateHandle"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateHandleResponse; +} + +/// Endpoint type for +///com.atproto.identity.updateHandle +pub struct UpdateHandleRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateHandleRequest { + const PATH: &'static str = "/xrpc/com.atproto.identity.updateHandle"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateHandle<'de>; + type Response = UpdateHandleResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/label.rs b/crates/weaver-api/src/com_atproto/label.rs new file mode 100644 index 0000000..4ba463a --- /dev/null +++ b/crates/weaver-api/src/com_atproto/label.rs @@ -0,0 +1,1853 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.label.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod query_labels; + +#[cfg(feature = "streaming")] +pub mod subscribe_labels; + +/// Metadata tag on an atproto resource (eg, repo or record). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Label<'a> { + /// Optionally, CID specifying the specific version of 'uri' resource this label applies to. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: Option>, + /// Timestamp when this label was created. + pub cts: jacquard_common::types::string::Datetime, + /// Timestamp at which this label expires (no longer applies). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub exp: Option, + /// If true, this is a negation label, overwriting a previous label. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub neg: Option, + /// Signature of dag-cbor encoded label. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub sig: Option, + /// DID of the actor who created this label. + #[serde(borrow)] + pub src: jacquard_common::types::string::Did<'a>, + /// AT URI of the record, repository (account), or other resource that this label applies to. + #[serde(borrow)] + pub uri: jacquard_common::types::string::Uri<'a>, + /// The short string name of the value or type of this label. + #[serde(borrow)] + pub val: jacquard_common::CowStr<'a>, + /// The AT Protocol version of the label object. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub ver: Option, +} + +pub mod label_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 Src; + type Uri; + type Val; + type Cts; + } + /// 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 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; + } + ///State transition - sets the `val` field to Set + pub struct SetVal(PhantomData S>); + impl sealed::Sealed for SetVal {} + impl State for SetVal { + type Src = S::Src; + type Uri = S::Uri; + type Val = Set; + type Cts = S::Cts; + } + ///State transition - sets the `cts` field to Set + pub struct SetCts(PhantomData S>); + impl sealed::Sealed for SetCts {} + impl State for SetCts { + type Src = S::Src; + type Uri = S::Uri; + type Val = S::Val; + type Cts = 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 `cts` field + pub struct cts(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelBuilder<'a, S: label_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> Label<'a> { + /// Create a new builder for this type + pub fn new() -> LabelBuilder<'a, label_state::Empty> { + LabelBuilder::new() + } +} + +impl<'a> LabelBuilder<'a, label_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: label_state::State> LabelBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> LabelBuilder<'a, S> +where + S: label_state::State, + S::Cts: label_state::IsUnset, +{ + /// Set the `cts` field (required) + pub fn cts( + mut self, + value: impl Into, + ) -> LabelBuilder<'a, label_state::SetCts> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LabelBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: label_state::State> LabelBuilder<'a, S> { + /// Set the `exp` field (optional) + pub fn exp( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `exp` field to an Option value (optional) + pub fn maybe_exp( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: label_state::State> LabelBuilder<'a, S> { + /// Set the `neg` field (optional) + pub fn neg(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `neg` field to an Option value (optional) + pub fn maybe_neg(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: label_state::State> LabelBuilder<'a, S> { + /// Set the `sig` field (optional) + pub fn sig(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `sig` field to an Option value (optional) + pub fn maybe_sig(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> LabelBuilder<'a, S> +where + S: label_state::State, + S::Src: label_state::IsUnset, +{ + /// Set the `src` field (required) + pub fn src( + mut self, + value: impl Into>, + ) -> LabelBuilder<'a, label_state::SetSrc> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + LabelBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelBuilder<'a, S> +where + S: label_state::State, + S::Uri: label_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> LabelBuilder<'a, label_state::SetUri> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + LabelBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelBuilder<'a, S> +where + S: label_state::State, + S::Val: label_state::IsUnset, +{ + /// Set the `val` field (required) + pub fn val( + mut self, + value: impl Into>, + ) -> LabelBuilder<'a, label_state::SetVal> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + LabelBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: label_state::State> LabelBuilder<'a, S> { + /// Set the `ver` field (optional) + pub fn ver(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `ver` field to an Option value (optional) + pub fn maybe_ver(mut self, value: Option) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +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::Cts: label_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Label<'a> { + Label { + cid: self.__unsafe_private_named.0, + cts: self.__unsafe_private_named.1.unwrap(), + exp: self.__unsafe_private_named.2, + neg: self.__unsafe_private_named.3, + sig: self.__unsafe_private_named.4, + src: self.__unsafe_private_named.5.unwrap(), + uri: self.__unsafe_private_named.6.unwrap(), + val: self.__unsafe_private_named.7.unwrap(), + ver: self.__unsafe_private_named.8, + 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>, + >, + ) -> Label<'a> { + Label { + cid: self.__unsafe_private_named.0, + cts: self.__unsafe_private_named.1.unwrap(), + exp: self.__unsafe_private_named.2, + neg: self.__unsafe_private_named.3, + sig: self.__unsafe_private_named.4, + src: self.__unsafe_private_named.5.unwrap(), + uri: self.__unsafe_private_named.6.unwrap(), + val: self.__unsafe_private_named.7.unwrap(), + ver: self.__unsafe_private_named.8, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_label_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.label.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("label"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Metadata tag on an atproto resource (eg, repo or record).", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("src"), + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("val"), + ::jacquard_common::smol_str::SmolStr::new_static("cts") + ], + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "Optionally, CID specifying the specific version of 'uri' resource this label applies to.", + ), + ), + 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("cts"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp when this label was created.", + ), + ), + 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("exp"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp at which this label expires (no longer applies).", + ), + ), + 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("neg"), + ::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("sig"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Bytes(::jacquard_lexicon::lexicon::LexBytes { + description: None, + max_length: None, + min_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("src"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the actor who created this label.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "AT URI of the record, repository (account), or other resource that this label applies to.", + ), + ), + 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("val"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The short string name of the value or type of this label.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(128usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("ver"), + ::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("labelValue"), + ::jacquard_lexicon::lexicon::LexUserType::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("labelValueDefinition"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Declares a label value and its expected interpretations and behaviors.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("identifier"), + ::jacquard_common::smol_str::SmolStr::new_static("severity"), + ::jacquard_common::smol_str::SmolStr::new_static("blurs"), + ::jacquard_common::smol_str::SmolStr::new_static("locales") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "adultOnly", + ), + ::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("blurs"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.", + ), + ), + 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( + "defaultSetting", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The default setting for this label.", + ), + ), + 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( + "identifier", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(100usize), + min_graphemes: None, + max_graphemes: Some(100usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("locales"), + ::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( + "#labelValueDefinitionStrings", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("severity"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.", + ), + ), + 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( + "labelValueDefinitionStrings", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Strings which describe the label in the UI, localized into a specific language.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("lang"), + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_common::smol_str::SmolStr::new_static("description") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "A longer description of what the label means and why it might be applied.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(100000usize), + min_graphemes: None, + max_graphemes: Some(10000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("lang"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The code of the language these strings are written in.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Language, + ), + 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("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "A short human-readable name for the label.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("selfLabel"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("val")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("val"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The short string name of the value or type of this label.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(128usize), + 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("selfLabels"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Metadata tags on an atproto record, published by the author within the record.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("values")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("values"), + ::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("#selfLabel"), + }), + min_length: None, + max_length: Some(10usize), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Label<'a> { + fn nsid() -> &'static str { + "com.atproto.label.defs" + } + fn def_name() -> &'static str { + "label" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_label_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.val; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "val", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum LabelValue<'a> { + Hide, + NoPromote, + Warn, + NoUnauthenticated, + DmcaViolation, + Doxxing, + Porn, + Sexual, + Nudity, + Nsfl, + Gore, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> LabelValue<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Hide => "!hide", + Self::NoPromote => "!no-promote", + Self::Warn => "!warn", + Self::NoUnauthenticated => "!no-unauthenticated", + Self::DmcaViolation => "dmca-violation", + Self::Doxxing => "doxxing", + Self::Porn => "porn", + Self::Sexual => "sexual", + Self::Nudity => "nudity", + Self::Nsfl => "nsfl", + Self::Gore => "gore", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for LabelValue<'a> { + fn from(s: &'a str) -> Self { + match s { + "!hide" => Self::Hide, + "!no-promote" => Self::NoPromote, + "!warn" => Self::Warn, + "!no-unauthenticated" => Self::NoUnauthenticated, + "dmca-violation" => Self::DmcaViolation, + "doxxing" => Self::Doxxing, + "porn" => Self::Porn, + "sexual" => Self::Sexual, + "nudity" => Self::Nudity, + "nsfl" => Self::Nsfl, + "gore" => Self::Gore, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for LabelValue<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "!hide" => Self::Hide, + "!no-promote" => Self::NoPromote, + "!warn" => Self::Warn, + "!no-unauthenticated" => Self::NoUnauthenticated, + "dmca-violation" => Self::DmcaViolation, + "doxxing" => Self::Doxxing, + "porn" => Self::Porn, + "sexual" => Self::Sexual, + "nudity" => Self::Nudity, + "nsfl" => Self::Nsfl, + "gore" => Self::Gore, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for LabelValue<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for LabelValue<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for LabelValue<'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 LabelValue<'_> { + type Output = LabelValue<'static>; + fn into_static(self) -> Self::Output { + match self { + LabelValue::Hide => LabelValue::Hide, + LabelValue::NoPromote => LabelValue::NoPromote, + LabelValue::Warn => LabelValue::Warn, + LabelValue::NoUnauthenticated => LabelValue::NoUnauthenticated, + LabelValue::DmcaViolation => LabelValue::DmcaViolation, + LabelValue::Doxxing => LabelValue::Doxxing, + LabelValue::Porn => LabelValue::Porn, + LabelValue::Sexual => LabelValue::Sexual, + LabelValue::Nudity => LabelValue::Nudity, + LabelValue::Nsfl => LabelValue::Nsfl, + LabelValue::Gore => LabelValue::Gore, + LabelValue::Other(v) => LabelValue::Other(v.into_static()), + } + } +} + +/// Declares a label value and its expected interpretations and behaviors. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct LabelValueDefinition<'a> { + /// Does the user need to have adult content enabled in order to configure this label? + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub adult_only: Option, + /// What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing. + #[serde(borrow)] + pub blurs: jacquard_common::CowStr<'a>, + /// The default setting for this label. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub default_setting: Option>, + /// The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). + #[serde(borrow)] + pub identifier: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub locales: Vec>, + /// How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. + #[serde(borrow)] + pub severity: jacquard_common::CowStr<'a>, +} + +pub mod label_value_definition_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 Identifier; + type Severity; + type Blurs; + type Locales; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Identifier = Unset; + type Severity = Unset; + type Blurs = Unset; + type Locales = Unset; + } + ///State transition - sets the `identifier` field to Set + pub struct SetIdentifier(PhantomData S>); + impl sealed::Sealed for SetIdentifier {} + impl State for SetIdentifier { + type Identifier = Set; + type Severity = S::Severity; + type Blurs = S::Blurs; + type Locales = S::Locales; + } + ///State transition - sets the `severity` field to Set + pub struct SetSeverity(PhantomData S>); + impl sealed::Sealed for SetSeverity {} + impl State for SetSeverity { + type Identifier = S::Identifier; + type Severity = Set; + type Blurs = S::Blurs; + type Locales = S::Locales; + } + ///State transition - sets the `blurs` field to Set + pub struct SetBlurs(PhantomData S>); + impl sealed::Sealed for SetBlurs {} + impl State for SetBlurs { + type Identifier = S::Identifier; + type Severity = S::Severity; + 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 Identifier = S::Identifier; + type Severity = S::Severity; + type Blurs = S::Blurs; + type Locales = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `identifier` field + pub struct identifier(()); + ///Marker type for the `severity` field + pub struct severity(()); + ///Marker type for the `blurs` field + pub struct blurs(()); + ///Marker type for the `locales` field + pub struct locales(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelValueDefinitionBuilder<'a, S: label_value_definition_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< + Vec>, + >, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> LabelValueDefinition<'a> { + /// Create a new builder for this type + pub fn new() -> LabelValueDefinitionBuilder< + 'a, + label_value_definition_state::Empty, + > { + LabelValueDefinitionBuilder::new() + } +} + +impl<'a> LabelValueDefinitionBuilder<'a, label_value_definition_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelValueDefinitionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: label_value_definition_state::State> LabelValueDefinitionBuilder<'a, S> { + /// Set the `adultOnly` field (optional) + pub fn adult_only(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `adultOnly` field to an Option value (optional) + pub fn maybe_adult_only(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> LabelValueDefinitionBuilder<'a, S> +where + S: label_value_definition_state::State, + S::Blurs: label_value_definition_state::IsUnset, +{ + /// Set the `blurs` field (required) + pub fn blurs( + mut self, + value: impl Into>, + ) -> LabelValueDefinitionBuilder<'a, label_value_definition_state::SetBlurs> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LabelValueDefinitionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: label_value_definition_state::State> LabelValueDefinitionBuilder<'a, S> { + /// Set the `defaultSetting` field (optional) + pub fn default_setting( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `defaultSetting` field to an Option value (optional) + pub fn maybe_default_setting( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> LabelValueDefinitionBuilder<'a, S> +where + S: label_value_definition_state::State, + S::Identifier: label_value_definition_state::IsUnset, +{ + /// Set the `identifier` field (required) + pub fn identifier( + mut self, + value: impl Into>, + ) -> LabelValueDefinitionBuilder< + 'a, + label_value_definition_state::SetIdentifier, + > { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + LabelValueDefinitionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelValueDefinitionBuilder<'a, S> +where + S: label_value_definition_state::State, + S::Locales: label_value_definition_state::IsUnset, +{ + /// Set the `locales` field (required) + pub fn locales( + mut self, + value: impl Into>>, + ) -> LabelValueDefinitionBuilder<'a, label_value_definition_state::SetLocales> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + LabelValueDefinitionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelValueDefinitionBuilder<'a, S> +where + S: label_value_definition_state::State, + S::Severity: label_value_definition_state::IsUnset, +{ + /// Set the `severity` field (required) + pub fn severity( + mut self, + value: impl Into>, + ) -> LabelValueDefinitionBuilder<'a, label_value_definition_state::SetSeverity> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + LabelValueDefinitionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelValueDefinitionBuilder<'a, S> +where + S: label_value_definition_state::State, + S::Identifier: label_value_definition_state::IsSet, + S::Severity: 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> { + LabelValueDefinition { + adult_only: self.__unsafe_private_named.0, + blurs: self.__unsafe_private_named.1.unwrap(), + default_setting: self.__unsafe_private_named.2, + identifier: self.__unsafe_private_named.3.unwrap(), + locales: self.__unsafe_private_named.4.unwrap(), + severity: 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>, + >, + ) -> LabelValueDefinition<'a> { + LabelValueDefinition { + adult_only: self.__unsafe_private_named.0, + blurs: self.__unsafe_private_named.1.unwrap(), + default_setting: self.__unsafe_private_named.2, + identifier: self.__unsafe_private_named.3.unwrap(), + locales: self.__unsafe_private_named.4.unwrap(), + severity: self.__unsafe_private_named.5.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelValueDefinition<'a> { + fn nsid() -> &'static str { + "com.atproto.label.defs" + } + fn def_name() -> &'static str { + "labelValueDefinition" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_label_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.identifier; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "identifier", + ), + max: 100usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.identifier; + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "identifier", + ), + max: 100usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +/// Strings which describe the label in the UI, localized into a specific language. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct LabelValueDefinitionStrings<'a> { + /// A longer description of what the label means and why it might be applied. + #[serde(borrow)] + pub description: jacquard_common::CowStr<'a>, + /// The code of the language these strings are written in. + pub lang: jacquard_common::types::string::Language, + /// A short human-readable name for the label. + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +pub mod label_value_definition_strings_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 Lang; + type Name; + type Description; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Lang = Unset; + type Name = Unset; + type Description = Unset; + } + ///State transition - sets the `lang` field to Set + pub struct SetLang(PhantomData S>); + impl sealed::Sealed for SetLang {} + impl State for SetLang { + type Lang = Set; + type Name = S::Name; + type Description = S::Description; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Lang = S::Lang; + type Name = 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 Lang = S::Lang; + type Name = S::Name; + type Description = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `lang` field + pub struct lang(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `description` field + pub struct description(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelValueDefinitionStringsBuilder< + 'a, + S: label_value_definition_strings_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> LabelValueDefinitionStrings<'a> { + /// Create a new builder for this type + pub fn new() -> LabelValueDefinitionStringsBuilder< + 'a, + label_value_definition_strings_state::Empty, + > { + LabelValueDefinitionStringsBuilder::new() + } +} + +impl< + 'a, +> LabelValueDefinitionStringsBuilder<'a, label_value_definition_strings_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelValueDefinitionStringsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> +where + S: label_value_definition_strings_state::State, + S::Description: label_value_definition_strings_state::IsUnset, +{ + /// Set the `description` field (required) + pub fn description( + mut self, + value: impl Into>, + ) -> LabelValueDefinitionStringsBuilder< + 'a, + label_value_definition_strings_state::SetDescription, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LabelValueDefinitionStringsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> +where + S: label_value_definition_strings_state::State, + S::Lang: label_value_definition_strings_state::IsUnset, +{ + /// Set the `lang` field (required) + pub fn lang( + mut self, + value: impl Into, + ) -> LabelValueDefinitionStringsBuilder< + 'a, + label_value_definition_strings_state::SetLang, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LabelValueDefinitionStringsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> +where + S: label_value_definition_strings_state::State, + S::Name: label_value_definition_strings_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> LabelValueDefinitionStringsBuilder< + 'a, + label_value_definition_strings_state::SetName, + > { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LabelValueDefinitionStringsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> +where + S: label_value_definition_strings_state::State, + S::Lang: label_value_definition_strings_state::IsSet, + S::Name: label_value_definition_strings_state::IsSet, + S::Description: label_value_definition_strings_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LabelValueDefinitionStrings<'a> { + LabelValueDefinitionStrings { + description: self.__unsafe_private_named.0.unwrap(), + lang: self.__unsafe_private_named.1.unwrap(), + name: 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>, + >, + ) -> LabelValueDefinitionStrings<'a> { + LabelValueDefinitionStrings { + description: self.__unsafe_private_named.0.unwrap(), + lang: self.__unsafe_private_named.1.unwrap(), + name: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelValueDefinitionStrings<'a> { + fn nsid() -> &'static str { + "com.atproto.label.defs" + } + fn def_name() -> &'static str { + "labelValueDefinitionStrings" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_label_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.description; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 100000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 100000usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.description; + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 10000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 10000usize, + actual: count, + }); + } + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 640usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 640usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.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( + "name", + ), + max: 64usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +/// Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct SelfLabel<'a> { + /// The short string name of the value or type of this label. + #[serde(borrow)] + pub val: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SelfLabel<'a> { + fn nsid() -> &'static str { + "com.atproto.label.defs" + } + fn def_name() -> &'static str { + "selfLabel" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_label_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.val; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "val", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +/// Metadata tags on an atproto record, published by the author within the record. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SelfLabels<'a> { + #[serde(borrow)] + pub values: Vec>, +} + +pub mod self_labels_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 Values; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Values = Unset; + } + ///State transition - sets the `values` field to Set + pub struct SetValues(PhantomData S>); + impl sealed::Sealed for SetValues {} + impl State for SetValues { + type Values = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `values` field + pub struct values(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SelfLabelsBuilder<'a, S: self_labels_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SelfLabels<'a> { + /// Create a new builder for this type + pub fn new() -> SelfLabelsBuilder<'a, self_labels_state::Empty> { + SelfLabelsBuilder::new() + } +} + +impl<'a> SelfLabelsBuilder<'a, self_labels_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SelfLabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SelfLabelsBuilder<'a, S> +where + S: self_labels_state::State, + S::Values: self_labels_state::IsUnset, +{ + /// Set the `values` field (required) + pub fn values( + mut self, + value: impl Into>>, + ) -> SelfLabelsBuilder<'a, self_labels_state::SetValues> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SelfLabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SelfLabelsBuilder<'a, S> +where + S: self_labels_state::State, + S::Values: self_labels_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SelfLabels<'a> { + SelfLabels { + values: 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>, + >, + ) -> SelfLabels<'a> { + SelfLabels { + values: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SelfLabels<'a> { + fn nsid() -> &'static str { + "com.atproto.label.defs" + } + fn def_name() -> &'static str { + "selfLabels" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_label_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.values; + #[allow(unused_comparisons)] + if value.len() > 10usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "values", + ), + max: 10usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/label/query_labels.rs b/crates/weaver-api/src/com_atproto/label/query_labels.rs new file mode 100644 index 0000000..f261e14 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/label/query_labels.rs @@ -0,0 +1,220 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.label.queryLabels +// +// 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 QueryLabels<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 250) + #[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 sources: std::option::Option>>, + #[serde(borrow)] + pub uri_patterns: Vec>, +} + +pub mod query_labels_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 UriPatterns; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type UriPatterns = Unset; + } + ///State transition - sets the `uri_patterns` field to Set + pub struct SetUriPatterns(PhantomData S>); + impl sealed::Sealed for SetUriPatterns {} + impl State for SetUriPatterns { + type UriPatterns = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `uri_patterns` field + pub struct uri_patterns(()); + } +} + +/// Builder for constructing an instance of this type +pub struct QueryLabelsBuilder<'a, S: query_labels_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> QueryLabels<'a> { + /// Create a new builder for this type + pub fn new() -> QueryLabelsBuilder<'a, query_labels_state::Empty> { + QueryLabelsBuilder::new() + } +} + +impl<'a> QueryLabelsBuilder<'a, query_labels_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + QueryLabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: query_labels_state::State> QueryLabelsBuilder<'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: query_labels_state::State> QueryLabelsBuilder<'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: query_labels_state::State> QueryLabelsBuilder<'a, S> { + /// Set the `sources` field (optional) + pub fn sources( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `sources` field to an Option value (optional) + pub fn maybe_sources( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> QueryLabelsBuilder<'a, S> +where + S: query_labels_state::State, + S::UriPatterns: query_labels_state::IsUnset, +{ + /// Set the `uriPatterns` field (required) + pub fn uri_patterns( + mut self, + value: impl Into>>, + ) -> QueryLabelsBuilder<'a, query_labels_state::SetUriPatterns> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + QueryLabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> QueryLabelsBuilder<'a, S> +where + S: query_labels_state::State, + S::UriPatterns: query_labels_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> QueryLabels<'a> { + QueryLabels { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + sources: self.__unsafe_private_named.2, + uri_patterns: 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 QueryLabelsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub labels: Vec>, +} + +/// Response type for +///com.atproto.label.queryLabels +pub struct QueryLabelsResponse; +impl jacquard_common::xrpc::XrpcResp for QueryLabelsResponse { + const NSID: &'static str = "com.atproto.label.queryLabels"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = QueryLabelsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for QueryLabels<'a> { + const NSID: &'static str = "com.atproto.label.queryLabels"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = QueryLabelsResponse; +} + +/// Endpoint type for +///com.atproto.label.queryLabels +pub struct QueryLabelsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for QueryLabelsRequest { + const PATH: &'static str = "/xrpc/com.atproto.label.queryLabels"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = QueryLabels<'de>; + type Response = QueryLabelsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs b/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs new file mode 100644 index 0000000..6ae8520 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs @@ -0,0 +1,541 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.label.subscribeLabels +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Info<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub message: std::option::Option>, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +fn lexicon_doc_com_atproto_label_subscribeLabels() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.label.subscribeLabels"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("info"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("name")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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("name"), + ::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("labels"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("seq"), + ::jacquard_common::smol_str::SmolStr::new_static("labels") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("seq"), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcSubscription(::jacquard_lexicon::lexicon::LexXrpcSubscription { + description: None, + parameters: Some( + ::jacquard_lexicon::lexicon::LexXrpcSubscriptionParameter::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::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ), + message: None, + infos: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Info<'a> { + fn nsid() -> &'static str { + "com.atproto.label.subscribeLabels" + } + fn def_name() -> &'static str { + "info" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_label_subscribeLabels() + } + 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 Labels<'a> { + #[serde(borrow)] + pub labels: Vec>, + pub seq: i64, +} + +pub mod labels_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 Seq; + type Labels; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Seq = Unset; + 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 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 `seq` field + pub struct seq(()); + ///Marker type for the `labels` field + pub struct labels(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LabelsBuilder<'a, S: labels_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Labels<'a> { + /// Create a new builder for this type + pub fn new() -> LabelsBuilder<'a, labels_state::Empty> { + LabelsBuilder::new() + } +} + +impl<'a> LabelsBuilder<'a, labels_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelsBuilder<'a, S> +where + S: labels_state::State, + S::Labels: labels_state::IsUnset, +{ + /// Set the `labels` field (required) + pub fn labels( + mut self, + value: impl Into>>, + ) -> LabelsBuilder<'a, labels_state::SetLabels> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelsBuilder<'a, S> +where + S: labels_state::State, + S::Seq: labels_state::IsUnset, +{ + /// Set the `seq` field (required) + pub fn seq( + mut self, + value: impl Into, + ) -> LabelsBuilder<'a, labels_state::SetSeq> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LabelsBuilder<'a, S> +where + S: labels_state::State, + S::Seq: labels_state::IsSet, + S::Labels: labels_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Labels<'a> { + Labels { + labels: self.__unsafe_private_named.0.unwrap(), + seq: 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>, + >, + ) -> Labels<'a> { + Labels { + labels: self.__unsafe_private_named.0.unwrap(), + seq: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Labels<'a> { + fn nsid() -> &'static str { + "com.atproto.label.subscribeLabels" + } + fn def_name() -> &'static str { + "labels" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_label_subscribeLabels() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SubscribeLabels { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub cursor: std::option::Option, +} + +pub mod subscribe_labels_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 SubscribeLabelsBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl SubscribeLabels { + /// Create a new builder for this type + pub fn new() -> SubscribeLabelsBuilder { + SubscribeLabelsBuilder::new() + } +} + +impl SubscribeLabelsBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubscribeLabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl SubscribeLabelsBuilder { + /// 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 SubscribeLabelsBuilder +where + S: subscribe_labels_state::State, +{ + /// Build the final struct + pub fn build(self) -> SubscribeLabels { + SubscribeLabels { + cursor: self.__unsafe_private_named.0, + } + } +} + +#[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 SubscribeLabelsMessage<'a> { + #[serde(rename = "#labels")] + Labels(Box>), + #[serde(rename = "#info")] + Info(Box>), +} + +impl<'a> SubscribeLabelsMessage<'a> { + /// Decode a framed DAG-CBOR message (header + body). + pub fn decode_framed<'de: 'a>( + bytes: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> { + let (header, body) = jacquard_common::xrpc::subscription::parse_event_header( + bytes, + )?; + match header.t.as_str() { + "#labels" => { + let variant = serde_ipld_dagcbor::from_slice(body)?; + Ok(Self::Labels(Box::new(variant))) + } + "#info" => { + let variant = serde_ipld_dagcbor::from_slice(body)?; + Ok(Self::Info(Box::new(variant))) + } + unknown => { + Err( + jacquard_common::error::DecodeError::UnknownEventType(unknown.into()), + ) + } + } + } +} + +#[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 SubscribeLabelsError<'a> { + #[serde(rename = "FutureCursor")] + FutureCursor(std::option::Option), +} + +impl std::fmt::Display for SubscribeLabelsError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::FutureCursor(msg) => { + write!(f, "FutureCursor")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +///Stream response type for +///com.atproto.label.subscribeLabels +pub struct SubscribeLabelsStream; +impl jacquard_common::xrpc::SubscriptionResp for SubscribeLabelsStream { + const NSID: &'static str = "com.atproto.label.subscribeLabels"; + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor; + type Message<'de> = SubscribeLabelsMessage<'de>; + type Error<'de> = SubscribeLabelsError<'de>; + fn decode_message<'de>( + bytes: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> { + SubscribeLabelsMessage::decode_framed(bytes) + } +} + +impl jacquard_common::xrpc::XrpcSubscription for SubscribeLabels { + const NSID: &'static str = "com.atproto.label.subscribeLabels"; + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor; + type Stream = SubscribeLabelsStream; +} + +pub struct SubscribeLabelsEndpoint; +impl jacquard_common::xrpc::SubscriptionEndpoint for SubscribeLabelsEndpoint { + const PATH: &'static str = "/xrpc/com.atproto.label.subscribeLabels"; + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor; + type Params<'de> = SubscribeLabels; + type Stream = SubscribeLabelsStream; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/lexicon.rs b/crates/weaver-api/src/com_atproto/lexicon.rs new file mode 100644 index 0000000..afe0ab6 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/lexicon.rs @@ -0,0 +1,6 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod schema; \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/lexicon/schema.rs b/crates/weaver-api/src/com_atproto/lexicon/schema.rs new file mode 100644 index 0000000..b8829f4 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/lexicon/schema.rs @@ -0,0 +1,255 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.lexicon.schema +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Representation of Lexicon schemas themselves, when published as atproto records. Note that the schema language is not defined in Lexicon; this meta schema currently only includes a single version field ('lexicon'). See the atproto specifications for description of the other expected top-level fields ('id', 'defs', etc). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Schema<'a> { + /// Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system. + pub lexicon: i64, +} + +pub mod schema_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 Lexicon; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Lexicon = Unset; + } + ///State transition - sets the `lexicon` field to Set + pub struct SetLexicon(PhantomData S>); + impl sealed::Sealed for SetLexicon {} + impl State for SetLexicon { + type Lexicon = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `lexicon` field + pub struct lexicon(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SchemaBuilder<'a, S: schema_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Schema<'a> { + /// Create a new builder for this type + pub fn new() -> SchemaBuilder<'a, schema_state::Empty> { + SchemaBuilder::new() + } +} + +impl<'a> SchemaBuilder<'a, schema_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SchemaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SchemaBuilder<'a, S> +where + S: schema_state::State, + S::Lexicon: schema_state::IsUnset, +{ + /// Set the `lexicon` field (required) + pub fn lexicon( + mut self, + value: impl Into, + ) -> SchemaBuilder<'a, schema_state::SetLexicon> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SchemaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SchemaBuilder<'a, S> +where + S: schema_state::State, + S::Lexicon: schema_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Schema<'a> { + Schema { + lexicon: 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>, + >, + ) -> Schema<'a> { + Schema { + lexicon: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Schema<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, SchemaRecord>, + 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 SchemaGetRecordOutput<'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: Schema<'a>, +} + +impl From> for Schema<'_> { + fn from(output: SchemaGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Schema<'_> { + const NSID: &'static str = "com.atproto.lexicon.schema"; + type Record = SchemaRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct SchemaRecord; +impl jacquard_common::xrpc::XrpcResp for SchemaRecord { + const NSID: &'static str = "com.atproto.lexicon.schema"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SchemaGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for SchemaRecord { + const NSID: &'static str = "com.atproto.lexicon.schema"; + type Record = SchemaRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Schema<'a> { + fn nsid() -> &'static str { + "com.atproto.lexicon.schema" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_lexicon_schema() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_com_atproto_lexicon_schema() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.lexicon.schema"), + 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( + "Representation of Lexicon schemas themselves, when published as atproto records. Note that the schema language is not defined in Lexicon; this meta schema currently only includes a single version field ('lexicon'). See the atproto specifications for description of the other expected top-level fields ('id', 'defs', etc).", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("nsid")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("lexicon") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("lexicon"), + ::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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/moderation.rs b/crates/weaver-api/src/com_atproto/moderation.rs new file mode 100644 index 0000000..1ea1c59 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/moderation.rs @@ -0,0 +1,893 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.moderation.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod create_report; + +/// Appeal a previously taken moderation action +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonAppeal; +impl std::fmt::Display for ReasonAppeal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonAppeal") + } +} + +/// Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonMisleading; +impl std::fmt::Display for ReasonMisleading { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonMisleading") + } +} + +/// Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonOther; +impl std::fmt::Display for ReasonOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonOther") + } +} + +/// Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonRude; +impl std::fmt::Display for ReasonRude { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonRude") + } +} + +/// Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSexual; +impl std::fmt::Display for ReasonSexual { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSexual") + } +} + +/// Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSpam; +impl std::fmt::Display for ReasonSpam { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSpam") + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ReasonType<'a> { + ComAtprotoModerationDefsReasonSpam, + ComAtprotoModerationDefsReasonViolation, + ComAtprotoModerationDefsReasonMisleading, + ComAtprotoModerationDefsReasonSexual, + ComAtprotoModerationDefsReasonRude, + ComAtprotoModerationDefsReasonOther, + ComAtprotoModerationDefsReasonAppeal, + ToolsOzoneReportDefsReasonAppeal, + ToolsOzoneReportDefsReasonOther, + ToolsOzoneReportDefsReasonViolenceAnimal, + ToolsOzoneReportDefsReasonViolenceThreats, + ToolsOzoneReportDefsReasonViolenceGraphicContent, + ToolsOzoneReportDefsReasonViolenceGlorification, + ToolsOzoneReportDefsReasonViolenceExtremistContent, + ToolsOzoneReportDefsReasonViolenceTrafficking, + ToolsOzoneReportDefsReasonViolenceOther, + ToolsOzoneReportDefsReasonSexualAbuseContent, + ToolsOzoneReportDefsReasonSexualNcii, + ToolsOzoneReportDefsReasonSexualDeepfake, + ToolsOzoneReportDefsReasonSexualAnimal, + ToolsOzoneReportDefsReasonSexualUnlabeled, + ToolsOzoneReportDefsReasonSexualOther, + ToolsOzoneReportDefsReasonChildSafetyCsam, + ToolsOzoneReportDefsReasonChildSafetyGroom, + ToolsOzoneReportDefsReasonChildSafetyPrivacy, + ToolsOzoneReportDefsReasonChildSafetyHarassment, + ToolsOzoneReportDefsReasonChildSafetyOther, + ToolsOzoneReportDefsReasonHarassmentTroll, + ToolsOzoneReportDefsReasonHarassmentTargeted, + ToolsOzoneReportDefsReasonHarassmentHateSpeech, + ToolsOzoneReportDefsReasonHarassmentDoxxing, + ToolsOzoneReportDefsReasonHarassmentOther, + ToolsOzoneReportDefsReasonMisleadingBot, + ToolsOzoneReportDefsReasonMisleadingImpersonation, + ToolsOzoneReportDefsReasonMisleadingSpam, + ToolsOzoneReportDefsReasonMisleadingScam, + ToolsOzoneReportDefsReasonMisleadingElections, + ToolsOzoneReportDefsReasonMisleadingOther, + ToolsOzoneReportDefsReasonRuleSiteSecurity, + ToolsOzoneReportDefsReasonRuleProhibitedSales, + ToolsOzoneReportDefsReasonRuleBanEvasion, + ToolsOzoneReportDefsReasonRuleOther, + ToolsOzoneReportDefsReasonSelfHarmContent, + ToolsOzoneReportDefsReasonSelfHarmEd, + ToolsOzoneReportDefsReasonSelfHarmStunts, + ToolsOzoneReportDefsReasonSelfHarmSubstances, + ToolsOzoneReportDefsReasonSelfHarmOther, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> ReasonType<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::ComAtprotoModerationDefsReasonSpam => { + "com.atproto.moderation.defs#reasonSpam" + } + Self::ComAtprotoModerationDefsReasonViolation => { + "com.atproto.moderation.defs#reasonViolation" + } + Self::ComAtprotoModerationDefsReasonMisleading => { + "com.atproto.moderation.defs#reasonMisleading" + } + Self::ComAtprotoModerationDefsReasonSexual => { + "com.atproto.moderation.defs#reasonSexual" + } + Self::ComAtprotoModerationDefsReasonRude => { + "com.atproto.moderation.defs#reasonRude" + } + Self::ComAtprotoModerationDefsReasonOther => { + "com.atproto.moderation.defs#reasonOther" + } + Self::ComAtprotoModerationDefsReasonAppeal => { + "com.atproto.moderation.defs#reasonAppeal" + } + Self::ToolsOzoneReportDefsReasonAppeal => { + "tools.ozone.report.defs#reasonAppeal" + } + Self::ToolsOzoneReportDefsReasonOther => { + "tools.ozone.report.defs#reasonOther" + } + Self::ToolsOzoneReportDefsReasonViolenceAnimal => { + "tools.ozone.report.defs#reasonViolenceAnimal" + } + Self::ToolsOzoneReportDefsReasonViolenceThreats => { + "tools.ozone.report.defs#reasonViolenceThreats" + } + Self::ToolsOzoneReportDefsReasonViolenceGraphicContent => { + "tools.ozone.report.defs#reasonViolenceGraphicContent" + } + Self::ToolsOzoneReportDefsReasonViolenceGlorification => { + "tools.ozone.report.defs#reasonViolenceGlorification" + } + Self::ToolsOzoneReportDefsReasonViolenceExtremistContent => { + "tools.ozone.report.defs#reasonViolenceExtremistContent" + } + Self::ToolsOzoneReportDefsReasonViolenceTrafficking => { + "tools.ozone.report.defs#reasonViolenceTrafficking" + } + Self::ToolsOzoneReportDefsReasonViolenceOther => { + "tools.ozone.report.defs#reasonViolenceOther" + } + Self::ToolsOzoneReportDefsReasonSexualAbuseContent => { + "tools.ozone.report.defs#reasonSexualAbuseContent" + } + Self::ToolsOzoneReportDefsReasonSexualNcii => { + "tools.ozone.report.defs#reasonSexualNCII" + } + Self::ToolsOzoneReportDefsReasonSexualDeepfake => { + "tools.ozone.report.defs#reasonSexualDeepfake" + } + Self::ToolsOzoneReportDefsReasonSexualAnimal => { + "tools.ozone.report.defs#reasonSexualAnimal" + } + Self::ToolsOzoneReportDefsReasonSexualUnlabeled => { + "tools.ozone.report.defs#reasonSexualUnlabeled" + } + Self::ToolsOzoneReportDefsReasonSexualOther => { + "tools.ozone.report.defs#reasonSexualOther" + } + Self::ToolsOzoneReportDefsReasonChildSafetyCsam => { + "tools.ozone.report.defs#reasonChildSafetyCSAM" + } + Self::ToolsOzoneReportDefsReasonChildSafetyGroom => { + "tools.ozone.report.defs#reasonChildSafetyGroom" + } + Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy => { + "tools.ozone.report.defs#reasonChildSafetyPrivacy" + } + Self::ToolsOzoneReportDefsReasonChildSafetyHarassment => { + "tools.ozone.report.defs#reasonChildSafetyHarassment" + } + Self::ToolsOzoneReportDefsReasonChildSafetyOther => { + "tools.ozone.report.defs#reasonChildSafetyOther" + } + Self::ToolsOzoneReportDefsReasonHarassmentTroll => { + "tools.ozone.report.defs#reasonHarassmentTroll" + } + Self::ToolsOzoneReportDefsReasonHarassmentTargeted => { + "tools.ozone.report.defs#reasonHarassmentTargeted" + } + Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech => { + "tools.ozone.report.defs#reasonHarassmentHateSpeech" + } + Self::ToolsOzoneReportDefsReasonHarassmentDoxxing => { + "tools.ozone.report.defs#reasonHarassmentDoxxing" + } + Self::ToolsOzoneReportDefsReasonHarassmentOther => { + "tools.ozone.report.defs#reasonHarassmentOther" + } + Self::ToolsOzoneReportDefsReasonMisleadingBot => { + "tools.ozone.report.defs#reasonMisleadingBot" + } + Self::ToolsOzoneReportDefsReasonMisleadingImpersonation => { + "tools.ozone.report.defs#reasonMisleadingImpersonation" + } + Self::ToolsOzoneReportDefsReasonMisleadingSpam => { + "tools.ozone.report.defs#reasonMisleadingSpam" + } + Self::ToolsOzoneReportDefsReasonMisleadingScam => { + "tools.ozone.report.defs#reasonMisleadingScam" + } + Self::ToolsOzoneReportDefsReasonMisleadingElections => { + "tools.ozone.report.defs#reasonMisleadingElections" + } + Self::ToolsOzoneReportDefsReasonMisleadingOther => { + "tools.ozone.report.defs#reasonMisleadingOther" + } + Self::ToolsOzoneReportDefsReasonRuleSiteSecurity => { + "tools.ozone.report.defs#reasonRuleSiteSecurity" + } + Self::ToolsOzoneReportDefsReasonRuleProhibitedSales => { + "tools.ozone.report.defs#reasonRuleProhibitedSales" + } + Self::ToolsOzoneReportDefsReasonRuleBanEvasion => { + "tools.ozone.report.defs#reasonRuleBanEvasion" + } + Self::ToolsOzoneReportDefsReasonRuleOther => { + "tools.ozone.report.defs#reasonRuleOther" + } + Self::ToolsOzoneReportDefsReasonSelfHarmContent => { + "tools.ozone.report.defs#reasonSelfHarmContent" + } + Self::ToolsOzoneReportDefsReasonSelfHarmEd => { + "tools.ozone.report.defs#reasonSelfHarmED" + } + Self::ToolsOzoneReportDefsReasonSelfHarmStunts => { + "tools.ozone.report.defs#reasonSelfHarmStunts" + } + Self::ToolsOzoneReportDefsReasonSelfHarmSubstances => { + "tools.ozone.report.defs#reasonSelfHarmSubstances" + } + Self::ToolsOzoneReportDefsReasonSelfHarmOther => { + "tools.ozone.report.defs#reasonSelfHarmOther" + } + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for ReasonType<'a> { + fn from(s: &'a str) -> Self { + match s { + "com.atproto.moderation.defs#reasonSpam" => { + Self::ComAtprotoModerationDefsReasonSpam + } + "com.atproto.moderation.defs#reasonViolation" => { + Self::ComAtprotoModerationDefsReasonViolation + } + "com.atproto.moderation.defs#reasonMisleading" => { + Self::ComAtprotoModerationDefsReasonMisleading + } + "com.atproto.moderation.defs#reasonSexual" => { + Self::ComAtprotoModerationDefsReasonSexual + } + "com.atproto.moderation.defs#reasonRude" => { + Self::ComAtprotoModerationDefsReasonRude + } + "com.atproto.moderation.defs#reasonOther" => { + Self::ComAtprotoModerationDefsReasonOther + } + "com.atproto.moderation.defs#reasonAppeal" => { + Self::ComAtprotoModerationDefsReasonAppeal + } + "tools.ozone.report.defs#reasonAppeal" => { + Self::ToolsOzoneReportDefsReasonAppeal + } + "tools.ozone.report.defs#reasonOther" => { + Self::ToolsOzoneReportDefsReasonOther + } + "tools.ozone.report.defs#reasonViolenceAnimal" => { + Self::ToolsOzoneReportDefsReasonViolenceAnimal + } + "tools.ozone.report.defs#reasonViolenceThreats" => { + Self::ToolsOzoneReportDefsReasonViolenceThreats + } + "tools.ozone.report.defs#reasonViolenceGraphicContent" => { + Self::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + "tools.ozone.report.defs#reasonViolenceGlorification" => { + Self::ToolsOzoneReportDefsReasonViolenceGlorification + } + "tools.ozone.report.defs#reasonViolenceExtremistContent" => { + Self::ToolsOzoneReportDefsReasonViolenceExtremistContent + } + "tools.ozone.report.defs#reasonViolenceTrafficking" => { + Self::ToolsOzoneReportDefsReasonViolenceTrafficking + } + "tools.ozone.report.defs#reasonViolenceOther" => { + Self::ToolsOzoneReportDefsReasonViolenceOther + } + "tools.ozone.report.defs#reasonSexualAbuseContent" => { + Self::ToolsOzoneReportDefsReasonSexualAbuseContent + } + "tools.ozone.report.defs#reasonSexualNCII" => { + Self::ToolsOzoneReportDefsReasonSexualNcii + } + "tools.ozone.report.defs#reasonSexualDeepfake" => { + Self::ToolsOzoneReportDefsReasonSexualDeepfake + } + "tools.ozone.report.defs#reasonSexualAnimal" => { + Self::ToolsOzoneReportDefsReasonSexualAnimal + } + "tools.ozone.report.defs#reasonSexualUnlabeled" => { + Self::ToolsOzoneReportDefsReasonSexualUnlabeled + } + "tools.ozone.report.defs#reasonSexualOther" => { + Self::ToolsOzoneReportDefsReasonSexualOther + } + "tools.ozone.report.defs#reasonChildSafetyCSAM" => { + Self::ToolsOzoneReportDefsReasonChildSafetyCsam + } + "tools.ozone.report.defs#reasonChildSafetyGroom" => { + Self::ToolsOzoneReportDefsReasonChildSafetyGroom + } + "tools.ozone.report.defs#reasonChildSafetyPrivacy" => { + Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy + } + "tools.ozone.report.defs#reasonChildSafetyHarassment" => { + Self::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + "tools.ozone.report.defs#reasonChildSafetyOther" => { + Self::ToolsOzoneReportDefsReasonChildSafetyOther + } + "tools.ozone.report.defs#reasonHarassmentTroll" => { + Self::ToolsOzoneReportDefsReasonHarassmentTroll + } + "tools.ozone.report.defs#reasonHarassmentTargeted" => { + Self::ToolsOzoneReportDefsReasonHarassmentTargeted + } + "tools.ozone.report.defs#reasonHarassmentHateSpeech" => { + Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech + } + "tools.ozone.report.defs#reasonHarassmentDoxxing" => { + Self::ToolsOzoneReportDefsReasonHarassmentDoxxing + } + "tools.ozone.report.defs#reasonHarassmentOther" => { + Self::ToolsOzoneReportDefsReasonHarassmentOther + } + "tools.ozone.report.defs#reasonMisleadingBot" => { + Self::ToolsOzoneReportDefsReasonMisleadingBot + } + "tools.ozone.report.defs#reasonMisleadingImpersonation" => { + Self::ToolsOzoneReportDefsReasonMisleadingImpersonation + } + "tools.ozone.report.defs#reasonMisleadingSpam" => { + Self::ToolsOzoneReportDefsReasonMisleadingSpam + } + "tools.ozone.report.defs#reasonMisleadingScam" => { + Self::ToolsOzoneReportDefsReasonMisleadingScam + } + "tools.ozone.report.defs#reasonMisleadingElections" => { + Self::ToolsOzoneReportDefsReasonMisleadingElections + } + "tools.ozone.report.defs#reasonMisleadingOther" => { + Self::ToolsOzoneReportDefsReasonMisleadingOther + } + "tools.ozone.report.defs#reasonRuleSiteSecurity" => { + Self::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + "tools.ozone.report.defs#reasonRuleProhibitedSales" => { + Self::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + "tools.ozone.report.defs#reasonRuleBanEvasion" => { + Self::ToolsOzoneReportDefsReasonRuleBanEvasion + } + "tools.ozone.report.defs#reasonRuleOther" => { + Self::ToolsOzoneReportDefsReasonRuleOther + } + "tools.ozone.report.defs#reasonSelfHarmContent" => { + Self::ToolsOzoneReportDefsReasonSelfHarmContent + } + "tools.ozone.report.defs#reasonSelfHarmED" => { + Self::ToolsOzoneReportDefsReasonSelfHarmEd + } + "tools.ozone.report.defs#reasonSelfHarmStunts" => { + Self::ToolsOzoneReportDefsReasonSelfHarmStunts + } + "tools.ozone.report.defs#reasonSelfHarmSubstances" => { + Self::ToolsOzoneReportDefsReasonSelfHarmSubstances + } + "tools.ozone.report.defs#reasonSelfHarmOther" => { + Self::ToolsOzoneReportDefsReasonSelfHarmOther + } + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for ReasonType<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "com.atproto.moderation.defs#reasonSpam" => { + Self::ComAtprotoModerationDefsReasonSpam + } + "com.atproto.moderation.defs#reasonViolation" => { + Self::ComAtprotoModerationDefsReasonViolation + } + "com.atproto.moderation.defs#reasonMisleading" => { + Self::ComAtprotoModerationDefsReasonMisleading + } + "com.atproto.moderation.defs#reasonSexual" => { + Self::ComAtprotoModerationDefsReasonSexual + } + "com.atproto.moderation.defs#reasonRude" => { + Self::ComAtprotoModerationDefsReasonRude + } + "com.atproto.moderation.defs#reasonOther" => { + Self::ComAtprotoModerationDefsReasonOther + } + "com.atproto.moderation.defs#reasonAppeal" => { + Self::ComAtprotoModerationDefsReasonAppeal + } + "tools.ozone.report.defs#reasonAppeal" => { + Self::ToolsOzoneReportDefsReasonAppeal + } + "tools.ozone.report.defs#reasonOther" => { + Self::ToolsOzoneReportDefsReasonOther + } + "tools.ozone.report.defs#reasonViolenceAnimal" => { + Self::ToolsOzoneReportDefsReasonViolenceAnimal + } + "tools.ozone.report.defs#reasonViolenceThreats" => { + Self::ToolsOzoneReportDefsReasonViolenceThreats + } + "tools.ozone.report.defs#reasonViolenceGraphicContent" => { + Self::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + "tools.ozone.report.defs#reasonViolenceGlorification" => { + Self::ToolsOzoneReportDefsReasonViolenceGlorification + } + "tools.ozone.report.defs#reasonViolenceExtremistContent" => { + Self::ToolsOzoneReportDefsReasonViolenceExtremistContent + } + "tools.ozone.report.defs#reasonViolenceTrafficking" => { + Self::ToolsOzoneReportDefsReasonViolenceTrafficking + } + "tools.ozone.report.defs#reasonViolenceOther" => { + Self::ToolsOzoneReportDefsReasonViolenceOther + } + "tools.ozone.report.defs#reasonSexualAbuseContent" => { + Self::ToolsOzoneReportDefsReasonSexualAbuseContent + } + "tools.ozone.report.defs#reasonSexualNCII" => { + Self::ToolsOzoneReportDefsReasonSexualNcii + } + "tools.ozone.report.defs#reasonSexualDeepfake" => { + Self::ToolsOzoneReportDefsReasonSexualDeepfake + } + "tools.ozone.report.defs#reasonSexualAnimal" => { + Self::ToolsOzoneReportDefsReasonSexualAnimal + } + "tools.ozone.report.defs#reasonSexualUnlabeled" => { + Self::ToolsOzoneReportDefsReasonSexualUnlabeled + } + "tools.ozone.report.defs#reasonSexualOther" => { + Self::ToolsOzoneReportDefsReasonSexualOther + } + "tools.ozone.report.defs#reasonChildSafetyCSAM" => { + Self::ToolsOzoneReportDefsReasonChildSafetyCsam + } + "tools.ozone.report.defs#reasonChildSafetyGroom" => { + Self::ToolsOzoneReportDefsReasonChildSafetyGroom + } + "tools.ozone.report.defs#reasonChildSafetyPrivacy" => { + Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy + } + "tools.ozone.report.defs#reasonChildSafetyHarassment" => { + Self::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + "tools.ozone.report.defs#reasonChildSafetyOther" => { + Self::ToolsOzoneReportDefsReasonChildSafetyOther + } + "tools.ozone.report.defs#reasonHarassmentTroll" => { + Self::ToolsOzoneReportDefsReasonHarassmentTroll + } + "tools.ozone.report.defs#reasonHarassmentTargeted" => { + Self::ToolsOzoneReportDefsReasonHarassmentTargeted + } + "tools.ozone.report.defs#reasonHarassmentHateSpeech" => { + Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech + } + "tools.ozone.report.defs#reasonHarassmentDoxxing" => { + Self::ToolsOzoneReportDefsReasonHarassmentDoxxing + } + "tools.ozone.report.defs#reasonHarassmentOther" => { + Self::ToolsOzoneReportDefsReasonHarassmentOther + } + "tools.ozone.report.defs#reasonMisleadingBot" => { + Self::ToolsOzoneReportDefsReasonMisleadingBot + } + "tools.ozone.report.defs#reasonMisleadingImpersonation" => { + Self::ToolsOzoneReportDefsReasonMisleadingImpersonation + } + "tools.ozone.report.defs#reasonMisleadingSpam" => { + Self::ToolsOzoneReportDefsReasonMisleadingSpam + } + "tools.ozone.report.defs#reasonMisleadingScam" => { + Self::ToolsOzoneReportDefsReasonMisleadingScam + } + "tools.ozone.report.defs#reasonMisleadingElections" => { + Self::ToolsOzoneReportDefsReasonMisleadingElections + } + "tools.ozone.report.defs#reasonMisleadingOther" => { + Self::ToolsOzoneReportDefsReasonMisleadingOther + } + "tools.ozone.report.defs#reasonRuleSiteSecurity" => { + Self::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + "tools.ozone.report.defs#reasonRuleProhibitedSales" => { + Self::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + "tools.ozone.report.defs#reasonRuleBanEvasion" => { + Self::ToolsOzoneReportDefsReasonRuleBanEvasion + } + "tools.ozone.report.defs#reasonRuleOther" => { + Self::ToolsOzoneReportDefsReasonRuleOther + } + "tools.ozone.report.defs#reasonSelfHarmContent" => { + Self::ToolsOzoneReportDefsReasonSelfHarmContent + } + "tools.ozone.report.defs#reasonSelfHarmED" => { + Self::ToolsOzoneReportDefsReasonSelfHarmEd + } + "tools.ozone.report.defs#reasonSelfHarmStunts" => { + Self::ToolsOzoneReportDefsReasonSelfHarmStunts + } + "tools.ozone.report.defs#reasonSelfHarmSubstances" => { + Self::ToolsOzoneReportDefsReasonSelfHarmSubstances + } + "tools.ozone.report.defs#reasonSelfHarmOther" => { + Self::ToolsOzoneReportDefsReasonSelfHarmOther + } + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for ReasonType<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for ReasonType<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for ReasonType<'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 ReasonType<'_> { + type Output = ReasonType<'static>; + fn into_static(self) -> Self::Output { + match self { + ReasonType::ComAtprotoModerationDefsReasonSpam => { + ReasonType::ComAtprotoModerationDefsReasonSpam + } + ReasonType::ComAtprotoModerationDefsReasonViolation => { + ReasonType::ComAtprotoModerationDefsReasonViolation + } + ReasonType::ComAtprotoModerationDefsReasonMisleading => { + ReasonType::ComAtprotoModerationDefsReasonMisleading + } + ReasonType::ComAtprotoModerationDefsReasonSexual => { + ReasonType::ComAtprotoModerationDefsReasonSexual + } + ReasonType::ComAtprotoModerationDefsReasonRude => { + ReasonType::ComAtprotoModerationDefsReasonRude + } + ReasonType::ComAtprotoModerationDefsReasonOther => { + ReasonType::ComAtprotoModerationDefsReasonOther + } + ReasonType::ComAtprotoModerationDefsReasonAppeal => { + ReasonType::ComAtprotoModerationDefsReasonAppeal + } + ReasonType::ToolsOzoneReportDefsReasonAppeal => { + ReasonType::ToolsOzoneReportDefsReasonAppeal + } + ReasonType::ToolsOzoneReportDefsReasonOther => { + ReasonType::ToolsOzoneReportDefsReasonOther + } + ReasonType::ToolsOzoneReportDefsReasonViolenceAnimal => { + ReasonType::ToolsOzoneReportDefsReasonViolenceAnimal + } + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats => { + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats + } + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent => { + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + ReasonType::ToolsOzoneReportDefsReasonViolenceGlorification => { + ReasonType::ToolsOzoneReportDefsReasonViolenceGlorification + } + ReasonType::ToolsOzoneReportDefsReasonViolenceExtremistContent => { + ReasonType::ToolsOzoneReportDefsReasonViolenceExtremistContent + } + ReasonType::ToolsOzoneReportDefsReasonViolenceTrafficking => { + ReasonType::ToolsOzoneReportDefsReasonViolenceTrafficking + } + ReasonType::ToolsOzoneReportDefsReasonViolenceOther => { + ReasonType::ToolsOzoneReportDefsReasonViolenceOther + } + ReasonType::ToolsOzoneReportDefsReasonSexualAbuseContent => { + ReasonType::ToolsOzoneReportDefsReasonSexualAbuseContent + } + ReasonType::ToolsOzoneReportDefsReasonSexualNcii => { + ReasonType::ToolsOzoneReportDefsReasonSexualNcii + } + ReasonType::ToolsOzoneReportDefsReasonSexualDeepfake => { + ReasonType::ToolsOzoneReportDefsReasonSexualDeepfake + } + ReasonType::ToolsOzoneReportDefsReasonSexualAnimal => { + ReasonType::ToolsOzoneReportDefsReasonSexualAnimal + } + ReasonType::ToolsOzoneReportDefsReasonSexualUnlabeled => { + ReasonType::ToolsOzoneReportDefsReasonSexualUnlabeled + } + ReasonType::ToolsOzoneReportDefsReasonSexualOther => { + ReasonType::ToolsOzoneReportDefsReasonSexualOther + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyCsam => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyCsam + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyGroom => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyGroom + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPrivacy => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPrivacy + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyOther => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyOther + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentTroll => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentTroll + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentTargeted => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentTargeted + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentHateSpeech => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentHateSpeech + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentDoxxing => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentDoxxing + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentOther => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentOther + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingBot => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingBot + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingImpersonation => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingImpersonation + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingSpam => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingSpam + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingScam => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingScam + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingElections => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingElections + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther + } + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity => { + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales => { + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion => { + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion + } + ReasonType::ToolsOzoneReportDefsReasonRuleOther => { + ReasonType::ToolsOzoneReportDefsReasonRuleOther + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmContent => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmContent + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmEd => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmEd + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmStunts => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmStunts + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmSubstances => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmSubstances + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmOther => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmOther + } + ReasonType::Other(v) => ReasonType::Other(v.into_static()), + } + } +} + +/// Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonViolation; +impl std::fmt::Display for ReasonViolation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonViolation") + } +} + +/// Tag describing a type of subject that might be reported. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum SubjectType<'a> { + Account, + Record, + Chat, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> SubjectType<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Account => "account", + Self::Record => "record", + Self::Chat => "chat", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for SubjectType<'a> { + fn from(s: &'a str) -> Self { + match s { + "account" => Self::Account, + "record" => Self::Record, + "chat" => Self::Chat, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for SubjectType<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "account" => Self::Account, + "record" => Self::Record, + "chat" => Self::Chat, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for SubjectType<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for SubjectType<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for SubjectType<'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 SubjectType<'_> { + type Output = SubjectType<'static>; + fn into_static(self) -> Self::Output { + match self { + SubjectType::Account => SubjectType::Account, + SubjectType::Record => SubjectType::Record, + SubjectType::Chat => SubjectType::Chat, + SubjectType::Other(v) => SubjectType::Other(v.into_static()), + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/moderation/create_report.rs b/crates/weaver-api/src/com_atproto/moderation/create_report.rs new file mode 100644 index 0000000..2c31ff8 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/moderation/create_report.rs @@ -0,0 +1,489 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.moderation.createReport +// +// 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 CreateReport<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub mod_tool: Option>, + /// Additional context about the content and violation. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason: Option>, + /// Indicates the broad category of violation the report is for. + #[serde(borrow)] + pub reason_type: crate::com_atproto::moderation::ReasonType<'a>, + #[serde(borrow)] + pub subject: CreateReportSubject<'a>, +} + +pub mod create_report_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 ReasonType; + type Subject; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ReasonType = Unset; + type Subject = Unset; + } + ///State transition - sets the `reason_type` field to Set + pub struct SetReasonType(PhantomData S>); + impl sealed::Sealed for SetReasonType {} + impl State for SetReasonType { + type ReasonType = 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 ReasonType = S::ReasonType; + type Subject = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `reason_type` field + pub struct reason_type(()); + ///Marker type for the `subject` field + pub struct subject(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CreateReportBuilder<'a, S: create_report_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + crate::com_atproto::moderation::create_report::ModTool<'a>, + >, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> CreateReport<'a> { + /// Create a new builder for this type + pub fn new() -> CreateReportBuilder<'a, create_report_state::Empty> { + CreateReportBuilder::new() + } +} + +impl<'a> CreateReportBuilder<'a, create_report_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CreateReportBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: create_report_state::State> CreateReportBuilder<'a, S> { + /// Set the `modTool` field (optional) + pub fn mod_tool( + mut self, + value: impl Into< + Option>, + >, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `modTool` field to an Option value (optional) + pub fn maybe_mod_tool( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: create_report_state::State> CreateReportBuilder<'a, S> { + /// Set the `reason` field (optional) + pub fn reason( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S> CreateReportBuilder<'a, S> +where + S: create_report_state::State, + S::ReasonType: create_report_state::IsUnset, +{ + /// Set the `reasonType` field (required) + pub fn reason_type( + mut self, + value: impl Into>, + ) -> CreateReportBuilder<'a, create_report_state::SetReasonType> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CreateReportBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateReportBuilder<'a, S> +where + S: create_report_state::State, + S::Subject: create_report_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> CreateReportBuilder<'a, create_report_state::SetSubject> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + CreateReportBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateReportBuilder<'a, S> +where + S: create_report_state::State, + S::ReasonType: create_report_state::IsSet, + S::Subject: create_report_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CreateReport<'a> { + CreateReport { + mod_tool: self.__unsafe_private_named.0, + reason: self.__unsafe_private_named.1, + reason_type: self.__unsafe_private_named.2.unwrap(), + subject: 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>, + >, + ) -> CreateReport<'a> { + CreateReport { + mod_tool: self.__unsafe_private_named.0, + reason: self.__unsafe_private_named.1, + reason_type: self.__unsafe_private_named.2.unwrap(), + subject: self.__unsafe_private_named.3.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 CreateReportSubject<'a> { + #[serde(rename = "com.atproto.admin.defs#repoRef")] + RepoRef(Box>), + #[serde(rename = "com.atproto.repo.strongRef")] + StrongRef(Box>), +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct CreateReportOutput<'a> { + pub created_at: jacquard_common::types::string::Datetime, + pub id: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason: std::option::Option>, + #[serde(borrow)] + pub reason_type: crate::com_atproto::moderation::ReasonType<'a>, + #[serde(borrow)] + pub reported_by: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub subject: CreateReportOutputSubject<'a>, +} + +#[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 CreateReportOutputSubject<'a> { + #[serde(rename = "com.atproto.admin.defs#repoRef")] + RepoRef(Box>), + #[serde(rename = "com.atproto.repo.strongRef")] + StrongRef(Box>), +} + +/// Response type for +///com.atproto.moderation.createReport +pub struct CreateReportResponse; +impl jacquard_common::xrpc::XrpcResp for CreateReportResponse { + const NSID: &'static str = "com.atproto.moderation.createReport"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CreateReportOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateReport<'a> { + const NSID: &'static str = "com.atproto.moderation.createReport"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateReportResponse; +} + +/// Endpoint type for +///com.atproto.moderation.createReport +pub struct CreateReportRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateReportRequest { + const PATH: &'static str = "/xrpc/com.atproto.moderation.createReport"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateReport<'de>; + type Response = CreateReportResponse; +} + +/// Moderation tool information for tracing the source of the action +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModTool<'a> { + /// Additional arbitrary metadata about the source + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub meta: std::option::Option>, + /// Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome') + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +fn lexicon_doc_com_atproto_moderation_createReport() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.moderation.createReport"), + 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::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("reasonType"), + ::jacquard_common::smol_str::SmolStr::new_static("subject") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("modTool"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#modTool"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Additional context about the content and violation.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(20000usize), + min_graphemes: None, + max_graphemes: Some(2000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "reasonType", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.moderation.defs#reasonType", + ), + }), + ); + 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("com.atproto.admin.defs#repoRef"), + ::jacquard_common::CowStr::new_static("com.atproto.repo.strongRef") + ], + closed: None, + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("modTool"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Moderation tool information for tracing the source of the action", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("name")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("meta"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome')", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModTool<'a> { + fn nsid() -> &'static str { + "com.atproto.moderation.createReport" + } + fn def_name() -> &'static str { + "modTool" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_moderation_createReport() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo.rs b/crates/weaver-api/src/com_atproto/repo.rs new file mode 100644 index 0000000..c4326dc --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo.rs @@ -0,0 +1,259 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod apply_writes; +pub mod create_record; +pub mod delete_record; +pub mod describe_repo; +pub mod get_record; +pub mod import_repo; +pub mod list_missing_blobs; +pub mod list_records; +pub mod put_record; +pub mod strong_ref; +pub mod upload_blob; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct CommitMeta<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub rev: jacquard_common::types::string::Tid, +} + +pub mod commit_meta_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 Cid; + type Rev; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CommitMetaBuilder<'a, S: commit_meta_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> CommitMeta<'a> { + /// Create a new builder for this type + pub fn new() -> CommitMetaBuilder<'a, commit_meta_state::Empty> { + CommitMetaBuilder::new() + } +} + +impl<'a> CommitMetaBuilder<'a, commit_meta_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CommitMetaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitMetaBuilder<'a, S> +where + S: commit_meta_state::State, + S::Cid: commit_meta_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> CommitMetaBuilder<'a, commit_meta_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CommitMetaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitMetaBuilder<'a, S> +where + S: commit_meta_state::State, + S::Rev: commit_meta_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> CommitMetaBuilder<'a, commit_meta_state::SetRev> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CommitMetaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitMetaBuilder<'a, S> +where + S: commit_meta_state::State, + S::Cid: commit_meta_state::IsSet, + S::Rev: commit_meta_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CommitMeta<'a> { + CommitMeta { + cid: self.__unsafe_private_named.0.unwrap(), + rev: 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>, + >, + ) -> CommitMeta<'a> { + CommitMeta { + cid: self.__unsafe_private_named.0.unwrap(), + rev: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_repo_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.repo.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("commitMeta"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("rev") + ], + ), + 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("rev"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Tid, + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CommitMeta<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.defs" + } + fn def_name() -> &'static str { + "commitMeta" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_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/com_atproto/repo/apply_writes.rs b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs new file mode 100644 index 0000000..646303c --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs @@ -0,0 +1,1869 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.applyWrites +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Operation which creates a new record. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Create<'a> { + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + /// NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub rkey: Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod create_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 Collection; + type Value; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Collection = Unset; + 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 Collection = 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 Value = 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 `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CreateBuilder<'a, S: create_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Create<'a> { + /// Create a new builder for this type + pub fn new() -> CreateBuilder<'a, create_state::Empty> { + CreateBuilder::new() + } +} + +impl<'a> CreateBuilder<'a, create_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CreateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateBuilder<'a, S> +where + S: create_state::State, + S::Collection: create_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> CreateBuilder<'a, create_state::SetCollection> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CreateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: create_state::State> CreateBuilder<'a, S> { + /// Set the `rkey` field (optional) + pub fn rkey( + mut self, + value: impl Into< + Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + >, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `rkey` field to an Option value (optional) + pub fn maybe_rkey( + mut self, + value: Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> CreateBuilder<'a, S> +where + S: create_state::State, + S::Value: create_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> CreateBuilder<'a, create_state::SetValue> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CreateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateBuilder<'a, S> +where + S: create_state::State, + S::Collection: create_state::IsSet, + S::Value: create_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Create<'a> { + Create { + collection: self.__unsafe_private_named.0.unwrap(), + rkey: self.__unsafe_private_named.1, + value: 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>, + >, + ) -> Create<'a> { + Create { + collection: self.__unsafe_private_named.0.unwrap(), + rkey: self.__unsafe_private_named.1, + value: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_repo_applyWrites() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.repo.applyWrites"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("create"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Operation which creates a new record.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("collection"), + ::jacquard_common::smol_str::SmolStr::new_static("value") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "collection", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, + ), + 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("rkey"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::RecordKey, + ), + default: None, + min_length: None, + max_length: Some(512usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("createResult"), + ::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") + ], + ), + 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("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( + "validationStatus", + ), + ::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("delete"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Operation which deletes an existing record.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("collection"), + ::jacquard_common::smol_str::SmolStr::new_static("rkey") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "collection", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, + ), + 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("rkey"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::RecordKey, + ), + 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("deleteResult"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_common::smol_str::SmolStr::new_static("writes") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The handle or DID of the repo (aka, current account).", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, + ), + 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( + "swapCommit", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations.", + ), + ), + 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( + "validate", + ), + ::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("writes"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#create"), + ::jacquard_common::CowStr::new_static("#update"), + ::jacquard_common::CowStr::new_static("#delete") + ], + closed: Some(true), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("update"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Operation which updates an existing record.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("collection"), + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), + ::jacquard_common::smol_str::SmolStr::new_static("value") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "collection", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, + ), + 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("rkey"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::RecordKey, + ), + 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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("updateResult"), + ::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") + ], + ), + 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("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( + "validationStatus", + ), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Create<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.applyWrites" + } + fn def_name() -> &'static str { + "create" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_applyWrites() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.rkey { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 512usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "rkey", + ), + max: 512usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct CreateResult<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub validation_status: Option>, +} + +pub mod create_result_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 Cid; + } + /// 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; + } + ///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 `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CreateResultBuilder<'a, S: create_result_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> CreateResult<'a> { + /// Create a new builder for this type + pub fn new() -> CreateResultBuilder<'a, create_result_state::Empty> { + CreateResultBuilder::new() + } +} + +impl<'a> CreateResultBuilder<'a, create_result_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CreateResultBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateResultBuilder<'a, S> +where + S: create_result_state::State, + S::Cid: create_result_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> CreateResultBuilder<'a, create_result_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CreateResultBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateResultBuilder<'a, S> +where + S: create_result_state::State, + S::Uri: create_result_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> CreateResultBuilder<'a, create_result_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CreateResultBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: create_result_state::State> CreateResultBuilder<'a, S> { + /// Set the `validationStatus` field (optional) + pub fn validation_status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `validationStatus` field to an Option value (optional) + pub fn maybe_validation_status( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> CreateResultBuilder<'a, S> +where + S: create_result_state::State, + S::Uri: create_result_state::IsSet, + S::Cid: create_result_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CreateResult<'a> { + CreateResult { + cid: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + validation_status: 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>, + >, + ) -> CreateResult<'a> { + CreateResult { + cid: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + validation_status: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CreateResult<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.applyWrites" + } + fn def_name() -> &'static str { + "createResult" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_applyWrites() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Operation which deletes an existing record. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Delete<'a> { + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + #[serde(borrow)] + pub rkey: jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, +} + +pub mod delete_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 Collection; + type Rkey; + } + /// 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; + } + ///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; + } + ///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 `collection` field + pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeleteBuilder<'a, S: delete_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Delete<'a> { + /// Create a new builder for this type + pub fn new() -> DeleteBuilder<'a, delete_state::Empty> { + DeleteBuilder::new() + } +} + +impl<'a> DeleteBuilder<'a, delete_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeleteBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteBuilder<'a, S> +where + S: delete_state::State, + S::Collection: delete_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> DeleteBuilder<'a, delete_state::SetCollection> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeleteBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteBuilder<'a, S> +where + S: delete_state::State, + S::Rkey: delete_state::IsUnset, +{ + /// Set the `rkey` field (required) + pub fn rkey( + mut self, + value: impl Into< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ) -> DeleteBuilder<'a, delete_state::SetRkey> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DeleteBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteBuilder<'a, S> +where + S: delete_state::State, + S::Collection: delete_state::IsSet, + S::Rkey: delete_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Delete<'a> { + Delete { + collection: self.__unsafe_private_named.0.unwrap(), + rkey: 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>, + >, + ) -> Delete<'a> { + Delete { + collection: self.__unsafe_private_named.0.unwrap(), + rkey: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Delete<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.applyWrites" + } + fn def_name() -> &'static str { + "delete" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_applyWrites() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DeleteResult<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DeleteResult<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.applyWrites" + } + fn def_name() -> &'static str { + "deleteResult" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_applyWrites() + } + 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 ApplyWrites<'a> { + /// The handle or DID of the repo (aka, current account). + #[serde(borrow)] + pub repo: jacquard_common::types::ident::AtIdentifier<'a>, + /// If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub swap_commit: Option>, + /// Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub validate: Option, + #[serde(borrow)] + pub writes: Vec>, +} + +pub mod apply_writes_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 Repo; + type Writes; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Repo = Unset; + 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 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 `repo` field + pub struct repo(()); + ///Marker type for the `writes` field + pub struct writes(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ApplyWritesBuilder<'a, S: apply_writes_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> ApplyWrites<'a> { + /// Create a new builder for this type + pub fn new() -> ApplyWritesBuilder<'a, apply_writes_state::Empty> { + ApplyWritesBuilder::new() + } +} + +impl<'a> ApplyWritesBuilder<'a, apply_writes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ApplyWritesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ApplyWritesBuilder<'a, S> +where + S: apply_writes_state::State, + S::Repo: apply_writes_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> ApplyWritesBuilder<'a, apply_writes_state::SetRepo> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ApplyWritesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: apply_writes_state::State> ApplyWritesBuilder<'a, S> { + /// Set the `swapCommit` field (optional) + pub fn swap_commit( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `swapCommit` field to an Option value (optional) + pub fn maybe_swap_commit( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: apply_writes_state::State> ApplyWritesBuilder<'a, S> { + /// Set the `validate` field (optional) + pub fn validate(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `validate` field to an Option value (optional) + pub fn maybe_validate(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ApplyWritesBuilder<'a, S> +where + S: apply_writes_state::State, + S::Writes: apply_writes_state::IsUnset, +{ + /// Set the `writes` field (required) + pub fn writes( + mut self, + value: impl Into>>, + ) -> ApplyWritesBuilder<'a, apply_writes_state::SetWrites> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ApplyWritesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ApplyWritesBuilder<'a, S> +where + S: apply_writes_state::State, + S::Repo: apply_writes_state::IsSet, + S::Writes: apply_writes_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ApplyWrites<'a> { + ApplyWrites { + repo: self.__unsafe_private_named.0.unwrap(), + swap_commit: self.__unsafe_private_named.1, + validate: self.__unsafe_private_named.2, + writes: 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>, + >, + ) -> ApplyWrites<'a> { + ApplyWrites { + repo: self.__unsafe_private_named.0.unwrap(), + swap_commit: self.__unsafe_private_named.1, + validate: self.__unsafe_private_named.2, + writes: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(tag = "$type")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum ApplyWritesWritesItem<'a> { + #[serde(rename = "com.atproto.repo.applyWrites#create")] + Create(Box>), + #[serde(rename = "com.atproto.repo.applyWrites#update")] + Update(Box>), + #[serde(rename = "com.atproto.repo.applyWrites#delete")] + Delete(Box>), +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ApplyWritesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub commit: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub results: std::option::Option>>, +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(tag = "$type")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum ApplyWritesOutputResultsItem<'a> { + #[serde(rename = "com.atproto.repo.applyWrites#createResult")] + CreateResult(Box>), + #[serde(rename = "com.atproto.repo.applyWrites#updateResult")] + UpdateResult(Box>), + #[serde(rename = "com.atproto.repo.applyWrites#deleteResult")] + DeleteResult(Box>), +} + +#[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 ApplyWritesError<'a> { + /// Indicates that the 'swapCommit' parameter did not match current commit. + #[serde(rename = "InvalidSwap")] + InvalidSwap(std::option::Option), +} + +impl std::fmt::Display for ApplyWritesError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidSwap(msg) => { + write!(f, "InvalidSwap")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.repo.applyWrites +pub struct ApplyWritesResponse; +impl jacquard_common::xrpc::XrpcResp for ApplyWritesResponse { + const NSID: &'static str = "com.atproto.repo.applyWrites"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ApplyWritesOutput<'de>; + type Err<'de> = ApplyWritesError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ApplyWrites<'a> { + const NSID: &'static str = "com.atproto.repo.applyWrites"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = ApplyWritesResponse; +} + +/// Endpoint type for +///com.atproto.repo.applyWrites +pub struct ApplyWritesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ApplyWritesRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.applyWrites"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = ApplyWrites<'de>; + type Response = ApplyWritesResponse; +} + +/// Operation which updates an existing record. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Update<'a> { + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + #[serde(borrow)] + pub rkey: jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod update_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 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 Collection = Unset; + type Rkey = Unset; + 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 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 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 `collection` field + pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + ///Marker type for the `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateBuilder<'a, S: update_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Update<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateBuilder<'a, update_state::Empty> { + UpdateBuilder::new() + } +} + +impl<'a> UpdateBuilder<'a, update_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateBuilder<'a, S> +where + S: update_state::State, + S::Collection: update_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> UpdateBuilder<'a, update_state::SetCollection> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateBuilder<'a, S> +where + S: update_state::State, + S::Rkey: update_state::IsUnset, +{ + /// Set the `rkey` field (required) + pub fn rkey( + mut self, + value: impl Into< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ) -> UpdateBuilder<'a, update_state::SetRkey> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateBuilder<'a, S> +where + S: update_state::State, + S::Value: update_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> UpdateBuilder<'a, update_state::SetValue> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + UpdateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateBuilder<'a, S> +where + S: update_state::State, + 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> { + Update { + collection: self.__unsafe_private_named.0.unwrap(), + rkey: self.__unsafe_private_named.1.unwrap(), + value: 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>, + >, + ) -> Update<'a> { + Update { + collection: self.__unsafe_private_named.0.unwrap(), + rkey: self.__unsafe_private_named.1.unwrap(), + value: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Update<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.applyWrites" + } + fn def_name() -> &'static str { + "update" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_applyWrites() + } + 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 UpdateResult<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub validation_status: Option>, +} + +pub mod update_result_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 Cid; + } + /// 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; + } + ///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 `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateResultBuilder<'a, S: update_result_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> UpdateResult<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateResultBuilder<'a, update_result_state::Empty> { + UpdateResultBuilder::new() + } +} + +impl<'a> UpdateResultBuilder<'a, update_result_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateResultBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateResultBuilder<'a, S> +where + S: update_result_state::State, + S::Cid: update_result_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> UpdateResultBuilder<'a, update_result_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateResultBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateResultBuilder<'a, S> +where + S: update_result_state::State, + S::Uri: update_result_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> UpdateResultBuilder<'a, update_result_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateResultBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: update_result_state::State> UpdateResultBuilder<'a, S> { + /// Set the `validationStatus` field (optional) + pub fn validation_status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `validationStatus` field to an Option value (optional) + pub fn maybe_validation_status( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> UpdateResultBuilder<'a, S> +where + S: update_result_state::State, + S::Uri: update_result_state::IsSet, + S::Cid: update_result_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpdateResult<'a> { + UpdateResult { + cid: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + validation_status: 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>, + >, + ) -> UpdateResult<'a> { + UpdateResult { + cid: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + validation_status: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for UpdateResult<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.applyWrites" + } + fn def_name() -> &'static str { + "updateResult" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_applyWrites() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/create_record.rs b/crates/weaver-api/src/com_atproto/repo/create_record.rs new file mode 100644 index 0000000..830dfef --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/create_record.rs @@ -0,0 +1,384 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.createRecord +// +// 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 CreateRecord<'a> { + /// The NSID of the record collection. + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + /// The record itself. Must contain a $type field. + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + /// The handle or DID of the repo (aka, current account). + #[serde(borrow)] + pub repo: jacquard_common::types::ident::AtIdentifier<'a>, + /// The Record Key. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub rkey: Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + /// Compare and swap with the previous commit by CID. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub swap_commit: Option>, + /// Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub validate: Option, +} + +pub mod create_record_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 Repo; + type Collection; + type Record; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Repo = Unset; + type Collection = Unset; + type Record = 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 Collection = S::Collection; + 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 Repo = S::Repo; + type Collection = 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 Repo = S::Repo; + type Collection = S::Collection; + type Record = 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 `collection` field + pub struct collection(()); + ///Marker type for the `record` field + pub struct record(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CreateRecordBuilder<'a, S: create_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> CreateRecord<'a> { + /// Create a new builder for this type + pub fn new() -> CreateRecordBuilder<'a, create_record_state::Empty> { + CreateRecordBuilder::new() + } +} + +impl<'a> CreateRecordBuilder<'a, create_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CreateRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateRecordBuilder<'a, S> +where + S: create_record_state::State, + S::Collection: create_record_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> CreateRecordBuilder<'a, create_record_state::SetCollection> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CreateRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateRecordBuilder<'a, S> +where + S: create_record_state::State, + S::Record: create_record_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> CreateRecordBuilder<'a, create_record_state::SetRecord> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CreateRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateRecordBuilder<'a, S> +where + S: create_record_state::State, + S::Repo: create_record_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> CreateRecordBuilder<'a, create_record_state::SetRepo> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CreateRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: create_record_state::State> CreateRecordBuilder<'a, S> { + /// Set the `rkey` field (optional) + pub fn rkey( + mut self, + value: impl Into< + Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + >, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `rkey` field to an Option value (optional) + pub fn maybe_rkey( + mut self, + value: Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: create_record_state::State> CreateRecordBuilder<'a, S> { + /// Set the `swapCommit` field (optional) + pub fn swap_commit( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `swapCommit` field to an Option value (optional) + pub fn maybe_swap_commit( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: create_record_state::State> CreateRecordBuilder<'a, S> { + /// Set the `validate` field (optional) + pub fn validate(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `validate` field to an Option value (optional) + pub fn maybe_validate(mut self, value: Option) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> CreateRecordBuilder<'a, S> +where + S: create_record_state::State, + S::Repo: create_record_state::IsSet, + S::Collection: create_record_state::IsSet, + S::Record: create_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CreateRecord<'a> { + CreateRecord { + collection: self.__unsafe_private_named.0.unwrap(), + record: self.__unsafe_private_named.1.unwrap(), + repo: self.__unsafe_private_named.2.unwrap(), + rkey: self.__unsafe_private_named.3, + swap_commit: self.__unsafe_private_named.4, + validate: self.__unsafe_private_named.5, + 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>, + >, + ) -> CreateRecord<'a> { + CreateRecord { + collection: self.__unsafe_private_named.0.unwrap(), + record: self.__unsafe_private_named.1.unwrap(), + repo: self.__unsafe_private_named.2.unwrap(), + rkey: self.__unsafe_private_named.3, + swap_commit: self.__unsafe_private_named.4, + validate: self.__unsafe_private_named.5, + 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 CreateRecordOutput<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub commit: 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 validation_status: 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 CreateRecordError<'a> { + /// Indicates that 'swapCommit' didn't match current repo commit. + #[serde(rename = "InvalidSwap")] + InvalidSwap(std::option::Option), +} + +impl std::fmt::Display for CreateRecordError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidSwap(msg) => { + write!(f, "InvalidSwap")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.repo.createRecord +pub struct CreateRecordResponse; +impl jacquard_common::xrpc::XrpcResp for CreateRecordResponse { + const NSID: &'static str = "com.atproto.repo.createRecord"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CreateRecordOutput<'de>; + type Err<'de> = CreateRecordError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateRecord<'a> { + const NSID: &'static str = "com.atproto.repo.createRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateRecordResponse; +} + +/// Endpoint type for +///com.atproto.repo.createRecord +pub struct CreateRecordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateRecordRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.createRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateRecord<'de>; + type Response = CreateRecordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/delete_record.rs b/crates/weaver-api/src/com_atproto/repo/delete_record.rs new file mode 100644 index 0000000..817fa9e --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/delete_record.rs @@ -0,0 +1,350 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.deleteRecord +// +// 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 DeleteRecord<'a> { + /// The NSID of the record collection. + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + /// The handle or DID of the repo (aka, current account). + #[serde(borrow)] + pub repo: jacquard_common::types::ident::AtIdentifier<'a>, + /// The Record Key. + #[serde(borrow)] + pub rkey: jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + /// Compare and swap with the previous commit by CID. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub swap_commit: Option>, + /// Compare and swap with the previous record by CID. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub swap_record: Option>, +} + +pub mod delete_record_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 Repo; + 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 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 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 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 `collection` field + pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeleteRecordBuilder<'a, S: delete_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DeleteRecord<'a> { + /// Create a new builder for this type + pub fn new() -> DeleteRecordBuilder<'a, delete_record_state::Empty> { + DeleteRecordBuilder::new() + } +} + +impl<'a> DeleteRecordBuilder<'a, delete_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeleteRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteRecordBuilder<'a, S> +where + S: delete_record_state::State, + S::Collection: delete_record_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> DeleteRecordBuilder<'a, delete_record_state::SetCollection> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeleteRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteRecordBuilder<'a, S> +where + S: delete_record_state::State, + S::Repo: delete_record_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> DeleteRecordBuilder<'a, delete_record_state::SetRepo> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DeleteRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteRecordBuilder<'a, S> +where + S: delete_record_state::State, + S::Rkey: delete_record_state::IsUnset, +{ + /// Set the `rkey` field (required) + pub fn rkey( + mut self, + value: impl Into< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ) -> DeleteRecordBuilder<'a, delete_record_state::SetRkey> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + DeleteRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: delete_record_state::State> DeleteRecordBuilder<'a, S> { + /// Set the `swapCommit` field (optional) + pub fn swap_commit( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `swapCommit` field to an Option value (optional) + pub fn maybe_swap_commit( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: delete_record_state::State> DeleteRecordBuilder<'a, S> { + /// Set the `swapRecord` field (optional) + pub fn swap_record( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `swapRecord` field to an Option value (optional) + pub fn maybe_swap_record( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> DeleteRecordBuilder<'a, S> +where + S: delete_record_state::State, + S::Repo: 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> { + DeleteRecord { + collection: self.__unsafe_private_named.0.unwrap(), + repo: self.__unsafe_private_named.1.unwrap(), + rkey: self.__unsafe_private_named.2.unwrap(), + swap_commit: self.__unsafe_private_named.3, + swap_record: self.__unsafe_private_named.4, + 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>, + >, + ) -> DeleteRecord<'a> { + DeleteRecord { + collection: self.__unsafe_private_named.0.unwrap(), + repo: self.__unsafe_private_named.1.unwrap(), + rkey: self.__unsafe_private_named.2.unwrap(), + swap_commit: self.__unsafe_private_named.3, + swap_record: self.__unsafe_private_named.4, + 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 DeleteRecordOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub commit: 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 DeleteRecordError<'a> { + #[serde(rename = "InvalidSwap")] + InvalidSwap(std::option::Option), +} + +impl std::fmt::Display for DeleteRecordError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidSwap(msg) => { + write!(f, "InvalidSwap")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.repo.deleteRecord +pub struct DeleteRecordResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteRecordResponse { + const NSID: &'static str = "com.atproto.repo.deleteRecord"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DeleteRecordOutput<'de>; + type Err<'de> = DeleteRecordError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteRecord<'a> { + const NSID: &'static str = "com.atproto.repo.deleteRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteRecordResponse; +} + +/// Endpoint type for +///com.atproto.repo.deleteRecord +pub struct DeleteRecordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteRecordRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.deleteRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteRecord<'de>; + type Response = DeleteRecordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/describe_repo.rs b/crates/weaver-api/src/com_atproto/repo/describe_repo.rs new file mode 100644 index 0000000..fa6bb68 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/describe_repo.rs @@ -0,0 +1,164 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.describeRepo +// +// 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 DescribeRepo<'a> { + #[serde(borrow)] + pub repo: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod describe_repo_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 Repo; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Repo = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `repo` field + pub struct repo(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DescribeRepoBuilder<'a, S: describe_repo_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DescribeRepo<'a> { + /// Create a new builder for this type + pub fn new() -> DescribeRepoBuilder<'a, describe_repo_state::Empty> { + DescribeRepoBuilder::new() + } +} + +impl<'a> DescribeRepoBuilder<'a, describe_repo_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DescribeRepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DescribeRepoBuilder<'a, S> +where + S: describe_repo_state::State, + S::Repo: describe_repo_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> DescribeRepoBuilder<'a, describe_repo_state::SetRepo> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DescribeRepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DescribeRepoBuilder<'a, S> +where + S: describe_repo_state::State, + S::Repo: describe_repo_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DescribeRepo<'a> { + DescribeRepo { + repo: 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 DescribeRepoOutput<'a> { + /// List of all the collections (NSIDs) for which this repo contains at least one record. + #[serde(borrow)] + pub collections: Vec>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// The complete DID document for this account. + #[serde(borrow)] + pub did_doc: jacquard_common::types::value::Data<'a>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + /// Indicates if handle is currently valid (resolves bi-directionally) + pub handle_is_correct: bool, +} + +/// Response type for +///com.atproto.repo.describeRepo +pub struct DescribeRepoResponse; +impl jacquard_common::xrpc::XrpcResp for DescribeRepoResponse { + const NSID: &'static str = "com.atproto.repo.describeRepo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DescribeRepoOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DescribeRepo<'a> { + const NSID: &'static str = "com.atproto.repo.describeRepo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = DescribeRepoResponse; +} + +/// Endpoint type for +///com.atproto.repo.describeRepo +pub struct DescribeRepoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DescribeRepoRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.describeRepo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = DescribeRepo<'de>; + type Response = DescribeRepoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/get_record.rs b/crates/weaver-api/src/com_atproto/repo/get_record.rs new file mode 100644 index 0000000..827955a --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/get_record.rs @@ -0,0 +1,301 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.getRecord +// +// 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 GetRecord<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: std::option::Option>, + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + #[serde(borrow)] + pub repo: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(borrow)] + pub rkey: jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, +} + +pub mod get_record_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 Repo; + 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 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 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 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 `collection` field + pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetRecordBuilder<'a, S: get_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRecord<'a> { + /// Create a new builder for this type + pub fn new() -> GetRecordBuilder<'a, get_record_state::Empty> { + GetRecordBuilder::new() + } +} + +impl<'a> GetRecordBuilder<'a, get_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_record_state::State> GetRecordBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Collection: get_record_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> GetRecordBuilder<'a, get_record_state::SetCollection> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Repo: get_record_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> GetRecordBuilder<'a, get_record_state::SetRepo> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Rkey: get_record_state::IsUnset, +{ + /// Set the `rkey` field (required) + pub fn rkey( + mut self, + value: impl Into< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ) -> GetRecordBuilder<'a, get_record_state::SetRkey> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Repo: get_record_state::IsSet, + S::Collection: get_record_state::IsSet, + S::Rkey: get_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRecord<'a> { + GetRecord { + cid: self.__unsafe_private_named.0, + collection: self.__unsafe_private_named.1.unwrap(), + repo: self.__unsafe_private_named.2.unwrap(), + rkey: 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 GetRecordOutput<'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: 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 GetRecordError<'a> { + #[serde(rename = "RecordNotFound")] + RecordNotFound(std::option::Option), +} + +impl std::fmt::Display for GetRecordError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RecordNotFound(msg) => { + write!(f, "RecordNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.repo.getRecord +pub struct GetRecordResponse; +impl jacquard_common::xrpc::XrpcResp for GetRecordResponse { + const NSID: &'static str = "com.atproto.repo.getRecord"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetRecordOutput<'de>; + type Err<'de> = GetRecordError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRecord<'a> { + const NSID: &'static str = "com.atproto.repo.getRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRecordResponse; +} + +/// Endpoint type for +///com.atproto.repo.getRecord +pub struct GetRecordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRecordRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.getRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRecord<'de>; + type Response = GetRecordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/import_repo.rs b/crates/weaver-api/src/com_atproto/repo/import_repo.rs new file mode 100644 index 0000000..1a05844 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/import_repo.rs @@ -0,0 +1,65 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.importRepo +// +// 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 ImportRepo { + pub body: bytes::Bytes, +} + +/// Response type for +///com.atproto.repo.importRepo +pub struct ImportRepoResponse; +impl jacquard_common::xrpc::XrpcResp for ImportRepoResponse { + const NSID: &'static str = "com.atproto.repo.importRepo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for ImportRepo { + const NSID: &'static str = "com.atproto.repo.importRepo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/vnd.ipld.car", + ); + type Response = ImportRepoResponse; + fn encode_body(&self) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(self.body.to_vec()) + } + fn decode_body<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self: serde::Deserialize<'de>, + { + Ok( + Box::new(Self { + body: bytes::Bytes::copy_from_slice(body), + }), + ) + } +} + +/// Endpoint type for +///com.atproto.repo.importRepo +pub struct ImportRepoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ImportRepoRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.importRepo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/vnd.ipld.car", + ); + type Request<'de> = ImportRepo; + type Response = ImportRepoResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..3295674 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/list_missing_blobs.rs @@ -0,0 +1,448 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.listMissingBlobs +// +// 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 ListMissingBlobs<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 500, min: 1, max: 1000) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod list_missing_blobs_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 ListMissingBlobsBuilder<'a, S: list_missing_blobs_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListMissingBlobs<'a> { + /// Create a new builder for this type + pub fn new() -> ListMissingBlobsBuilder<'a, list_missing_blobs_state::Empty> { + ListMissingBlobsBuilder::new() + } +} + +impl<'a> ListMissingBlobsBuilder<'a, list_missing_blobs_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListMissingBlobsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_missing_blobs_state::State> ListMissingBlobsBuilder<'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: list_missing_blobs_state::State> ListMissingBlobsBuilder<'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> ListMissingBlobsBuilder<'a, S> +where + S: list_missing_blobs_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListMissingBlobs<'a> { + ListMissingBlobs { + 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 ListMissingBlobsOutput<'a> { + #[serde(borrow)] + pub blobs: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///com.atproto.repo.listMissingBlobs +pub struct ListMissingBlobsResponse; +impl jacquard_common::xrpc::XrpcResp for ListMissingBlobsResponse { + const NSID: &'static str = "com.atproto.repo.listMissingBlobs"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListMissingBlobsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListMissingBlobs<'a> { + const NSID: &'static str = "com.atproto.repo.listMissingBlobs"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListMissingBlobsResponse; +} + +/// Endpoint type for +///com.atproto.repo.listMissingBlobs +pub struct ListMissingBlobsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListMissingBlobsRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.listMissingBlobs"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListMissingBlobs<'de>; + type Response = ListMissingBlobsResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RecordBlob<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub record_uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod record_blob_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 Cid; + type RecordUri; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordBlobBuilder<'a, S: record_blob_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RecordBlob<'a> { + /// Create a new builder for this type + pub fn new() -> RecordBlobBuilder<'a, record_blob_state::Empty> { + RecordBlobBuilder::new() + } +} + +impl<'a> RecordBlobBuilder<'a, record_blob_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordBlobBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBlobBuilder<'a, S> +where + S: record_blob_state::State, + S::Cid: record_blob_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> RecordBlobBuilder<'a, record_blob_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordBlobBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBlobBuilder<'a, S> +where + S: record_blob_state::State, + S::RecordUri: record_blob_state::IsUnset, +{ + /// Set the `recordUri` field (required) + pub fn record_uri( + mut self, + value: impl Into>, + ) -> RecordBlobBuilder<'a, record_blob_state::SetRecordUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RecordBlobBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBlobBuilder<'a, S> +where + S: record_blob_state::State, + S::Cid: record_blob_state::IsSet, + S::RecordUri: record_blob_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RecordBlob<'a> { + RecordBlob { + cid: self.__unsafe_private_named.0.unwrap(), + record_uri: 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>, + >, + ) -> RecordBlob<'a> { + RecordBlob { + cid: self.__unsafe_private_named.0.unwrap(), + record_uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_repo_listMissingBlobs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.repo.listMissingBlobs"), + 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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("recordBlob"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("recordUri") + ], + ), + 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( + "recordUri", + ), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordBlob<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.listMissingBlobs" + } + fn def_name() -> &'static str { + "recordBlob" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_listMissingBlobs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/list_records.rs b/crates/weaver-api/src/com_atproto/repo/list_records.rs new file mode 100644 index 0000000..9bed001 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/list_records.rs @@ -0,0 +1,639 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.listRecords +// +// 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 ListRecords<'a> { + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'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 repo: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reverse: std::option::Option, +} + +pub mod list_records_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 Repo; + type Collection; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Repo = Unset; + 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 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 `repo` field + pub struct repo(()); + ///Marker type for the `collection` field + pub struct collection(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListRecordsBuilder<'a, S: list_records_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> ListRecords<'a> { + /// Create a new builder for this type + pub fn new() -> ListRecordsBuilder<'a, list_records_state::Empty> { + ListRecordsBuilder::new() + } +} + +impl<'a> ListRecordsBuilder<'a, list_records_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListRecordsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListRecordsBuilder<'a, S> +where + S: list_records_state::State, + S::Collection: list_records_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> ListRecordsBuilder<'a, list_records_state::SetCollection> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ListRecordsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_records_state::State> ListRecordsBuilder<'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: list_records_state::State> ListRecordsBuilder<'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> ListRecordsBuilder<'a, S> +where + S: list_records_state::State, + S::Repo: list_records_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> ListRecordsBuilder<'a, list_records_state::SetRepo> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ListRecordsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_records_state::State> ListRecordsBuilder<'a, S> { + /// Set the `reverse` field (optional) + pub fn reverse(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `reverse` field to an Option value (optional) + pub fn maybe_reverse(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ListRecordsBuilder<'a, S> +where + S: list_records_state::State, + S::Repo: list_records_state::IsSet, + S::Collection: list_records_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListRecords<'a> { + ListRecords { + collection: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + repo: self.__unsafe_private_named.3.unwrap(), + reverse: 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 ListRecordsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub records: Vec>, +} + +/// Response type for +///com.atproto.repo.listRecords +pub struct ListRecordsResponse; +impl jacquard_common::xrpc::XrpcResp for ListRecordsResponse { + const NSID: &'static str = "com.atproto.repo.listRecords"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListRecordsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListRecords<'a> { + const NSID: &'static str = "com.atproto.repo.listRecords"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListRecordsResponse; +} + +/// Endpoint type for +///com.atproto.repo.listRecords +pub struct ListRecordsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListRecordsRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.listRecords"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListRecords<'de>; + type Response = ListRecordsResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Record<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod record_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 Cid; + 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 Cid = 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 Cid = S::Cid; + 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; + type Cid = 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 Cid = S::Cid; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordBuilder<'a, S: record_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> Record<'a> { + /// Create a new builder for this type + pub fn new() -> RecordBuilder<'a, record_state::Empty> { + RecordBuilder::new() + } +} + +impl<'a> RecordBuilder<'a, record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBuilder<'a, S> +where + S: record_state::State, + S::Cid: record_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> RecordBuilder<'a, record_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBuilder<'a, S> +where + S: record_state::State, + S::Uri: record_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> RecordBuilder<'a, record_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBuilder<'a, S> +where + S: record_state::State, + S::Value: record_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> RecordBuilder<'a, record_state::SetValue> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordBuilder<'a, S> +where + S: record_state::State, + S::Uri: record_state::IsSet, + S::Cid: record_state::IsSet, + S::Value: record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Record<'a> { + Record { + cid: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + value: 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>, + >, + ) -> Record<'a> { + Record { + cid: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + value: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_repo_listRecords() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.repo.listRecords"), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_common::smol_str::SmolStr::new_static("collection") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "collection", + ), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The NSID of the record type.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, + ), + 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("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("repo"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The handle or DID of the repo.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, + ), + 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("reverse"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::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("value") + ], + ), + 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("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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Record<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.listRecords" + } + fn def_name() -> &'static str { + "record" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_listRecords() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/put_record.rs b/crates/weaver-api/src/com_atproto/repo/put_record.rs new file mode 100644 index 0000000..8e4ae48 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/put_record.rs @@ -0,0 +1,417 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.putRecord +// +// 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 PutRecord<'a> { + /// The NSID of the record collection. + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + /// The record to write. + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + /// The handle or DID of the repo (aka, current account). + #[serde(borrow)] + pub repo: jacquard_common::types::ident::AtIdentifier<'a>, + /// The Record Key. + #[serde(borrow)] + pub rkey: jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + /// Compare and swap with the previous commit by CID. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub swap_commit: Option>, + /// Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub swap_record: Option>, + /// Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub validate: Option, +} + +pub mod put_record_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 Repo; + type Collection; + type Rkey; + type Record; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Repo = Unset; + type Collection = Unset; + type Rkey = Unset; + type Record = 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 Collection = S::Collection; + type Rkey = S::Rkey; + 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 Repo = S::Repo; + type Collection = Set; + type Rkey = S::Rkey; + type Record = S::Record; + } + ///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; + 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 Repo = S::Repo; + type Collection = S::Collection; + type Rkey = S::Rkey; + type Record = 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 `collection` field + pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + ///Marker type for the `record` field + pub struct record(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PutRecordBuilder<'a, S: put_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PutRecord<'a> { + /// Create a new builder for this type + pub fn new() -> PutRecordBuilder<'a, put_record_state::Empty> { + PutRecordBuilder::new() + } +} + +impl<'a> PutRecordBuilder<'a, put_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PutRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutRecordBuilder<'a, S> +where + S: put_record_state::State, + S::Collection: put_record_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> PutRecordBuilder<'a, put_record_state::SetCollection> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PutRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutRecordBuilder<'a, S> +where + S: put_record_state::State, + S::Record: put_record_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> PutRecordBuilder<'a, put_record_state::SetRecord> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PutRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutRecordBuilder<'a, S> +where + S: put_record_state::State, + S::Repo: put_record_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> PutRecordBuilder<'a, put_record_state::SetRepo> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + PutRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PutRecordBuilder<'a, S> +where + S: put_record_state::State, + S::Rkey: put_record_state::IsUnset, +{ + /// Set the `rkey` field (required) + pub fn rkey( + mut self, + value: impl Into< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ) -> PutRecordBuilder<'a, put_record_state::SetRkey> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + PutRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: put_record_state::State> PutRecordBuilder<'a, S> { + /// Set the `swapCommit` field (optional) + pub fn swap_commit( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `swapCommit` field to an Option value (optional) + pub fn maybe_swap_commit( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: put_record_state::State> PutRecordBuilder<'a, S> { + /// Set the `swapRecord` field (optional) + pub fn swap_record( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `swapRecord` field to an Option value (optional) + pub fn maybe_swap_record( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: put_record_state::State> PutRecordBuilder<'a, S> { + /// Set the `validate` field (optional) + pub fn validate(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `validate` field to an Option value (optional) + pub fn maybe_validate(mut self, value: Option) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> PutRecordBuilder<'a, S> +where + S: put_record_state::State, + S::Repo: put_record_state::IsSet, + S::Collection: put_record_state::IsSet, + S::Rkey: put_record_state::IsSet, + S::Record: put_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PutRecord<'a> { + PutRecord { + collection: self.__unsafe_private_named.0.unwrap(), + record: self.__unsafe_private_named.1.unwrap(), + repo: self.__unsafe_private_named.2.unwrap(), + rkey: self.__unsafe_private_named.3.unwrap(), + swap_commit: self.__unsafe_private_named.4, + swap_record: self.__unsafe_private_named.5, + validate: 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>, + >, + ) -> PutRecord<'a> { + PutRecord { + collection: self.__unsafe_private_named.0.unwrap(), + record: self.__unsafe_private_named.1.unwrap(), + repo: self.__unsafe_private_named.2.unwrap(), + rkey: self.__unsafe_private_named.3.unwrap(), + swap_commit: self.__unsafe_private_named.4, + swap_record: self.__unsafe_private_named.5, + validate: self.__unsafe_private_named.6, + 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 PutRecordOutput<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub commit: 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 validation_status: 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 PutRecordError<'a> { + #[serde(rename = "InvalidSwap")] + InvalidSwap(std::option::Option), +} + +impl std::fmt::Display for PutRecordError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidSwap(msg) => { + write!(f, "InvalidSwap")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.repo.putRecord +pub struct PutRecordResponse; +impl jacquard_common::xrpc::XrpcResp for PutRecordResponse { + const NSID: &'static str = "com.atproto.repo.putRecord"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = PutRecordOutput<'de>; + type Err<'de> = PutRecordError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for PutRecord<'a> { + const NSID: &'static str = "com.atproto.repo.putRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = PutRecordResponse; +} + +/// Endpoint type for +///com.atproto.repo.putRecord +pub struct PutRecordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for PutRecordRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.putRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = PutRecord<'de>; + type Response = PutRecordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/strong_ref.rs b/crates/weaver-api/src/com_atproto/repo/strong_ref.rs new file mode 100644 index 0000000..dc0555c --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/strong_ref.rs @@ -0,0 +1,248 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.strongRef +// +// 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 StrongRef<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod strong_ref_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 Cid; + } + /// 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; + } + ///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 `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StrongRefBuilder<'a, S: strong_ref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> StrongRef<'a> { + /// Create a new builder for this type + pub fn new() -> StrongRefBuilder<'a, strong_ref_state::Empty> { + StrongRefBuilder::new() + } +} + +impl<'a> StrongRefBuilder<'a, strong_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StrongRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StrongRefBuilder<'a, S> +where + S: strong_ref_state::State, + S::Cid: strong_ref_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> StrongRefBuilder<'a, strong_ref_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + StrongRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StrongRefBuilder<'a, S> +where + S: strong_ref_state::State, + S::Uri: strong_ref_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> StrongRefBuilder<'a, strong_ref_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + StrongRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StrongRefBuilder<'a, S> +where + S: strong_ref_state::State, + S::Uri: strong_ref_state::IsSet, + S::Cid: strong_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> StrongRef<'a> { + StrongRef { + cid: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> StrongRef<'a> { + StrongRef { + cid: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_repo_strongRef() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.repo.strongRef"), + 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::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") + ], + ), + 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("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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StrongRef<'a> { + fn nsid() -> &'static str { + "com.atproto.repo.strongRef" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_repo_strongRef() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/repo/upload_blob.rs b/crates/weaver-api/src/com_atproto/repo/upload_blob.rs new file mode 100644 index 0000000..6c0ce69 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/repo/upload_blob.rs @@ -0,0 +1,81 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.repo.uploadBlob +// +// 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 UploadBlob { + pub body: bytes::Bytes, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UploadBlobOutput<'a> { + #[serde(borrow)] + pub blob: jacquard_common::types::blob::BlobRef<'a>, +} + +/// Response type for +///com.atproto.repo.uploadBlob +pub struct UploadBlobResponse; +impl jacquard_common::xrpc::XrpcResp for UploadBlobResponse { + const NSID: &'static str = "com.atproto.repo.uploadBlob"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UploadBlobOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for UploadBlob { + const NSID: &'static str = "com.atproto.repo.uploadBlob"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "*/*", + ); + type Response = UploadBlobResponse; + fn encode_body(&self) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(self.body.to_vec()) + } + fn decode_body<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self: serde::Deserialize<'de>, + { + Ok( + Box::new(Self { + body: bytes::Bytes::copy_from_slice(body), + }), + ) + } +} + +/// Endpoint type for +///com.atproto.repo.uploadBlob +pub struct UploadBlobRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UploadBlobRequest { + const PATH: &'static str = "/xrpc/com.atproto.repo.uploadBlob"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "*/*", + ); + type Request<'de> = UploadBlob; + type Response = UploadBlobResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server.rs b/crates/weaver-api/src/com_atproto/server.rs new file mode 100644 index 0000000..0665603 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server.rs @@ -0,0 +1,786 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod activate_account; +pub mod check_account_status; +pub mod confirm_email; +pub mod create_account; +pub mod create_app_password; +pub mod create_invite_code; +pub mod create_invite_codes; +pub mod create_session; +pub mod deactivate_account; +pub mod delete_account; +pub mod delete_session; +pub mod describe_server; +pub mod get_account_invite_codes; +pub mod get_service_auth; +pub mod get_session; +pub mod list_app_passwords; +pub mod refresh_session; +pub mod request_account_delete; +pub mod request_email_confirmation; +pub mod request_email_update; +pub mod request_password_reset; +pub mod reserve_signing_key; +pub mod reset_password; +pub mod revoke_app_password; +pub mod update_email; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct InviteCode<'a> { + pub available: i64, + #[serde(borrow)] + pub code: jacquard_common::CowStr<'a>, + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub created_by: jacquard_common::CowStr<'a>, + pub disabled: bool, + #[serde(borrow)] + pub for_account: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uses: Vec>, +} + +pub mod invite_code_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 Code; + type Available; + type Disabled; + type ForAccount; + type CreatedBy; + type CreatedAt; + type Uses; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Code = Unset; + type Available = Unset; + type Disabled = Unset; + type ForAccount = Unset; + type CreatedBy = Unset; + type CreatedAt = Unset; + type Uses = Unset; + } + ///State transition - sets the `code` field to Set + pub struct SetCode(PhantomData S>); + impl sealed::Sealed for SetCode {} + impl State for SetCode { + type Code = Set; + type Available = S::Available; + type Disabled = S::Disabled; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Uses = S::Uses; + } + ///State transition - sets the `available` field to Set + pub struct SetAvailable(PhantomData S>); + impl sealed::Sealed for SetAvailable {} + impl State for SetAvailable { + type Code = S::Code; + type Available = Set; + type Disabled = S::Disabled; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Uses = S::Uses; + } + ///State transition - sets the `disabled` field to Set + pub struct SetDisabled(PhantomData S>); + impl sealed::Sealed for SetDisabled {} + impl State for SetDisabled { + type Code = S::Code; + type Available = S::Available; + type Disabled = Set; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Uses = S::Uses; + } + ///State transition - sets the `for_account` field to Set + pub struct SetForAccount(PhantomData S>); + impl sealed::Sealed for SetForAccount {} + impl State for SetForAccount { + type Code = S::Code; + type Available = S::Available; + type Disabled = S::Disabled; + type ForAccount = Set; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Uses = S::Uses; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Code = S::Code; + type Available = S::Available; + type Disabled = S::Disabled; + type ForAccount = S::ForAccount; + type CreatedBy = Set; + type CreatedAt = S::CreatedAt; + type Uses = S::Uses; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Code = S::Code; + type Available = S::Available; + type Disabled = S::Disabled; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type CreatedAt = Set; + type Uses = S::Uses; + } + ///State transition - sets the `uses` field to Set + pub struct SetUses(PhantomData S>); + impl sealed::Sealed for SetUses {} + impl State for SetUses { + type Code = S::Code; + type Available = S::Available; + type Disabled = S::Disabled; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Uses = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///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 `for_account` field + pub struct for_account(()); + ///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 `uses` field + pub struct uses(()); + } +} + +/// Builder for constructing an instance of this type +pub struct InviteCodeBuilder<'a, S: invite_code_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> InviteCode<'a> { + /// Create a new builder for this type + pub fn new() -> InviteCodeBuilder<'a, invite_code_state::Empty> { + InviteCodeBuilder::new() + } +} + +impl<'a> InviteCodeBuilder<'a, invite_code_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + InviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeBuilder<'a, S> +where + S: invite_code_state::State, + S::Available: invite_code_state::IsUnset, +{ + /// Set the `available` field (required) + pub fn available( + mut self, + value: impl Into, + ) -> InviteCodeBuilder<'a, invite_code_state::SetAvailable> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + InviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeBuilder<'a, S> +where + S: invite_code_state::State, + S::Code: invite_code_state::IsUnset, +{ + /// Set the `code` field (required) + pub fn code( + mut self, + value: impl Into>, + ) -> InviteCodeBuilder<'a, invite_code_state::SetCode> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + InviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeBuilder<'a, S> +where + S: invite_code_state::State, + S::CreatedAt: invite_code_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> InviteCodeBuilder<'a, invite_code_state::SetCreatedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + InviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeBuilder<'a, S> +where + S: invite_code_state::State, + S::CreatedBy: invite_code_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> InviteCodeBuilder<'a, invite_code_state::SetCreatedBy> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + InviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeBuilder<'a, S> +where + S: invite_code_state::State, + S::Disabled: invite_code_state::IsUnset, +{ + /// Set the `disabled` field (required) + pub fn disabled( + mut self, + value: impl Into, + ) -> InviteCodeBuilder<'a, invite_code_state::SetDisabled> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + InviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeBuilder<'a, S> +where + S: invite_code_state::State, + S::ForAccount: invite_code_state::IsUnset, +{ + /// Set the `forAccount` field (required) + pub fn for_account( + mut self, + value: impl Into>, + ) -> InviteCodeBuilder<'a, invite_code_state::SetForAccount> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + InviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeBuilder<'a, S> +where + S: invite_code_state::State, + S::Uses: invite_code_state::IsUnset, +{ + /// Set the `uses` field (required) + pub fn uses( + mut self, + value: impl Into>>, + ) -> InviteCodeBuilder<'a, invite_code_state::SetUses> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + InviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeBuilder<'a, S> +where + S: invite_code_state::State, + S::Code: invite_code_state::IsSet, + S::Available: invite_code_state::IsSet, + S::Disabled: invite_code_state::IsSet, + S::ForAccount: invite_code_state::IsSet, + S::CreatedBy: invite_code_state::IsSet, + S::CreatedAt: invite_code_state::IsSet, + S::Uses: invite_code_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> InviteCode<'a> { + InviteCode { + available: self.__unsafe_private_named.0.unwrap(), + code: self.__unsafe_private_named.1.unwrap(), + created_at: self.__unsafe_private_named.2.unwrap(), + created_by: self.__unsafe_private_named.3.unwrap(), + disabled: self.__unsafe_private_named.4.unwrap(), + for_account: self.__unsafe_private_named.5.unwrap(), + uses: 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>, + >, + ) -> InviteCode<'a> { + InviteCode { + available: self.__unsafe_private_named.0.unwrap(), + code: self.__unsafe_private_named.1.unwrap(), + created_at: self.__unsafe_private_named.2.unwrap(), + created_by: self.__unsafe_private_named.3.unwrap(), + disabled: self.__unsafe_private_named.4.unwrap(), + for_account: self.__unsafe_private_named.5.unwrap(), + uses: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_server_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.server.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("inviteCode"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("code"), + ::jacquard_common::smol_str::SmolStr::new_static("available"), + ::jacquard_common::smol_str::SmolStr::new_static("disabled"), + ::jacquard_common::smol_str::SmolStr::new_static("forAccount"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::jacquard_common::smol_str::SmolStr::new_static("uses") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "available", + ), + ::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("code"), + ::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( + "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( + "createdBy", + ), + ::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("disabled"), + ::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( + "forAccount", + ), + ::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("uses"), + ::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( + "#inviteCodeUse", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("inviteCodeUse"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("usedBy"), + ::jacquard_common::smol_str::SmolStr::new_static("usedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("usedAt"), + ::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("usedBy"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for InviteCode<'a> { + fn nsid() -> &'static str { + "com.atproto.server.defs" + } + fn def_name() -> &'static str { + "inviteCode" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_server_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 InviteCodeUse<'a> { + pub used_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub used_by: jacquard_common::types::string::Did<'a>, +} + +pub mod invite_code_use_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 UsedBy; + type UsedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type UsedBy = Unset; + type UsedAt = Unset; + } + ///State transition - sets the `used_by` field to Set + pub struct SetUsedBy(PhantomData S>); + impl sealed::Sealed for SetUsedBy {} + impl State for SetUsedBy { + type UsedBy = Set; + type UsedAt = S::UsedAt; + } + ///State transition - sets the `used_at` field to Set + pub struct SetUsedAt(PhantomData S>); + impl sealed::Sealed for SetUsedAt {} + impl State for SetUsedAt { + type UsedBy = S::UsedBy; + type UsedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `used_by` field + pub struct used_by(()); + ///Marker type for the `used_at` field + pub struct used_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct InviteCodeUseBuilder<'a, S: invite_code_use_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> InviteCodeUse<'a> { + /// Create a new builder for this type + pub fn new() -> InviteCodeUseBuilder<'a, invite_code_use_state::Empty> { + InviteCodeUseBuilder::new() + } +} + +impl<'a> InviteCodeUseBuilder<'a, invite_code_use_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + InviteCodeUseBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeUseBuilder<'a, S> +where + S: invite_code_use_state::State, + S::UsedAt: invite_code_use_state::IsUnset, +{ + /// Set the `usedAt` field (required) + pub fn used_at( + mut self, + value: impl Into, + ) -> InviteCodeUseBuilder<'a, invite_code_use_state::SetUsedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + InviteCodeUseBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeUseBuilder<'a, S> +where + S: invite_code_use_state::State, + S::UsedBy: invite_code_use_state::IsUnset, +{ + /// Set the `usedBy` field (required) + pub fn used_by( + mut self, + value: impl Into>, + ) -> InviteCodeUseBuilder<'a, invite_code_use_state::SetUsedBy> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + InviteCodeUseBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteCodeUseBuilder<'a, S> +where + S: invite_code_use_state::State, + S::UsedBy: invite_code_use_state::IsSet, + S::UsedAt: invite_code_use_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> InviteCodeUse<'a> { + InviteCodeUse { + used_at: self.__unsafe_private_named.0.unwrap(), + used_by: 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>, + >, + ) -> InviteCodeUse<'a> { + InviteCodeUse { + used_at: self.__unsafe_private_named.0.unwrap(), + used_by: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for InviteCodeUse<'a> { + fn nsid() -> &'static str { + "com.atproto.server.defs" + } + fn def_name() -> &'static str { + "inviteCodeUse" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_server_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/com_atproto/server/activate_account.rs b/crates/weaver-api/src/com_atproto/server/activate_account.rs new file mode 100644 index 0000000..ac08c7d --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/activate_account.rs @@ -0,0 +1,48 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.activateAccount +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct ActivateAccount; +/// Response type for +///com.atproto.server.activateAccount +pub struct ActivateAccountResponse; +impl jacquard_common::xrpc::XrpcResp for ActivateAccountResponse { + const NSID: &'static str = "com.atproto.server.activateAccount"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for ActivateAccount { + const NSID: &'static str = "com.atproto.server.activateAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = ActivateAccountResponse; +} + +/// Endpoint type for +///com.atproto.server.activateAccount +pub struct ActivateAccountRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ActivateAccountRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.activateAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = ActivateAccount; + type Response = ActivateAccountResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/check_account_status.rs b/crates/weaver-api/src/com_atproto/server/check_account_status.rs new file mode 100644 index 0000000..afea02b --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/check_account_status.rs @@ -0,0 +1,69 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.checkAccountStatus +// +// 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 CheckAccountStatusOutput<'a> { + pub activated: bool, + pub expected_blobs: i64, + pub imported_blobs: i64, + pub indexed_records: i64, + pub private_state_values: i64, + pub repo_blocks: i64, + #[serde(borrow)] + pub repo_commit: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub repo_rev: jacquard_common::CowStr<'a>, + pub valid_did: bool, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct CheckAccountStatus; +/// Response type for +///com.atproto.server.checkAccountStatus +pub struct CheckAccountStatusResponse; +impl jacquard_common::xrpc::XrpcResp for CheckAccountStatusResponse { + const NSID: &'static str = "com.atproto.server.checkAccountStatus"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CheckAccountStatusOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for CheckAccountStatus { + const NSID: &'static str = "com.atproto.server.checkAccountStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = CheckAccountStatusResponse; +} + +/// Endpoint type for +///com.atproto.server.checkAccountStatus +pub struct CheckAccountStatusRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CheckAccountStatusRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.checkAccountStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = CheckAccountStatus; + type Response = CheckAccountStatusResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/confirm_email.rs b/crates/weaver-api/src/com_atproto/server/confirm_email.rs new file mode 100644 index 0000000..f476ef2 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/confirm_email.rs @@ -0,0 +1,116 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.confirmEmail +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ConfirmEmail<'a> { + #[serde(borrow)] + pub email: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub token: jacquard_common::CowStr<'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 ConfirmEmailError<'a> { + #[serde(rename = "AccountNotFound")] + AccountNotFound(std::option::Option), + #[serde(rename = "ExpiredToken")] + ExpiredToken(std::option::Option), + #[serde(rename = "InvalidToken")] + InvalidToken(std::option::Option), + #[serde(rename = "InvalidEmail")] + InvalidEmail(std::option::Option), +} + +impl std::fmt::Display for ConfirmEmailError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::AccountNotFound(msg) => { + write!(f, "AccountNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ExpiredToken(msg) => { + write!(f, "ExpiredToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidToken(msg) => { + write!(f, "InvalidToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidEmail(msg) => { + write!(f, "InvalidEmail")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.confirmEmail +pub struct ConfirmEmailResponse; +impl jacquard_common::xrpc::XrpcResp for ConfirmEmailResponse { + const NSID: &'static str = "com.atproto.server.confirmEmail"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = ConfirmEmailError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ConfirmEmail<'a> { + const NSID: &'static str = "com.atproto.server.confirmEmail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = ConfirmEmailResponse; +} + +/// Endpoint type for +///com.atproto.server.confirmEmail +pub struct ConfirmEmailRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ConfirmEmailRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.confirmEmail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = ConfirmEmail<'de>; + type Response = ConfirmEmailResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/create_account.rs b/crates/weaver-api/src/com_atproto/server/create_account.rs new file mode 100644 index 0000000..1dfcaba --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/create_account.rs @@ -0,0 +1,481 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.createAccount +// +// 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 CreateAccount<'a> { + /// Pre-existing atproto DID, being imported to a new account. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub did: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: Option>, + /// Requested handle for the account. + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invite_code: Option>, + /// Initial account password. May need to meet instance-specific password strength requirements. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub password: Option>, + /// A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub plc_op: Option>, + /// DID PLC rotation key (aka, recovery key) to be included in PLC creation operation. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub recovery_key: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verification_code: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verification_phone: Option>, +} + +pub mod create_account_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 Handle; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CreateAccountBuilder<'a, S: create_account_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> CreateAccount<'a> { + /// Create a new builder for this type + pub fn new() -> CreateAccountBuilder<'a, create_account_state::Empty> { + CreateAccountBuilder::new() + } +} + +impl<'a> CreateAccountBuilder<'a, create_account_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CreateAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: create_account_state::State> CreateAccountBuilder<'a, S> { + /// Set the `did` field (optional) + pub fn did( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `did` field to an Option value (optional) + pub fn maybe_did( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: create_account_state::State> CreateAccountBuilder<'a, S> { + /// Set the `email` field (optional) + pub fn email( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `email` field to an Option value (optional) + pub fn maybe_email(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> CreateAccountBuilder<'a, S> +where + S: create_account_state::State, + S::Handle: create_account_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> CreateAccountBuilder<'a, create_account_state::SetHandle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CreateAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: create_account_state::State> CreateAccountBuilder<'a, S> { + /// Set the `inviteCode` field (optional) + pub fn invite_code( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `inviteCode` field to an Option value (optional) + pub fn maybe_invite_code( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: create_account_state::State> CreateAccountBuilder<'a, S> { + /// Set the `password` field (optional) + pub fn password( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `password` field to an Option value (optional) + pub fn maybe_password(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: create_account_state::State> CreateAccountBuilder<'a, S> { + /// Set the `plcOp` field (optional) + pub fn plc_op( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `plcOp` field to an Option value (optional) + pub fn maybe_plc_op( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: create_account_state::State> CreateAccountBuilder<'a, S> { + /// Set the `recoveryKey` field (optional) + pub fn recovery_key( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `recoveryKey` field to an Option value (optional) + pub fn maybe_recovery_key( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: create_account_state::State> CreateAccountBuilder<'a, S> { + /// Set the `verificationCode` field (optional) + pub fn verification_code( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `verificationCode` field to an Option value (optional) + pub fn maybe_verification_code( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: create_account_state::State> CreateAccountBuilder<'a, S> { + /// Set the `verificationPhone` field (optional) + pub fn verification_phone( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `verificationPhone` field to an Option value (optional) + pub fn maybe_verification_phone( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> CreateAccountBuilder<'a, S> +where + S: create_account_state::State, + S::Handle: create_account_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CreateAccount<'a> { + CreateAccount { + did: self.__unsafe_private_named.0, + email: self.__unsafe_private_named.1, + handle: self.__unsafe_private_named.2.unwrap(), + invite_code: self.__unsafe_private_named.3, + password: self.__unsafe_private_named.4, + plc_op: self.__unsafe_private_named.5, + recovery_key: self.__unsafe_private_named.6, + verification_code: self.__unsafe_private_named.7, + verification_phone: self.__unsafe_private_named.8, + 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>, + >, + ) -> CreateAccount<'a> { + CreateAccount { + did: self.__unsafe_private_named.0, + email: self.__unsafe_private_named.1, + handle: self.__unsafe_private_named.2.unwrap(), + invite_code: self.__unsafe_private_named.3, + password: self.__unsafe_private_named.4, + plc_op: self.__unsafe_private_named.5, + recovery_key: self.__unsafe_private_named.6, + verification_code: self.__unsafe_private_named.7, + verification_phone: self.__unsafe_private_named.8, + 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 CreateAccountOutput<'a> { + #[serde(borrow)] + pub access_jwt: jacquard_common::CowStr<'a>, + /// The DID of the new account. + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// Complete DID document. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub did_doc: std::option::Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(borrow)] + pub refresh_jwt: jacquard_common::CowStr<'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 CreateAccountError<'a> { + #[serde(rename = "InvalidHandle")] + InvalidHandle(std::option::Option), + #[serde(rename = "InvalidPassword")] + InvalidPassword(std::option::Option), + #[serde(rename = "InvalidInviteCode")] + InvalidInviteCode(std::option::Option), + #[serde(rename = "HandleNotAvailable")] + HandleNotAvailable(std::option::Option), + #[serde(rename = "UnsupportedDomain")] + UnsupportedDomain(std::option::Option), + #[serde(rename = "UnresolvableDid")] + UnresolvableDid(std::option::Option), + #[serde(rename = "IncompatibleDidDoc")] + IncompatibleDidDoc(std::option::Option), +} + +impl std::fmt::Display for CreateAccountError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidHandle(msg) => { + write!(f, "InvalidHandle")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidPassword(msg) => { + write!(f, "InvalidPassword")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidInviteCode(msg) => { + write!(f, "InvalidInviteCode")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::HandleNotAvailable(msg) => { + write!(f, "HandleNotAvailable")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::UnsupportedDomain(msg) => { + write!(f, "UnsupportedDomain")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::UnresolvableDid(msg) => { + write!(f, "UnresolvableDid")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::IncompatibleDidDoc(msg) => { + write!(f, "IncompatibleDidDoc")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.createAccount +pub struct CreateAccountResponse; +impl jacquard_common::xrpc::XrpcResp for CreateAccountResponse { + const NSID: &'static str = "com.atproto.server.createAccount"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CreateAccountOutput<'de>; + type Err<'de> = CreateAccountError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateAccount<'a> { + const NSID: &'static str = "com.atproto.server.createAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateAccountResponse; +} + +/// Endpoint type for +///com.atproto.server.createAccount +pub struct CreateAccountRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateAccountRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.createAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateAccount<'de>; + type Response = CreateAccountResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..bb1450c --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/create_app_password.rs @@ -0,0 +1,494 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.createAppPassword +// +// 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 AppPassword<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub password: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub privileged: Option, +} + +pub mod app_password_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 Name; + type Password; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Name = Unset; + type Password = Unset; + 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 Name = Set; + type Password = S::Password; + type CreatedAt = S::CreatedAt; + } + ///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 Password = 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 Password = S::Password; + 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 `password` field + pub struct password(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AppPasswordBuilder<'a, S: app_password_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> AppPassword<'a> { + /// Create a new builder for this type + pub fn new() -> AppPasswordBuilder<'a, app_password_state::Empty> { + AppPasswordBuilder::new() + } +} + +impl<'a> AppPasswordBuilder<'a, app_password_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AppPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AppPasswordBuilder<'a, S> +where + S: app_password_state::State, + S::CreatedAt: app_password_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> AppPasswordBuilder<'a, app_password_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AppPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AppPasswordBuilder<'a, S> +where + S: app_password_state::State, + S::Name: app_password_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> AppPasswordBuilder<'a, app_password_state::SetName> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AppPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AppPasswordBuilder<'a, S> +where + S: app_password_state::State, + S::Password: app_password_state::IsUnset, +{ + /// Set the `password` field (required) + pub fn password( + mut self, + value: impl Into>, + ) -> AppPasswordBuilder<'a, app_password_state::SetPassword> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + AppPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: app_password_state::State> AppPasswordBuilder<'a, S> { + /// Set the `privileged` field (optional) + pub fn privileged(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `privileged` field to an Option value (optional) + pub fn maybe_privileged(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> AppPasswordBuilder<'a, S> +where + S: app_password_state::State, + S::Name: app_password_state::IsSet, + S::Password: app_password_state::IsSet, + S::CreatedAt: app_password_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AppPassword<'a> { + AppPassword { + created_at: self.__unsafe_private_named.0.unwrap(), + name: self.__unsafe_private_named.1.unwrap(), + password: self.__unsafe_private_named.2.unwrap(), + privileged: 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>, + >, + ) -> AppPassword<'a> { + AppPassword { + created_at: self.__unsafe_private_named.0.unwrap(), + name: self.__unsafe_private_named.1.unwrap(), + password: self.__unsafe_private_named.2.unwrap(), + privileged: self.__unsafe_private_named.3, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_server_createAppPassword() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "com.atproto.server.createAppPassword", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("appPassword"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_common::smol_str::SmolStr::new_static("password"), + ::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("name"), + ::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("password"), + ::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( + "privileged", + ), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("name") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "A short name for the App Password, to help distinguish them.", + ), + ), + 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( + "privileged", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AppPassword<'a> { + fn nsid() -> &'static str { + "com.atproto.server.createAppPassword" + } + fn def_name() -> &'static str { + "appPassword" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_server_createAppPassword() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct CreateAppPassword<'a> { + /// A short name for the App Password, to help distinguish them. + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + /// If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub privileged: std::option::Option, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct CreateAppPasswordOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: 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 CreateAppPasswordError<'a> { + #[serde(rename = "AccountTakedown")] + AccountTakedown(std::option::Option), +} + +impl std::fmt::Display for CreateAppPasswordError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::AccountTakedown(msg) => { + write!(f, "AccountTakedown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.createAppPassword +pub struct CreateAppPasswordResponse; +impl jacquard_common::xrpc::XrpcResp for CreateAppPasswordResponse { + const NSID: &'static str = "com.atproto.server.createAppPassword"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CreateAppPasswordOutput<'de>; + type Err<'de> = CreateAppPasswordError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateAppPassword<'a> { + const NSID: &'static str = "com.atproto.server.createAppPassword"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateAppPasswordResponse; +} + +/// Endpoint type for +///com.atproto.server.createAppPassword +pub struct CreateAppPasswordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateAppPasswordRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.createAppPassword"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateAppPassword<'de>; + type Response = CreateAppPasswordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/create_invite_code.rs b/crates/weaver-api/src/com_atproto/server/create_invite_code.rs new file mode 100644 index 0000000..ca8b14e --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/create_invite_code.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.createInviteCode +// +// 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 CreateInviteCode<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub for_account: Option>, + pub use_count: i64, +} + +pub mod create_invite_code_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 UseCount; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type UseCount = Unset; + } + ///State transition - sets the `use_count` field to Set + pub struct SetUseCount(PhantomData S>); + impl sealed::Sealed for SetUseCount {} + impl State for SetUseCount { + type UseCount = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `use_count` field + pub struct use_count(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CreateInviteCodeBuilder<'a, S: create_invite_code_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> CreateInviteCode<'a> { + /// Create a new builder for this type + pub fn new() -> CreateInviteCodeBuilder<'a, create_invite_code_state::Empty> { + CreateInviteCodeBuilder::new() + } +} + +impl<'a> CreateInviteCodeBuilder<'a, create_invite_code_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CreateInviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: create_invite_code_state::State> CreateInviteCodeBuilder<'a, S> { + /// Set the `forAccount` field (optional) + pub fn for_account( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `forAccount` field to an Option value (optional) + pub fn maybe_for_account( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> CreateInviteCodeBuilder<'a, S> +where + S: create_invite_code_state::State, + S::UseCount: create_invite_code_state::IsUnset, +{ + /// Set the `useCount` field (required) + pub fn use_count( + mut self, + value: impl Into, + ) -> CreateInviteCodeBuilder<'a, create_invite_code_state::SetUseCount> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CreateInviteCodeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateInviteCodeBuilder<'a, S> +where + S: create_invite_code_state::State, + S::UseCount: create_invite_code_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CreateInviteCode<'a> { + CreateInviteCode { + for_account: self.__unsafe_private_named.0, + use_count: 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>, + >, + ) -> CreateInviteCode<'a> { + CreateInviteCode { + for_account: self.__unsafe_private_named.0, + use_count: self.__unsafe_private_named.1.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 CreateInviteCodeOutput<'a> { + #[serde(borrow)] + pub code: jacquard_common::CowStr<'a>, +} + +/// Response type for +///com.atproto.server.createInviteCode +pub struct CreateInviteCodeResponse; +impl jacquard_common::xrpc::XrpcResp for CreateInviteCodeResponse { + const NSID: &'static str = "com.atproto.server.createInviteCode"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CreateInviteCodeOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateInviteCode<'a> { + const NSID: &'static str = "com.atproto.server.createInviteCode"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateInviteCodeResponse; +} + +/// Endpoint type for +///com.atproto.server.createInviteCode +pub struct CreateInviteCodeRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateInviteCodeRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.createInviteCode"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateInviteCode<'de>; + type Response = CreateInviteCodeResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..cf2512d --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs @@ -0,0 +1,560 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.createInviteCodes +// +// 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 AccountCodes<'a> { + #[serde(borrow)] + pub account: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub codes: Vec>, +} + +pub mod account_codes_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 Account; + type Codes; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AccountCodesBuilder<'a, S: account_codes_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> AccountCodes<'a> { + /// Create a new builder for this type + pub fn new() -> AccountCodesBuilder<'a, account_codes_state::Empty> { + AccountCodesBuilder::new() + } +} + +impl<'a> AccountCodesBuilder<'a, account_codes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AccountCodesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountCodesBuilder<'a, S> +where + S: account_codes_state::State, + S::Account: account_codes_state::IsUnset, +{ + /// Set the `account` field (required) + pub fn account( + mut self, + value: impl Into>, + ) -> AccountCodesBuilder<'a, account_codes_state::SetAccount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AccountCodesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountCodesBuilder<'a, S> +where + S: account_codes_state::State, + S::Codes: account_codes_state::IsUnset, +{ + /// Set the `codes` field (required) + pub fn codes( + mut self, + value: impl Into>>, + ) -> AccountCodesBuilder<'a, account_codes_state::SetCodes> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AccountCodesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountCodesBuilder<'a, S> +where + S: account_codes_state::State, + S::Account: account_codes_state::IsSet, + S::Codes: account_codes_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AccountCodes<'a> { + AccountCodes { + account: self.__unsafe_private_named.0.unwrap(), + codes: 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>, + >, + ) -> AccountCodes<'a> { + AccountCodes { + account: self.__unsafe_private_named.0.unwrap(), + codes: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_server_createInviteCodes() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "com.atproto.server.createInviteCodes", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("accountCodes"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("account"), + ::jacquard_common::smol_str::SmolStr::new_static("codes") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("account"), + ::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("codes"), + ::jacquard_lexicon::lexicon::LexObjectProperty::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: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("codeCount"), + ::jacquard_common::smol_str::SmolStr::new_static("useCount") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "codeCount", + ), + ::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( + "forAccounts", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "useCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AccountCodes<'a> { + fn nsid() -> &'static str { + "com.atproto.server.createInviteCodes" + } + fn def_name() -> &'static str { + "accountCodes" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_server_createInviteCodes() + } + 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 CreateInviteCodes<'a> { + pub code_count: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub for_accounts: Option>>, + pub use_count: i64, +} + +pub mod create_invite_codes_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 CodeCount; + type UseCount; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type CodeCount = Unset; + type UseCount = Unset; + } + ///State transition - sets the `code_count` field to Set + pub struct SetCodeCount(PhantomData S>); + impl sealed::Sealed for SetCodeCount {} + impl State for SetCodeCount { + type CodeCount = Set; + type UseCount = S::UseCount; + } + ///State transition - sets the `use_count` field to Set + pub struct SetUseCount(PhantomData S>); + impl sealed::Sealed for SetUseCount {} + impl State for SetUseCount { + type CodeCount = S::CodeCount; + type UseCount = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `code_count` field + pub struct code_count(()); + ///Marker type for the `use_count` field + pub struct use_count(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CreateInviteCodesBuilder<'a, S: create_invite_codes_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> CreateInviteCodes<'a> { + /// Create a new builder for this type + pub fn new() -> CreateInviteCodesBuilder<'a, create_invite_codes_state::Empty> { + CreateInviteCodesBuilder::new() + } +} + +impl<'a> CreateInviteCodesBuilder<'a, create_invite_codes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CreateInviteCodesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateInviteCodesBuilder<'a, S> +where + S: create_invite_codes_state::State, + S::CodeCount: create_invite_codes_state::IsUnset, +{ + /// Set the `codeCount` field (required) + pub fn code_count( + mut self, + value: impl Into, + ) -> CreateInviteCodesBuilder<'a, create_invite_codes_state::SetCodeCount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CreateInviteCodesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: create_invite_codes_state::State> CreateInviteCodesBuilder<'a, S> { + /// Set the `forAccounts` field (optional) + pub fn for_accounts( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `forAccounts` field to an Option value (optional) + pub fn maybe_for_accounts( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> CreateInviteCodesBuilder<'a, S> +where + S: create_invite_codes_state::State, + S::UseCount: create_invite_codes_state::IsUnset, +{ + /// Set the `useCount` field (required) + pub fn use_count( + mut self, + value: impl Into, + ) -> CreateInviteCodesBuilder<'a, create_invite_codes_state::SetUseCount> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CreateInviteCodesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CreateInviteCodesBuilder<'a, S> +where + S: create_invite_codes_state::State, + S::CodeCount: create_invite_codes_state::IsSet, + S::UseCount: create_invite_codes_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CreateInviteCodes<'a> { + CreateInviteCodes { + code_count: self.__unsafe_private_named.0.unwrap(), + for_accounts: self.__unsafe_private_named.1, + use_count: 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>, + >, + ) -> CreateInviteCodes<'a> { + CreateInviteCodes { + code_count: self.__unsafe_private_named.0.unwrap(), + for_accounts: self.__unsafe_private_named.1, + use_count: self.__unsafe_private_named.2.unwrap(), + 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 CreateInviteCodesOutput<'a> { + #[serde(borrow)] + pub codes: Vec>, +} + +/// Response type for +///com.atproto.server.createInviteCodes +pub struct CreateInviteCodesResponse; +impl jacquard_common::xrpc::XrpcResp for CreateInviteCodesResponse { + const NSID: &'static str = "com.atproto.server.createInviteCodes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CreateInviteCodesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateInviteCodes<'a> { + const NSID: &'static str = "com.atproto.server.createInviteCodes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateInviteCodesResponse; +} + +/// Endpoint type for +///com.atproto.server.createInviteCodes +pub struct CreateInviteCodesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateInviteCodesRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.createInviteCodes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateInviteCodes<'de>; + type Response = CreateInviteCodesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/create_session.rs b/crates/weaver-api/src/com_atproto/server/create_session.rs new file mode 100644 index 0000000..ae3ab82 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/create_session.rs @@ -0,0 +1,143 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.createSession +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct CreateSession<'a> { + /// When true, instead of throwing error for takendown accounts, a valid response with a narrow scoped token will be returned + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub allow_takendown: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub auth_factor_token: std::option::Option>, + /// Handle or other identifier supported by the server for the authenticating user. + #[serde(borrow)] + pub identifier: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub password: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct CreateSessionOutput<'a> { + #[serde(borrow)] + pub access_jwt: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub active: std::option::Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub did_doc: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub email_auth_factor: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub email_confirmed: std::option::Option, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(borrow)] + pub refresh_jwt: jacquard_common::CowStr<'a>, + /// If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: 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 CreateSessionError<'a> { + #[serde(rename = "AccountTakedown")] + AccountTakedown(std::option::Option), + #[serde(rename = "AuthFactorTokenRequired")] + AuthFactorTokenRequired(std::option::Option), +} + +impl std::fmt::Display for CreateSessionError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::AccountTakedown(msg) => { + write!(f, "AccountTakedown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::AuthFactorTokenRequired(msg) => { + write!(f, "AuthFactorTokenRequired")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.createSession +pub struct CreateSessionResponse; +impl jacquard_common::xrpc::XrpcResp for CreateSessionResponse { + const NSID: &'static str = "com.atproto.server.createSession"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CreateSessionOutput<'de>; + type Err<'de> = CreateSessionError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateSession<'a> { + const NSID: &'static str = "com.atproto.server.createSession"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateSessionResponse; +} + +/// Endpoint type for +///com.atproto.server.createSession +pub struct CreateSessionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateSessionRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.createSession"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateSession<'de>; + type Response = CreateSessionResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/deactivate_account.rs b/crates/weaver-api/src/com_atproto/server/deactivate_account.rs new file mode 100644 index 0000000..7ef8f2d --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/deactivate_account.rs @@ -0,0 +1,54 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.deactivateAccount +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DeactivateAccount<'a> { + /// A recommendation to server as to how long they should hold onto the deactivated account before deleting. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub delete_after: std::option::Option, +} + +/// Response type for +///com.atproto.server.deactivateAccount +pub struct DeactivateAccountResponse; +impl jacquard_common::xrpc::XrpcResp for DeactivateAccountResponse { + const NSID: &'static str = "com.atproto.server.deactivateAccount"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeactivateAccount<'a> { + const NSID: &'static str = "com.atproto.server.deactivateAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeactivateAccountResponse; +} + +/// Endpoint type for +///com.atproto.server.deactivateAccount +pub struct DeactivateAccountRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeactivateAccountRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.deactivateAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeactivateAccount<'de>; + type Response = DeactivateAccountResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/delete_account.rs b/crates/weaver-api/src/com_atproto/server/delete_account.rs new file mode 100644 index 0000000..9805d89 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/delete_account.rs @@ -0,0 +1,276 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.deleteAccount +// +// 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 DeleteAccount<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub password: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub token: jacquard_common::CowStr<'a>, +} + +pub mod delete_account_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 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 Did = Unset; + type Password = Unset; + 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 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 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 `did` field + pub struct did(()); + ///Marker type for the `password` field + pub struct password(()); + ///Marker type for the `token` field + pub struct token(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeleteAccountBuilder<'a, S: delete_account_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> DeleteAccount<'a> { + /// Create a new builder for this type + pub fn new() -> DeleteAccountBuilder<'a, delete_account_state::Empty> { + DeleteAccountBuilder::new() + } +} + +impl<'a> DeleteAccountBuilder<'a, delete_account_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeleteAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteAccountBuilder<'a, S> +where + S: delete_account_state::State, + S::Did: delete_account_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> DeleteAccountBuilder<'a, delete_account_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeleteAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteAccountBuilder<'a, S> +where + S: delete_account_state::State, + S::Password: delete_account_state::IsUnset, +{ + /// Set the `password` field (required) + pub fn password( + mut self, + value: impl Into>, + ) -> DeleteAccountBuilder<'a, delete_account_state::SetPassword> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DeleteAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteAccountBuilder<'a, S> +where + S: delete_account_state::State, + S::Token: delete_account_state::IsUnset, +{ + /// Set the `token` field (required) + pub fn token( + mut self, + value: impl Into>, + ) -> DeleteAccountBuilder<'a, delete_account_state::SetToken> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + DeleteAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteAccountBuilder<'a, S> +where + S: delete_account_state::State, + 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> { + DeleteAccount { + did: self.__unsafe_private_named.0.unwrap(), + password: self.__unsafe_private_named.1.unwrap(), + token: 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>, + >, + ) -> DeleteAccount<'a> { + DeleteAccount { + did: self.__unsafe_private_named.0.unwrap(), + password: self.__unsafe_private_named.1.unwrap(), + token: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[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 DeleteAccountError<'a> { + #[serde(rename = "ExpiredToken")] + ExpiredToken(std::option::Option), + #[serde(rename = "InvalidToken")] + InvalidToken(std::option::Option), +} + +impl std::fmt::Display for DeleteAccountError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ExpiredToken(msg) => { + write!(f, "ExpiredToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidToken(msg) => { + write!(f, "InvalidToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.deleteAccount +pub struct DeleteAccountResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteAccountResponse { + const NSID: &'static str = "com.atproto.server.deleteAccount"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = DeleteAccountError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteAccount<'a> { + const NSID: &'static str = "com.atproto.server.deleteAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteAccountResponse; +} + +/// Endpoint type for +///com.atproto.server.deleteAccount +pub struct DeleteAccountRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteAccountRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.deleteAccount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteAccount<'de>; + type Response = DeleteAccountResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/delete_session.rs b/crates/weaver-api/src/com_atproto/server/delete_session.rs new file mode 100644 index 0000000..324008a --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/delete_session.rs @@ -0,0 +1,48 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.deleteSession +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct DeleteSession; +/// Response type for +///com.atproto.server.deleteSession +pub struct DeleteSessionResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteSessionResponse { + const NSID: &'static str = "com.atproto.server.deleteSession"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for DeleteSession { + const NSID: &'static str = "com.atproto.server.deleteSession"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteSessionResponse; +} + +/// Endpoint type for +///com.atproto.server.deleteSession +pub struct DeleteSessionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteSessionRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.deleteSession"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteSession; + type Response = DeleteSessionResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/describe_server.rs b/crates/weaver-api/src/com_atproto/server/describe_server.rs new file mode 100644 index 0000000..fb5bab1 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/describe_server.rs @@ -0,0 +1,257 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.describeServer +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Contact<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: std::option::Option>, +} + +fn lexicon_doc_com_atproto_server_describeServer() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.server.describeServer"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("contact"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("email"), + ::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("links"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "privacyPolicy", + ), + ::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( + "termsOfService", + ), + ::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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { + description: None, + parameters: None, + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Contact<'a> { + fn nsid() -> &'static str { + "com.atproto.server.describeServer" + } + fn def_name() -> &'static str { + "contact" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_server_describeServer() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Links<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub privacy_policy: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub terms_of_service: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Links<'a> { + fn nsid() -> &'static str { + "com.atproto.server.describeServer" + } + fn def_name() -> &'static str { + "links" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_server_describeServer() + } + 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 DescribeServerOutput<'a> { + /// List of domain suffixes that can be used in account handles. + #[serde(borrow)] + pub available_user_domains: Vec>, + /// Contact information + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub contact: std::option::Option< + crate::com_atproto::server::describe_server::Contact<'a>, + >, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// If true, an invite code must be supplied to create an account on this instance. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub invite_code_required: std::option::Option, + /// URLs of service policy documents. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub links: std::option::Option< + crate::com_atproto::server::describe_server::Links<'a>, + >, + /// If true, a phone verification token must be supplied to create an account on this instance. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub phone_verification_required: std::option::Option, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct DescribeServer; +/// Response type for +///com.atproto.server.describeServer +pub struct DescribeServerResponse; +impl jacquard_common::xrpc::XrpcResp for DescribeServerResponse { + const NSID: &'static str = "com.atproto.server.describeServer"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DescribeServerOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for DescribeServer { + const NSID: &'static str = "com.atproto.server.describeServer"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = DescribeServerResponse; +} + +/// Endpoint type for +///com.atproto.server.describeServer +pub struct DescribeServerRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DescribeServerRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.describeServer"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = DescribeServer; + type Response = DescribeServerResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/get_account_invite_codes.rs b/crates/weaver-api/src/com_atproto/server/get_account_invite_codes.rs new file mode 100644 index 0000000..3ddb41a --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/get_account_invite_codes.rs @@ -0,0 +1,182 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.getAccountInviteCodes +// +// 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 GetAccountInviteCodes { + /// (default: true) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub create_available: std::option::Option, + /// (default: true) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_used: std::option::Option, +} + +pub mod get_account_invite_codes_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 GetAccountInviteCodesBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), +} + +impl GetAccountInviteCodes { + /// Create a new builder for this type + pub fn new() -> GetAccountInviteCodesBuilder { + GetAccountInviteCodesBuilder::new() + } +} + +impl GetAccountInviteCodesBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetAccountInviteCodesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + } + } +} + +impl GetAccountInviteCodesBuilder { + /// Set the `createAvailable` field (optional) + pub fn create_available(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `createAvailable` field to an Option value (optional) + pub fn maybe_create_available(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl GetAccountInviteCodesBuilder { + /// Set the `includeUsed` field (optional) + pub fn include_used(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `includeUsed` field to an Option value (optional) + pub fn maybe_include_used(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl GetAccountInviteCodesBuilder +where + S: get_account_invite_codes_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetAccountInviteCodes { + GetAccountInviteCodes { + create_available: self.__unsafe_private_named.0, + include_used: 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 GetAccountInviteCodesOutput<'a> { + #[serde(borrow)] + pub codes: 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 GetAccountInviteCodesError<'a> { + #[serde(rename = "DuplicateCreate")] + DuplicateCreate(std::option::Option), +} + +impl std::fmt::Display for GetAccountInviteCodesError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::DuplicateCreate(msg) => { + write!(f, "DuplicateCreate")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.getAccountInviteCodes +pub struct GetAccountInviteCodesResponse; +impl jacquard_common::xrpc::XrpcResp for GetAccountInviteCodesResponse { + const NSID: &'static str = "com.atproto.server.getAccountInviteCodes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetAccountInviteCodesOutput<'de>; + type Err<'de> = GetAccountInviteCodesError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetAccountInviteCodes { + const NSID: &'static str = "com.atproto.server.getAccountInviteCodes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetAccountInviteCodesResponse; +} + +/// Endpoint type for +///com.atproto.server.getAccountInviteCodes +pub struct GetAccountInviteCodesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetAccountInviteCodesRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.getAccountInviteCodes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetAccountInviteCodes; + type Response = GetAccountInviteCodesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/get_service_auth.rs b/crates/weaver-api/src/com_atproto/server/get_service_auth.rs new file mode 100644 index 0000000..6e68011 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/get_service_auth.rs @@ -0,0 +1,231 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.getServiceAuth +// +// 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 GetServiceAuth<'a> { + #[serde(borrow)] + pub aud: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub exp: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub lxm: std::option::Option>, +} + +pub mod get_service_auth_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 Aud; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Aud = Unset; + } + ///State transition - sets the `aud` field to Set + pub struct SetAud(PhantomData S>); + impl sealed::Sealed for SetAud {} + impl State for SetAud { + type Aud = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `aud` field + pub struct aud(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetServiceAuthBuilder<'a, S: get_service_auth_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> GetServiceAuth<'a> { + /// Create a new builder for this type + pub fn new() -> GetServiceAuthBuilder<'a, get_service_auth_state::Empty> { + GetServiceAuthBuilder::new() + } +} + +impl<'a> GetServiceAuthBuilder<'a, get_service_auth_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetServiceAuthBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetServiceAuthBuilder<'a, S> +where + S: get_service_auth_state::State, + S::Aud: get_service_auth_state::IsUnset, +{ + /// Set the `aud` field (required) + pub fn aud( + mut self, + value: impl Into>, + ) -> GetServiceAuthBuilder<'a, get_service_auth_state::SetAud> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetServiceAuthBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_service_auth_state::State> GetServiceAuthBuilder<'a, S> { + /// Set the `exp` field (optional) + pub fn exp(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `exp` field to an Option value (optional) + pub fn maybe_exp(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_service_auth_state::State> GetServiceAuthBuilder<'a, S> { + /// Set the `lxm` field (optional) + pub fn lxm( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `lxm` field to an Option value (optional) + pub fn maybe_lxm( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetServiceAuthBuilder<'a, S> +where + S: get_service_auth_state::State, + S::Aud: get_service_auth_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetServiceAuth<'a> { + GetServiceAuth { + aud: self.__unsafe_private_named.0.unwrap(), + exp: self.__unsafe_private_named.1, + lxm: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct GetServiceAuthOutput<'a> { + #[serde(borrow)] + pub token: jacquard_common::CowStr<'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 GetServiceAuthError<'a> { + /// Indicates that the requested expiration date is not a valid. May be in the past or may be reliant on the requested scopes. + #[serde(rename = "BadExpiration")] + BadExpiration(std::option::Option), +} + +impl std::fmt::Display for GetServiceAuthError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BadExpiration(msg) => { + write!(f, "BadExpiration")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.getServiceAuth +pub struct GetServiceAuthResponse; +impl jacquard_common::xrpc::XrpcResp for GetServiceAuthResponse { + const NSID: &'static str = "com.atproto.server.getServiceAuth"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetServiceAuthOutput<'de>; + type Err<'de> = GetServiceAuthError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetServiceAuth<'a> { + const NSID: &'static str = "com.atproto.server.getServiceAuth"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetServiceAuthResponse; +} + +/// Endpoint type for +///com.atproto.server.getServiceAuth +pub struct GetServiceAuthRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetServiceAuthRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.getServiceAuth"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetServiceAuth<'de>; + type Response = GetServiceAuthResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/get_session.rs b/crates/weaver-api/src/com_atproto/server/get_session.rs new file mode 100644 index 0000000..f12ea21 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/get_session.rs @@ -0,0 +1,78 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.getSession +// +// 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 GetSessionOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub active: std::option::Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub did_doc: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub email_auth_factor: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub email_confirmed: std::option::Option, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + /// If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: std::option::Option>, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct GetSession; +/// Response type for +///com.atproto.server.getSession +pub struct GetSessionResponse; +impl jacquard_common::xrpc::XrpcResp for GetSessionResponse { + const NSID: &'static str = "com.atproto.server.getSession"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSessionOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetSession { + const NSID: &'static str = "com.atproto.server.getSession"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSessionResponse; +} + +/// Endpoint type for +///com.atproto.server.getSession +pub struct GetSessionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSessionRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.getSession"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSession; + type Response = GetSessionResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..d206079 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs @@ -0,0 +1,372 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.listAppPasswords +// +// 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 AppPassword<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub privileged: Option, +} + +pub mod app_password_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 Name; + type CreatedAt; + } + /// 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; + } + ///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 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 `name` field + pub struct name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AppPasswordBuilder<'a, S: app_password_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> AppPassword<'a> { + /// Create a new builder for this type + pub fn new() -> AppPasswordBuilder<'a, app_password_state::Empty> { + AppPasswordBuilder::new() + } +} + +impl<'a> AppPasswordBuilder<'a, app_password_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AppPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AppPasswordBuilder<'a, S> +where + S: app_password_state::State, + S::CreatedAt: app_password_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> AppPasswordBuilder<'a, app_password_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AppPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AppPasswordBuilder<'a, S> +where + S: app_password_state::State, + S::Name: app_password_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> AppPasswordBuilder<'a, app_password_state::SetName> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AppPasswordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: app_password_state::State> AppPasswordBuilder<'a, S> { + /// Set the `privileged` field (optional) + pub fn privileged(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `privileged` field to an Option value (optional) + pub fn maybe_privileged(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> AppPasswordBuilder<'a, S> +where + S: app_password_state::State, + S::Name: app_password_state::IsSet, + S::CreatedAt: app_password_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AppPassword<'a> { + AppPassword { + created_at: self.__unsafe_private_named.0.unwrap(), + name: self.__unsafe_private_named.1.unwrap(), + privileged: 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>, + >, + ) -> AppPassword<'a> { + AppPassword { + created_at: self.__unsafe_private_named.0.unwrap(), + name: self.__unsafe_private_named.1.unwrap(), + privileged: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_server_listAppPasswords() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.server.listAppPasswords"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("appPassword"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::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("name"), + ::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( + "privileged", + ), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { + description: None, + parameters: None, + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AppPassword<'a> { + fn nsid() -> &'static str { + "com.atproto.server.listAppPasswords" + } + fn def_name() -> &'static str { + "appPassword" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_server_listAppPasswords() + } + 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 ListAppPasswordsOutput<'a> { + #[serde(borrow)] + pub passwords: 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 ListAppPasswordsError<'a> { + #[serde(rename = "AccountTakedown")] + AccountTakedown(std::option::Option), +} + +impl std::fmt::Display for ListAppPasswordsError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::AccountTakedown(msg) => { + write!(f, "AccountTakedown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct ListAppPasswords; +/// Response type for +///com.atproto.server.listAppPasswords +pub struct ListAppPasswordsResponse; +impl jacquard_common::xrpc::XrpcResp for ListAppPasswordsResponse { + const NSID: &'static str = "com.atproto.server.listAppPasswords"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListAppPasswordsOutput<'de>; + type Err<'de> = ListAppPasswordsError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for ListAppPasswords { + const NSID: &'static str = "com.atproto.server.listAppPasswords"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListAppPasswordsResponse; +} + +/// Endpoint type for +///com.atproto.server.listAppPasswords +pub struct ListAppPasswordsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListAppPasswordsRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.listAppPasswords"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListAppPasswords; + type Response = ListAppPasswordsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/refresh_session.rs b/crates/weaver-api/src/com_atproto/server/refresh_session.rs new file mode 100644 index 0000000..8b8fd60 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/refresh_session.rs @@ -0,0 +1,113 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.refreshSession +// +// 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 RefreshSessionOutput<'a> { + #[serde(borrow)] + pub access_jwt: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub active: std::option::Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub did_doc: std::option::Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(borrow)] + pub refresh_jwt: jacquard_common::CowStr<'a>, + /// Hosting status of the account. If not specified, then assume 'active'. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: 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 RefreshSessionError<'a> { + #[serde(rename = "AccountTakedown")] + AccountTakedown(std::option::Option), +} + +impl std::fmt::Display for RefreshSessionError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::AccountTakedown(msg) => { + write!(f, "AccountTakedown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct RefreshSession; +/// Response type for +///com.atproto.server.refreshSession +pub struct RefreshSessionResponse; +impl jacquard_common::xrpc::XrpcResp for RefreshSessionResponse { + const NSID: &'static str = "com.atproto.server.refreshSession"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RefreshSessionOutput<'de>; + type Err<'de> = RefreshSessionError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for RefreshSession { + const NSID: &'static str = "com.atproto.server.refreshSession"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RefreshSessionResponse; +} + +/// Endpoint type for +///com.atproto.server.refreshSession +pub struct RefreshSessionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RefreshSessionRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.refreshSession"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RefreshSession; + type Response = RefreshSessionResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/request_account_delete.rs b/crates/weaver-api/src/com_atproto/server/request_account_delete.rs new file mode 100644 index 0000000..9ad6598 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/request_account_delete.rs @@ -0,0 +1,48 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.requestAccountDelete +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct RequestAccountDelete; +/// Response type for +///com.atproto.server.requestAccountDelete +pub struct RequestAccountDeleteResponse; +impl jacquard_common::xrpc::XrpcResp for RequestAccountDeleteResponse { + const NSID: &'static str = "com.atproto.server.requestAccountDelete"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for RequestAccountDelete { + const NSID: &'static str = "com.atproto.server.requestAccountDelete"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RequestAccountDeleteResponse; +} + +/// Endpoint type for +///com.atproto.server.requestAccountDelete +pub struct RequestAccountDeleteRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RequestAccountDeleteRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.requestAccountDelete"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RequestAccountDelete; + type Response = RequestAccountDeleteResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/request_email_confirmation.rs b/crates/weaver-api/src/com_atproto/server/request_email_confirmation.rs new file mode 100644 index 0000000..6310b99 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/request_email_confirmation.rs @@ -0,0 +1,48 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.requestEmailConfirmation +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct RequestEmailConfirmation; +/// Response type for +///com.atproto.server.requestEmailConfirmation +pub struct RequestEmailConfirmationResponse; +impl jacquard_common::xrpc::XrpcResp for RequestEmailConfirmationResponse { + const NSID: &'static str = "com.atproto.server.requestEmailConfirmation"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for RequestEmailConfirmation { + const NSID: &'static str = "com.atproto.server.requestEmailConfirmation"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RequestEmailConfirmationResponse; +} + +/// Endpoint type for +///com.atproto.server.requestEmailConfirmation +pub struct RequestEmailConfirmationRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RequestEmailConfirmationRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.requestEmailConfirmation"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RequestEmailConfirmation; + type Response = RequestEmailConfirmationResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/request_email_update.rs b/crates/weaver-api/src/com_atproto/server/request_email_update.rs new file mode 100644 index 0000000..32f35c0 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/request_email_update.rs @@ -0,0 +1,63 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.requestEmailUpdate +// +// 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 RequestEmailUpdateOutput<'a> { + pub token_required: bool, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct RequestEmailUpdate; +/// Response type for +///com.atproto.server.requestEmailUpdate +pub struct RequestEmailUpdateResponse; +impl jacquard_common::xrpc::XrpcResp for RequestEmailUpdateResponse { + const NSID: &'static str = "com.atproto.server.requestEmailUpdate"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RequestEmailUpdateOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for RequestEmailUpdate { + const NSID: &'static str = "com.atproto.server.requestEmailUpdate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RequestEmailUpdateResponse; +} + +/// Endpoint type for +///com.atproto.server.requestEmailUpdate +pub struct RequestEmailUpdateRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RequestEmailUpdateRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.requestEmailUpdate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RequestEmailUpdate; + type Response = RequestEmailUpdateResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/request_password_reset.rs b/crates/weaver-api/src/com_atproto/server/request_password_reset.rs new file mode 100644 index 0000000..c239117 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/request_password_reset.rs @@ -0,0 +1,53 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.requestPasswordReset +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RequestPasswordReset<'a> { + #[serde(borrow)] + pub email: jacquard_common::CowStr<'a>, +} + +/// Response type for +///com.atproto.server.requestPasswordReset +pub struct RequestPasswordResetResponse; +impl jacquard_common::xrpc::XrpcResp for RequestPasswordResetResponse { + const NSID: &'static str = "com.atproto.server.requestPasswordReset"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RequestPasswordReset<'a> { + const NSID: &'static str = "com.atproto.server.requestPasswordReset"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RequestPasswordResetResponse; +} + +/// Endpoint type for +///com.atproto.server.requestPasswordReset +pub struct RequestPasswordResetRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RequestPasswordResetRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.requestPasswordReset"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RequestPasswordReset<'de>; + type Response = RequestPasswordResetResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/reserve_signing_key.rs b/crates/weaver-api/src/com_atproto/server/reserve_signing_key.rs new file mode 100644 index 0000000..194130d --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/reserve_signing_key.rs @@ -0,0 +1,73 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.reserveSigningKey +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ReserveSigningKey<'a> { + /// The DID to reserve a key for. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub did: std::option::Option>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ReserveSigningKeyOutput<'a> { + /// The public key for the reserved signing key, in did:key serialization. + #[serde(borrow)] + pub signing_key: jacquard_common::CowStr<'a>, +} + +/// Response type for +///com.atproto.server.reserveSigningKey +pub struct ReserveSigningKeyResponse; +impl jacquard_common::xrpc::XrpcResp for ReserveSigningKeyResponse { + const NSID: &'static str = "com.atproto.server.reserveSigningKey"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ReserveSigningKeyOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ReserveSigningKey<'a> { + const NSID: &'static str = "com.atproto.server.reserveSigningKey"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = ReserveSigningKeyResponse; +} + +/// Endpoint type for +///com.atproto.server.reserveSigningKey +pub struct ReserveSigningKeyRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ReserveSigningKeyRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.reserveSigningKey"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = ReserveSigningKey<'de>; + type Response = ReserveSigningKeyResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/reset_password.rs b/crates/weaver-api/src/com_atproto/server/reset_password.rs new file mode 100644 index 0000000..38f78c9 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/reset_password.rs @@ -0,0 +1,98 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.resetPassword +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ResetPassword<'a> { + #[serde(borrow)] + pub password: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub token: jacquard_common::CowStr<'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 ResetPasswordError<'a> { + #[serde(rename = "ExpiredToken")] + ExpiredToken(std::option::Option), + #[serde(rename = "InvalidToken")] + InvalidToken(std::option::Option), +} + +impl std::fmt::Display for ResetPasswordError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ExpiredToken(msg) => { + write!(f, "ExpiredToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidToken(msg) => { + write!(f, "InvalidToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.resetPassword +pub struct ResetPasswordResponse; +impl jacquard_common::xrpc::XrpcResp for ResetPasswordResponse { + const NSID: &'static str = "com.atproto.server.resetPassword"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = ResetPasswordError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResetPassword<'a> { + const NSID: &'static str = "com.atproto.server.resetPassword"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = ResetPasswordResponse; +} + +/// Endpoint type for +///com.atproto.server.resetPassword +pub struct ResetPasswordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResetPasswordRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.resetPassword"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = ResetPassword<'de>; + type Response = ResetPasswordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/revoke_app_password.rs b/crates/weaver-api/src/com_atproto/server/revoke_app_password.rs new file mode 100644 index 0000000..c25760d --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/revoke_app_password.rs @@ -0,0 +1,53 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.revokeAppPassword +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RevokeAppPassword<'a> { + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +/// Response type for +///com.atproto.server.revokeAppPassword +pub struct RevokeAppPasswordResponse; +impl jacquard_common::xrpc::XrpcResp for RevokeAppPasswordResponse { + const NSID: &'static str = "com.atproto.server.revokeAppPassword"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RevokeAppPassword<'a> { + const NSID: &'static str = "com.atproto.server.revokeAppPassword"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RevokeAppPasswordResponse; +} + +/// Endpoint type for +///com.atproto.server.revokeAppPassword +pub struct RevokeAppPasswordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RevokeAppPasswordRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.revokeAppPassword"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RevokeAppPassword<'de>; + type Response = RevokeAppPasswordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/server/update_email.rs b/crates/weaver-api/src/com_atproto/server/update_email.rs new file mode 100644 index 0000000..9dcd815 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/server/update_email.rs @@ -0,0 +1,111 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.server.updateEmail +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateEmail<'a> { + #[serde(borrow)] + pub email: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub email_auth_factor: std::option::Option, + /// Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub token: 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 UpdateEmailError<'a> { + #[serde(rename = "ExpiredToken")] + ExpiredToken(std::option::Option), + #[serde(rename = "InvalidToken")] + InvalidToken(std::option::Option), + #[serde(rename = "TokenRequired")] + TokenRequired(std::option::Option), +} + +impl std::fmt::Display for UpdateEmailError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ExpiredToken(msg) => { + write!(f, "ExpiredToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidToken(msg) => { + write!(f, "InvalidToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::TokenRequired(msg) => { + write!(f, "TokenRequired")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.server.updateEmail +pub struct UpdateEmailResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateEmailResponse { + const NSID: &'static str = "com.atproto.server.updateEmail"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = UpdateEmailError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateEmail<'a> { + const NSID: &'static str = "com.atproto.server.updateEmail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateEmailResponse; +} + +/// Endpoint type for +///com.atproto.server.updateEmail +pub struct UpdateEmailRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateEmailRequest { + const PATH: &'static str = "/xrpc/com.atproto.server.updateEmail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateEmail<'de>; + type Response = UpdateEmailResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync.rs b/crates/weaver-api/src/com_atproto/sync.rs new file mode 100644 index 0000000..4983742 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync.rs @@ -0,0 +1,116 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_blob; +pub mod get_blocks; +pub mod get_checkout; +pub mod get_head; +pub mod get_host_status; +pub mod get_latest_commit; +pub mod get_record; +pub mod get_repo; +pub mod get_repo_status; +pub mod list_blobs; +pub mod list_hosts; +pub mod list_repos; +pub mod list_repos_by_collection; +pub mod notify_of_update; +pub mod request_crawl; + +#[cfg(feature = "streaming")] +pub mod subscribe_repos; + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum HostStatus<'a> { + Active, + Idle, + Offline, + Throttled, + Banned, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> HostStatus<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Active => "active", + Self::Idle => "idle", + Self::Offline => "offline", + Self::Throttled => "throttled", + Self::Banned => "banned", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for HostStatus<'a> { + fn from(s: &'a str) -> Self { + match s { + "active" => Self::Active, + "idle" => Self::Idle, + "offline" => Self::Offline, + "throttled" => Self::Throttled, + "banned" => Self::Banned, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for HostStatus<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "active" => Self::Active, + "idle" => Self::Idle, + "offline" => Self::Offline, + "throttled" => Self::Throttled, + "banned" => Self::Banned, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for HostStatus<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for HostStatus<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for HostStatus<'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 HostStatus<'_> { + type Output = HostStatus<'static>; + fn into_static(self) -> Self::Output { + match self { + HostStatus::Active => HostStatus::Active, + HostStatus::Idle => HostStatus::Idle, + HostStatus::Offline => HostStatus::Offline, + HostStatus::Throttled => HostStatus::Throttled, + HostStatus::Banned => HostStatus::Banned, + HostStatus::Other(v) => HostStatus::Other(v.into_static()), + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_blob.rs b/crates/weaver-api/src/com_atproto/sync/get_blob.rs new file mode 100644 index 0000000..549b7a1 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_blob.rs @@ -0,0 +1,273 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getBlob +// +// 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 GetBlob<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_blob_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 Did; + type Cid; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + 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 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 `did` field + pub struct did(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetBlobBuilder<'a, S: get_blob_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetBlob<'a> { + /// Create a new builder for this type + pub fn new() -> GetBlobBuilder<'a, get_blob_state::Empty> { + GetBlobBuilder::new() + } +} + +impl<'a> GetBlobBuilder<'a, get_blob_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetBlobBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetBlobBuilder<'a, S> +where + S: get_blob_state::State, + S::Cid: get_blob_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> GetBlobBuilder<'a, get_blob_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetBlobBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetBlobBuilder<'a, S> +where + S: get_blob_state::State, + S::Did: get_blob_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetBlobBuilder<'a, get_blob_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetBlobBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetBlobBuilder<'a, S> +where + S: get_blob_state::State, + S::Did: get_blob_state::IsSet, + S::Cid: get_blob_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetBlob<'a> { + GetBlob { + cid: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + } + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetBlobOutput { + pub body: bytes::Bytes, +} + +#[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 GetBlobError<'a> { + #[serde(rename = "BlobNotFound")] + BlobNotFound(std::option::Option), + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), + #[serde(rename = "RepoTakendown")] + RepoTakendown(std::option::Option), + #[serde(rename = "RepoSuspended")] + RepoSuspended(std::option::Option), + #[serde(rename = "RepoDeactivated")] + RepoDeactivated(std::option::Option), +} + +impl std::fmt::Display for GetBlobError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BlobNotFound(msg) => { + write!(f, "BlobNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoTakendown(msg) => { + write!(f, "RepoTakendown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoSuspended(msg) => { + write!(f, "RepoSuspended")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoDeactivated(msg) => { + write!(f, "RepoDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.getBlob +pub struct GetBlobResponse; +impl jacquard_common::xrpc::XrpcResp for GetBlobResponse { + const NSID: &'static str = "com.atproto.sync.getBlob"; + const ENCODING: &'static str = "*/*"; + type Output<'de> = GetBlobOutput; + type Err<'de> = GetBlobError<'de>; + fn encode_output( + output: &Self::Output<'_>, + ) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(output.body.to_vec()) + } + fn decode_output<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self::Output<'de>: serde::Deserialize<'de>, + { + Ok(GetBlobOutput { + body: bytes::Bytes::copy_from_slice(body), + }) + } +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetBlob<'a> { + const NSID: &'static str = "com.atproto.sync.getBlob"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetBlobResponse; +} + +/// Endpoint type for +///com.atproto.sync.getBlob +pub struct GetBlobRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetBlobRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getBlob"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetBlob<'de>; + type Response = GetBlobResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_blocks.rs b/crates/weaver-api/src/com_atproto/sync/get_blocks.rs new file mode 100644 index 0000000..3022ba6 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_blocks.rs @@ -0,0 +1,273 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getBlocks +// +// 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 GetBlocks<'a> { + #[serde(borrow)] + pub cids: Vec>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_blocks_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 Did; + type Cids; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetBlocksBuilder<'a, S: get_blocks_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetBlocks<'a> { + /// Create a new builder for this type + pub fn new() -> GetBlocksBuilder<'a, get_blocks_state::Empty> { + GetBlocksBuilder::new() + } +} + +impl<'a> GetBlocksBuilder<'a, get_blocks_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetBlocksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetBlocksBuilder<'a, S> +where + S: get_blocks_state::State, + S::Cids: get_blocks_state::IsUnset, +{ + /// Set the `cids` field (required) + pub fn cids( + mut self, + value: impl Into>>, + ) -> GetBlocksBuilder<'a, get_blocks_state::SetCids> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetBlocksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetBlocksBuilder<'a, S> +where + S: get_blocks_state::State, + S::Did: get_blocks_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetBlocksBuilder<'a, get_blocks_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetBlocksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetBlocksBuilder<'a, S> +where + S: get_blocks_state::State, + S::Did: get_blocks_state::IsSet, + S::Cids: get_blocks_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetBlocks<'a> { + GetBlocks { + cids: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + } + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetBlocksOutput { + pub body: bytes::Bytes, +} + +#[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 GetBlocksError<'a> { + #[serde(rename = "BlockNotFound")] + BlockNotFound(std::option::Option), + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), + #[serde(rename = "RepoTakendown")] + RepoTakendown(std::option::Option), + #[serde(rename = "RepoSuspended")] + RepoSuspended(std::option::Option), + #[serde(rename = "RepoDeactivated")] + RepoDeactivated(std::option::Option), +} + +impl std::fmt::Display for GetBlocksError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::BlockNotFound(msg) => { + write!(f, "BlockNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoTakendown(msg) => { + write!(f, "RepoTakendown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoSuspended(msg) => { + write!(f, "RepoSuspended")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoDeactivated(msg) => { + write!(f, "RepoDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.getBlocks +pub struct GetBlocksResponse; +impl jacquard_common::xrpc::XrpcResp for GetBlocksResponse { + const NSID: &'static str = "com.atproto.sync.getBlocks"; + const ENCODING: &'static str = "application/vnd.ipld.car"; + type Output<'de> = GetBlocksOutput; + type Err<'de> = GetBlocksError<'de>; + fn encode_output( + output: &Self::Output<'_>, + ) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(output.body.to_vec()) + } + fn decode_output<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self::Output<'de>: serde::Deserialize<'de>, + { + Ok(GetBlocksOutput { + body: bytes::Bytes::copy_from_slice(body), + }) + } +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetBlocks<'a> { + const NSID: &'static str = "com.atproto.sync.getBlocks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetBlocksResponse; +} + +/// Endpoint type for +///com.atproto.sync.getBlocks +pub struct GetBlocksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetBlocksRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getBlocks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetBlocks<'de>; + type Response = GetBlocksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_checkout.rs b/crates/weaver-api/src/com_atproto/sync/get_checkout.rs new file mode 100644 index 0000000..0189955 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_checkout.rs @@ -0,0 +1,167 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getCheckout +// +// 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 GetCheckout<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_checkout_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetCheckoutBuilder<'a, S: get_checkout_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetCheckout<'a> { + /// Create a new builder for this type + pub fn new() -> GetCheckoutBuilder<'a, get_checkout_state::Empty> { + GetCheckoutBuilder::new() + } +} + +impl<'a> GetCheckoutBuilder<'a, get_checkout_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetCheckoutBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetCheckoutBuilder<'a, S> +where + S: get_checkout_state::State, + S::Did: get_checkout_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetCheckoutBuilder<'a, get_checkout_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetCheckoutBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetCheckoutBuilder<'a, S> +where + S: get_checkout_state::State, + S::Did: get_checkout_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetCheckout<'a> { + GetCheckout { + did: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetCheckoutOutput { + pub body: bytes::Bytes, +} + +/// Response type for +///com.atproto.sync.getCheckout +pub struct GetCheckoutResponse; +impl jacquard_common::xrpc::XrpcResp for GetCheckoutResponse { + const NSID: &'static str = "com.atproto.sync.getCheckout"; + const ENCODING: &'static str = "application/vnd.ipld.car"; + type Output<'de> = GetCheckoutOutput; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; + fn encode_output( + output: &Self::Output<'_>, + ) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(output.body.to_vec()) + } + fn decode_output<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self::Output<'de>: serde::Deserialize<'de>, + { + Ok(GetCheckoutOutput { + body: bytes::Bytes::copy_from_slice(body), + }) + } +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetCheckout<'a> { + const NSID: &'static str = "com.atproto.sync.getCheckout"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetCheckoutResponse; +} + +/// Endpoint type for +///com.atproto.sync.getCheckout +pub struct GetCheckoutRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetCheckoutRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getCheckout"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetCheckout<'de>; + type Response = GetCheckoutResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_head.rs b/crates/weaver-api/src/com_atproto/sync/get_head.rs new file mode 100644 index 0000000..995a6cd --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_head.rs @@ -0,0 +1,188 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getHead +// +// 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 GetHead<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_head_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetHeadBuilder<'a, S: get_head_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetHead<'a> { + /// Create a new builder for this type + pub fn new() -> GetHeadBuilder<'a, get_head_state::Empty> { + GetHeadBuilder::new() + } +} + +impl<'a> GetHeadBuilder<'a, get_head_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetHeadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetHeadBuilder<'a, S> +where + S: get_head_state::State, + S::Did: get_head_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetHeadBuilder<'a, get_head_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetHeadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetHeadBuilder<'a, S> +where + S: get_head_state::State, + S::Did: get_head_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetHead<'a> { + GetHead { + did: 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 GetHeadOutput<'a> { + #[serde(borrow)] + pub root: jacquard_common::types::string::Cid<'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 GetHeadError<'a> { + #[serde(rename = "HeadNotFound")] + HeadNotFound(std::option::Option), +} + +impl std::fmt::Display for GetHeadError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::HeadNotFound(msg) => { + write!(f, "HeadNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.getHead +pub struct GetHeadResponse; +impl jacquard_common::xrpc::XrpcResp for GetHeadResponse { + const NSID: &'static str = "com.atproto.sync.getHead"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetHeadOutput<'de>; + type Err<'de> = GetHeadError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetHead<'a> { + const NSID: &'static str = "com.atproto.sync.getHead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetHeadResponse; +} + +/// Endpoint type for +///com.atproto.sync.getHead +pub struct GetHeadRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetHeadRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getHead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetHead<'de>; + type Response = GetHeadResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_host_status.rs b/crates/weaver-api/src/com_atproto/sync/get_host_status.rs new file mode 100644 index 0000000..cf63fda --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_host_status.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getHostStatus +// +// 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 GetHostStatus<'a> { + #[serde(borrow)] + pub hostname: jacquard_common::CowStr<'a>, +} + +pub mod get_host_status_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 Hostname; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Hostname = Unset; + } + ///State transition - sets the `hostname` field to Set + pub struct SetHostname(PhantomData S>); + impl sealed::Sealed for SetHostname {} + impl State for SetHostname { + type Hostname = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `hostname` field + pub struct hostname(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetHostStatusBuilder<'a, S: get_host_status_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetHostStatus<'a> { + /// Create a new builder for this type + pub fn new() -> GetHostStatusBuilder<'a, get_host_status_state::Empty> { + GetHostStatusBuilder::new() + } +} + +impl<'a> GetHostStatusBuilder<'a, get_host_status_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetHostStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetHostStatusBuilder<'a, S> +where + S: get_host_status_state::State, + S::Hostname: get_host_status_state::IsUnset, +{ + /// Set the `hostname` field (required) + pub fn hostname( + mut self, + value: impl Into>, + ) -> GetHostStatusBuilder<'a, get_host_status_state::SetHostname> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetHostStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetHostStatusBuilder<'a, S> +where + S: get_host_status_state::State, + S::Hostname: get_host_status_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetHostStatus<'a> { + GetHostStatus { + hostname: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct GetHostStatusOutput<'a> { + /// Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub account_count: std::option::Option, + #[serde(borrow)] + pub hostname: jacquard_common::CowStr<'a>, + /// Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub seq: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: 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 GetHostStatusError<'a> { + #[serde(rename = "HostNotFound")] + HostNotFound(std::option::Option), +} + +impl std::fmt::Display for GetHostStatusError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::HostNotFound(msg) => { + write!(f, "HostNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.getHostStatus +pub struct GetHostStatusResponse; +impl jacquard_common::xrpc::XrpcResp for GetHostStatusResponse { + const NSID: &'static str = "com.atproto.sync.getHostStatus"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetHostStatusOutput<'de>; + type Err<'de> = GetHostStatusError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetHostStatus<'a> { + const NSID: &'static str = "com.atproto.sync.getHostStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetHostStatusResponse; +} + +/// Endpoint type for +///com.atproto.sync.getHostStatus +pub struct GetHostStatusRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetHostStatusRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getHostStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetHostStatus<'de>; + type Response = GetHostStatusResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_latest_commit.rs b/crates/weaver-api/src/com_atproto/sync/get_latest_commit.rs new file mode 100644 index 0000000..ecc3ab8 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_latest_commit.rs @@ -0,0 +1,216 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getLatestCommit +// +// 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 GetLatestCommit<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_latest_commit_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetLatestCommitBuilder<'a, S: get_latest_commit_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetLatestCommit<'a> { + /// Create a new builder for this type + pub fn new() -> GetLatestCommitBuilder<'a, get_latest_commit_state::Empty> { + GetLatestCommitBuilder::new() + } +} + +impl<'a> GetLatestCommitBuilder<'a, get_latest_commit_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetLatestCommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetLatestCommitBuilder<'a, S> +where + S: get_latest_commit_state::State, + S::Did: get_latest_commit_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetLatestCommitBuilder<'a, get_latest_commit_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetLatestCommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetLatestCommitBuilder<'a, S> +where + S: get_latest_commit_state::State, + S::Did: get_latest_commit_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetLatestCommit<'a> { + GetLatestCommit { + did: 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 GetLatestCommitOutput<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub rev: jacquard_common::types::string::Tid, +} + +#[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 GetLatestCommitError<'a> { + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), + #[serde(rename = "RepoTakendown")] + RepoTakendown(std::option::Option), + #[serde(rename = "RepoSuspended")] + RepoSuspended(std::option::Option), + #[serde(rename = "RepoDeactivated")] + RepoDeactivated(std::option::Option), +} + +impl std::fmt::Display for GetLatestCommitError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoTakendown(msg) => { + write!(f, "RepoTakendown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoSuspended(msg) => { + write!(f, "RepoSuspended")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoDeactivated(msg) => { + write!(f, "RepoDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.getLatestCommit +pub struct GetLatestCommitResponse; +impl jacquard_common::xrpc::XrpcResp for GetLatestCommitResponse { + const NSID: &'static str = "com.atproto.sync.getLatestCommit"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetLatestCommitOutput<'de>; + type Err<'de> = GetLatestCommitError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetLatestCommit<'a> { + const NSID: &'static str = "com.atproto.sync.getLatestCommit"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetLatestCommitResponse; +} + +/// Endpoint type for +///com.atproto.sync.getLatestCommit +pub struct GetLatestCommitRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetLatestCommitRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getLatestCommit"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetLatestCommit<'de>; + type Response = GetLatestCommitResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_record.rs b/crates/weaver-api/src/com_atproto/sync/get_record.rs new file mode 100644 index 0000000..6706fc9 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_record.rs @@ -0,0 +1,321 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getRecord +// +// 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 GetRecord<'a> { + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub rkey: jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, +} + +pub mod get_record_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 Did; + type Collection; + type Rkey; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type Collection = Unset; + type Rkey = 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 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 Did = S::Did; + 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 Did = S::Did; + type Collection = S::Collection; + type Rkey = 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 `collection` field + pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetRecordBuilder<'a, S: get_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRecord<'a> { + /// Create a new builder for this type + pub fn new() -> GetRecordBuilder<'a, get_record_state::Empty> { + GetRecordBuilder::new() + } +} + +impl<'a> GetRecordBuilder<'a, get_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Collection: get_record_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> GetRecordBuilder<'a, get_record_state::SetCollection> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Did: get_record_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetRecordBuilder<'a, get_record_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Rkey: get_record_state::IsUnset, +{ + /// Set the `rkey` field (required) + pub fn rkey( + mut self, + value: impl Into< + jacquard_common::types::string::RecordKey< + jacquard_common::types::string::Rkey<'a>, + >, + >, + ) -> GetRecordBuilder<'a, get_record_state::SetRkey> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Did: get_record_state::IsSet, + S::Collection: get_record_state::IsSet, + S::Rkey: get_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRecord<'a> { + GetRecord { + collection: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + rkey: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetRecordOutput { + pub body: bytes::Bytes, +} + +#[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 GetRecordError<'a> { + #[serde(rename = "RecordNotFound")] + RecordNotFound(std::option::Option), + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), + #[serde(rename = "RepoTakendown")] + RepoTakendown(std::option::Option), + #[serde(rename = "RepoSuspended")] + RepoSuspended(std::option::Option), + #[serde(rename = "RepoDeactivated")] + RepoDeactivated(std::option::Option), +} + +impl std::fmt::Display for GetRecordError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RecordNotFound(msg) => { + write!(f, "RecordNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoTakendown(msg) => { + write!(f, "RepoTakendown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoSuspended(msg) => { + write!(f, "RepoSuspended")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoDeactivated(msg) => { + write!(f, "RepoDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.getRecord +pub struct GetRecordResponse; +impl jacquard_common::xrpc::XrpcResp for GetRecordResponse { + const NSID: &'static str = "com.atproto.sync.getRecord"; + const ENCODING: &'static str = "application/vnd.ipld.car"; + type Output<'de> = GetRecordOutput; + type Err<'de> = GetRecordError<'de>; + fn encode_output( + output: &Self::Output<'_>, + ) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(output.body.to_vec()) + } + fn decode_output<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self::Output<'de>: serde::Deserialize<'de>, + { + Ok(GetRecordOutput { + body: bytes::Bytes::copy_from_slice(body), + }) + } +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRecord<'a> { + const NSID: &'static str = "com.atproto.sync.getRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRecordResponse; +} + +/// Endpoint type for +///com.atproto.sync.getRecord +pub struct GetRecordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRecordRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRecord<'de>; + type Response = GetRecordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_repo.rs b/crates/weaver-api/src/com_atproto/sync/get_repo.rs new file mode 100644 index 0000000..2a834ad --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_repo.rs @@ -0,0 +1,251 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getRepo +// +// 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 GetRepo<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub since: std::option::Option, +} + +pub mod get_repo_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetRepoBuilder<'a, S: get_repo_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRepo<'a> { + /// Create a new builder for this type + pub fn new() -> GetRepoBuilder<'a, get_repo_state::Empty> { + GetRepoBuilder::new() + } +} + +impl<'a> GetRepoBuilder<'a, get_repo_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRepoBuilder<'a, S> +where + S: get_repo_state::State, + S::Did: get_repo_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetRepoBuilder<'a, get_repo_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetRepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_repo_state::State> GetRepoBuilder<'a, S> { + /// Set the `since` field (optional) + pub fn since( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S> GetRepoBuilder<'a, S> +where + S: get_repo_state::State, + S::Did: get_repo_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRepo<'a> { + GetRepo { + did: self.__unsafe_private_named.0.unwrap(), + since: self.__unsafe_private_named.1, + } + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetRepoOutput { + pub body: bytes::Bytes, +} + +#[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 GetRepoError<'a> { + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), + #[serde(rename = "RepoTakendown")] + RepoTakendown(std::option::Option), + #[serde(rename = "RepoSuspended")] + RepoSuspended(std::option::Option), + #[serde(rename = "RepoDeactivated")] + RepoDeactivated(std::option::Option), +} + +impl std::fmt::Display for GetRepoError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoTakendown(msg) => { + write!(f, "RepoTakendown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoSuspended(msg) => { + write!(f, "RepoSuspended")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoDeactivated(msg) => { + write!(f, "RepoDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.getRepo +pub struct GetRepoResponse; +impl jacquard_common::xrpc::XrpcResp for GetRepoResponse { + const NSID: &'static str = "com.atproto.sync.getRepo"; + const ENCODING: &'static str = "application/vnd.ipld.car"; + type Output<'de> = GetRepoOutput; + type Err<'de> = GetRepoError<'de>; + fn encode_output( + output: &Self::Output<'_>, + ) -> Result, jacquard_common::xrpc::EncodeError> { + Ok(output.body.to_vec()) + } + fn decode_output<'de>( + body: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> + where + Self::Output<'de>: serde::Deserialize<'de>, + { + Ok(GetRepoOutput { + body: bytes::Bytes::copy_from_slice(body), + }) + } +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRepo<'a> { + const NSID: &'static str = "com.atproto.sync.getRepo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRepoResponse; +} + +/// Endpoint type for +///com.atproto.sync.getRepo +pub struct GetRepoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRepoRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getRepo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRepo<'de>; + type Response = GetRepoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/get_repo_status.rs b/crates/weaver-api/src/com_atproto/sync/get_repo_status.rs new file mode 100644 index 0000000..48a318b --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/get_repo_status.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.getRepoStatus +// +// 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 GetRepoStatus<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_repo_status_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetRepoStatusBuilder<'a, S: get_repo_status_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRepoStatus<'a> { + /// Create a new builder for this type + pub fn new() -> GetRepoStatusBuilder<'a, get_repo_status_state::Empty> { + GetRepoStatusBuilder::new() + } +} + +impl<'a> GetRepoStatusBuilder<'a, get_repo_status_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRepoStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRepoStatusBuilder<'a, S> +where + S: get_repo_status_state::State, + S::Did: get_repo_status_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetRepoStatusBuilder<'a, get_repo_status_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetRepoStatusBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRepoStatusBuilder<'a, S> +where + S: get_repo_status_state::State, + S::Did: get_repo_status_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRepoStatus<'a> { + GetRepoStatus { + did: 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 GetRepoStatusOutput<'a> { + pub active: bool, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// Optional field, the current rev of the repo, if active=true + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub rev: std::option::Option, + /// If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: 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 GetRepoStatusError<'a> { + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), +} + +impl std::fmt::Display for GetRepoStatusError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.getRepoStatus +pub struct GetRepoStatusResponse; +impl jacquard_common::xrpc::XrpcResp for GetRepoStatusResponse { + const NSID: &'static str = "com.atproto.sync.getRepoStatus"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetRepoStatusOutput<'de>; + type Err<'de> = GetRepoStatusError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRepoStatus<'a> { + const NSID: &'static str = "com.atproto.sync.getRepoStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRepoStatusResponse; +} + +/// Endpoint type for +///com.atproto.sync.getRepoStatus +pub struct GetRepoStatusRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRepoStatusRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.getRepoStatus"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRepoStatus<'de>; + type Response = GetRepoStatusResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/list_blobs.rs b/crates/weaver-api/src/com_atproto/sync/list_blobs.rs new file mode 100644 index 0000000..0953b54 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/list_blobs.rs @@ -0,0 +1,280 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.listBlobs +// +// 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 ListBlobs<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + ///(default: 500, min: 1, max: 1000) + #[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 list_blobs_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListBlobsBuilder<'a, S: list_blobs_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> ListBlobs<'a> { + /// Create a new builder for this type + pub fn new() -> ListBlobsBuilder<'a, list_blobs_state::Empty> { + ListBlobsBuilder::new() + } +} + +impl<'a> ListBlobsBuilder<'a, list_blobs_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListBlobsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_blobs_state::State> ListBlobsBuilder<'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> ListBlobsBuilder<'a, S> +where + S: list_blobs_state::State, + S::Did: list_blobs_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ListBlobsBuilder<'a, list_blobs_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ListBlobsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_blobs_state::State> ListBlobsBuilder<'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: list_blobs_state::State> ListBlobsBuilder<'a, S> { + /// Set the `since` field (optional) + pub fn since( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = 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.3 = value; + self + } +} + +impl<'a, S> ListBlobsBuilder<'a, S> +where + S: list_blobs_state::State, + S::Did: list_blobs_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListBlobs<'a> { + ListBlobs { + cursor: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + limit: self.__unsafe_private_named.2, + since: 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 ListBlobsOutput<'a> { + #[serde(borrow)] + pub cids: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub 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 ListBlobsError<'a> { + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), + #[serde(rename = "RepoTakendown")] + RepoTakendown(std::option::Option), + #[serde(rename = "RepoSuspended")] + RepoSuspended(std::option::Option), + #[serde(rename = "RepoDeactivated")] + RepoDeactivated(std::option::Option), +} + +impl std::fmt::Display for ListBlobsError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoTakendown(msg) => { + write!(f, "RepoTakendown")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoSuspended(msg) => { + write!(f, "RepoSuspended")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RepoDeactivated(msg) => { + write!(f, "RepoDeactivated")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.listBlobs +pub struct ListBlobsResponse; +impl jacquard_common::xrpc::XrpcResp for ListBlobsResponse { + const NSID: &'static str = "com.atproto.sync.listBlobs"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListBlobsOutput<'de>; + type Err<'de> = ListBlobsError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListBlobs<'a> { + const NSID: &'static str = "com.atproto.sync.listBlobs"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListBlobsResponse; +} + +/// Endpoint type for +///com.atproto.sync.listBlobs +pub struct ListBlobsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListBlobsRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.listBlobs"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListBlobs<'de>; + type Response = ListBlobsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/list_hosts.rs b/crates/weaver-api/src/com_atproto/sync/list_hosts.rs new file mode 100644 index 0000000..f26bb5b --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/list_hosts.rs @@ -0,0 +1,332 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.listHosts +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Host<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub account_count: std::option::Option, + /// hostname of server; not a URL (no scheme) + #[serde(borrow)] + pub hostname: jacquard_common::CowStr<'a>, + /// Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub seq: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: std::option::Option>, +} + +fn lexicon_doc_com_atproto_sync_listHosts() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.sync.listHosts"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("host"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("hostname") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "accountCount", + ), + ::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("hostname"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "hostname of server; not a URL (no scheme)", + ), + ), + 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("seq"), + ::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("status"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.sync.defs#hostStatus", + ), + }), + ); + map + }, + }), + ); + 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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Host<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.listHosts" + } + fn def_name() -> &'static str { + "host" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_listHosts() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListHosts<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 200, min: 1, max: 1000) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod list_hosts_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 ListHostsBuilder<'a, S: list_hosts_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListHosts<'a> { + /// Create a new builder for this type + pub fn new() -> ListHostsBuilder<'a, list_hosts_state::Empty> { + ListHostsBuilder::new() + } +} + +impl<'a> ListHostsBuilder<'a, list_hosts_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListHostsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_hosts_state::State> ListHostsBuilder<'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: list_hosts_state::State> ListHostsBuilder<'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> ListHostsBuilder<'a, S> +where + S: list_hosts_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListHosts<'a> { + ListHosts { + 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 ListHostsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first. + #[serde(borrow)] + pub hosts: Vec>, +} + +/// Response type for +///com.atproto.sync.listHosts +pub struct ListHostsResponse; +impl jacquard_common::xrpc::XrpcResp for ListHostsResponse { + const NSID: &'static str = "com.atproto.sync.listHosts"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListHostsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListHosts<'a> { + const NSID: &'static str = "com.atproto.sync.listHosts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListHostsResponse; +} + +/// Endpoint type for +///com.atproto.sync.listHosts +pub struct ListHostsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListHostsRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.listHosts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListHosts<'de>; + type Response = ListHostsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/list_repos.rs b/crates/weaver-api/src/com_atproto/sync/list_repos.rs new file mode 100644 index 0000000..128f33f --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/list_repos.rs @@ -0,0 +1,575 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.listRepos +// +// 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 ListRepos<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 500, min: 1, max: 1000) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod list_repos_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 ListReposBuilder<'a, S: list_repos_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListRepos<'a> { + /// Create a new builder for this type + pub fn new() -> ListReposBuilder<'a, list_repos_state::Empty> { + ListReposBuilder::new() + } +} + +impl<'a> ListReposBuilder<'a, list_repos_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListReposBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_repos_state::State> ListReposBuilder<'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: list_repos_state::State> ListReposBuilder<'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> ListReposBuilder<'a, S> +where + S: list_repos_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListRepos<'a> { + ListRepos { + 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 ListReposOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub repos: Vec>, +} + +/// Response type for +///com.atproto.sync.listRepos +pub struct ListReposResponse; +impl jacquard_common::xrpc::XrpcResp for ListReposResponse { + const NSID: &'static str = "com.atproto.sync.listRepos"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListReposOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListRepos<'a> { + const NSID: &'static str = "com.atproto.sync.listRepos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListReposResponse; +} + +/// Endpoint type for +///com.atproto.sync.listRepos +pub struct ListReposRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListReposRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.listRepos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListRepos<'de>; + type Response = ListReposResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Repo<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub active: Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// Current repo commit CID + #[serde(borrow)] + pub head: jacquard_common::types::string::Cid<'a>, + pub rev: jacquard_common::types::string::Tid, + /// If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, +} + +pub mod repo_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 Did; + type Head; + type Rev; + } + /// 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; + } + ///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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepoBuilder<'a, S: repo_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> Repo<'a> { + /// Create a new builder for this type + pub fn new() -> RepoBuilder<'a, repo_state::Empty> { + RepoBuilder::new() + } +} + +impl<'a> RepoBuilder<'a, repo_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_state::State> RepoBuilder<'a, S> { + /// Set the `active` field (optional) + pub fn active(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `active` field to an Option value (optional) + pub fn maybe_active(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> RepoBuilder<'a, S> +where + S: repo_state::State, + S::Did: repo_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> RepoBuilder<'a, repo_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoBuilder<'a, S> +where + S: repo_state::State, + S::Head: repo_state::IsUnset, +{ + /// Set the `head` field (required) + pub fn head( + mut self, + value: impl Into>, + ) -> RepoBuilder<'a, repo_state::SetHead> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoBuilder<'a, S> +where + S: repo_state::State, + S::Rev: repo_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> RepoBuilder<'a, repo_state::SetRev> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + RepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_state::State> RepoBuilder<'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> RepoBuilder<'a, S> +where + S: repo_state::State, + S::Did: repo_state::IsSet, + S::Head: repo_state::IsSet, + S::Rev: repo_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Repo<'a> { + Repo { + active: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + head: self.__unsafe_private_named.2.unwrap(), + rev: self.__unsafe_private_named.3.unwrap(), + status: self.__unsafe_private_named.4, + 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>, + >, + ) -> Repo<'a> { + Repo { + active: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + head: self.__unsafe_private_named.2.unwrap(), + rev: self.__unsafe_private_named.3.unwrap(), + status: self.__unsafe_private_named.4, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_sync_listRepos() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.sync.listRepos"), + 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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("head"), + ::jacquard_common::smol_str::SmolStr::new_static("rev") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("active"), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("head"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Current repo commit CID", + ), + ), + 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("rev"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Tid, + ), + 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( + "If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Repo<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.listRepos" + } + fn def_name() -> &'static str { + "repo" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_listRepos() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/list_repos_by_collection.rs b/crates/weaver-api/src/com_atproto/sync/list_repos_by_collection.rs new file mode 100644 index 0000000..4a0c9bc --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/list_repos_by_collection.rs @@ -0,0 +1,457 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.listReposByCollection +// +// 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 ListReposByCollection<'a> { + #[serde(borrow)] + pub collection: jacquard_common::types::string::Nsid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 500, min: 1, max: 2000) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod list_repos_by_collection_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 Collection; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `collection` field + pub struct collection(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListReposByCollectionBuilder<'a, S: list_repos_by_collection_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> ListReposByCollection<'a> { + /// Create a new builder for this type + pub fn new() -> ListReposByCollectionBuilder< + 'a, + list_repos_by_collection_state::Empty, + > { + ListReposByCollectionBuilder::new() + } +} + +impl<'a> ListReposByCollectionBuilder<'a, list_repos_by_collection_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListReposByCollectionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListReposByCollectionBuilder<'a, S> +where + S: list_repos_by_collection_state::State, + S::Collection: list_repos_by_collection_state::IsUnset, +{ + /// Set the `collection` field (required) + pub fn collection( + mut self, + value: impl Into>, + ) -> ListReposByCollectionBuilder< + 'a, + list_repos_by_collection_state::SetCollection, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ListReposByCollectionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_repos_by_collection_state::State> ListReposByCollectionBuilder<'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: list_repos_by_collection_state::State> ListReposByCollectionBuilder<'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> ListReposByCollectionBuilder<'a, S> +where + S: list_repos_by_collection_state::State, + S::Collection: list_repos_by_collection_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListReposByCollection<'a> { + ListReposByCollection { + collection: 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 ListReposByCollectionOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub repos: Vec>, +} + +/// Response type for +///com.atproto.sync.listReposByCollection +pub struct ListReposByCollectionResponse; +impl jacquard_common::xrpc::XrpcResp for ListReposByCollectionResponse { + const NSID: &'static str = "com.atproto.sync.listReposByCollection"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListReposByCollectionOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListReposByCollection<'a> { + const NSID: &'static str = "com.atproto.sync.listReposByCollection"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListReposByCollectionResponse; +} + +/// Endpoint type for +///com.atproto.sync.listReposByCollection +pub struct ListReposByCollectionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListReposByCollectionRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.listReposByCollection"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListReposByCollection<'de>; + type Response = ListReposByCollectionResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Repo<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod repo_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepoBuilder<'a, S: repo_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Repo<'a> { + /// Create a new builder for this type + pub fn new() -> RepoBuilder<'a, repo_state::Empty> { + RepoBuilder::new() + } +} + +impl<'a> RepoBuilder<'a, repo_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoBuilder<'a, S> +where + S: repo_state::State, + S::Did: repo_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> RepoBuilder<'a, repo_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoBuilder<'a, S> +where + S: repo_state::State, + S::Did: repo_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Repo<'a> { + Repo { + did: 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>, + >, + ) -> Repo<'a> { + Repo { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_sync_listReposByCollection() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "com.atproto.sync.listReposByCollection", + ), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("collection") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "collection", + ), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, + ), + 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("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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Repo<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.listReposByCollection" + } + fn def_name() -> &'static str { + "repo" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_listReposByCollection() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/notify_of_update.rs b/crates/weaver-api/src/com_atproto/sync/notify_of_update.rs new file mode 100644 index 0000000..9dcc048 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/notify_of_update.rs @@ -0,0 +1,54 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.notifyOfUpdate +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct NotifyOfUpdate<'a> { + /// Hostname of the current service (usually a PDS) that is notifying of update. + #[serde(borrow)] + pub hostname: jacquard_common::CowStr<'a>, +} + +/// Response type for +///com.atproto.sync.notifyOfUpdate +pub struct NotifyOfUpdateResponse; +impl jacquard_common::xrpc::XrpcResp for NotifyOfUpdateResponse { + const NSID: &'static str = "com.atproto.sync.notifyOfUpdate"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for NotifyOfUpdate<'a> { + const NSID: &'static str = "com.atproto.sync.notifyOfUpdate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = NotifyOfUpdateResponse; +} + +/// Endpoint type for +///com.atproto.sync.notifyOfUpdate +pub struct NotifyOfUpdateRequest; +impl jacquard_common::xrpc::XrpcEndpoint for NotifyOfUpdateRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.notifyOfUpdate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = NotifyOfUpdate<'de>; + type Response = NotifyOfUpdateResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/request_crawl.rs b/crates/weaver-api/src/com_atproto/sync/request_crawl.rs new file mode 100644 index 0000000..22dc615 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/request_crawl.rs @@ -0,0 +1,88 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.requestCrawl +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RequestCrawl<'a> { + /// Hostname of the current service (eg, PDS) that is requesting to be crawled. + #[serde(borrow)] + pub hostname: jacquard_common::CowStr<'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 RequestCrawlError<'a> { + #[serde(rename = "HostBanned")] + HostBanned(std::option::Option), +} + +impl std::fmt::Display for RequestCrawlError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::HostBanned(msg) => { + write!(f, "HostBanned")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.sync.requestCrawl +pub struct RequestCrawlResponse; +impl jacquard_common::xrpc::XrpcResp for RequestCrawlResponse { + const NSID: &'static str = "com.atproto.sync.requestCrawl"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = RequestCrawlError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RequestCrawl<'a> { + const NSID: &'static str = "com.atproto.sync.requestCrawl"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RequestCrawlResponse; +} + +/// Endpoint type for +///com.atproto.sync.requestCrawl +pub struct RequestCrawlRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RequestCrawlRequest { + const PATH: &'static str = "/xrpc/com.atproto.sync.requestCrawl"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RequestCrawl<'de>; + type Response = RequestCrawlResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs new file mode 100644 index 0000000..642b49f --- /dev/null +++ b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs @@ -0,0 +1,2606 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.sync.subscribeRepos +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Account<'a> { + /// Indicates that the account has a repository which can be fetched from the host that emitted this event. + pub active: bool, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + pub seq: i64, + /// If active=false, this optional field indicates a reason for why the account is not active. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + pub time: jacquard_common::types::string::Datetime, +} + +pub mod account_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 Seq; + type Did; + type Time; + type Active; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Seq = Unset; + type Did = Unset; + type Time = Unset; + type Active = Unset; + } + ///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 Did = S::Did; + type Time = S::Time; + type Active = S::Active; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Seq = S::Seq; + type Did = Set; + type Time = S::Time; + 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 Seq = S::Seq; + type Did = S::Did; + type Time = Set; + type Active = S::Active; + } + ///State transition - sets the `active` field to Set + pub struct SetActive(PhantomData S>); + impl sealed::Sealed for SetActive {} + impl State for SetActive { + type Seq = S::Seq; + type Did = S::Did; + type Time = S::Time; + type Active = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `time` field + pub struct time(()); + ///Marker type for the `active` field + pub struct active(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AccountBuilder<'a, S: account_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> Account<'a> { + /// Create a new builder for this type + pub fn new() -> AccountBuilder<'a, account_state::Empty> { + AccountBuilder::new() + } +} + +impl<'a> AccountBuilder<'a, account_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountBuilder<'a, S> +where + S: account_state::State, + S::Active: account_state::IsUnset, +{ + /// Set the `active` field (required) + pub fn active( + mut self, + value: impl Into, + ) -> AccountBuilder<'a, account_state::SetActive> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountBuilder<'a, S> +where + S: account_state::State, + S::Did: account_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> AccountBuilder<'a, account_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountBuilder<'a, S> +where + S: account_state::State, + S::Seq: account_state::IsUnset, +{ + /// Set the `seq` field (required) + pub fn seq( + mut self, + value: impl Into, + ) -> AccountBuilder<'a, account_state::SetSeq> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + AccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: account_state::State> AccountBuilder<'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> AccountBuilder<'a, S> +where + S: account_state::State, + S::Time: account_state::IsUnset, +{ + /// Set the `time` field (required) + pub fn time( + mut self, + value: impl Into, + ) -> AccountBuilder<'a, account_state::SetTime> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + AccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountBuilder<'a, S> +where + S: account_state::State, + S::Seq: account_state::IsSet, + S::Did: account_state::IsSet, + S::Time: account_state::IsSet, + S::Active: account_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Account<'a> { + Account { + active: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + seq: self.__unsafe_private_named.2.unwrap(), + status: self.__unsafe_private_named.3, + time: 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>, + >, + ) -> Account<'a> { + Account { + active: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + seq: self.__unsafe_private_named.2.unwrap(), + status: self.__unsafe_private_named.3, + time: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_com_atproto_sync_subscribeRepos() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.atproto.sync.subscribeRepos"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("account"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("seq"), + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("time"), + ::jacquard_common::smol_str::SmolStr::new_static("active") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("active"), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("seq"), + ::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("status"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "If active=false, this optional field indicates a reason for why the account is not active.", + ), + ), + 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("time"), + ::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("commit"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("seq"), + ::jacquard_common::smol_str::SmolStr::new_static("rebase"), + ::jacquard_common::smol_str::SmolStr::new_static("tooBig"), + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_common::smol_str::SmolStr::new_static("commit"), + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("since"), + ::jacquard_common::smol_str::SmolStr::new_static("blocks"), + ::jacquard_common::smol_str::SmolStr::new_static("ops"), + ::jacquard_common::smol_str::SmolStr::new_static("blobs"), + ::jacquard_common::smol_str::SmolStr::new_static("time") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blobs"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::CidLink(::jacquard_lexicon::lexicon::LexCidLink { + description: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blocks"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Bytes(::jacquard_lexicon::lexicon::LexBytes { + description: None, + max_length: Some(2000000usize), + min_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("commit"), + ::jacquard_lexicon::lexicon::LexObjectProperty::CidLink(::jacquard_lexicon::lexicon::LexCidLink { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("ops"), + ::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("#repoOp"), + }), + min_length: None, + max_length: Some(200usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("prevData"), + ::jacquard_lexicon::lexicon::LexObjectProperty::CidLink(::jacquard_lexicon::lexicon::LexCidLink { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rebase"), + ::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("repo"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The repo this event comes from. Note that all other message types name this field 'did'.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("rev"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Tid, + ), + 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("seq"), + ::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("since"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The rev of the last emitted commit from this repo (if any).", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Tid, + ), + 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("time"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp of when this message was originally broadcast.", + ), + ), + 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("tooBig"), + ::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("identity"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("seq"), + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("time") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("seq"), + ::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("time"), + ::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("info"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("name")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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("name"), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcSubscription(::jacquard_lexicon::lexicon::LexXrpcSubscription { + description: None, + parameters: Some( + ::jacquard_lexicon::lexicon::LexXrpcSubscriptionParameter::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::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ), + message: None, + infos: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repoOp"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A repo operation, ie a mutation of a single record.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("action"), + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_common::smol_str::SmolStr::new_static("cid") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("action"), + ::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("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::CidLink(::jacquard_lexicon::lexicon::LexCidLink { + description: None, + }), + ); + 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("prev"), + ::jacquard_lexicon::lexicon::LexObjectProperty::CidLink(::jacquard_lexicon::lexicon::LexCidLink { + description: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("sync"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("seq"), + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("blocks"), + ::jacquard_common::smol_str::SmolStr::new_static("rev"), + ::jacquard_common::smol_str::SmolStr::new_static("time") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blocks"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Bytes(::jacquard_lexicon::lexicon::LexBytes { + description: None, + max_length: Some(10000usize), + min_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The account this repo event corresponds to. Must match that in the commit object.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("rev"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The rev of the commit. This value must match that in the commit object.", + ), + ), + 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("seq"), + ::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("time"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp of when this message was originally broadcast.", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Account<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.subscribeRepos" + } + fn def_name() -> &'static str { + "account" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_subscribeRepos() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Commit<'a> { + #[serde(borrow)] + pub blobs: Vec>, + /// CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. + pub blocks: bytes::Bytes, + /// Repo commit object CID. + #[serde(borrow)] + pub commit: jacquard_common::types::cid::CidLink<'a>, + #[serde(borrow)] + pub ops: Vec>, + /// The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub prev_data: Option>, + /// DEPRECATED -- unused + pub rebase: bool, + /// The repo this event comes from. Note that all other message types name this field 'did'. + #[serde(borrow)] + pub repo: jacquard_common::types::string::Did<'a>, + /// The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event. + pub rev: jacquard_common::types::string::Tid, + /// The stream sequence number of this message. + pub seq: i64, + /// The rev of the last emitted commit from this repo (if any). + pub since: jacquard_common::types::string::Tid, + /// Timestamp of when this message was originally broadcast. + pub time: jacquard_common::types::string::Datetime, + /// DEPRECATED -- replaced by #sync event and data limits. Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. + pub too_big: bool, +} + +pub mod commit_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 Seq; + type Rebase; + type TooBig; + type Repo; + type Commit; + type Rev; + type Since; + type Blocks; + type Ops; + type Blobs; + type Time; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Seq = Unset; + type Rebase = Unset; + type TooBig = Unset; + type Repo = Unset; + type Commit = Unset; + type Rev = Unset; + type Since = Unset; + type Blocks = Unset; + type Ops = Unset; + type Blobs = Unset; + type Time = Unset; + } + ///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 TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = S::Blobs; + type Time = S::Time; + } + ///State transition - sets the `rebase` field to Set + pub struct SetRebase(PhantomData S>); + impl sealed::Sealed for SetRebase {} + impl State for SetRebase { + type Seq = S::Seq; + type Rebase = Set; + type TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = S::Blobs; + type Time = S::Time; + } + ///State transition - sets the `too_big` field to Set + pub struct SetTooBig(PhantomData S>); + impl sealed::Sealed for SetTooBig {} + impl State for SetTooBig { + type Seq = S::Seq; + type Rebase = S::Rebase; + type TooBig = Set; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = S::Blobs; + 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 TooBig = S::TooBig; + type Repo = Set; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = S::Blobs; + type Time = S::Time; + } + ///State transition - sets the `commit` field to Set + pub struct SetCommit(PhantomData S>); + impl sealed::Sealed for SetCommit {} + impl State for SetCommit { + type Seq = S::Seq; + type Rebase = S::Rebase; + type TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = Set; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = S::Blobs; + 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 Seq = S::Seq; + type Rebase = S::Rebase; + type TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = Set; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = S::Blobs; + type Time = S::Time; + } + ///State transition - sets the `since` field to Set + pub struct SetSince(PhantomData S>); + impl sealed::Sealed for SetSince {} + impl State for SetSince { + type Seq = S::Seq; + type Rebase = S::Rebase; + type TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = Set; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = S::Blobs; + type Time = S::Time; + } + ///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 TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = Set; + type Ops = S::Ops; + type Blobs = S::Blobs; + 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 TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = Set; + type Blobs = S::Blobs; + type Time = S::Time; + } + ///State transition - sets the `blobs` field to Set + pub struct SetBlobs(PhantomData S>); + impl sealed::Sealed for SetBlobs {} + impl State for SetBlobs { + type Seq = S::Seq; + type Rebase = S::Rebase; + type TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = 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 Seq = S::Seq; + type Rebase = S::Rebase; + type TooBig = S::TooBig; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = S::Rev; + type Since = S::Since; + type Blocks = S::Blocks; + type Ops = S::Ops; + type Blobs = S::Blobs; + type Time = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `rebase` field + pub struct rebase(()); + ///Marker type for the `too_big` field + pub struct too_big(()); + ///Marker type for the `repo` field + pub struct repo(()); + ///Marker type for the `commit` field + pub struct commit(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `since` field + pub struct since(()); + ///Marker type for the `blocks` field + pub struct blocks(()); + ///Marker type for the `ops` field + pub struct ops(()); + ///Marker type for the `blobs` field + pub struct blobs(()); + ///Marker type for the `time` field + pub struct time(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CommitBuilder<'a, S: commit_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, + ::core::option::Option, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Commit<'a> { + /// Create a new builder for this type + pub fn new() -> CommitBuilder<'a, commit_state::Empty> { + CommitBuilder::new() + } +} + +impl<'a> CommitBuilder<'a, commit_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CommitBuilder { + _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> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Blobs: commit_state::IsUnset, +{ + /// Set the `blobs` field (required) + pub fn blobs( + mut self, + value: impl Into>>, + ) -> CommitBuilder<'a, commit_state::SetBlobs> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Blocks: commit_state::IsUnset, +{ + /// Set the `blocks` field (required) + pub fn blocks( + mut self, + value: impl Into, + ) -> CommitBuilder<'a, commit_state::SetBlocks> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Commit: commit_state::IsUnset, +{ + /// Set the `commit` field (required) + pub fn commit( + mut self, + value: impl Into>, + ) -> CommitBuilder<'a, commit_state::SetCommit> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Ops: commit_state::IsUnset, +{ + /// Set the `ops` field (required) + pub fn ops( + mut self, + value: impl Into>>, + ) -> CommitBuilder<'a, commit_state::SetOps> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: commit_state::State> CommitBuilder<'a, S> { + /// Set the `prevData` field (optional) + pub fn prev_data( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `prevData` field to an Option value (optional) + pub fn maybe_prev_data( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Rebase: commit_state::IsUnset, +{ + /// Set the `rebase` field (required) + pub fn rebase( + mut self, + value: impl Into, + ) -> CommitBuilder<'a, commit_state::SetRebase> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Repo: commit_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> CommitBuilder<'a, commit_state::SetRepo> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Rev: commit_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> CommitBuilder<'a, commit_state::SetRev> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Seq: commit_state::IsUnset, +{ + /// Set the `seq` field (required) + pub fn seq( + mut self, + value: impl Into, + ) -> CommitBuilder<'a, commit_state::SetSeq> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Since: commit_state::IsUnset, +{ + /// Set the `since` field (required) + pub fn since( + mut self, + value: impl Into, + ) -> CommitBuilder<'a, commit_state::SetSince> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Time: commit_state::IsUnset, +{ + /// Set the `time` field (required) + pub fn time( + mut self, + value: impl Into, + ) -> CommitBuilder<'a, commit_state::SetTime> { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::TooBig: commit_state::IsUnset, +{ + /// Set the `tooBig` field (required) + pub fn too_big( + mut self, + value: impl Into, + ) -> CommitBuilder<'a, commit_state::SetTooBig> { + self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); + CommitBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CommitBuilder<'a, S> +where + S: commit_state::State, + S::Seq: commit_state::IsSet, + S::Rebase: commit_state::IsSet, + S::TooBig: commit_state::IsSet, + S::Repo: commit_state::IsSet, + S::Commit: commit_state::IsSet, + S::Rev: commit_state::IsSet, + S::Since: commit_state::IsSet, + S::Blocks: commit_state::IsSet, + S::Ops: commit_state::IsSet, + S::Blobs: commit_state::IsSet, + S::Time: commit_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Commit<'a> { + Commit { + blobs: self.__unsafe_private_named.0.unwrap(), + blocks: self.__unsafe_private_named.1.unwrap(), + commit: self.__unsafe_private_named.2.unwrap(), + ops: self.__unsafe_private_named.3.unwrap(), + prev_data: self.__unsafe_private_named.4, + rebase: self.__unsafe_private_named.5.unwrap(), + repo: self.__unsafe_private_named.6.unwrap(), + rev: self.__unsafe_private_named.7.unwrap(), + seq: self.__unsafe_private_named.8.unwrap(), + since: self.__unsafe_private_named.9.unwrap(), + time: self.__unsafe_private_named.10.unwrap(), + too_big: 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>, + >, + ) -> Commit<'a> { + Commit { + blobs: self.__unsafe_private_named.0.unwrap(), + blocks: self.__unsafe_private_named.1.unwrap(), + commit: self.__unsafe_private_named.2.unwrap(), + ops: self.__unsafe_private_named.3.unwrap(), + prev_data: self.__unsafe_private_named.4, + rebase: self.__unsafe_private_named.5.unwrap(), + repo: self.__unsafe_private_named.6.unwrap(), + rev: self.__unsafe_private_named.7.unwrap(), + seq: self.__unsafe_private_named.8.unwrap(), + since: self.__unsafe_private_named.9.unwrap(), + time: self.__unsafe_private_named.10.unwrap(), + too_big: self.__unsafe_private_named.11.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Commit<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.subscribeRepos" + } + fn def_name() -> &'static str { + "commit" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_subscribeRepos() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.ops; + #[allow(unused_comparisons)] + if value.len() > 200usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "ops", + ), + max: 200usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +/// Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Identity<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub handle: Option>, + pub seq: i64, + pub time: jacquard_common::types::string::Datetime, +} + +pub mod identity_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 Seq; + type Did; + type Time; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Seq = Unset; + type Did = Unset; + type Time = Unset; + } + ///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 Did = S::Did; + 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 Seq = S::Seq; + type Did = 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 Seq = S::Seq; + type Did = S::Did; + type Time = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `time` field + pub struct time(()); + } +} + +/// Builder for constructing an instance of this type +pub struct IdentityBuilder<'a, S: identity_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> Identity<'a> { + /// Create a new builder for this type + pub fn new() -> IdentityBuilder<'a, identity_state::Empty> { + IdentityBuilder::new() + } +} + +impl<'a> IdentityBuilder<'a, identity_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + IdentityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdentityBuilder<'a, S> +where + S: identity_state::State, + S::Did: identity_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> IdentityBuilder<'a, identity_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + IdentityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: identity_state::State> IdentityBuilder<'a, S> { + /// Set the `handle` field (optional) + pub fn handle( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `handle` field to an Option value (optional) + pub fn maybe_handle( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> IdentityBuilder<'a, S> +where + S: identity_state::State, + S::Seq: identity_state::IsUnset, +{ + /// Set the `seq` field (required) + pub fn seq( + mut self, + value: impl Into, + ) -> IdentityBuilder<'a, identity_state::SetSeq> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + IdentityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdentityBuilder<'a, S> +where + S: identity_state::State, + S::Time: identity_state::IsUnset, +{ + /// Set the `time` field (required) + pub fn time( + mut self, + value: impl Into, + ) -> IdentityBuilder<'a, identity_state::SetTime> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + IdentityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdentityBuilder<'a, S> +where + S: identity_state::State, + S::Seq: identity_state::IsSet, + S::Did: identity_state::IsSet, + S::Time: identity_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Identity<'a> { + Identity { + did: self.__unsafe_private_named.0.unwrap(), + handle: self.__unsafe_private_named.1, + seq: self.__unsafe_private_named.2.unwrap(), + time: 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>, + >, + ) -> Identity<'a> { + Identity { + did: self.__unsafe_private_named.0.unwrap(), + handle: self.__unsafe_private_named.1, + seq: self.__unsafe_private_named.2.unwrap(), + time: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Identity<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.subscribeRepos" + } + fn def_name() -> &'static str { + "identity" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_subscribeRepos() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Info<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub message: std::option::Option>, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Info<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.subscribeRepos" + } + fn def_name() -> &'static str { + "info" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_subscribeRepos() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SubscribeRepos { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub cursor: std::option::Option, +} + +pub mod subscribe_repos_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 SubscribeReposBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl SubscribeRepos { + /// Create a new builder for this type + pub fn new() -> SubscribeReposBuilder { + SubscribeReposBuilder::new() + } +} + +impl SubscribeReposBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubscribeReposBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl SubscribeReposBuilder { + /// 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 SubscribeReposBuilder +where + S: subscribe_repos_state::State, +{ + /// Build the final struct + pub fn build(self) -> SubscribeRepos { + SubscribeRepos { + cursor: self.__unsafe_private_named.0, + } + } +} + +#[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 SubscribeReposMessage<'a> { + #[serde(rename = "#commit")] + Commit(Box>), + #[serde(rename = "#sync")] + Sync(Box>), + #[serde(rename = "#identity")] + Identity(Box>), + #[serde(rename = "#account")] + Account(Box>), + #[serde(rename = "#info")] + Info(Box>), +} + +impl<'a> SubscribeReposMessage<'a> { + /// Decode a framed DAG-CBOR message (header + body). + pub fn decode_framed<'de: 'a>( + bytes: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> { + let (header, body) = jacquard_common::xrpc::subscription::parse_event_header( + bytes, + )?; + match header.t.as_str() { + "#commit" => { + let variant = serde_ipld_dagcbor::from_slice(body)?; + Ok(Self::Commit(Box::new(variant))) + } + "#sync" => { + let variant = serde_ipld_dagcbor::from_slice(body)?; + Ok(Self::Sync(Box::new(variant))) + } + "#identity" => { + let variant = serde_ipld_dagcbor::from_slice(body)?; + Ok(Self::Identity(Box::new(variant))) + } + "#account" => { + let variant = serde_ipld_dagcbor::from_slice(body)?; + Ok(Self::Account(Box::new(variant))) + } + "#info" => { + let variant = serde_ipld_dagcbor::from_slice(body)?; + Ok(Self::Info(Box::new(variant))) + } + unknown => { + Err( + jacquard_common::error::DecodeError::UnknownEventType(unknown.into()), + ) + } + } + } +} + +#[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 SubscribeReposError<'a> { + #[serde(rename = "FutureCursor")] + FutureCursor(std::option::Option), + /// If the consumer of the stream can not keep up with events, and a backlog gets too large, the server will drop the connection. + #[serde(rename = "ConsumerTooSlow")] + ConsumerTooSlow(std::option::Option), +} + +impl std::fmt::Display for SubscribeReposError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::FutureCursor(msg) => { + write!(f, "FutureCursor")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ConsumerTooSlow(msg) => { + write!(f, "ConsumerTooSlow")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +///Stream response type for +///com.atproto.sync.subscribeRepos +pub struct SubscribeReposStream; +impl jacquard_common::xrpc::SubscriptionResp for SubscribeReposStream { + const NSID: &'static str = "com.atproto.sync.subscribeRepos"; + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor; + type Message<'de> = SubscribeReposMessage<'de>; + type Error<'de> = SubscribeReposError<'de>; + fn decode_message<'de>( + bytes: &'de [u8], + ) -> Result, jacquard_common::error::DecodeError> { + SubscribeReposMessage::decode_framed(bytes) + } +} + +impl jacquard_common::xrpc::XrpcSubscription for SubscribeRepos { + const NSID: &'static str = "com.atproto.sync.subscribeRepos"; + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor; + type Stream = SubscribeReposStream; +} + +pub struct SubscribeReposEndpoint; +impl jacquard_common::xrpc::SubscriptionEndpoint for SubscribeReposEndpoint { + const PATH: &'static str = "/xrpc/com.atproto.sync.subscribeRepos"; + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::DagCbor; + type Params<'de> = SubscribeRepos; + type Stream = SubscribeReposStream; +} + +/// A repo operation, ie a mutation of a single record. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RepoOp<'a> { + #[serde(borrow)] + pub action: jacquard_common::CowStr<'a>, + /// For creates and updates, the new record CID. For deletions, null. + #[serde(borrow)] + pub cid: jacquard_common::types::cid::CidLink<'a>, + #[serde(borrow)] + pub path: jacquard_common::CowStr<'a>, + /// For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub prev: Option>, +} + +pub mod repo_op_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 Action; + type Path; + type Cid; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Action = Unset; + type Path = Unset; + type Cid = 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 Path = S::Path; + type Cid = S::Cid; + } + ///State transition - sets the `path` field to Set + pub struct SetPath(PhantomData S>); + impl sealed::Sealed for SetPath {} + impl State for SetPath { + type Action = S::Action; + type Path = 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 Action = S::Action; + type Path = S::Path; + type Cid = 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 `path` field + pub struct path(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepoOpBuilder<'a, S: repo_op_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> RepoOp<'a> { + /// Create a new builder for this type + pub fn new() -> RepoOpBuilder<'a, repo_op_state::Empty> { + RepoOpBuilder::new() + } +} + +impl<'a> RepoOpBuilder<'a, repo_op_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepoOpBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoOpBuilder<'a, S> +where + S: repo_op_state::State, + S::Action: repo_op_state::IsUnset, +{ + /// Set the `action` field (required) + pub fn action( + mut self, + value: impl Into>, + ) -> RepoOpBuilder<'a, repo_op_state::SetAction> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RepoOpBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoOpBuilder<'a, S> +where + S: repo_op_state::State, + S::Cid: repo_op_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> RepoOpBuilder<'a, repo_op_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RepoOpBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoOpBuilder<'a, S> +where + S: repo_op_state::State, + S::Path: repo_op_state::IsUnset, +{ + /// Set the `path` field (required) + pub fn path( + mut self, + value: impl Into>, + ) -> RepoOpBuilder<'a, repo_op_state::SetPath> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RepoOpBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_op_state::State> RepoOpBuilder<'a, S> { + /// Set the `prev` field (optional) + pub fn prev( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `prev` field to an Option value (optional) + pub fn maybe_prev( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> RepoOpBuilder<'a, S> +where + S: repo_op_state::State, + S::Action: repo_op_state::IsSet, + S::Path: repo_op_state::IsSet, + S::Cid: repo_op_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RepoOp<'a> { + RepoOp { + action: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + path: self.__unsafe_private_named.2.unwrap(), + prev: 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>, + >, + ) -> RepoOp<'a> { + RepoOp { + action: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + path: self.__unsafe_private_named.2.unwrap(), + prev: self.__unsafe_private_named.3, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RepoOp<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.subscribeRepos" + } + fn def_name() -> &'static str { + "repoOp" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_subscribeRepos() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Updates the repo to a new state, without necessarily including that state on the firehose. Used to recover from broken commit streams, data loss incidents, or in situations where upstream host does not know recent state of the repository. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Sync<'a> { + /// CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. + pub blocks: bytes::Bytes, + /// The account this repo event corresponds to. Must match that in the commit object. + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// The rev of the commit. This value must match that in the commit object. + #[serde(borrow)] + pub rev: jacquard_common::CowStr<'a>, + /// The stream sequence number of this message. + pub seq: i64, + /// Timestamp of when this message was originally broadcast. + pub time: jacquard_common::types::string::Datetime, +} + +pub mod sync_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 Seq; + type Did; + type Blocks; + type Rev; + type Time; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Seq = Unset; + type Did = Unset; + type Blocks = Unset; + type Rev = Unset; + type Time = Unset; + } + ///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 Did = S::Did; + type Blocks = S::Blocks; + type Rev = S::Rev; + 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 Seq = S::Seq; + type Did = Set; + type Blocks = S::Blocks; + type Rev = S::Rev; + type Time = S::Time; + } + ///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 Did = S::Did; + type Blocks = 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 Seq = S::Seq; + type Did = S::Did; + type Blocks = S::Blocks; + type Rev = 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 Seq = S::Seq; + type Did = S::Did; + type Blocks = S::Blocks; + type Rev = S::Rev; + type Time = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `blocks` field + pub struct blocks(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `time` field + pub struct time(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SyncBuilder<'a, S: sync_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> Sync<'a> { + /// Create a new builder for this type + pub fn new() -> SyncBuilder<'a, sync_state::Empty> { + SyncBuilder::new() + } +} + +impl<'a> SyncBuilder<'a, sync_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SyncBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SyncBuilder<'a, S> +where + S: sync_state::State, + S::Blocks: sync_state::IsUnset, +{ + /// Set the `blocks` field (required) + pub fn blocks( + mut self, + value: impl Into, + ) -> SyncBuilder<'a, sync_state::SetBlocks> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SyncBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SyncBuilder<'a, S> +where + S: sync_state::State, + S::Did: sync_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> SyncBuilder<'a, sync_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SyncBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SyncBuilder<'a, S> +where + S: sync_state::State, + S::Rev: sync_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into>, + ) -> SyncBuilder<'a, sync_state::SetRev> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SyncBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SyncBuilder<'a, S> +where + S: sync_state::State, + S::Seq: sync_state::IsUnset, +{ + /// Set the `seq` field (required) + pub fn seq( + mut self, + value: impl Into, + ) -> SyncBuilder<'a, sync_state::SetSeq> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + SyncBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SyncBuilder<'a, S> +where + S: sync_state::State, + S::Time: sync_state::IsUnset, +{ + /// Set the `time` field (required) + pub fn time( + mut self, + value: impl Into, + ) -> SyncBuilder<'a, sync_state::SetTime> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + SyncBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SyncBuilder<'a, S> +where + S: sync_state::State, + S::Seq: sync_state::IsSet, + S::Did: sync_state::IsSet, + S::Blocks: sync_state::IsSet, + S::Rev: sync_state::IsSet, + S::Time: sync_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Sync<'a> { + Sync { + blocks: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + rev: self.__unsafe_private_named.2.unwrap(), + seq: self.__unsafe_private_named.3.unwrap(), + time: 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>, + >, + ) -> Sync<'a> { + Sync { + blocks: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + rev: self.__unsafe_private_named.2.unwrap(), + seq: self.__unsafe_private_named.3.unwrap(), + time: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Sync<'a> { + fn nsid() -> &'static str { + "com.atproto.sync.subscribeRepos" + } + fn def_name() -> &'static str { + "sync" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_sync_subscribeRepos() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/temp.rs b/crates/weaver-api/src/com_atproto/temp.rs new file mode 100644 index 0000000..d8d777e --- /dev/null +++ b/crates/weaver-api/src/com_atproto/temp.rs @@ -0,0 +1,12 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod add_reserved_handle; +pub mod check_handle_availability; +pub mod check_signup_queue; +pub mod dereference_scope; +pub mod fetch_labels; +pub mod request_phone_verification; +pub mod revoke_account_credentials; \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/temp/add_reserved_handle.rs b/crates/weaver-api/src/com_atproto/temp/add_reserved_handle.rs new file mode 100644 index 0000000..09ec985 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/temp/add_reserved_handle.rs @@ -0,0 +1,66 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.temp.addReservedHandle +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AddReservedHandle<'a> { + #[serde(borrow)] + pub handle: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AddReservedHandleOutput<'a> {} +/// Response type for +///com.atproto.temp.addReservedHandle +pub struct AddReservedHandleResponse; +impl jacquard_common::xrpc::XrpcResp for AddReservedHandleResponse { + const NSID: &'static str = "com.atproto.temp.addReservedHandle"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = AddReservedHandleOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for AddReservedHandle<'a> { + const NSID: &'static str = "com.atproto.temp.addReservedHandle"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = AddReservedHandleResponse; +} + +/// Endpoint type for +///com.atproto.temp.addReservedHandle +pub struct AddReservedHandleRequest; +impl jacquard_common::xrpc::XrpcEndpoint for AddReservedHandleRequest { + const PATH: &'static str = "/xrpc/com.atproto.temp.addReservedHandle"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = AddReservedHandle<'de>; + type Response = AddReservedHandleResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..6590cd1 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs @@ -0,0 +1,840 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.temp.checkHandleAvailability +// +// 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 CheckHandleAvailability<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub birth_date: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: std::option::Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, +} + +pub mod check_handle_availability_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 Handle; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CheckHandleAvailabilityBuilder< + 'a, + S: check_handle_availability_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> CheckHandleAvailability<'a> { + /// Create a new builder for this type + pub fn new() -> CheckHandleAvailabilityBuilder< + 'a, + check_handle_availability_state::Empty, + > { + CheckHandleAvailabilityBuilder::new() + } +} + +impl<'a> CheckHandleAvailabilityBuilder<'a, check_handle_availability_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CheckHandleAvailabilityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl< + 'a, + S: check_handle_availability_state::State, +> CheckHandleAvailabilityBuilder<'a, S> { + /// Set the `birthDate` field (optional) + pub fn birth_date( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `birthDate` field to an Option value (optional) + pub fn maybe_birth_date( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl< + 'a, + S: check_handle_availability_state::State, +> CheckHandleAvailabilityBuilder<'a, S> { + /// Set the `email` field (optional) + pub fn email( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `email` field to an Option value (optional) + pub fn maybe_email(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> CheckHandleAvailabilityBuilder<'a, S> +where + S: check_handle_availability_state::State, + S::Handle: check_handle_availability_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> CheckHandleAvailabilityBuilder< + 'a, + check_handle_availability_state::SetHandle, + > { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CheckHandleAvailabilityBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CheckHandleAvailabilityBuilder<'a, S> +where + S: check_handle_availability_state::State, + S::Handle: check_handle_availability_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CheckHandleAvailability<'a> { + CheckHandleAvailability { + birth_date: self.__unsafe_private_named.0, + email: self.__unsafe_private_named.1, + handle: 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 CheckHandleAvailabilityOutput<'a> { + /// Echo of the input handle. + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(borrow)] + pub result: CheckHandleAvailabilityOutputResult<'a>, +} + +#[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 CheckHandleAvailabilityOutputResult<'a> { + #[serde(rename = "com.atproto.temp.checkHandleAvailability#resultAvailable")] + ResultAvailable( + Box>, + ), + #[serde(rename = "com.atproto.temp.checkHandleAvailability#resultUnavailable")] + ResultUnavailable( + Box>, + ), +} + +#[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 CheckHandleAvailabilityError<'a> { + /// An invalid email was provided. + #[serde(rename = "InvalidEmail")] + InvalidEmail(std::option::Option), +} + +impl std::fmt::Display for CheckHandleAvailabilityError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidEmail(msg) => { + write!(f, "InvalidEmail")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.temp.checkHandleAvailability +pub struct CheckHandleAvailabilityResponse; +impl jacquard_common::xrpc::XrpcResp for CheckHandleAvailabilityResponse { + const NSID: &'static str = "com.atproto.temp.checkHandleAvailability"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CheckHandleAvailabilityOutput<'de>; + type Err<'de> = CheckHandleAvailabilityError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CheckHandleAvailability<'a> { + const NSID: &'static str = "com.atproto.temp.checkHandleAvailability"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = CheckHandleAvailabilityResponse; +} + +/// Endpoint type for +///com.atproto.temp.checkHandleAvailability +pub struct CheckHandleAvailabilityRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CheckHandleAvailabilityRequest { + const PATH: &'static str = "/xrpc/com.atproto.temp.checkHandleAvailability"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = CheckHandleAvailability<'de>; + type Response = CheckHandleAvailabilityResponse; +} + +/// Indicates the provided handle is available. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ResultAvailable<'a> {} +fn lexicon_doc_com_atproto_temp_checkHandleAvailability() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "com.atproto.temp.checkHandleAvailability", + ), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("handle") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "birthDate", + ), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "User-provided birth date. Might be used to build handle suggestions.", + ), + ), + 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("email"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "User-provided email. Might be used to build handle suggestions.", + ), + ), + 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("handle"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Tentative handle. Will be checked for availability or used to build handle suggestions.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("resultAvailable"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Indicates the provided handle is available.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("resultUnavailable"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Indicates the provided handle is unavailable and gives suggestions of available handles.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("suggestions") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "suggestions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "List of suggested handles based on the provided inputs.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#suggestion"), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("suggestion"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_common::smol_str::SmolStr::new_static("method") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("method"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics.", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ResultAvailable<'a> { + fn nsid() -> &'static str { + "com.atproto.temp.checkHandleAvailability" + } + fn def_name() -> &'static str { + "resultAvailable" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_temp_checkHandleAvailability() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Indicates the provided handle is unavailable and gives suggestions of available handles. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ResultUnavailable<'a> { + /// List of suggested handles based on the provided inputs. + #[serde(borrow)] + pub suggestions: Vec< + crate::com_atproto::temp::check_handle_availability::Suggestion<'a>, + >, +} + +pub mod result_unavailable_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 Suggestions; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Suggestions = Unset; + } + ///State transition - sets the `suggestions` field to Set + pub struct SetSuggestions(PhantomData S>); + impl sealed::Sealed for SetSuggestions {} + impl State for SetSuggestions { + type Suggestions = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `suggestions` field + pub struct suggestions(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResultUnavailableBuilder<'a, S: result_unavailable_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + Vec>, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResultUnavailable<'a> { + /// Create a new builder for this type + pub fn new() -> ResultUnavailableBuilder<'a, result_unavailable_state::Empty> { + ResultUnavailableBuilder::new() + } +} + +impl<'a> ResultUnavailableBuilder<'a, result_unavailable_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResultUnavailableBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResultUnavailableBuilder<'a, S> +where + S: result_unavailable_state::State, + S::Suggestions: result_unavailable_state::IsUnset, +{ + /// Set the `suggestions` field (required) + pub fn suggestions( + mut self, + value: impl Into< + Vec>, + >, + ) -> ResultUnavailableBuilder<'a, result_unavailable_state::SetSuggestions> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResultUnavailableBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResultUnavailableBuilder<'a, S> +where + S: result_unavailable_state::State, + S::Suggestions: result_unavailable_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResultUnavailable<'a> { + ResultUnavailable { + suggestions: 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>, + >, + ) -> ResultUnavailable<'a> { + ResultUnavailable { + suggestions: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ResultUnavailable<'a> { + fn nsid() -> &'static str { + "com.atproto.temp.checkHandleAvailability" + } + fn def_name() -> &'static str { + "resultUnavailable" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_temp_checkHandleAvailability() + } + 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 Suggestion<'a> { + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + /// Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics. + #[serde(borrow)] + pub method: jacquard_common::CowStr<'a>, +} + +pub mod suggestion_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 Handle; + type Method; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SuggestionBuilder<'a, S: suggestion_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Suggestion<'a> { + /// Create a new builder for this type + pub fn new() -> SuggestionBuilder<'a, suggestion_state::Empty> { + SuggestionBuilder::new() + } +} + +impl<'a> SuggestionBuilder<'a, suggestion_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SuggestionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SuggestionBuilder<'a, S> +where + S: suggestion_state::State, + S::Handle: suggestion_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> SuggestionBuilder<'a, suggestion_state::SetHandle> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SuggestionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SuggestionBuilder<'a, S> +where + S: suggestion_state::State, + S::Method: suggestion_state::IsUnset, +{ + /// Set the `method` field (required) + pub fn method( + mut self, + value: impl Into>, + ) -> SuggestionBuilder<'a, suggestion_state::SetMethod> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SuggestionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SuggestionBuilder<'a, S> +where + S: suggestion_state::State, + S::Handle: suggestion_state::IsSet, + S::Method: suggestion_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Suggestion<'a> { + Suggestion { + handle: self.__unsafe_private_named.0.unwrap(), + method: 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>, + >, + ) -> Suggestion<'a> { + Suggestion { + handle: self.__unsafe_private_named.0.unwrap(), + method: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Suggestion<'a> { + fn nsid() -> &'static str { + "com.atproto.temp.checkHandleAvailability" + } + fn def_name() -> &'static str { + "suggestion" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_atproto_temp_checkHandleAvailability() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/temp/check_signup_queue.rs b/crates/weaver-api/src/com_atproto/temp/check_signup_queue.rs new file mode 100644 index 0000000..01fd21a --- /dev/null +++ b/crates/weaver-api/src/com_atproto/temp/check_signup_queue.rs @@ -0,0 +1,63 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.temp.checkSignupQueue +// +// 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 CheckSignupQueueOutput<'a> { + pub activated: bool, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub estimated_time_ms: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub place_in_queue: std::option::Option, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct CheckSignupQueue; +/// Response type for +///com.atproto.temp.checkSignupQueue +pub struct CheckSignupQueueResponse; +impl jacquard_common::xrpc::XrpcResp for CheckSignupQueueResponse { + const NSID: &'static str = "com.atproto.temp.checkSignupQueue"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CheckSignupQueueOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for CheckSignupQueue { + const NSID: &'static str = "com.atproto.temp.checkSignupQueue"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = CheckSignupQueueResponse; +} + +/// Endpoint type for +///com.atproto.temp.checkSignupQueue +pub struct CheckSignupQueueRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CheckSignupQueueRequest { + const PATH: &'static str = "/xrpc/com.atproto.temp.checkSignupQueue"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = CheckSignupQueue; + type Response = CheckSignupQueueResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/temp/dereference_scope.rs b/crates/weaver-api/src/com_atproto/temp/dereference_scope.rs new file mode 100644 index 0000000..e003982 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/temp/dereference_scope.rs @@ -0,0 +1,189 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.temp.dereferenceScope +// +// 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 DereferenceScope<'a> { + #[serde(borrow)] + pub scope: jacquard_common::CowStr<'a>, +} + +pub mod dereference_scope_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 Scope; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Scope = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `scope` field + pub struct scope(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DereferenceScopeBuilder<'a, S: dereference_scope_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DereferenceScope<'a> { + /// Create a new builder for this type + pub fn new() -> DereferenceScopeBuilder<'a, dereference_scope_state::Empty> { + DereferenceScopeBuilder::new() + } +} + +impl<'a> DereferenceScopeBuilder<'a, dereference_scope_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DereferenceScopeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DereferenceScopeBuilder<'a, S> +where + S: dereference_scope_state::State, + S::Scope: dereference_scope_state::IsUnset, +{ + /// Set the `scope` field (required) + pub fn scope( + mut self, + value: impl Into>, + ) -> DereferenceScopeBuilder<'a, dereference_scope_state::SetScope> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DereferenceScopeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DereferenceScopeBuilder<'a, S> +where + S: dereference_scope_state::State, + S::Scope: dereference_scope_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DereferenceScope<'a> { + DereferenceScope { + scope: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DereferenceScopeOutput<'a> { + /// The full oauth permission scope + #[serde(borrow)] + pub scope: jacquard_common::CowStr<'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 DereferenceScopeError<'a> { + /// An invalid scope reference was provided. + #[serde(rename = "InvalidScopeReference")] + InvalidScopeReference(std::option::Option), +} + +impl std::fmt::Display for DereferenceScopeError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidScopeReference(msg) => { + write!(f, "InvalidScopeReference")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///com.atproto.temp.dereferenceScope +pub struct DereferenceScopeResponse; +impl jacquard_common::xrpc::XrpcResp for DereferenceScopeResponse { + const NSID: &'static str = "com.atproto.temp.dereferenceScope"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DereferenceScopeOutput<'de>; + type Err<'de> = DereferenceScopeError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DereferenceScope<'a> { + const NSID: &'static str = "com.atproto.temp.dereferenceScope"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = DereferenceScopeResponse; +} + +/// Endpoint type for +///com.atproto.temp.dereferenceScope +pub struct DereferenceScopeRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DereferenceScopeRequest { + const PATH: &'static str = "/xrpc/com.atproto.temp.dereferenceScope"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = DereferenceScope<'de>; + type Response = DereferenceScopeResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/temp/fetch_labels.rs b/crates/weaver-api/src/com_atproto/temp/fetch_labels.rs new file mode 100644 index 0000000..f880033 --- /dev/null +++ b/crates/weaver-api/src/com_atproto/temp/fetch_labels.rs @@ -0,0 +1,147 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.temp.fetchLabels +// +// 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 FetchLabels { + ///(default: 50, min: 1, max: 250) + #[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 fetch_labels_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 FetchLabelsBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), +} + +impl FetchLabels { + /// Create a new builder for this type + pub fn new() -> FetchLabelsBuilder { + FetchLabelsBuilder::new() + } +} + +impl FetchLabelsBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FetchLabelsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + } + } +} + +impl FetchLabelsBuilder { + /// 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 FetchLabelsBuilder { + /// Set the `since` field (optional) + pub fn since(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl FetchLabelsBuilder +where + S: fetch_labels_state::State, +{ + /// Build the final struct + pub fn build(self) -> FetchLabels { + FetchLabels { + limit: self.__unsafe_private_named.0, + since: 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 FetchLabelsOutput<'a> { + #[serde(borrow)] + pub labels: Vec>, +} + +/// Response type for +///com.atproto.temp.fetchLabels +pub struct FetchLabelsResponse; +impl jacquard_common::xrpc::XrpcResp for FetchLabelsResponse { + const NSID: &'static str = "com.atproto.temp.fetchLabels"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = FetchLabelsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for FetchLabels { + const NSID: &'static str = "com.atproto.temp.fetchLabels"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = FetchLabelsResponse; +} + +/// Endpoint type for +///com.atproto.temp.fetchLabels +pub struct FetchLabelsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for FetchLabelsRequest { + const PATH: &'static str = "/xrpc/com.atproto.temp.fetchLabels"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = FetchLabels; + type Response = FetchLabelsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/temp/request_phone_verification.rs b/crates/weaver-api/src/com_atproto/temp/request_phone_verification.rs new file mode 100644 index 0000000..9263c3d --- /dev/null +++ b/crates/weaver-api/src/com_atproto/temp/request_phone_verification.rs @@ -0,0 +1,53 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.temp.requestPhoneVerification +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RequestPhoneVerification<'a> { + #[serde(borrow)] + pub phone_number: jacquard_common::CowStr<'a>, +} + +/// Response type for +///com.atproto.temp.requestPhoneVerification +pub struct RequestPhoneVerificationResponse; +impl jacquard_common::xrpc::XrpcResp for RequestPhoneVerificationResponse { + const NSID: &'static str = "com.atproto.temp.requestPhoneVerification"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RequestPhoneVerification<'a> { + const NSID: &'static str = "com.atproto.temp.requestPhoneVerification"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RequestPhoneVerificationResponse; +} + +/// Endpoint type for +///com.atproto.temp.requestPhoneVerification +pub struct RequestPhoneVerificationRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RequestPhoneVerificationRequest { + const PATH: &'static str = "/xrpc/com.atproto.temp.requestPhoneVerification"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RequestPhoneVerification<'de>; + type Response = RequestPhoneVerificationResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/com_atproto/temp/revoke_account_credentials.rs b/crates/weaver-api/src/com_atproto/temp/revoke_account_credentials.rs new file mode 100644 index 0000000..41e948c --- /dev/null +++ b/crates/weaver-api/src/com_atproto/temp/revoke_account_credentials.rs @@ -0,0 +1,166 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.atproto.temp.revokeAccountCredentials +// +// 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 RevokeAccountCredentials<'a> { + #[serde(borrow)] + pub account: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod revoke_account_credentials_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 Account; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Account = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `account` field + pub struct account(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RevokeAccountCredentialsBuilder< + 'a, + S: revoke_account_credentials_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RevokeAccountCredentials<'a> { + /// Create a new builder for this type + pub fn new() -> RevokeAccountCredentialsBuilder< + 'a, + revoke_account_credentials_state::Empty, + > { + RevokeAccountCredentialsBuilder::new() + } +} + +impl<'a> RevokeAccountCredentialsBuilder<'a, revoke_account_credentials_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RevokeAccountCredentialsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RevokeAccountCredentialsBuilder<'a, S> +where + S: revoke_account_credentials_state::State, + S::Account: revoke_account_credentials_state::IsUnset, +{ + /// Set the `account` field (required) + pub fn account( + mut self, + value: impl Into>, + ) -> RevokeAccountCredentialsBuilder< + 'a, + revoke_account_credentials_state::SetAccount, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RevokeAccountCredentialsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RevokeAccountCredentialsBuilder<'a, S> +where + S: revoke_account_credentials_state::State, + S::Account: revoke_account_credentials_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RevokeAccountCredentials<'a> { + RevokeAccountCredentials { + account: 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>, + >, + ) -> RevokeAccountCredentials<'a> { + RevokeAccountCredentials { + account: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///com.atproto.temp.revokeAccountCredentials +pub struct RevokeAccountCredentialsResponse; +impl jacquard_common::xrpc::XrpcResp for RevokeAccountCredentialsResponse { + const NSID: &'static str = "com.atproto.temp.revokeAccountCredentials"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RevokeAccountCredentials<'a> { + const NSID: &'static str = "com.atproto.temp.revokeAccountCredentials"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RevokeAccountCredentialsResponse; +} + +/// Endpoint type for +///com.atproto.temp.revokeAccountCredentials +pub struct RevokeAccountCredentialsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RevokeAccountCredentialsRequest { + const PATH: &'static str = "/xrpc/com.atproto.temp.revokeAccountCredentials"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RevokeAccountCredentials<'de>; + type Response = RevokeAccountCredentialsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/lib.rs b/crates/weaver-api/src/lib.rs new file mode 100644 index 0000000..68c4e59 --- /dev/null +++ b/crates/weaver-api/src/lib.rs @@ -0,0 +1,20 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[cfg(feature = "app_bsky")] +pub mod app_bsky; +pub mod builder_types; + +#[cfg(feature = "chat_bsky")] +pub mod chat_bsky; + +#[cfg(feature = "com_atproto")] +pub mod com_atproto; + +#[cfg(feature = "sh_weaver")] +pub mod sh_weaver; + +#[cfg(feature = "tools_ozone")] +pub mod tools_ozone; \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver.rs b/crates/weaver-api/src/sh_weaver.rs new file mode 100644 index 0000000..4d95cde --- /dev/null +++ b/crates/weaver-api/src/sh_weaver.rs @@ -0,0 +1,10 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod actor; +pub mod edit; +pub mod embed; +pub mod notebook; +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 new file mode 100644 index 0000000..72df499 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/actor.rs @@ -0,0 +1,2742 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.actor.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_profile; +pub mod profile; + +/// A single author in a Weaver notebook. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Author<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub handle: Option>, +} + +pub mod author_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AuthorBuilder<'a, S: author_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> Author<'a> { + /// Create a new builder for this type + pub fn new() -> AuthorBuilder<'a, author_state::Empty> { + AuthorBuilder::new() + } +} + +impl<'a> AuthorBuilder<'a, author_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AuthorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AuthorBuilder<'a, S> +where + S: author_state::State, + S::Did: author_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> AuthorBuilder<'a, author_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AuthorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: author_state::State> AuthorBuilder<'a, S> { + /// Set the `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: author_state::State> AuthorBuilder<'a, S> { + /// Set the `handle` field (optional) + pub fn handle( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `handle` field to an Option value (optional) + pub fn maybe_handle( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> AuthorBuilder<'a, S> +where + S: author_state::State, + S::Did: author_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Author<'a> { + Author { + did: self.__unsafe_private_named.0.unwrap(), + display_name: self.__unsafe_private_named.1, + handle: 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>, + >, + ) -> Author<'a> { + Author { + did: self.__unsafe_private_named.0.unwrap(), + display_name: self.__unsafe_private_named.1, + handle: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.actor.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("author"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A single author in a Weaver notebook.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("pinnedList"), + ::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( + "com.atproto.repo.strongRef", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profileDataView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("inner")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("inner"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#profileView"), + ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewDetailed"), + ::jacquard_common::CowStr::new_static("#tangledProfileView") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profileDataViewBasic"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("inner")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("inner"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#profileViewBasic"), + ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewBasic"), + ::jacquard_common::CowStr::new_static("#tangledProfileView") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profileView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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("banner"), + ::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( + "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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(10240usize), + min_graphemes: None, + max_graphemes: Some(1024usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("links"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", + ), + ), + 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, + }), + min_length: Some(0usize), + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("location"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Free-form location text.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(400usize), + min_graphemes: None, + max_graphemes: Some(40usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pinned"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#pinnedList"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pronouns"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#pronounsList", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subscribedCount", + ), + ::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( + "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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profileViewBasic"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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( + "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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pronouns"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#pronounsList", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pronounsList"), + ::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(500usize), + min_graphemes: None, + max_graphemes: Some(50usize), + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tangledProfileView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("bluesky"), + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("bluesky"), + ::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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Free-form profile description text.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(2560usize), + min_graphemes: None, + max_graphemes: Some(256usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("links"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", + ), + ), + 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, + }), + min_length: Some(0usize), + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("location"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Free-form location text.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(400usize), + min_graphemes: None, + max_graphemes: Some(40usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "pinnedRepositories", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Any ATURI, it is up to appviews to validate these fields.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: Some(0usize), + max_length: Some(6usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("stats"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static("Vanity stats."), + ), + 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, + }), + min_length: Some(0usize), + max_length: Some(2usize), + }), + ); + 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> { + 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 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, + value: impl Into>, + ) -> ProfileDataViewBuilder<'a, profile_data_view_state::SetInner> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ProfileDataViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ProfileDataViewBuilder<'a, S> +where + S: profile_data_view_state::State, + S::Inner: profile_data_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ProfileDataView<'a> { + ProfileDataView { + inner: 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>, + >, + ) -> ProfileDataView<'a> { + ProfileDataView { + inner: self.__unsafe_private_named.0.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 ProfileDataViewInner<'a> { + #[serde(rename = "sh.weaver.actor.defs#profileView")] + ProfileView(Box>), + #[serde(rename = "app.bsky.actor.defs#profileViewDetailed")] + ProfileViewDetailed(Box>), + #[serde(rename = "sh.weaver.actor.defs#tangledProfileView")] + TangledProfileView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileDataView<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.defs" + } + fn def_name() -> &'static str { + "profileDataView" + } + 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(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileDataViewBasic<'a> { + #[serde(borrow)] + pub inner: ProfileDataViewBasicInner<'a>, +} + +pub mod profile_data_view_basic_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 ProfileDataViewBasicBuilder<'a, S: profile_data_view_basic_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ProfileDataViewBasic<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileDataViewBasicBuilder< + 'a, + profile_data_view_basic_state::Empty, + > { + ProfileDataViewBasicBuilder::new() + } +} + +impl<'a> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileDataViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ProfileDataViewBasicBuilder<'a, S> +where + S: profile_data_view_basic_state::State, + S::Inner: profile_data_view_basic_state::IsUnset, +{ + /// Set the `inner` field (required) + pub fn inner( + mut self, + value: impl Into>, + ) -> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::SetInner> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ProfileDataViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ProfileDataViewBasicBuilder<'a, S> +where + S: profile_data_view_basic_state::State, + S::Inner: profile_data_view_basic_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ProfileDataViewBasic<'a> { + ProfileDataViewBasic { + inner: 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>, + >, + ) -> ProfileDataViewBasic<'a> { + ProfileDataViewBasic { + inner: self.__unsafe_private_named.0.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 ProfileDataViewBasicInner<'a> { + #[serde(rename = "sh.weaver.actor.defs#profileViewBasic")] + ProfileViewBasic(Box>), + #[serde(rename = "app.bsky.actor.defs#profileViewBasic")] + BskyProfileViewBasic(Box>), + #[serde(rename = "sh.weaver.actor.defs#tangledProfileView")] + TangledProfileView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileDataViewBasic<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.defs" + } + fn def_name() -> &'static str { + "profileDataViewBasic" + } + 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(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub banner: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub indexed_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub links: Option>>, + /// Free-form location text. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub location: Option>, + /// Notebooks or other records pinned for display. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pinned: Option>, + /// Pronouns to use in user-generated content. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pronouns: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub subscribed_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub subscriber_count: Option, +} + +pub mod profile_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 Did; + type Handle; + } + /// 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; + } + ///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 `did` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileViewBuilder<'a, S: profile_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> ProfileView<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileViewBuilder<'a, profile_view_state::Empty> { + ProfileViewBuilder::new() + } +} + +impl<'a> ProfileViewBuilder<'a, profile_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileViewBuilder { + _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: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `banner` field (optional) + pub fn banner( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `banner` field to an Option value (optional) + pub fn maybe_banner( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> ProfileViewBuilder<'a, S> +where + S: profile_view_state::State, + S::Did: profile_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ProfileViewBuilder<'a, profile_view_state::SetDid> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> ProfileViewBuilder<'a, S> +where + S: profile_view_state::State, + S::Handle: profile_view_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> ProfileViewBuilder<'a, profile_view_state::SetHandle> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + ProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `indexedAt` field (optional) + pub fn indexed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.7 = 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.7 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `links` field (optional) + pub fn links( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `links` field to an Option value (optional) + pub fn maybe_links( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `location` field (optional) + pub fn location( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `location` field to an Option value (optional) + pub fn maybe_location(mut self, value: Option>) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `pinned` field (optional) + pub fn pinned( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `pinned` field to an Option value (optional) + pub fn maybe_pinned( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `pronouns` field (optional) + pub fn pronouns( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.12 = 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.12 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `subscribedCount` field (optional) + pub fn subscribed_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.13 = value.into(); + self + } + /// Set the `subscribedCount` field to an Option value (optional) + pub fn maybe_subscribed_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.13 = value; + self + } +} + +impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { + /// Set the `subscriberCount` field (optional) + pub fn subscriber_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.14 = 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.14 = value; + self + } +} + +impl<'a, S> ProfileViewBuilder<'a, S> +where + S: profile_view_state::State, + S::Did: profile_view_state::IsSet, + S::Handle: profile_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ProfileView<'a> { + ProfileView { + avatar: self.__unsafe_private_named.0, + banner: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + description: self.__unsafe_private_named.3, + did: self.__unsafe_private_named.4.unwrap(), + display_name: self.__unsafe_private_named.5, + handle: self.__unsafe_private_named.6.unwrap(), + indexed_at: self.__unsafe_private_named.7, + labels: self.__unsafe_private_named.8, + links: self.__unsafe_private_named.9, + location: self.__unsafe_private_named.10, + pinned: self.__unsafe_private_named.11, + pronouns: self.__unsafe_private_named.12, + subscribed_count: self.__unsafe_private_named.13, + subscriber_count: 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>, + >, + ) -> ProfileView<'a> { + ProfileView { + avatar: self.__unsafe_private_named.0, + banner: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + description: self.__unsafe_private_named.3, + did: self.__unsafe_private_named.4.unwrap(), + display_name: self.__unsafe_private_named.5, + handle: self.__unsafe_private_named.6.unwrap(), + indexed_at: self.__unsafe_private_named.7, + labels: self.__unsafe_private_named.8, + links: self.__unsafe_private_named.9, + location: self.__unsafe_private_named.10, + pinned: self.__unsafe_private_named.11, + pronouns: self.__unsafe_private_named.12, + subscribed_count: self.__unsafe_private_named.13, + subscriber_count: self.__unsafe_private_named.14, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileView<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.defs" + } + fn def_name() -> &'static str { + "profileView" + } + 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.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10240usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 10240usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1024usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 1024usize, + actual: count, + }); + } + } + } + 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, + }); + } + } + } + if let Some(ref value) = self.links { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "links", + ), + max: 5usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.links { + #[allow(unused_comparisons)] + if value.len() < 0usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "links", + ), + min: 0usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.location { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 400usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "location", + ), + max: 400usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.location { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 40usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "location", + ), + max: 40usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileViewBasic<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub indexed_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + /// Pronouns to use in user-generated content. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pronouns: Option>, +} + +pub mod profile_view_basic_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 Did; + type Handle; + } + /// 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; + } + ///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 `did` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_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> ProfileViewBasic<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { + ProfileViewBasicBuilder::new() + } +} + +impl<'a> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + 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 `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> ProfileViewBasicBuilder<'a, S> +where + S: profile_view_basic_state::State, + S::Did: profile_view_basic_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid> { + self.__unsafe_private_named.2 = ::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 `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +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>; +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct TangledProfileView<'a> { + /// Include link to this account on Bluesky. + pub bluesky: bool, + /// Free-form profile description text. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub links: Option>>, + /// Free-form location text. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub location: Option>, + /// Any ATURI, it is up to appviews to validate these fields. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pinned_repositories: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub stats: Option>>, +} + +pub mod tangled_profile_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 Bluesky; + type Did; + type Handle; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Bluesky = Unset; + type Did = Unset; + type Handle = Unset; + } + ///State transition - sets the `bluesky` field to Set + pub struct SetBluesky(PhantomData S>); + impl sealed::Sealed for SetBluesky {} + impl State for SetBluesky { + type Bluesky = Set; + type Did = S::Did; + type Handle = S::Handle; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Bluesky = S::Bluesky; + 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 Bluesky = S::Bluesky; + type Did = S::Did; + type Handle = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `bluesky` field + pub struct bluesky(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct TangledProfileViewBuilder<'a, S: tangled_profile_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> TangledProfileView<'a> { + /// Create a new builder for this type + pub fn new() -> TangledProfileViewBuilder<'a, tangled_profile_view_state::Empty> { + TangledProfileViewBuilder::new() + } +} + +impl<'a> TangledProfileViewBuilder<'a, tangled_profile_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + TangledProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TangledProfileViewBuilder<'a, S> +where + S: tangled_profile_view_state::State, + S::Bluesky: tangled_profile_view_state::IsUnset, +{ + /// Set the `bluesky` field (required) + pub fn bluesky( + mut self, + value: impl Into, + ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetBluesky> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + TangledProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> TangledProfileViewBuilder<'a, S> +where + S: tangled_profile_view_state::State, + S::Did: tangled_profile_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetDid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + TangledProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TangledProfileViewBuilder<'a, S> +where + S: tangled_profile_view_state::State, + S::Handle: tangled_profile_view_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetHandle> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + TangledProfileViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { + /// Set the `links` field (optional) + pub fn links( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `links` field to an Option value (optional) + pub fn maybe_links( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { + /// Set the `location` field (optional) + pub fn location( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `location` field to an Option value (optional) + pub fn maybe_location(mut self, value: Option>) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { + /// Set the `pinnedRepositories` field (optional) + pub fn pinned_repositories( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `pinnedRepositories` field to an Option value (optional) + pub fn maybe_pinned_repositories( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { + /// Set the `stats` field (optional) + pub fn stats( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `stats` field to an Option value (optional) + pub fn maybe_stats( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> TangledProfileViewBuilder<'a, S> +where + S: tangled_profile_view_state::State, + S::Bluesky: tangled_profile_view_state::IsSet, + S::Did: tangled_profile_view_state::IsSet, + S::Handle: tangled_profile_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> TangledProfileView<'a> { + TangledProfileView { + bluesky: self.__unsafe_private_named.0.unwrap(), + description: self.__unsafe_private_named.1, + did: self.__unsafe_private_named.2.unwrap(), + handle: self.__unsafe_private_named.3.unwrap(), + links: self.__unsafe_private_named.4, + location: self.__unsafe_private_named.5, + pinned_repositories: self.__unsafe_private_named.6, + stats: 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>, + >, + ) -> TangledProfileView<'a> { + TangledProfileView { + bluesky: self.__unsafe_private_named.0.unwrap(), + description: self.__unsafe_private_named.1, + did: self.__unsafe_private_named.2.unwrap(), + handle: self.__unsafe_private_named.3.unwrap(), + links: self.__unsafe_private_named.4, + location: self.__unsafe_private_named.5, + pinned_repositories: self.__unsafe_private_named.6, + stats: self.__unsafe_private_named.7, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TangledProfileView<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.defs" + } + fn def_name() -> &'static str { + "tangledProfileView" + } + 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.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 2560usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 2560usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 256usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 256usize, + actual: count, + }); + } + } + } + if let Some(ref value) = self.links { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "links", + ), + max: 5usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.links { + #[allow(unused_comparisons)] + if value.len() < 0usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "links", + ), + min: 0usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.location { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 400usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "location", + ), + max: 400usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.location { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 40usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "location", + ), + max: 40usize, + actual: count, + }); + } + } + } + if let Some(ref value) = self.pinned_repositories { + #[allow(unused_comparisons)] + if value.len() > 6usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "pinned_repositories", + ), + max: 6usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.pinned_repositories { + #[allow(unused_comparisons)] + if value.len() < 0usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "pinned_repositories", + ), + min: 0usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.stats { + #[allow(unused_comparisons)] + if value.len() > 2usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "stats", + ), + max: 2usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.stats { + #[allow(unused_comparisons)] + if value.len() < 0usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "stats", + ), + min: 0usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/actor/get_profile.rs b/crates/weaver-api/src/sh_weaver/actor/get_profile.rs new file mode 100644 index 0000000..b9c1be4 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/actor/get_profile.rs @@ -0,0 +1,155 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.actor.getProfile +// +// 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 GetProfile<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod get_profile_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 GetProfileBuilder<'a, S: get_profile_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetProfile<'a> { + /// Create a new builder for this type + pub fn new() -> GetProfileBuilder<'a, get_profile_state::Empty> { + GetProfileBuilder::new() + } +} + +impl<'a> GetProfileBuilder<'a, get_profile_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetProfileBuilder<'a, S> +where + S: get_profile_state::State, + S::Actor: get_profile_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetProfileBuilder<'a, get_profile_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetProfileBuilder<'a, S> +where + S: get_profile_state::State, + S::Actor: get_profile_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetProfile<'a> { + GetProfile { + actor: 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 GetProfileOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::sh_weaver::actor::ProfileDataView<'a>, +} + +/// Response type for +///sh.weaver.actor.getProfile +pub struct GetProfileResponse; +impl jacquard_common::xrpc::XrpcResp for GetProfileResponse { + const NSID: &'static str = "sh.weaver.actor.getProfile"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetProfileOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetProfile<'a> { + const NSID: &'static str = "sh.weaver.actor.getProfile"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetProfileResponse; +} + +/// Endpoint type for +///sh.weaver.actor.getProfile +pub struct GetProfileRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetProfileRequest { + const PATH: &'static str = "/xrpc/sh.weaver.actor.getProfile"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetProfile<'de>; + type Response = GetProfileResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/actor/profile.rs b/crates/weaver-api/src/sh_weaver/actor/profile.rs new file mode 100644 index 0000000..f0143ef --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/actor/profile.rs @@ -0,0 +1,822 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.actor.profile +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A declaration of a Weaver account profile. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Profile<'a> { + /// Small image to be displayed next to posts from account. AKA, 'profile picture' + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub avatar: Option>, + /// Larger horizontal image to display behind profile view. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub banner: Option>, + /// Include link to this account on Bluesky. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub bluesky: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + /// Free-form profile description text. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: Option>, + /// Self-label values, specific to the application, on the overall account. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub links: Option>>, + /// Free-form location text. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub location: Option>, + /// Notebooks or other records pinned for display. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pinned: Option>, + /// Pronouns to use in user-generated content. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pronouns: Option>, + /// Include link to this account on stream.place. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub streamplace: Option, + /// Include link to this account on Tangled. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub tangled: Option, +} + +pub mod profile_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 ProfileBuilder<'a, S: profile_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> Profile<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { + ProfileBuilder::new() + } +} + +impl<'a> ProfileBuilder<'a, profile_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileBuilder { + _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: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `avatar` field (optional) + pub fn avatar( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `avatar` field to an Option value (optional) + pub fn maybe_avatar( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `banner` field (optional) + pub fn banner( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `banner` field to an Option value (optional) + pub fn maybe_banner( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `bluesky` field (optional) + pub fn bluesky(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `bluesky` field to an Option value (optional) + pub fn maybe_bluesky(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = 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.3 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `displayName` field (optional) + pub fn display_name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'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_state::State> ProfileBuilder<'a, S> { + /// Set the `links` field (optional) + pub fn links( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `links` field to an Option value (optional) + pub fn maybe_links( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `location` field (optional) + pub fn location( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `location` field to an Option value (optional) + pub fn maybe_location(mut self, value: Option>) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `pinned` field (optional) + pub fn pinned( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `pinned` field to an Option value (optional) + pub fn maybe_pinned( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `pronouns` field (optional) + pub fn pronouns( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = 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.10 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `streamplace` field (optional) + pub fn streamplace(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `streamplace` field to an Option value (optional) + pub fn maybe_streamplace(mut self, value: Option) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `tangled` field (optional) + pub fn tangled(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `tangled` field to an Option value (optional) + pub fn maybe_tangled(mut self, value: Option) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, +{ + /// Build the final struct + pub fn build(self) -> Profile<'a> { + Profile { + avatar: self.__unsafe_private_named.0, + banner: self.__unsafe_private_named.1, + bluesky: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3, + description: self.__unsafe_private_named.4, + display_name: self.__unsafe_private_named.5, + labels: self.__unsafe_private_named.6, + links: self.__unsafe_private_named.7, + location: self.__unsafe_private_named.8, + pinned: self.__unsafe_private_named.9, + pronouns: self.__unsafe_private_named.10, + streamplace: self.__unsafe_private_named.11, + tangled: self.__unsafe_private_named.12, + 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>, + >, + ) -> Profile<'a> { + Profile { + avatar: self.__unsafe_private_named.0, + banner: self.__unsafe_private_named.1, + bluesky: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3, + description: self.__unsafe_private_named.4, + display_name: self.__unsafe_private_named.5, + labels: self.__unsafe_private_named.6, + links: self.__unsafe_private_named.7, + location: self.__unsafe_private_named.8, + pinned: self.__unsafe_private_named.9, + pronouns: self.__unsafe_private_named.10, + streamplace: self.__unsafe_private_named.11, + tangled: self.__unsafe_private_named.12, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Profile<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, + 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 ProfileGetRecordOutput<'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: Profile<'a>, +} + +impl From> for Profile<'_> { + fn from(output: ProfileGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Profile<'_> { + const NSID: &'static str = "sh.weaver.actor.profile"; + type Record = ProfileRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ProfileRecord; +impl jacquard_common::xrpc::XrpcResp for ProfileRecord { + const NSID: &'static str = "sh.weaver.actor.profile"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ProfileGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ProfileRecord { + const NSID: &'static str = "sh.weaver.actor.profile"; + type Record = ProfileRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.profile" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_actor_profile() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10240usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 10240usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1024usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 1024usize, + actual: count, + }); + } + } + } + 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, + }); + } + } + } + if let Some(ref value) = self.links { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "links", + ), + max: 5usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.links { + #[allow(unused_comparisons)] + if value.len() < 0usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "links", + ), + min: 0usize, + actual: value.len(), + }); + } + } + if let Some(ref value) = self.location { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 400usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "location", + ), + max: 400usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.location { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 40usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "location", + ), + max: 40usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +fn lexicon_doc_sh_weaver_actor_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.actor.profile"), + 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( + "A declaration of a Weaver account profile.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), + ::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("banner"), + ::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("bluesky"), + ::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( + "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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Free-form profile description text.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(10240usize), + min_graphemes: None, + max_graphemes: Some(1024usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("labels"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: Some( + ::jacquard_common::CowStr::new_static( + "Self-label values, specific to the application, on the overall account.", + ), + ), + refs: vec![ + ::jacquard_common::CowStr::new_static("com.atproto.label.defs#selfLabels") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("links"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", + ), + ), + 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, + }), + min_length: Some(0usize), + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "location", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Free-form location text.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(400usize), + min_graphemes: None, + max_graphemes: Some(40usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pinned"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#pinnedList", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "pronouns", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#pronounsList", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "streamplace", + ), + ::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("tangled"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/edit.rs b/crates/weaver-api/src/sh_weaver/edit.rs new file mode 100644 index 0000000..4fb4b3e --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit.rs @@ -0,0 +1,534 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod cursor; +pub mod diff; +pub mod root; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct DocRef<'a> { + #[serde(borrow)] + pub value: DocRefValue<'a>, +} + +pub mod doc_ref_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 Value; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Value = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DocRefBuilder<'a, S: doc_ref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DocRef<'a> { + /// Create a new builder for this type + pub fn new() -> DocRefBuilder<'a, doc_ref_state::Empty> { + DocRefBuilder::new() + } +} + +impl<'a> DocRefBuilder<'a, doc_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DocRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocRefBuilder<'a, S> +where + S: doc_ref_state::State, + S::Value: doc_ref_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> DocRefBuilder<'a, doc_ref_state::SetValue> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DocRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocRefBuilder<'a, S> +where + S: doc_ref_state::State, + S::Value: doc_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DocRef<'a> { + DocRef { + value: 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>, + >, + ) -> DocRef<'a> { + DocRef { + value: self.__unsafe_private_named.0.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 DocRefValue<'a> { + #[serde(rename = "sh.weaver.edit.defs#notebookRef")] + NotebookRef(Box>), + #[serde(rename = "sh.weaver.edit.defs#entryRef")] + EntryRef(Box>), +} + +fn lexicon_doc_sh_weaver_edit_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.edit.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("docRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("value")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#notebookRef"), + ::jacquard_common::CowStr::new_static("#entryRef") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entryRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("notebook") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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( + "com.atproto.repo.strongRef", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notebookRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("notebook") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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( + "com.atproto.repo.strongRef", + ), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DocRef<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.defs" + } + fn def_name() -> &'static str { + "docRef" + } + 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, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct EntryRef<'a> { + #[serde(borrow)] + pub notebook: crate::com_atproto::repo::strong_ref::StrongRef<'a>, +} + +pub mod entry_ref_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 EntryRefBuilder<'a, S: entry_ref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> EntryRef<'a> { + /// Create a new builder for this type + pub fn new() -> EntryRefBuilder<'a, entry_ref_state::Empty> { + EntryRefBuilder::new() + } +} + +impl<'a> EntryRefBuilder<'a, entry_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EntryRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntryRefBuilder<'a, S> +where + S: entry_ref_state::State, + S::Notebook: entry_ref_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> EntryRefBuilder<'a, entry_ref_state::SetNotebook> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EntryRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntryRefBuilder<'a, S> +where + S: entry_ref_state::State, + S::Notebook: entry_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> EntryRef<'a> { + EntryRef { + notebook: 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>, + >, + ) -> EntryRef<'a> { + EntryRef { + notebook: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryRef<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.defs" + } + fn def_name() -> &'static str { + "entryRef" + } + 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, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct NotebookRef<'a> { + #[serde(borrow)] + pub notebook: crate::com_atproto::repo::strong_ref::StrongRef<'a>, +} + +pub mod notebook_ref_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 NotebookRefBuilder<'a, S: notebook_ref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> NotebookRef<'a> { + /// Create a new builder for this type + pub fn new() -> NotebookRefBuilder<'a, notebook_ref_state::Empty> { + NotebookRefBuilder::new() + } +} + +impl<'a> NotebookRefBuilder<'a, notebook_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NotebookRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotebookRefBuilder<'a, S> +where + S: notebook_ref_state::State, + S::Notebook: notebook_ref_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> NotebookRefBuilder<'a, notebook_ref_state::SetNotebook> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NotebookRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotebookRefBuilder<'a, S> +where + S: notebook_ref_state::State, + S::Notebook: notebook_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> NotebookRef<'a> { + NotebookRef { + notebook: 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>, + >, + ) -> NotebookRef<'a> { + NotebookRef { + notebook: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookRef<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.defs" + } + fn def_name() -> &'static str { + "notebookRef" + } + 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(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/edit/cursor.rs b/crates/weaver-api/src/sh_weaver/edit/cursor.rs new file mode 100644 index 0000000..7b2db06 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit/cursor.rs @@ -0,0 +1,1238 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.cursor +// +// 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 ContainerId<'a> { + #[serde(borrow)] + pub value: ContainerIdValue<'a>, +} + +pub mod container_id_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 Value; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Value = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ContainerIdBuilder<'a, S: container_id_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ContainerId<'a> { + /// Create a new builder for this type + pub fn new() -> ContainerIdBuilder<'a, container_id_state::Empty> { + ContainerIdBuilder::new() + } +} + +impl<'a> ContainerIdBuilder<'a, container_id_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ContainerIdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ContainerIdBuilder<'a, S> +where + S: container_id_state::State, + S::Value: container_id_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> ContainerIdBuilder<'a, container_id_state::SetValue> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ContainerIdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ContainerIdBuilder<'a, S> +where + S: container_id_state::State, + S::Value: container_id_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ContainerId<'a> { + ContainerId { + value: 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>, + >, + ) -> ContainerId<'a> { + ContainerId { + value: self.__unsafe_private_named.0.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 ContainerIdValue<'a> { + #[serde(rename = "sh.weaver.edit.cursor#normalContainerId")] + NormalContainerId(Box>), + #[serde(rename = "sh.weaver.edit.cursor#rootContainerId")] + RootContainerId(Box>), +} + +fn lexicon_doc_sh_weaver_edit_cursor() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.edit.cursor"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("containerId"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("value")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#normalContainerId"), + ::jacquard_common::CowStr::new_static("#rootContainerId") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cursorSide"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("value")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::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("id"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("peer"), + ::jacquard_common::smol_str::SmolStr::new_static("counter") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("counter"), + ::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("peer"), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "An edit record for a notebook.", + ), + ), + 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("container"), + ::jacquard_common::smol_str::SmolStr::new_static("id") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "container", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#containerId"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#id"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("side"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#cursorSide"), + }), + ); + map + }, + }), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("normalContainerId"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("peer"), + ::jacquard_common::smol_str::SmolStr::new_static("counter"), + ::jacquard_common::smol_str::SmolStr::new_static("container_type") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "container_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("counter"), + ::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("peer"), + ::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("rootContainerId"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_common::smol_str::SmolStr::new_static("container_type") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "container_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("name"), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ContainerId<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.cursor" + } + fn def_name() -> &'static str { + "containerId" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_cursor() + } + 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 CursorSide<'a> { + /// The side of an item the cursor is on (left = -1, right = 1, middle = 0) + pub value: i64, +} + +pub mod cursor_side_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 Value; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Value = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CursorSideBuilder<'a, S: cursor_side_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> CursorSide<'a> { + /// Create a new builder for this type + pub fn new() -> CursorSideBuilder<'a, cursor_side_state::Empty> { + CursorSideBuilder::new() + } +} + +impl<'a> CursorSideBuilder<'a, cursor_side_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CursorSideBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CursorSideBuilder<'a, S> +where + S: cursor_side_state::State, + S::Value: cursor_side_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into, + ) -> CursorSideBuilder<'a, cursor_side_state::SetValue> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CursorSideBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CursorSideBuilder<'a, S> +where + S: cursor_side_state::State, + S::Value: cursor_side_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CursorSide<'a> { + CursorSide { + value: 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>, + >, + ) -> CursorSide<'a> { + CursorSide { + value: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CursorSide<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.cursor" + } + fn def_name() -> &'static str { + "cursorSide" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_cursor() + } + 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 Id<'a> { + pub counter: i64, + pub peer: i64, +} + +pub mod id_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 Peer; + type Counter; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Peer = Unset; + 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 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 `peer` field + pub struct peer(()); + ///Marker type for the `counter` field + pub struct counter(()); + } +} + +/// Builder for constructing an instance of this type +pub struct IdBuilder<'a, S: id_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Id<'a> { + /// Create a new builder for this type + pub fn new() -> IdBuilder<'a, id_state::Empty> { + IdBuilder::new() + } +} + +impl<'a> IdBuilder<'a, id_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + IdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdBuilder<'a, S> +where + S: id_state::State, + S::Counter: id_state::IsUnset, +{ + /// Set the `counter` field (required) + pub fn counter( + mut self, + value: impl Into, + ) -> IdBuilder<'a, id_state::SetCounter> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + IdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdBuilder<'a, S> +where + S: id_state::State, + S::Peer: id_state::IsUnset, +{ + /// Set the `peer` field (required) + pub fn peer(mut self, value: impl Into) -> IdBuilder<'a, id_state::SetPeer> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + IdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> IdBuilder<'a, S> +where + S: id_state::State, + S::Peer: id_state::IsSet, + S::Counter: id_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Id<'a> { + Id { + counter: self.__unsafe_private_named.0.unwrap(), + peer: 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>, + >, + ) -> Id<'a> { + Id { + counter: self.__unsafe_private_named.0.unwrap(), + peer: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Id<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.cursor" + } + fn def_name() -> &'static str { + "id" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_cursor() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// An edit record for a notebook. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Cursor<'a> { + #[serde(borrow)] + pub container: crate::sh_weaver::edit::cursor::ContainerId<'a>, + #[serde(borrow)] + pub id: crate::sh_weaver::edit::cursor::Id<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub side: Option>, +} + +pub mod cursor_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 Container; + type Id; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Container = Unset; + type Id = Unset; + } + ///State transition - sets the `container` field to Set + pub struct SetContainer(PhantomData S>); + impl sealed::Sealed for SetContainer {} + impl State for SetContainer { + type Container = 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 Container = S::Container; + type Id = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `container` field + pub struct container(()); + ///Marker type for the `id` field + pub struct id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CursorBuilder<'a, S: cursor_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> Cursor<'a> { + /// Create a new builder for this type + pub fn new() -> CursorBuilder<'a, cursor_state::Empty> { + CursorBuilder::new() + } +} + +impl<'a> CursorBuilder<'a, cursor_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CursorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CursorBuilder<'a, S> +where + S: cursor_state::State, + S::Container: cursor_state::IsUnset, +{ + /// Set the `container` field (required) + pub fn container( + mut self, + value: impl Into>, + ) -> CursorBuilder<'a, cursor_state::SetContainer> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CursorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CursorBuilder<'a, S> +where + S: cursor_state::State, + S::Id: cursor_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into>, + ) -> CursorBuilder<'a, cursor_state::SetId> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CursorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: cursor_state::State> CursorBuilder<'a, S> { + /// Set the `side` field (optional) + pub fn side( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `side` field to an Option value (optional) + pub fn maybe_side( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> CursorBuilder<'a, S> +where + S: cursor_state::State, + S::Container: cursor_state::IsSet, + S::Id: cursor_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Cursor<'a> { + Cursor { + container: self.__unsafe_private_named.0.unwrap(), + id: self.__unsafe_private_named.1.unwrap(), + side: 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>, + >, + ) -> Cursor<'a> { + Cursor { + container: self.__unsafe_private_named.0.unwrap(), + id: self.__unsafe_private_named.1.unwrap(), + side: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Cursor<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, CursorRecord>, + 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 CursorGetRecordOutput<'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: Cursor<'a>, +} + +impl From> for Cursor<'_> { + fn from(output: CursorGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Cursor<'_> { + const NSID: &'static str = "sh.weaver.edit.cursor"; + type Record = CursorRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct CursorRecord; +impl jacquard_common::xrpc::XrpcResp for CursorRecord { + const NSID: &'static str = "sh.weaver.edit.cursor"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CursorGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for CursorRecord { + const NSID: &'static str = "sh.weaver.edit.cursor"; + type Record = CursorRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Cursor<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.cursor" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_cursor() + } + 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 NormalContainerId<'a> { + #[serde(borrow)] + pub container_type: jacquard_common::CowStr<'a>, + pub counter: i64, + pub peer: i64, +} + +pub mod normal_container_id_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 Peer; + type Counter; + type ContainerType; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Peer = Unset; + type Counter = Unset; + type ContainerType = Unset; + } + ///State transition - sets the `peer` field to Set + pub struct SetPeer(PhantomData S>); + impl sealed::Sealed for SetPeer {} + impl State for SetPeer { + type Peer = Set; + type Counter = S::Counter; + type ContainerType = S::ContainerType; + } + ///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; + 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 Peer = S::Peer; + type Counter = S::Counter; + type ContainerType = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `peer` field + pub struct peer(()); + ///Marker type for the `counter` field + pub struct counter(()); + ///Marker type for the `container_type` field + pub struct container_type(()); + } +} + +/// Builder for constructing an instance of this type +pub struct NormalContainerIdBuilder<'a, S: normal_container_id_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> NormalContainerId<'a> { + /// Create a new builder for this type + pub fn new() -> NormalContainerIdBuilder<'a, normal_container_id_state::Empty> { + NormalContainerIdBuilder::new() + } +} + +impl<'a> NormalContainerIdBuilder<'a, normal_container_id_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NormalContainerIdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NormalContainerIdBuilder<'a, S> +where + S: normal_container_id_state::State, + S::ContainerType: normal_container_id_state::IsUnset, +{ + /// Set the `container_type` field (required) + pub fn container_type( + mut self, + value: impl Into>, + ) -> NormalContainerIdBuilder<'a, normal_container_id_state::SetContainerType> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NormalContainerIdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NormalContainerIdBuilder<'a, S> +where + S: normal_container_id_state::State, + S::Counter: normal_container_id_state::IsUnset, +{ + /// Set the `counter` field (required) + pub fn counter( + mut self, + value: impl Into, + ) -> NormalContainerIdBuilder<'a, normal_container_id_state::SetCounter> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + NormalContainerIdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NormalContainerIdBuilder<'a, S> +where + S: normal_container_id_state::State, + S::Peer: normal_container_id_state::IsUnset, +{ + /// Set the `peer` field (required) + pub fn peer( + mut self, + value: impl Into, + ) -> NormalContainerIdBuilder<'a, normal_container_id_state::SetPeer> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + NormalContainerIdBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NormalContainerIdBuilder<'a, S> +where + S: normal_container_id_state::State, + S::Peer: normal_container_id_state::IsSet, + S::Counter: normal_container_id_state::IsSet, + S::ContainerType: normal_container_id_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> NormalContainerId<'a> { + NormalContainerId { + container_type: self.__unsafe_private_named.0.unwrap(), + counter: self.__unsafe_private_named.1.unwrap(), + peer: 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>, + >, + ) -> NormalContainerId<'a> { + NormalContainerId { + container_type: self.__unsafe_private_named.0.unwrap(), + counter: self.__unsafe_private_named.1.unwrap(), + peer: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NormalContainerId<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.cursor" + } + fn def_name() -> &'static str { + "normalContainerId" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_cursor() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RootContainerId<'a> { + #[serde(borrow)] + pub container_type: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RootContainerId<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.cursor" + } + fn def_name() -> &'static str { + "rootContainerId" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_cursor() + } + 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/edit/diff.rs b/crates/weaver-api/src/sh_weaver/edit/diff.rs new file mode 100644 index 0000000..a573cf3 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit/diff.rs @@ -0,0 +1,352 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.diff +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// An edit record for a notebook. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Diff<'a> { + #[serde(borrow)] + pub doc: crate::sh_weaver::edit::DocRef<'a>, + #[serde(borrow)] + pub root: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + #[serde(borrow)] + pub snapshot: jacquard_common::types::blob::BlobRef<'a>, +} + +pub mod diff_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 Snapshot; + type Root; + type Doc; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Snapshot = Unset; + type Root = Unset; + type Doc = Unset; + } + ///State transition - sets the `snapshot` field to Set + pub struct SetSnapshot(PhantomData S>); + impl sealed::Sealed for SetSnapshot {} + impl State for SetSnapshot { + type Snapshot = Set; + type Root = S::Root; + type Doc = S::Doc; + } + ///State transition - sets the `root` field to Set + pub struct SetRoot(PhantomData S>); + impl sealed::Sealed for SetRoot {} + impl State for SetRoot { + type Snapshot = S::Snapshot; + type Root = Set; + type Doc = S::Doc; + } + ///State transition - sets the `doc` field to Set + pub struct SetDoc(PhantomData S>); + impl sealed::Sealed for SetDoc {} + impl State for SetDoc { + type Snapshot = S::Snapshot; + type Root = S::Root; + type Doc = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `snapshot` field + pub struct snapshot(()); + ///Marker type for the `root` field + pub struct root(()); + ///Marker type for the `doc` field + pub struct doc(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DiffBuilder<'a, S: diff_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> Diff<'a> { + /// Create a new builder for this type + pub fn new() -> DiffBuilder<'a, diff_state::Empty> { + DiffBuilder::new() + } +} + +impl<'a> DiffBuilder<'a, diff_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DiffBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DiffBuilder<'a, S> +where + S: diff_state::State, + S::Doc: diff_state::IsUnset, +{ + /// Set the `doc` field (required) + pub fn doc( + mut self, + value: impl Into>, + ) -> DiffBuilder<'a, diff_state::SetDoc> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DiffBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DiffBuilder<'a, S> +where + S: diff_state::State, + S::Root: diff_state::IsUnset, +{ + /// Set the `root` field (required) + pub fn root( + mut self, + value: impl Into>, + ) -> DiffBuilder<'a, diff_state::SetRoot> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DiffBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DiffBuilder<'a, S> +where + S: diff_state::State, + S::Snapshot: diff_state::IsUnset, +{ + /// Set the `snapshot` field (required) + pub fn snapshot( + mut self, + value: impl Into>, + ) -> DiffBuilder<'a, diff_state::SetSnapshot> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + DiffBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DiffBuilder<'a, S> +where + S: diff_state::State, + S::Snapshot: diff_state::IsSet, + S::Root: diff_state::IsSet, + S::Doc: diff_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Diff<'a> { + Diff { + doc: self.__unsafe_private_named.0.unwrap(), + root: self.__unsafe_private_named.1.unwrap(), + snapshot: 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>, + >, + ) -> Diff<'a> { + Diff { + doc: self.__unsafe_private_named.0.unwrap(), + root: self.__unsafe_private_named.1.unwrap(), + snapshot: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Diff<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, DiffRecord>, + 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 DiffGetRecordOutput<'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: Diff<'a>, +} + +impl From> for Diff<'_> { + fn from(output: DiffGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Diff<'_> { + const NSID: &'static str = "sh.weaver.edit.diff"; + type Record = DiffRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct DiffRecord; +impl jacquard_common::xrpc::XrpcResp for DiffRecord { + const NSID: &'static str = "sh.weaver.edit.diff"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DiffGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for DiffRecord { + const NSID: &'static str = "sh.weaver.edit.diff"; + type Record = DiffRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Diff<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.diff" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_diff() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_sh_weaver_edit_diff() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.edit.diff"), + 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( + "An edit record for a notebook.", + ), + ), + 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("snapshot"), + ::jacquard_common::smol_str::SmolStr::new_static("root"), + ::jacquard_common::smol_str::SmolStr::new_static("doc") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("doc"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.edit.defs#docRef", + ), + }), + ); + 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.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "snapshot", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { + description: None, + accept: None, + max_size: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/edit/root.rs b/crates/weaver-api/src/sh_weaver/edit/root.rs new file mode 100644 index 0000000..e9dec52 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit/root.rs @@ -0,0 +1,419 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.root +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// The starting point for edit history on a notebook. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Root<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub doc: crate::sh_weaver::edit::DocRef<'a>, + #[serde(borrow)] + pub snapshot: jacquard_common::types::blob::BlobRef<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod root_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 Cid; + type Uri; + type Doc; + type Snapshot; + } + /// 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 Doc = Unset; + type Snapshot = 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 Doc = S::Doc; + type Snapshot = S::Snapshot; + } + ///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 Doc = S::Doc; + type Snapshot = S::Snapshot; + } + ///State transition - sets the `doc` field to Set + pub struct SetDoc(PhantomData S>); + impl sealed::Sealed for SetDoc {} + impl State for SetDoc { + type Cid = S::Cid; + type Uri = S::Uri; + type Doc = Set; + type Snapshot = S::Snapshot; + } + ///State transition - sets the `snapshot` field to Set + pub struct SetSnapshot(PhantomData S>); + impl sealed::Sealed for SetSnapshot {} + impl State for SetSnapshot { + type Cid = S::Cid; + type Uri = S::Uri; + type Doc = S::Doc; + type Snapshot = 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 `doc` field + pub struct doc(()); + ///Marker type for the `snapshot` field + pub struct snapshot(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RootBuilder<'a, S: root_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> Root<'a> { + /// Create a new builder for this type + pub fn new() -> RootBuilder<'a, root_state::Empty> { + RootBuilder::new() + } +} + +impl<'a> RootBuilder<'a, root_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RootBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RootBuilder<'a, S> +where + S: root_state::State, + S::Cid: root_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> RootBuilder<'a, root_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RootBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RootBuilder<'a, S> +where + S: root_state::State, + S::Doc: root_state::IsUnset, +{ + /// Set the `doc` field (required) + pub fn doc( + mut self, + value: impl Into>, + ) -> RootBuilder<'a, root_state::SetDoc> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RootBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RootBuilder<'a, S> +where + S: root_state::State, + S::Snapshot: root_state::IsUnset, +{ + /// Set the `snapshot` field (required) + pub fn snapshot( + mut self, + value: impl Into>, + ) -> RootBuilder<'a, root_state::SetSnapshot> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RootBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RootBuilder<'a, S> +where + S: root_state::State, + S::Uri: root_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> RootBuilder<'a, root_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + RootBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RootBuilder<'a, S> +where + S: root_state::State, + S::Cid: root_state::IsSet, + S::Uri: root_state::IsSet, + S::Doc: root_state::IsSet, + S::Snapshot: root_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Root<'a> { + Root { + cid: self.__unsafe_private_named.0.unwrap(), + doc: self.__unsafe_private_named.1.unwrap(), + snapshot: self.__unsafe_private_named.2.unwrap(), + uri: 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>, + >, + ) -> Root<'a> { + Root { + cid: self.__unsafe_private_named.0.unwrap(), + doc: self.__unsafe_private_named.1.unwrap(), + snapshot: self.__unsafe_private_named.2.unwrap(), + uri: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Root<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, RootRecord>, + 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 RootGetRecordOutput<'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: Root<'a>, +} + +impl From> for Root<'_> { + fn from(output: RootGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Root<'_> { + const NSID: &'static str = "sh.weaver.edit.root"; + type Record = RootRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct RootRecord; +impl jacquard_common::xrpc::XrpcResp for RootRecord { + const NSID: &'static str = "sh.weaver.edit.root"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RootGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for RootRecord { + const NSID: &'static str = "sh.weaver.edit.root"; + type Record = RootRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Root<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.root" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_root() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_sh_weaver_edit_root() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.edit.root"), + 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( + "The starting point for edit history on a notebook.", + ), + ), + 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("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("doc"), + ::jacquard_common::smol_str::SmolStr::new_static("snapshot") + ], + ), + 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("doc"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.edit.defs#docRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "snapshot", + ), + ::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("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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/embed.rs b/crates/weaver-api/src/sh_weaver/embed.rs new file mode 100644 index 0000000..d831cf2 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/embed.rs @@ -0,0 +1,457 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.embed.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod external; +pub mod images; +pub mod record_with_media; +pub mod records; +pub mod video; + +/// Proportional size of the embed relative to the viewport in larger windows. The dimensions are percentage out of 100. Could we use more granularity? Maybe, but come on. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct PercentSize<'a> { + pub height: i64, + pub width: i64, +} + +pub mod percent_size_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 Width; + type Height; + } + /// 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; + } + ///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 `width` field + pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PercentSizeBuilder<'a, S: percent_size_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PercentSize<'a> { + /// Create a new builder for this type + pub fn new() -> PercentSizeBuilder<'a, percent_size_state::Empty> { + PercentSizeBuilder::new() + } +} + +impl<'a> PercentSizeBuilder<'a, percent_size_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PercentSizeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PercentSizeBuilder<'a, S> +where + S: percent_size_state::State, + S::Height: percent_size_state::IsUnset, +{ + /// Set the `height` field (required) + pub fn height( + mut self, + value: impl Into, + ) -> PercentSizeBuilder<'a, percent_size_state::SetHeight> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PercentSizeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PercentSizeBuilder<'a, S> +where + S: percent_size_state::State, + S::Width: percent_size_state::IsUnset, +{ + /// Set the `width` field (required) + pub fn width( + mut self, + value: impl Into, + ) -> PercentSizeBuilder<'a, percent_size_state::SetWidth> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PercentSizeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PercentSizeBuilder<'a, S> +where + S: percent_size_state::State, + S::Width: percent_size_state::IsSet, + S::Height: percent_size_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PercentSize<'a> { + PercentSize { + height: self.__unsafe_private_named.0.unwrap(), + width: 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>, + >, + ) -> PercentSize<'a> { + PercentSize { + height: self.__unsafe_private_named.0.unwrap(), + width: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_embed_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.embed.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("percentSize"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Proportional size of the embed relative to the viewport in larger windows. The dimensions are percentage out of 100. Could we use more granularity? Maybe, but come on.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("width"), + ::jacquard_common::smol_str::SmolStr::new_static("height") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("height"), + ::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("width"), + ::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("pixelSize"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Pixel-exact embed size. The dimensions are logical pixels, subject to scaling, so 200px at X2 scale is 400px.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("width"), + ::jacquard_common::smol_str::SmolStr::new_static("height") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("height"), + ::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("width"), + ::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 PercentSize<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.defs" + } + fn def_name() -> &'static str { + "percentSize" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Pixel-exact embed size. The dimensions are logical pixels, subject to scaling, so 200px at X2 scale is 400px. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct PixelSize<'a> { + pub height: i64, + pub width: i64, +} + +pub mod pixel_size_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 Width; + type Height; + } + /// 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; + } + ///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 `width` field + pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PixelSizeBuilder<'a, S: pixel_size_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PixelSize<'a> { + /// Create a new builder for this type + pub fn new() -> PixelSizeBuilder<'a, pixel_size_state::Empty> { + PixelSizeBuilder::new() + } +} + +impl<'a> PixelSizeBuilder<'a, pixel_size_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PixelSizeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PixelSizeBuilder<'a, S> +where + S: pixel_size_state::State, + S::Height: pixel_size_state::IsUnset, +{ + /// Set the `height` field (required) + pub fn height( + mut self, + value: impl Into, + ) -> PixelSizeBuilder<'a, pixel_size_state::SetHeight> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PixelSizeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PixelSizeBuilder<'a, S> +where + S: pixel_size_state::State, + S::Width: pixel_size_state::IsUnset, +{ + /// Set the `width` field (required) + pub fn width( + mut self, + value: impl Into, + ) -> PixelSizeBuilder<'a, pixel_size_state::SetWidth> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PixelSizeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PixelSizeBuilder<'a, S> +where + S: pixel_size_state::State, + S::Width: pixel_size_state::IsSet, + S::Height: pixel_size_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PixelSize<'a> { + PixelSize { + height: self.__unsafe_private_named.0.unwrap(), + width: 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>, + >, + ) -> PixelSize<'a> { + PixelSize { + height: self.__unsafe_private_named.0.unwrap(), + width: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PixelSize<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.defs" + } + fn def_name() -> &'static str { + "pixelSize" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_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/embed/external.rs b/crates/weaver-api/src/sh_weaver/embed/external.rs new file mode 100644 index 0000000..25a82d3 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/embed/external.rs @@ -0,0 +1,1024 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.embed.external +// +// 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 ExternalEmbed<'a> { + #[serde(borrow)] + pub description: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub thumb: Option>, + #[serde(borrow)] + pub title: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::Uri<'a>, +} + +pub mod external_embed_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 Title; + type Description; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + type Title = Unset; + 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 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 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 `uri` field + pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `description` field + pub struct description(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ExternalEmbedBuilder<'a, S: external_embed_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> ExternalEmbed<'a> { + /// Create a new builder for this type + pub fn new() -> ExternalEmbedBuilder<'a, external_embed_state::Empty> { + ExternalEmbedBuilder::new() + } +} + +impl<'a> ExternalEmbedBuilder<'a, external_embed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ExternalEmbedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalEmbedBuilder<'a, S> +where + S: external_embed_state::State, + S::Description: external_embed_state::IsUnset, +{ + /// Set the `description` field (required) + pub fn description( + mut self, + value: impl Into>, + ) -> ExternalEmbedBuilder<'a, external_embed_state::SetDescription> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ExternalEmbedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: external_embed_state::State> ExternalEmbedBuilder<'a, S> { + /// Set the `thumb` field (optional) + pub fn thumb( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `thumb` field to an Option value (optional) + pub fn maybe_thumb( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ExternalEmbedBuilder<'a, S> +where + S: external_embed_state::State, + S::Title: external_embed_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into>, + ) -> ExternalEmbedBuilder<'a, external_embed_state::SetTitle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ExternalEmbedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalEmbedBuilder<'a, S> +where + S: external_embed_state::State, + S::Uri: external_embed_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ExternalEmbedBuilder<'a, external_embed_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ExternalEmbedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalEmbedBuilder<'a, S> +where + S: external_embed_state::State, + S::Uri: external_embed_state::IsSet, + S::Title: external_embed_state::IsSet, + S::Description: external_embed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ExternalEmbed<'a> { + ExternalEmbed { + description: self.__unsafe_private_named.0.unwrap(), + thumb: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2.unwrap(), + uri: 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>, + >, + ) -> ExternalEmbed<'a> { + ExternalEmbed { + description: self.__unsafe_private_named.0.unwrap(), + thumb: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2.unwrap(), + uri: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_embed_external() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.embed.external"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("externalEmbed"), + ::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("title"), + ::jacquard_common::smol_str::SmolStr::new_static("description") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::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("thumb"), + ::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("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::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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("embeds")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("embeds"), + ::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( + "#externalEmbed", + ), + }), + min_length: None, + max_length: Some(48usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("view"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("external") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("external"), + ::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( + "#viewExternal", + ), + }), + min_length: None, + max_length: Some(48usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewExternal"), + ::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("title"), + ::jacquard_common::smol_str::SmolStr::new_static("description") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::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("thumb"), + ::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("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::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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ExternalEmbed<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.external" + } + fn def_name() -> &'static str { + "externalEmbed" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_external() + } + 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 External<'a> { + #[serde(borrow)] + pub embeds: Vec>, +} + +pub mod external_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 Embeds; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Embeds = Unset; + } + ///State transition - sets the `embeds` field to Set + pub struct SetEmbeds(PhantomData S>); + impl sealed::Sealed for SetEmbeds {} + impl State for SetEmbeds { + type Embeds = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `embeds` field + pub struct embeds(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ExternalBuilder<'a, S: external_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + Vec>, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> External<'a> { + /// Create a new builder for this type + pub fn new() -> ExternalBuilder<'a, external_state::Empty> { + ExternalBuilder::new() + } +} + +impl<'a> ExternalBuilder<'a, external_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalBuilder<'a, S> +where + S: external_state::State, + S::Embeds: external_state::IsUnset, +{ + /// Set the `embeds` field (required) + pub fn embeds( + mut self, + value: impl Into>>, + ) -> ExternalBuilder<'a, external_state::SetEmbeds> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ExternalBuilder<'a, S> +where + S: external_state::State, + S::Embeds: external_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> External<'a> { + External { + embeds: 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>, + >, + ) -> External<'a> { + External { + embeds: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for External<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.external" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_external() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.embeds; + #[allow(unused_comparisons)] + if value.len() > 48usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "embeds", + ), + max: 48usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct View<'a> { + #[serde(borrow)] + pub external: Vec>, +} + +pub mod 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 External; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type External = Unset; + } + ///State transition - sets the `external` field to Set + pub struct SetExternal(PhantomData S>); + impl sealed::Sealed for SetExternal {} + impl State for SetExternal { + type External = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `external` field + pub struct external(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::External: view_state::IsUnset, +{ + /// Set the `external` field (required) + pub fn external( + mut self, + value: impl Into>>, + ) -> ViewBuilder<'a, view_state::SetExternal> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::External: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + external: 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>, + >, + ) -> View<'a> { + View { + external: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.external" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_external() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.external; + #[allow(unused_comparisons)] + if value.len() > 48usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "external", + ), + max: 48usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ViewExternal<'a> { + #[serde(borrow)] + pub description: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub thumb: Option>, + #[serde(borrow)] + pub title: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::Uri<'a>, +} + +pub mod view_external_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 Title; + type Description; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + type Title = Unset; + 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 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 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 `uri` field + pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `description` field + pub struct description(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewExternalBuilder<'a, S: view_external_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> ViewExternal<'a> { + /// Create a new builder for this type + pub fn new() -> ViewExternalBuilder<'a, view_external_state::Empty> { + ViewExternalBuilder::new() + } +} + +impl<'a> ViewExternalBuilder<'a, view_external_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewExternalBuilder<'a, S> +where + S: view_external_state::State, + S::Description: view_external_state::IsUnset, +{ + /// Set the `description` field (required) + pub fn description( + mut self, + value: impl Into>, + ) -> ViewExternalBuilder<'a, view_external_state::SetDescription> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_external_state::State> ViewExternalBuilder<'a, S> { + /// Set the `thumb` field (optional) + pub fn thumb( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `thumb` field to an Option value (optional) + pub fn maybe_thumb( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ViewExternalBuilder<'a, S> +where + S: view_external_state::State, + S::Title: view_external_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into>, + ) -> ViewExternalBuilder<'a, view_external_state::SetTitle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ViewExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewExternalBuilder<'a, S> +where + S: view_external_state::State, + S::Uri: view_external_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewExternalBuilder<'a, view_external_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ViewExternalBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewExternalBuilder<'a, S> +where + S: view_external_state::State, + 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> { + ViewExternal { + description: self.__unsafe_private_named.0.unwrap(), + thumb: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2.unwrap(), + uri: 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>, + >, + ) -> ViewExternal<'a> { + ViewExternal { + description: self.__unsafe_private_named.0.unwrap(), + thumb: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2.unwrap(), + uri: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewExternal<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.external" + } + fn def_name() -> &'static str { + "viewExternal" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_external() + } + 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/embed/images.rs b/crates/weaver-api/src/sh_weaver/embed/images.rs new file mode 100644 index 0000000..0caf799 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/embed/images.rs @@ -0,0 +1,1158 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.embed.images +// +// 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 Image<'a> { + /// alt text description of the image + #[serde(borrow)] + pub alt: jacquard_common::CowStr<'a>, + /// Blurhash string for the image, used for low-resolution placeholders. This must be a valid Blurhash string. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub blurhash: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub dimensions: Option>, + #[serde(borrow)] + pub image: jacquard_common::types::blob::BlobRef<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub name: Option>, +} + +pub mod image_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 Image; + type Alt; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ImageBuilder<'a, S: image_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> Image<'a> { + /// Create a new builder for this type + pub fn new() -> ImageBuilder<'a, image_state::Empty> { + ImageBuilder::new() + } +} + +impl<'a> ImageBuilder<'a, image_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImageBuilder<'a, S> +where + S: image_state::State, + S::Alt: image_state::IsUnset, +{ + /// Set the `alt` field (required) + pub fn alt( + mut self, + value: impl Into>, + ) -> ImageBuilder<'a, image_state::SetAlt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: image_state::State> ImageBuilder<'a, S> { + /// Set the `blurhash` field (optional) + pub fn blurhash( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `blurhash` field to an Option value (optional) + pub fn maybe_blurhash(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: image_state::State> ImageBuilder<'a, S> { + /// Set the `dimensions` field (optional) + pub fn dimensions(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `dimensions` field to an Option value (optional) + pub fn maybe_dimensions(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ImageBuilder<'a, S> +where + S: image_state::State, + S::Image: image_state::IsUnset, +{ + /// Set the `image` field (required) + pub fn image( + mut self, + value: impl Into>, + ) -> ImageBuilder<'a, image_state::SetImage> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: image_state::State> ImageBuilder<'a, S> { + /// Set the `name` field (optional) + pub fn name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `name` field to an Option value (optional) + pub fn maybe_name(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ImageBuilder<'a, S> +where + S: image_state::State, + S::Image: image_state::IsSet, + S::Alt: image_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Image<'a> { + Image { + alt: self.__unsafe_private_named.0.unwrap(), + blurhash: self.__unsafe_private_named.1, + dimensions: self.__unsafe_private_named.2, + image: self.__unsafe_private_named.3.unwrap(), + name: self.__unsafe_private_named.4, + 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>, + >, + ) -> Image<'a> { + Image { + alt: self.__unsafe_private_named.0.unwrap(), + blurhash: self.__unsafe_private_named.1, + dimensions: self.__unsafe_private_named.2, + image: self.__unsafe_private_named.3.unwrap(), + name: self.__unsafe_private_named.4, + 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 ImageDimensions<'a> { + #[serde(rename = "app.bsky.embed.defs#aspectRatio")] + AspectRatio(Box>), + #[serde(rename = "sh.weaver.embed.defs#percentSize")] + PercentSize(Box>), + #[serde(rename = "sh.weaver.embed.defs#pixelSize")] + PixelSize(Box>), +} + +fn lexicon_doc_sh_weaver_embed_images() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.embed.images"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("image"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("image"), + ::jacquard_common::smol_str::SmolStr::new_static("alt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("alt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "alt text description of the image", + ), + ), + 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("blurhash"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Blurhash string for the image, used for low-resolution placeholders. This must be a valid Blurhash string.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(32usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "dimensions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.defs#aspectRatio"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.defs#percentSize"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.defs#pixelSize") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("image"), + ::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("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(128usize), + 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("main"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("images")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("images"), + ::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("#image"), + }), + min_length: None, + max_length: Some(48usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("view"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("images")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("images"), + ::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("#viewImage"), + }), + min_length: None, + max_length: Some(48usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewImage"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("thumb"), + ::jacquard_common::smol_str::SmolStr::new_static("fullsize"), + ::jacquard_common::smol_str::SmolStr::new_static("alt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("alt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Alt text description of the image, for accessibility.", + ), + ), + 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( + "dimensions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.defs#aspectRatio"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.defs#percentSize"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.defs#pixelSize") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("fullsize"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.", + ), + ), + 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("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(128usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("thumb"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.", + ), + ), + 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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Image<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.images" + } + fn def_name() -> &'static str { + "image" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_images() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.blurhash { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 32usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "blurhash", + ), + max: 32usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.name { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Images<'a> { + #[serde(borrow)] + pub images: Vec>, +} + +pub mod images_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 Images; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Images = Unset; + } + ///State transition - sets the `images` field to Set + pub struct SetImages(PhantomData S>); + impl sealed::Sealed for SetImages {} + impl State for SetImages { + type Images = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `images` field + pub struct images(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ImagesBuilder<'a, S: images_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Images<'a> { + /// Create a new builder for this type + pub fn new() -> ImagesBuilder<'a, images_state::Empty> { + ImagesBuilder::new() + } +} + +impl<'a> ImagesBuilder<'a, images_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ImagesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImagesBuilder<'a, S> +where + S: images_state::State, + S::Images: images_state::IsUnset, +{ + /// Set the `images` field (required) + pub fn images( + mut self, + value: impl Into>>, + ) -> ImagesBuilder<'a, images_state::SetImages> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ImagesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImagesBuilder<'a, S> +where + S: images_state::State, + S::Images: images_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Images<'a> { + Images { + images: 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>, + >, + ) -> Images<'a> { + Images { + images: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Images<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.images" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_images() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.images; + #[allow(unused_comparisons)] + if value.len() > 48usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "images", + ), + max: 48usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct View<'a> { + #[serde(borrow)] + pub images: Vec>, +} + +pub mod 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 Images; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Images = Unset; + } + ///State transition - sets the `images` field to Set + pub struct SetImages(PhantomData S>); + impl sealed::Sealed for SetImages {} + impl State for SetImages { + type Images = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `images` field + pub struct images(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Images: view_state::IsUnset, +{ + /// Set the `images` field (required) + pub fn images( + mut self, + value: impl Into>>, + ) -> ViewBuilder<'a, view_state::SetImages> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Images: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + images: 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>, + >, + ) -> View<'a> { + View { + images: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.images" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_images() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.images; + #[allow(unused_comparisons)] + if value.len() > 48usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "images", + ), + max: 48usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ViewImage<'a> { + /// Alt text description of the image, for accessibility. + #[serde(borrow)] + pub alt: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub dimensions: Option>, + /// Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. + #[serde(borrow)] + pub fullsize: jacquard_common::types::string::Uri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub name: Option>, + /// Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. + #[serde(borrow)] + pub thumb: jacquard_common::types::string::Uri<'a>, +} + +pub mod view_image_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 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 Thumb = Unset; + type Fullsize = Unset; + type Alt = Unset; + } + ///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 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 Thumb = S::Thumb; + 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 Alt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewImageBuilder<'a, S: view_image_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> ViewImage<'a> { + /// Create a new builder for this type + pub fn new() -> ViewImageBuilder<'a, view_image_state::Empty> { + ViewImageBuilder::new() + } +} + +impl<'a> ViewImageBuilder<'a, view_image_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewImageBuilder<'a, S> +where + S: view_image_state::State, + S::Alt: view_image_state::IsUnset, +{ + /// Set the `alt` field (required) + pub fn alt( + mut self, + value: impl Into>, + ) -> ViewImageBuilder<'a, view_image_state::SetAlt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_image_state::State> ViewImageBuilder<'a, S> { + /// Set the `dimensions` field (optional) + pub fn dimensions( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `dimensions` field to an Option value (optional) + pub fn maybe_dimensions(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ViewImageBuilder<'a, S> +where + S: view_image_state::State, + S::Fullsize: view_image_state::IsUnset, +{ + /// Set the `fullsize` field (required) + pub fn fullsize( + mut self, + value: impl Into>, + ) -> ViewImageBuilder<'a, view_image_state::SetFullsize> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ViewImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_image_state::State> ViewImageBuilder<'a, S> { + /// Set the `name` field (optional) + pub fn name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `name` field to an Option value (optional) + pub fn maybe_name(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> ViewImageBuilder<'a, S> +where + S: view_image_state::State, + S::Thumb: view_image_state::IsUnset, +{ + /// Set the `thumb` field (required) + pub fn thumb( + mut self, + value: impl Into>, + ) -> ViewImageBuilder<'a, view_image_state::SetThumb> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ViewImageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewImageBuilder<'a, S> +where + S: view_image_state::State, + 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> { + ViewImage { + alt: self.__unsafe_private_named.0.unwrap(), + dimensions: self.__unsafe_private_named.1, + fullsize: self.__unsafe_private_named.2.unwrap(), + name: self.__unsafe_private_named.3, + thumb: 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>, + >, + ) -> ViewImage<'a> { + ViewImage { + alt: self.__unsafe_private_named.0.unwrap(), + dimensions: self.__unsafe_private_named.1, + fullsize: self.__unsafe_private_named.2.unwrap(), + name: self.__unsafe_private_named.3, + thumb: self.__unsafe_private_named.4.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 ViewImageDimensions<'a> { + #[serde(rename = "app.bsky.embed.defs#aspectRatio")] + AspectRatio(Box>), + #[serde(rename = "sh.weaver.embed.defs#percentSize")] + PercentSize(Box>), + #[serde(rename = "sh.weaver.embed.defs#pixelSize")] + PixelSize(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewImage<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.images" + } + fn def_name() -> &'static str { + "viewImage" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_images() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.name { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} \ No newline at end of file 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 new file mode 100644 index 0000000..48e7e4d --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs @@ -0,0 +1,551 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.embed.recordWithMedia +// +// 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 RecordWithMedia<'a> { + #[serde(borrow)] + pub media: RecordWithMediaMedia<'a>, + #[serde(borrow)] + pub record: RecordWithMediaRecord<'a>, +} + +pub mod record_with_media_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 Record; + type Media; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = Unset; + 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 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 `record` field + pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordWithMediaBuilder<'a, S: record_with_media_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RecordWithMedia<'a> { + /// Create a new builder for this type + pub fn new() -> RecordWithMediaBuilder<'a, record_with_media_state::Empty> { + RecordWithMediaBuilder::new() + } +} + +impl<'a> RecordWithMediaBuilder<'a, record_with_media_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordWithMediaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordWithMediaBuilder<'a, S> +where + S: record_with_media_state::State, + S::Media: record_with_media_state::IsUnset, +{ + /// Set the `media` field (required) + pub fn media( + mut self, + value: impl Into>, + ) -> RecordWithMediaBuilder<'a, record_with_media_state::SetMedia> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordWithMediaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordWithMediaBuilder<'a, S> +where + S: record_with_media_state::State, + S::Record: record_with_media_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> RecordWithMediaBuilder<'a, record_with_media_state::SetRecord> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RecordWithMediaBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordWithMediaBuilder<'a, S> +where + S: record_with_media_state::State, + S::Record: record_with_media_state::IsSet, + S::Media: record_with_media_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RecordWithMedia<'a> { + RecordWithMedia { + media: self.__unsafe_private_named.0.unwrap(), + record: 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>, + >, + ) -> RecordWithMedia<'a> { + RecordWithMedia { + media: self.__unsafe_private_named.0.unwrap(), + record: self.__unsafe_private_named.1.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 RecordWithMediaMedia<'a> { + #[serde(rename = "sh.weaver.embed.images")] + Images(Box>), + #[serde(rename = "sh.weaver.embed.external")] + External(Box>), + #[serde(rename = "sh.weaver.embed.video")] + Video(Box>), + #[serde(rename = "app.bsky.embed.images")] + BskyImages(Box>), + #[serde(rename = "app.bsky.embed.video")] + BskyVideo(Box>), + #[serde(rename = "app.bsky.embed.external")] + BskyExternal(Box>), +} + +#[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 RecordWithMediaRecord<'a> { + #[serde(rename = "app.bsky.embed.record")] + Record(Box>), + #[serde(rename = "sh.weaver.embed.records")] + Records(Box>), +} + +fn lexicon_doc_sh_weaver_embed_recordWithMedia() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.embed.recordWithMedia"), + 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::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("media") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("media"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("sh.weaver.embed.images"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.external"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.video"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.images"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.video"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.external") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.record"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.records") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("view"), + ::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("media") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("media"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("sh.weaver.embed.images#view"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.external#view"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.video#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.images#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.video#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("sh.weaver.embed.records#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.record#view") + ], + closed: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordWithMedia<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.recordWithMedia" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_recordWithMedia() + } + 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 View<'a> { + #[serde(borrow)] + pub media: ViewMedia<'a>, + #[serde(borrow)] + pub record: ViewRecord<'a>, +} + +pub mod 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 Record; + type Media; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = Unset; + 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 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 `record` field + pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Media: view_state::IsUnset, +{ + /// Set the `media` field (required) + pub fn media( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetMedia> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Record: view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetRecord> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Record: view_state::IsSet, + S::Media: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + media: self.__unsafe_private_named.0.unwrap(), + record: 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>, + >, + ) -> View<'a> { + View { + media: self.__unsafe_private_named.0.unwrap(), + record: self.__unsafe_private_named.1.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 ViewMedia<'a> { + #[serde(rename = "sh.weaver.embed.images#view")] + ImagesView(Box>), + #[serde(rename = "sh.weaver.embed.external#view")] + ExternalView(Box>), + #[serde(rename = "sh.weaver.embed.video#view")] + VideoView(Box>), + #[serde(rename = "app.bsky.embed.images#view")] + BskyImagesView(Box>), + #[serde(rename = "app.bsky.embed.video#view")] + BskyVideoView(Box>), + #[serde(rename = "app.bsky.embed.external#view")] + BskyExternalView(Box>), +} + +#[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 ViewRecord<'a> { + #[serde(rename = "sh.weaver.embed.records#view")] + RecordsView(Box>), + #[serde(rename = "app.bsky.embed.record#view")] + RecordView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.recordWithMedia" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_recordWithMedia() + } + 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/embed/records.rs b/crates/weaver-api/src/sh_weaver/embed/records.rs new file mode 100644 index 0000000..d94e722 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/embed/records.rs @@ -0,0 +1,2171 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.embed.records +// +// 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 Records<'a> { + #[serde(borrow)] + pub records: Vec>, +} + +pub mod records_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 Records; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Records = Unset; + } + ///State transition - sets the `records` field to Set + pub struct SetRecords(PhantomData S>); + impl sealed::Sealed for SetRecords {} + impl State for SetRecords { + type Records = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `records` field + pub struct records(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordsBuilder<'a, S: records_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Records<'a> { + /// Create a new builder for this type + pub fn new() -> RecordsBuilder<'a, records_state::Empty> { + RecordsBuilder::new() + } +} + +impl<'a> RecordsBuilder<'a, records_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordsBuilder<'a, S> +where + S: records_state::State, + S::Records: records_state::IsUnset, +{ + /// Set the `records` field (required) + pub fn records( + mut self, + value: impl Into>>, + ) -> RecordsBuilder<'a, records_state::SetRecords> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordsBuilder<'a, S> +where + S: records_state::State, + S::Records: records_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Records<'a> { + Records { + records: 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>, + >, + ) -> Records<'a> { + Records { + records: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_embed_records() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.embed.records"), + 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::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("records")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("records"), + ::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("#recordEmbed"), + }), + min_length: None, + max_length: Some(48usize), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("recordEmbed"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("record")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(128usize), + 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::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("recordEmbedView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("recordView") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(128usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "recordView", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.embed.images#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.video#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.record#view"), + ::jacquard_common::CowStr::new_static("app.bsky.embed.recordWithMedia#view"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.records#view"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.images#view"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.recordWithMedia#view"), + ::jacquard_common::CowStr::new_static("sh.weaver.embed.video#view") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("view"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("record")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#viewRecord"), + ::jacquard_common::CowStr::new_static("#viewNotFound"), + ::jacquard_common::CowStr::new_static("#viewBlocked"), + ::jacquard_common::CowStr::new_static("#viewDetached"), + ::jacquard_common::CowStr::new_static("app.bsky.feed.defs#generatorView"), + ::jacquard_common::CowStr::new_static("app.bsky.graph.defs#listView"), + ::jacquard_common::CowStr::new_static("app.bsky.labeler.defs#labelerView"), + ::jacquard_common::CowStr::new_static("app.bsky.graph.defs#starterPackViewBasic") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewBlocked"), + ::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("blocked"), + ::jacquard_common::smol_str::SmolStr::new_static("author") + ], + ), + 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( + "app.bsky.feed.defs#blockedAuthor", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blocked"), + ::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("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("viewDetached"), + ::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("detached") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("detached"), + ::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("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("viewNotFound"), + ::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("notFound") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notFound"), + ::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("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("viewRecord"), + ::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("author"), + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::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#profileDataViewBasic", + ), + }), + ); + 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("embeds"), + ::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( + "#recordEmbedView", + ), + }), + min_length: None, + max_length: 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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: 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( + "quoteCount", + ), + ::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( + "replyCount", + ), + ::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( + "repostCount", + ), + ::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, + ), + 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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Records<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.records" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_records() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.records; + #[allow(unused_comparisons)] + if value.len() > 48usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "records", + ), + max: 48usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RecordEmbed<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub name: Option>, + #[serde(borrow)] + pub record: crate::com_atproto::repo::strong_ref::StrongRef<'a>, +} + +pub mod record_embed_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 Record; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `record` field + pub struct record(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordEmbedBuilder<'a, S: record_embed_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RecordEmbed<'a> { + /// Create a new builder for this type + pub fn new() -> RecordEmbedBuilder<'a, record_embed_state::Empty> { + RecordEmbedBuilder::new() + } +} + +impl<'a> RecordEmbedBuilder<'a, record_embed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordEmbedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: record_embed_state::State> RecordEmbedBuilder<'a, S> { + /// Set the `name` field (optional) + pub fn name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `name` field to an Option value (optional) + pub fn maybe_name(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> RecordEmbedBuilder<'a, S> +where + S: record_embed_state::State, + S::Record: record_embed_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> RecordEmbedBuilder<'a, record_embed_state::SetRecord> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RecordEmbedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordEmbedBuilder<'a, S> +where + S: record_embed_state::State, + S::Record: record_embed_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RecordEmbed<'a> { + RecordEmbed { + name: self.__unsafe_private_named.0, + record: 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>, + >, + ) -> RecordEmbed<'a> { + RecordEmbed { + name: self.__unsafe_private_named.0, + record: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordEmbed<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.records" + } + fn def_name() -> &'static str { + "recordEmbed" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_records() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.name { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RecordEmbedView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub name: Option>, + #[serde(borrow)] + pub record_view: RecordEmbedViewRecordView<'a>, +} + +pub mod record_embed_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 RecordView; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type RecordView = Unset; + } + ///State transition - sets the `record_view` field to Set + pub struct SetRecordView(PhantomData S>); + impl sealed::Sealed for SetRecordView {} + impl State for SetRecordView { + type RecordView = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `record_view` field + pub struct record_view(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordEmbedViewBuilder<'a, S: record_embed_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RecordEmbedView<'a> { + /// Create a new builder for this type + pub fn new() -> RecordEmbedViewBuilder<'a, record_embed_view_state::Empty> { + RecordEmbedViewBuilder::new() + } +} + +impl<'a> RecordEmbedViewBuilder<'a, record_embed_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordEmbedViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: record_embed_view_state::State> RecordEmbedViewBuilder<'a, S> { + /// Set the `name` field (optional) + pub fn name( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `name` field to an Option value (optional) + pub fn maybe_name(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> RecordEmbedViewBuilder<'a, S> +where + S: record_embed_view_state::State, + S::RecordView: record_embed_view_state::IsUnset, +{ + /// Set the `recordView` field (required) + pub fn record_view( + mut self, + value: impl Into>, + ) -> RecordEmbedViewBuilder<'a, record_embed_view_state::SetRecordView> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RecordEmbedViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordEmbedViewBuilder<'a, S> +where + S: record_embed_view_state::State, + S::RecordView: record_embed_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RecordEmbedView<'a> { + RecordEmbedView { + name: self.__unsafe_private_named.0, + record_view: 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>, + >, + ) -> RecordEmbedView<'a> { + RecordEmbedView { + name: self.__unsafe_private_named.0, + record_view: self.__unsafe_private_named.1.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 RecordEmbedViewRecordView<'a> { + #[serde(rename = "app.bsky.embed.images#view")] + BskyImagesView(Box>), + #[serde(rename = "app.bsky.embed.video#view")] + BskyVideoView(Box>), + #[serde(rename = "app.bsky.embed.external#view")] + ExternalView(Box>), + #[serde(rename = "app.bsky.embed.record#view")] + RecordView(Box>), + #[serde(rename = "app.bsky.embed.recordWithMedia#view")] + BskyRecordWithMediaView(Box>), + #[serde(rename = "sh.weaver.embed.records#view")] + View(Box>), + #[serde(rename = "sh.weaver.embed.images#view")] + ImagesView(Box>), + #[serde(rename = "sh.weaver.embed.recordWithMedia#view")] + RecordWithMediaView(Box>), + #[serde(rename = "sh.weaver.embed.video#view")] + VideoView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordEmbedView<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.records" + } + fn def_name() -> &'static str { + "recordEmbedView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_records() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.name { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct View<'a> { + #[serde(borrow)] + pub record: ViewUnionRecord<'a>, +} + +pub mod 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 Record; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `record` field + pub struct record(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Record: view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetRecord> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Record: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + record: 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>, + >, + ) -> View<'a> { + View { + record: self.__unsafe_private_named.0.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 ViewUnionRecord<'a> { + #[serde(rename = "sh.weaver.embed.records#viewRecord")] + ViewRecord(Box>), + #[serde(rename = "sh.weaver.embed.records#viewNotFound")] + ViewNotFound(Box>), + #[serde(rename = "sh.weaver.embed.records#viewBlocked")] + ViewBlocked(Box>), + #[serde(rename = "sh.weaver.embed.records#viewDetached")] + ViewDetached(Box>), + #[serde(rename = "app.bsky.feed.defs#generatorView")] + GeneratorView(Box>), + #[serde(rename = "app.bsky.graph.defs#listView")] + ListView(Box>), + #[serde(rename = "app.bsky.labeler.defs#labelerView")] + LabelerView(Box>), + #[serde(rename = "app.bsky.graph.defs#starterPackViewBasic")] + StarterPackViewBasic(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.records" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_records() + } + 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 ViewBlocked<'a> { + #[serde(borrow)] + pub author: crate::app_bsky::feed::BlockedAuthor<'a>, + pub blocked: bool, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod view_blocked_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 Blocked; + type Author; + } + /// 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; + } + ///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; + } + ///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 `uri` field + pub struct uri(()); + ///Marker type for the `blocked` field + pub struct blocked(()); + ///Marker type for the `author` field + pub struct author(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBlockedBuilder<'a, S: view_blocked_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> ViewBlocked<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBlockedBuilder<'a, view_blocked_state::Empty> { + ViewBlockedBuilder::new() + } +} + +impl<'a> ViewBlockedBuilder<'a, view_blocked_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBlockedBuilder<'a, S> +where + S: view_blocked_state::State, + S::Author: view_blocked_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> ViewBlockedBuilder<'a, view_blocked_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBlockedBuilder<'a, S> +where + S: view_blocked_state::State, + S::Blocked: view_blocked_state::IsUnset, +{ + /// Set the `blocked` field (required) + pub fn blocked( + mut self, + value: impl Into, + ) -> ViewBlockedBuilder<'a, view_blocked_state::SetBlocked> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBlockedBuilder<'a, S> +where + S: view_blocked_state::State, + S::Uri: view_blocked_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewBlockedBuilder<'a, view_blocked_state::SetUri> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ViewBlockedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBlockedBuilder<'a, S> +where + S: view_blocked_state::State, + 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> { + ViewBlocked { + author: self.__unsafe_private_named.0.unwrap(), + blocked: 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>, + >, + ) -> ViewBlocked<'a> { + ViewBlocked { + author: self.__unsafe_private_named.0.unwrap(), + blocked: 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 ViewBlocked<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.records" + } + fn def_name() -> &'static str { + "viewBlocked" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_records() + } + 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 ViewDetached<'a> { + pub detached: bool, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod view_detached_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 Detached; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewDetachedBuilder<'a, S: view_detached_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ViewDetached<'a> { + /// Create a new builder for this type + pub fn new() -> ViewDetachedBuilder<'a, view_detached_state::Empty> { + ViewDetachedBuilder::new() + } +} + +impl<'a> ViewDetachedBuilder<'a, view_detached_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewDetachedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewDetachedBuilder<'a, S> +where + S: view_detached_state::State, + S::Detached: view_detached_state::IsUnset, +{ + /// Set the `detached` field (required) + pub fn detached( + mut self, + value: impl Into, + ) -> ViewDetachedBuilder<'a, view_detached_state::SetDetached> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewDetachedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewDetachedBuilder<'a, S> +where + S: view_detached_state::State, + S::Uri: view_detached_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewDetachedBuilder<'a, view_detached_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewDetachedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewDetachedBuilder<'a, S> +where + S: view_detached_state::State, + S::Uri: view_detached_state::IsSet, + S::Detached: view_detached_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ViewDetached<'a> { + ViewDetached { + detached: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> ViewDetached<'a> { + ViewDetached { + detached: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewDetached<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.records" + } + fn def_name() -> &'static str { + "viewDetached" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_records() + } + 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 ViewNotFound<'a> { + pub not_found: bool, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod view_not_found_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 NotFound; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + 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 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 `uri` field + pub struct uri(()); + ///Marker type for the `not_found` field + pub struct not_found(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewNotFoundBuilder<'a, S: view_not_found_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ViewNotFound<'a> { + /// Create a new builder for this type + pub fn new() -> ViewNotFoundBuilder<'a, view_not_found_state::Empty> { + ViewNotFoundBuilder::new() + } +} + +impl<'a> ViewNotFoundBuilder<'a, view_not_found_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewNotFoundBuilder<'a, S> +where + S: view_not_found_state::State, + S::NotFound: view_not_found_state::IsUnset, +{ + /// Set the `notFound` field (required) + pub fn not_found( + mut self, + value: impl Into, + ) -> ViewNotFoundBuilder<'a, view_not_found_state::SetNotFound> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewNotFoundBuilder<'a, S> +where + S: view_not_found_state::State, + S::Uri: view_not_found_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewNotFoundBuilder<'a, view_not_found_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewNotFoundBuilder<'a, S> +where + S: view_not_found_state::State, + S::Uri: view_not_found_state::IsSet, + S::NotFound: view_not_found_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ViewNotFound<'a> { + ViewNotFound { + not_found: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> ViewNotFound<'a> { + ViewNotFound { + not_found: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewNotFound<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.records" + } + fn def_name() -> &'static str { + "viewNotFound" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_records() + } + 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 ViewRecord<'a> { + #[serde(borrow)] + pub author: crate::sh_weaver::actor::ProfileDataViewBasic<'a>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embeds: Option>>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub like_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub quote_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reply_count: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub repost_count: Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + /// The record data itself. + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod view_record_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 Cid; + type Author; + type Value; + 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 Cid = Unset; + type Author = Unset; + type Value = 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; + type Cid = S::Cid; + type Author = S::Author; + type Value = S::Value; + 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 Cid = Set; + type Author = S::Author; + type Value = S::Value; + type IndexedAt = S::IndexedAt; + } + ///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 Cid = S::Cid; + type Author = Set; + type Value = S::Value; + type IndexedAt = S::IndexedAt; + } + ///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 Author = S::Author; + type Value = 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 Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + type Value = S::Value; + 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 `cid` field + pub struct cid(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `value` field + pub struct value(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewRecordBuilder<'a, S: view_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::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, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ViewRecord<'a> { + /// Create a new builder for this type + pub fn new() -> ViewRecordBuilder<'a, view_record_state::Empty> { + ViewRecordBuilder::new() + } +} + +impl<'a> ViewRecordBuilder<'a, view_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewRecordBuilder { + _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> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Author: view_record_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> ViewRecordBuilder<'a, view_record_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Cid: view_record_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> ViewRecordBuilder<'a, view_record_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `embeds` field (optional) + pub fn embeds( + mut self, + value: impl Into< + Option>>, + >, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::IndexedAt: view_record_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> ViewRecordBuilder<'a, view_record_state::SetIndexedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'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: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `quoteCount` field (optional) + pub fn quote_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `quoteCount` field to an Option value (optional) + pub fn maybe_quote_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `replyCount` field (optional) + pub fn reply_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `replyCount` field to an Option value (optional) + pub fn maybe_reply_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: view_record_state::State> ViewRecordBuilder<'a, S> { + /// Set the `repostCount` field (optional) + pub fn repost_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `repostCount` field to an Option value (optional) + pub fn maybe_repost_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Uri: view_record_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewRecordBuilder<'a, view_record_state::SetUri> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Value: view_record_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> ViewRecordBuilder<'a, view_record_state::SetValue> { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + ViewRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewRecordBuilder<'a, S> +where + S: view_record_state::State, + S::Uri: view_record_state::IsSet, + S::Cid: view_record_state::IsSet, + S::Author: view_record_state::IsSet, + S::Value: view_record_state::IsSet, + S::IndexedAt: view_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ViewRecord<'a> { + ViewRecord { + author: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + embeds: self.__unsafe_private_named.2, + indexed_at: self.__unsafe_private_named.3.unwrap(), + labels: self.__unsafe_private_named.4, + like_count: self.__unsafe_private_named.5, + quote_count: self.__unsafe_private_named.6, + reply_count: self.__unsafe_private_named.7, + repost_count: self.__unsafe_private_named.8, + uri: self.__unsafe_private_named.9.unwrap(), + value: self.__unsafe_private_named.10.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>, + >, + ) -> ViewRecord<'a> { + ViewRecord { + author: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + embeds: self.__unsafe_private_named.2, + indexed_at: self.__unsafe_private_named.3.unwrap(), + labels: self.__unsafe_private_named.4, + like_count: self.__unsafe_private_named.5, + quote_count: self.__unsafe_private_named.6, + reply_count: self.__unsafe_private_named.7, + repost_count: self.__unsafe_private_named.8, + uri: self.__unsafe_private_named.9.unwrap(), + value: self.__unsafe_private_named.10.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewRecord<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.records" + } + fn def_name() -> &'static str { + "viewRecord" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_records() + } + 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/embed/video.rs b/crates/weaver-api/src/sh_weaver/embed/video.rs new file mode 100644 index 0000000..76f0919 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/embed/video.rs @@ -0,0 +1,1090 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.embed.video +// +// 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 Caption<'a> { + #[serde(borrow)] + pub file: jacquard_common::types::blob::BlobRef<'a>, + pub lang: jacquard_common::types::string::Language, +} + +pub mod caption_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 Lang; + type File; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Lang = Unset; + 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 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 `lang` field + pub struct lang(()); + ///Marker type for the `file` field + pub struct file(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CaptionBuilder<'a, S: caption_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Caption<'a> { + /// Create a new builder for this type + pub fn new() -> CaptionBuilder<'a, caption_state::Empty> { + CaptionBuilder::new() + } +} + +impl<'a> CaptionBuilder<'a, caption_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CaptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptionBuilder<'a, S> +where + S: caption_state::State, + S::File: caption_state::IsUnset, +{ + /// Set the `file` field (required) + pub fn file( + mut self, + value: impl Into>, + ) -> CaptionBuilder<'a, caption_state::SetFile> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CaptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptionBuilder<'a, S> +where + S: caption_state::State, + S::Lang: caption_state::IsUnset, +{ + /// Set the `lang` field (required) + pub fn lang( + mut self, + value: impl Into, + ) -> CaptionBuilder<'a, caption_state::SetLang> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CaptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptionBuilder<'a, S> +where + S: caption_state::State, + S::Lang: caption_state::IsSet, + S::File: caption_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Caption<'a> { + Caption { + file: self.__unsafe_private_named.0.unwrap(), + lang: 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>, + >, + ) -> Caption<'a> { + Caption { + file: self.__unsafe_private_named.0.unwrap(), + lang: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_embed_video() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.embed.video"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("caption"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("lang"), + ::jacquard_common::smol_str::SmolStr::new_static("file") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("file"), + ::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("lang"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Language, + ), + 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("main"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("videos")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("videos"), + ::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("#video"), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("video"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("video")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("alt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Alt text description of the video, for accessibility.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(10000usize), + min_graphemes: None, + max_graphemes: Some(1000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "aspectRatio", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.embed.defs#aspectRatio", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("captions"), + ::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("#caption"), + }), + min_length: None, + max_length: Some(20usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("video"), + ::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("view"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("playlist") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("alt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(10000usize), + min_graphemes: None, + max_graphemes: Some(1000usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "aspectRatio", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.embed.defs#aspectRatio", + ), + }), + ); + 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("playlist"), + ::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( + "thumbnail", + ), + ::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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Caption<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.video" + } + fn def_name() -> &'static str { + "caption" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_video() + } + 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 VideoRecord<'a> { + #[serde(borrow)] + pub videos: Vec>, +} + +pub mod video_record_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 Videos; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Videos = Unset; + } + ///State transition - sets the `videos` field to Set + pub struct SetVideos(PhantomData S>); + impl sealed::Sealed for SetVideos {} + impl State for SetVideos { + type Videos = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `videos` field + pub struct videos(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VideoRecordBuilder<'a, S: video_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> VideoRecord<'a> { + /// Create a new builder for this type + pub fn new() -> VideoRecordBuilder<'a, video_record_state::Empty> { + VideoRecordBuilder::new() + } +} + +impl<'a> VideoRecordBuilder<'a, video_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VideoRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VideoRecordBuilder<'a, S> +where + S: video_record_state::State, + S::Videos: video_record_state::IsUnset, +{ + /// Set the `videos` field (required) + pub fn videos( + mut self, + value: impl Into>>, + ) -> VideoRecordBuilder<'a, video_record_state::SetVideos> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + VideoRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VideoRecordBuilder<'a, S> +where + S: video_record_state::State, + S::Videos: video_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> VideoRecord<'a> { + VideoRecord { + videos: 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>, + >, + ) -> VideoRecord<'a> { + VideoRecord { + videos: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for VideoRecord<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.video" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_video() + } + 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 Video<'a> { + /// Alt text description of the video, for accessibility. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub alt: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub aspect_ratio: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub captions: Option>>, + /// The mp4 video file. May be up to 100mb, formerly limited to 50mb. + #[serde(borrow)] + pub video: jacquard_common::types::blob::BlobRef<'a>, +} + +pub mod video_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 Video; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Video = Unset; + } + ///State transition - sets the `video` field to Set + pub struct SetVideo(PhantomData S>); + impl sealed::Sealed for SetVideo {} + impl State for SetVideo { + type Video = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `video` field + pub struct video(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VideoBuilder<'a, S: video_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> Video<'a> { + /// Create a new builder for this type + pub fn new() -> VideoBuilder<'a, video_state::Empty> { + VideoBuilder::new() + } +} + +impl<'a> VideoBuilder<'a, video_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VideoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: video_state::State> VideoBuilder<'a, S> { + /// Set the `alt` field (optional) + pub fn alt(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `alt` field to an Option value (optional) + pub fn maybe_alt(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: video_state::State> VideoBuilder<'a, S> { + /// Set the `aspectRatio` field (optional) + pub fn aspect_ratio( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `aspectRatio` field to an Option value (optional) + pub fn maybe_aspect_ratio( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: video_state::State> VideoBuilder<'a, S> { + /// Set the `captions` field (optional) + pub fn captions( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `captions` field to an Option value (optional) + pub fn maybe_captions( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> VideoBuilder<'a, S> +where + S: video_state::State, + S::Video: video_state::IsUnset, +{ + /// Set the `video` field (required) + pub fn video( + mut self, + value: impl Into>, + ) -> VideoBuilder<'a, video_state::SetVideo> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + VideoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VideoBuilder<'a, S> +where + S: video_state::State, + S::Video: video_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Video<'a> { + Video { + alt: self.__unsafe_private_named.0, + aspect_ratio: self.__unsafe_private_named.1, + captions: self.__unsafe_private_named.2, + video: 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>, + >, + ) -> Video<'a> { + Video { + alt: self.__unsafe_private_named.0, + aspect_ratio: self.__unsafe_private_named.1, + captions: self.__unsafe_private_named.2, + video: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Video<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.video" + } + fn def_name() -> &'static str { + "video" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_video() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.alt { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "alt", + ), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.alt { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "alt", + ), + max: 1000usize, + actual: count, + }); + } + } + } + if let Some(ref value) = self.captions { + #[allow(unused_comparisons)] + if value.len() > 20usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "captions", + ), + max: 20usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct View<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub alt: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub aspect_ratio: Option>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub playlist: jacquard_common::types::string::Uri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub thumbnail: Option>, +} + +pub mod 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 Cid; + type Playlist; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ViewBuilder<'a, S: 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> View<'a> { + /// Create a new builder for this type + pub fn new() -> ViewBuilder<'a, view_state::Empty> { + ViewBuilder::new() + } +} + +impl<'a> ViewBuilder<'a, view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_state::State> ViewBuilder<'a, S> { + /// Set the `alt` field (optional) + pub fn alt(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `alt` field to an Option value (optional) + pub fn maybe_alt(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: view_state::State> ViewBuilder<'a, S> { + /// Set the `aspectRatio` field (optional) + pub fn aspect_ratio( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `aspectRatio` field to an Option value (optional) + pub fn maybe_aspect_ratio( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Cid: view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetCid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Playlist: view_state::IsUnset, +{ + /// Set the `playlist` field (required) + pub fn playlist( + mut self, + value: impl Into>, + ) -> ViewBuilder<'a, view_state::SetPlaylist> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: view_state::State> ViewBuilder<'a, S> { + /// Set the `thumbnail` field (optional) + pub fn thumbnail( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `thumbnail` field to an Option value (optional) + pub fn maybe_thumbnail( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ViewBuilder<'a, S> +where + S: view_state::State, + S::Cid: view_state::IsSet, + S::Playlist: view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> View<'a> { + View { + alt: self.__unsafe_private_named.0, + aspect_ratio: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + playlist: self.__unsafe_private_named.3.unwrap(), + thumbnail: self.__unsafe_private_named.4, + 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>, + >, + ) -> View<'a> { + View { + alt: self.__unsafe_private_named.0, + aspect_ratio: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + playlist: self.__unsafe_private_named.3.unwrap(), + thumbnail: self.__unsafe_private_named.4, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { + fn nsid() -> &'static str { + "sh.weaver.embed.video" + } + fn def_name() -> &'static str { + "view" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_embed_video() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.alt { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "alt", + ), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.alt { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "alt", + ), + max: 1000usize, + actual: count, + }); + } + } + } + Ok(()) + } +} \ 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 new file mode 100644 index 0000000..50caafe --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook.rs @@ -0,0 +1,2017 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod authors; +pub mod book; +pub mod chapter; +pub mod entry; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AuthorListView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: Option>, + pub index: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub record: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub uri: Option>, +} + +pub mod author_list_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 Profile; + type Index; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Profile = Unset; + type Index = Unset; + } + ///State transition - sets the `profile` field to Set + pub struct SetProfile(PhantomData S>); + impl sealed::Sealed for SetProfile {} + impl State for SetProfile { + type Profile = 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 Profile = S::Profile; + type Index = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `profile` field + pub struct profile(()); + ///Marker type for the `index` field + pub struct index(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AuthorListViewBuilder<'a, S: author_list_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> AuthorListView<'a> { + /// Create a new builder for this type + pub fn new() -> AuthorListViewBuilder<'a, author_list_view_state::Empty> { + AuthorListViewBuilder::new() + } +} + +impl<'a> AuthorListViewBuilder<'a, author_list_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AuthorListViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> AuthorListViewBuilder<'a, S> +where + S: author_list_view_state::State, + S::Index: author_list_view_state::IsUnset, +{ + /// Set the `index` field (required) + pub fn index( + mut self, + value: impl Into, + ) -> AuthorListViewBuilder<'a, author_list_view_state::SetIndex> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AuthorListViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> { + /// Set the `record` field (optional) + pub fn record( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> { + /// Set the `uri` field (optional) + pub fn uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `uri` field to an Option value (optional) + pub fn maybe_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> AuthorListViewBuilder<'a, S> +where + S: author_list_view_state::State, + S::Profile: author_list_view_state::IsSet, + S::Index: author_list_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AuthorListView<'a> { + AuthorListView { + cid: self.__unsafe_private_named.0, + index: self.__unsafe_private_named.1.unwrap(), + record: self.__unsafe_private_named.2, + uri: 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>, + >, + ) -> AuthorListView<'a> { + AuthorListView { + cid: self.__unsafe_private_named.0, + index: self.__unsafe_private_named.1.unwrap(), + record: self.__unsafe_private_named.2, + uri: self.__unsafe_private_named.3, + extra_data: Some(extra_data), + } + } +} + +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"), + revision: None, + description: None, + defs: { + 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_common::smol_str::SmolStr::new_static("profile"), + ::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("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("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::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("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 + }, + }), + ); + 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( + "An ordered entry in a Weaver notebook.", + ), + ), + 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("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("contentFormat"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "The format of the content. This is used to determine how to render the content.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("markdown"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The format of the content. This is used to determine how to render the content.", + ), + ), + 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("entryView"), + ::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("author"), + ::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::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#authorListView", + ), + }), + ); + 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("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 + }, + }), + ); + 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_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("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::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#authorListView", + ), + }), + ); + 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("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("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( + "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, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AuthorListView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "authorListView" + } + 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 BookEntryRef<'a> { + #[serde(borrow)] + pub entry: crate::sh_weaver::notebook::EntryView<'a>, +} + +pub mod book_entry_ref_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 BookEntryRefBuilder<'a, S: book_entry_ref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> BookEntryRef<'a> { + /// Create a new builder for this type + pub fn new() -> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> { + BookEntryRefBuilder::new() + } +} + +impl<'a> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BookEntryRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookEntryRefBuilder<'a, S> +where + S: book_entry_ref_state::State, + S::Entry: book_entry_ref_state::IsUnset, +{ + /// Set the `entry` field (required) + pub fn entry( + mut self, + value: impl Into>, + ) -> BookEntryRefBuilder<'a, book_entry_ref_state::SetEntry> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BookEntryRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookEntryRefBuilder<'a, S> +where + S: book_entry_ref_state::State, + S::Entry: book_entry_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> BookEntryRef<'a> { + BookEntryRef { + entry: 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>, + >, + ) -> BookEntryRef<'a> { + BookEntryRef { + entry: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryRef<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "bookEntryRef" + } + 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(()) + } +} + +/// An ordered entry in a Weaver notebook. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct BookEntryView<'a> { + #[serde(borrow)] + pub entry: crate::sh_weaver::notebook::EntryView<'a>, + pub index: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub next: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub prev: Option>, +} + +pub mod book_entry_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 Entry; + type Index; + } + /// 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; + } + ///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 `entry` field + pub struct entry(()); + ///Marker type for the `index` field + pub struct index(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BookEntryViewBuilder<'a, S: book_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> BookEntryView<'a> { + /// Create a new builder for this type + pub fn new() -> BookEntryViewBuilder<'a, book_entry_view_state::Empty> { + BookEntryViewBuilder::new() + } +} + +impl<'a> BookEntryViewBuilder<'a, book_entry_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BookEntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookEntryViewBuilder<'a, S> +where + S: book_entry_view_state::State, + S::Entry: book_entry_view_state::IsUnset, +{ + /// Set the `entry` field (required) + pub fn entry( + mut self, + value: impl Into>, + ) -> BookEntryViewBuilder<'a, book_entry_view_state::SetEntry> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BookEntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookEntryViewBuilder<'a, S> +where + S: book_entry_view_state::State, + S::Index: book_entry_view_state::IsUnset, +{ + /// Set the `index` field (required) + pub fn index( + mut self, + value: impl Into, + ) -> BookEntryViewBuilder<'a, book_entry_view_state::SetIndex> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + BookEntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { + /// Set the `next` field (optional) + pub fn next( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `next` field to an Option value (optional) + pub fn maybe_next( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { + /// Set the `prev` field (optional) + pub fn prev( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `prev` field to an Option value (optional) + pub fn maybe_prev( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> BookEntryView<'a> { + BookEntryView { + 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(), + } + } + /// 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>, + >, + ) -> BookEntryView<'a> { + BookEntryView { + 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 BookEntryView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "bookEntryView" + } + 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 format of the content. This is used to determine how to render the content. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + 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(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct EntryView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub authors: Option>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub rendered_view: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod entry_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 Uri; + type Cid; + type Author; + 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 Cid = Unset; + type Author = Unset; + type Record = 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; + type Cid = S::Cid; + type Author = S::Author; + type Record = S::Record; + 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 Cid = Set; + type Author = S::Author; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + } + ///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 Cid = S::Cid; + type Author = Set; + type Record = S::Record; + 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 Cid = S::Cid; + type Author = S::Author; + 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 Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + type Record = S::Record; + 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 `cid` field + pub struct cid(()); + ///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(()); + } +} + +/// 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>, + ), + _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), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `authors` field (optional) + pub fn authors( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `authors` field to an Option value (optional) + pub fn maybe_authors( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = 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.1 = ::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.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::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.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 `renderedView` field (optional) + pub fn rendered_view( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = 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.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: 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.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> 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.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> EntryViewBuilder<'a, S> +where + S: entry_view_state::State, + S::Uri: entry_view_state::IsSet, + S::Cid: entry_view_state::IsSet, + S::Author: entry_view_state::IsSet, + S::Record: entry_view_state::IsSet, + S::IndexedAt: entry_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> EntryView<'a> { + EntryView { + authors: self.__unsafe_private_named.0, + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + record: self.__unsafe_private_named.3.unwrap(), + rendered_view: self.__unsafe_private_named.4, + 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>, + >, + ) -> EntryView<'a> { + EntryView { + authors: self.__unsafe_private_named.0, + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + record: self.__unsafe_private_named.3.unwrap(), + rendered_view: self.__unsafe_private_named.4, + 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 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(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct NotebookView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub authors: Option>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod notebook_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 Uri; + type Cid; + type Author; + 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 Cid = Unset; + type Author = Unset; + type Record = 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; + type Cid = S::Cid; + type Author = S::Author; + type Record = S::Record; + 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 Cid = Set; + type Author = S::Author; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + } + ///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 Cid = S::Cid; + type Author = Set; + type Record = S::Record; + 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 Cid = S::Cid; + type Author = S::Author; + 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 Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + type Record = S::Record; + 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 `cid` field + pub struct cid(()); + ///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(()); + } +} + +/// 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>, + ), + _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), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `authors` field (optional) + pub fn authors( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `authors` field to an Option value (optional) + pub fn maybe_authors( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = 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.1 = ::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> 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.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> 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.3 = ::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 `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: 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.5 = 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.5 = 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.6 = ::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> NotebookViewBuilder<'a, S> +where + S: notebook_view_state::State, + S::Uri: notebook_view_state::IsSet, + S::Cid: notebook_view_state::IsSet, + S::Author: notebook_view_state::IsSet, + S::Record: notebook_view_state::IsSet, + S::IndexedAt: notebook_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> NotebookView<'a> { + NotebookView { + authors: self.__unsafe_private_named.0, + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + record: self.__unsafe_private_named.3.unwrap(), + tags: self.__unsafe_private_named.4, + title: 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>, + >, + ) -> NotebookView<'a> { + NotebookView { + authors: self.__unsafe_private_named.0, + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + record: self.__unsafe_private_named.3.unwrap(), + tags: self.__unsafe_private_named.4, + title: self.__unsafe_private_named.5, + uri: self.__unsafe_private_named.6.unwrap(), + 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(()) + } +} + +/// View of a rendered and cached notebook entry +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RenderedView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub css: Option>, + #[serde(borrow)] + pub html: jacquard_common::types::blob::BlobRef<'a>, +} + +pub mod rendered_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 Html; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Html = Unset; + } + ///State transition - sets the `html` field to Set + pub struct SetHtml(PhantomData S>); + impl sealed::Sealed for SetHtml {} + impl State for SetHtml { + type Html = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `html` field + pub struct html(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RenderedViewBuilder<'a, S: rendered_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RenderedView<'a> { + /// Create a new builder for this type + pub fn new() -> RenderedViewBuilder<'a, rendered_view_state::Empty> { + RenderedViewBuilder::new() + } +} + +impl<'a> RenderedViewBuilder<'a, rendered_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RenderedViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: rendered_view_state::State> RenderedViewBuilder<'a, S> { + /// Set the `css` field (optional) + pub fn css( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `css` field to an Option value (optional) + pub fn maybe_css( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> RenderedViewBuilder<'a, S> +where + S: rendered_view_state::State, + S::Html: rendered_view_state::IsUnset, +{ + /// Set the `html` field (required) + pub fn html( + mut self, + value: impl Into>, + ) -> RenderedViewBuilder<'a, rendered_view_state::SetHtml> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RenderedViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RenderedViewBuilder<'a, S> +where + S: rendered_view_state::State, + S::Html: rendered_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RenderedView<'a> { + RenderedView { + css: self.__unsafe_private_named.0, + html: 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>, + >, + ) -> RenderedView<'a> { + RenderedView { + css: self.__unsafe_private_named.0, + html: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RenderedView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "renderedView" + } + 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(()) + } +} + +/// 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 diff --git a/crates/weaver-api/src/sh_weaver/notebook/authors.rs b/crates/weaver-api/src/sh_weaver/notebook/authors.rs new file mode 100644 index 0000000..5b67589 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/authors.rs @@ -0,0 +1,524 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.authors +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A single author in a Weaver notebook. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AuthorListItem<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub index: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub profile: Option>, +} + +pub mod author_list_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 ProfileIndex; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ProfileIndex = Unset; + } + ///State transition - sets the `profile_index` field to Set + pub struct SetProfileIndex(PhantomData S>); + impl sealed::Sealed for SetProfileIndex {} + impl State for SetProfileIndex { + type ProfileIndex = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `profile_index` field + pub struct profile_index(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AuthorListItemBuilder<'a, S: author_list_item_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> AuthorListItem<'a> { + /// Create a new builder for this type + pub fn new() -> AuthorListItemBuilder<'a, author_list_item_state::Empty> { + AuthorListItemBuilder::new() + } +} + +impl<'a> AuthorListItemBuilder<'a, author_list_item_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AuthorListItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: author_list_item_state::State> AuthorListItemBuilder<'a, S> { + /// Set the `index` field (optional) + pub fn index(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `index` field to an Option value (optional) + pub fn maybe_index(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: author_list_item_state::State> AuthorListItemBuilder<'a, S> { + /// Set the `profile` field (optional) + pub fn profile( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `profile` field to an Option value (optional) + pub fn maybe_profile(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> AuthorListItemBuilder<'a, S> +where + S: author_list_item_state::State, + S::ProfileIndex: author_list_item_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AuthorListItem<'a> { + AuthorListItem { + index: self.__unsafe_private_named.0, + profile: 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>, + >, + ) -> AuthorListItem<'a> { + AuthorListItem { + index: self.__unsafe_private_named.0, + profile: self.__unsafe_private_named.1, + 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 AuthorListItemProfile<'a> { + #[serde(rename = "app.bsky.actor.defs#profileViewBasic")] + ProfileViewBasic(Box>), + #[serde(rename = "sh.weaver.actor.defs#profileView")] + ProfileView(Box>), +} + +fn lexicon_doc_sh_weaver_notebook_authors() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.authors"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("authorListItem"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A single author in a Weaver notebook.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("profile, 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("profile"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewBasic"), + ::jacquard_common::CowStr::new_static("sh.weaver.actor.defs#profileView") + ], + closed: None, + }), + ); + map + }, + }), + ); + 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( + "Authors of a Weaver notebook.", + ), + ), + 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("authorList") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "authorList", + ), + ::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( + "#authorListItem", + ), + }), + min_length: None, + max_length: 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 + }, + }), + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AuthorListItem<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.authors" + } + fn def_name() -> &'static str { + "authorListItem" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_authors() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Authors of a Weaver notebook. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Authors<'a> { + #[serde(borrow)] + pub author_list: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, +} + +pub mod 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 { + type AuthorList; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type AuthorList = Unset; + } + ///State transition - sets the `author_list` field to Set + pub struct SetAuthorList(PhantomData S>); + impl sealed::Sealed for SetAuthorList {} + impl State for SetAuthorList { + type AuthorList = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `author_list` field + pub struct author_list(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AuthorsBuilder<'a, S: authors_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + Vec>, + >, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Authors<'a> { + /// Create a new builder for this type + pub fn new() -> AuthorsBuilder<'a, authors_state::Empty> { + AuthorsBuilder::new() + } +} + +impl<'a> AuthorsBuilder<'a, authors_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AuthorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AuthorsBuilder<'a, S> +where + S: authors_state::State, + S::AuthorList: authors_state::IsUnset, +{ + /// Set the `authorList` field (required) + pub fn author_list( + mut self, + value: impl Into>>, + ) -> AuthorsBuilder<'a, authors_state::SetAuthorList> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AuthorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: authors_state::State> AuthorsBuilder<'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> AuthorsBuilder<'a, S> +where + S: authors_state::State, + S::AuthorList: authors_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Authors<'a> { + Authors { + author_list: self.__unsafe_private_named.0.unwrap(), + created_at: 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>, + >, + ) -> Authors<'a> { + Authors { + author_list: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Authors<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, AuthorsRecord>, + 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 AuthorsGetRecordOutput<'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: Authors<'a>, +} + +impl From> for Authors<'_> { + fn from(output: AuthorsGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Authors<'_> { + const NSID: &'static str = "sh.weaver.notebook.authors"; + type Record = AuthorsRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct AuthorsRecord; +impl jacquard_common::xrpc::XrpcResp for AuthorsRecord { + const NSID: &'static str = "sh.weaver.notebook.authors"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = AuthorsGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for AuthorsRecord { + const NSID: &'static str = "sh.weaver.notebook.authors"; + type Record = AuthorsRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Authors<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.authors" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_authors() + } + 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/book.rs b/crates/weaver-api/src/sh_weaver/notebook/book.rs new file mode 100644 index 0000000..994aec6 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/book.rs @@ -0,0 +1,430 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.book +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Authors of a Weaver notebook. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Book<'a> { + #[serde(borrow)] + pub authors: Vec>, + /// Client-declared timestamp when this was originally created. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + #[serde(borrow)] + pub entry_list: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: Option>, +} + +pub mod book_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 Authors; + type EntryList; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Authors = Unset; + type EntryList = 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 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 Authors = S::Authors; + type EntryList = 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 `entry_list` field + pub struct entry_list(()); + } +} + +/// Builder for constructing an instance of this type +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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Book<'a> { + /// Create a new builder for this type + pub fn new() -> BookBuilder<'a, book_state::Empty> { + BookBuilder::new() + } +} + +impl<'a> BookBuilder<'a, book_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BookBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BookBuilder<'a, S> +where + S: book_state::State, + S::Authors: book_state::IsUnset, +{ + /// Set the `authors` field (required) + pub fn authors( + mut self, + value: impl Into>>, + ) -> BookBuilder<'a, book_state::SetAuthors> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BookBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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 + } + /// 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> BookBuilder<'a, S> +where + S: book_state::State, + S::EntryList: book_state::IsUnset, +{ + /// Set the `entryList` field (required) + pub fn entry_list( + mut self, + value: impl Into>>, + ) -> BookBuilder<'a, book_state::SetEntryList> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + BookBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: book_state::State> BookBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = 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.3 = value; + self + } +} + +impl<'a, S: book_state::State> BookBuilder<'a, S> { + /// Set the `title` field (optional) + pub fn title( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S> BookBuilder<'a, S> +where + S: book_state::State, + S::Authors: book_state::IsSet, + S::EntryList: book_state::IsSet, +{ + /// Build the final struct + 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(), + tags: self.__unsafe_private_named.3, + title: self.__unsafe_private_named.4, + 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>, + >, + ) -> 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(), + tags: self.__unsafe_private_named.3, + title: self.__unsafe_private_named.4, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Book<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, BookRecord>, + 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 BookGetRecordOutput<'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: Book<'a>, +} + +impl From> for Book<'_> { + fn from(output: BookGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Book<'_> { + const NSID: &'static str = "sh.weaver.notebook.book"; + type Record = BookRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct BookRecord; +impl jacquard_common::xrpc::XrpcResp for BookRecord { + const NSID: &'static str = "sh.weaver.notebook.book"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = BookGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for BookRecord { + const NSID: &'static str = "sh.weaver.notebook.book"; + type Record = BookRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Book<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.book" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_book() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_sh_weaver_notebook_book() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.book"), + 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( + "Authors of a Weaver notebook.", + ), + ), + 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("authors"), + ::jacquard_common::smol_str::SmolStr::new_static("entryList") + ], + ), + 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( + "sh.weaver.actor.defs#author", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Client-declared timestamp when this was originally created.", + ), + ), + 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( + "entryList", + ), + ::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( + "com.atproto.repo.strongRef", + ), + }), + min_length: None, + max_length: 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( + "sh.weaver.notebook.defs#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( + "sh.weaver.notebook.defs#title", + ), + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/chapter.rs b/crates/weaver-api/src/sh_weaver/notebook/chapter.rs new file mode 100644 index 0000000..3fc6012 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/chapter.rs @@ -0,0 +1,444 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.chapter +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A grouping of entries in a notebook, intended to be displayed as a single page. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Chapter<'a> { + /// Client-declared timestamp when this was originally created. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + #[serde(borrow)] + pub entry_list: Vec>, + /// The notebook this page belongs to. + #[serde(borrow)] + pub notebook: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: Option>, +} + +pub mod 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 Notebook; + type Authors; + 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 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 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 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 `entry_list` field + pub struct entry_list(()); + } +} + +/// Builder for constructing an instance of this type +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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Chapter<'a> { + /// Create a new builder for this type + pub fn new() -> ChapterBuilder<'a, chapter_state::Empty> { + ChapterBuilder::new() + } +} + +impl<'a> ChapterBuilder<'a, chapter_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ChapterBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +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.0 = 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.0 = value; + self + } +} + +impl<'a, S> ChapterBuilder<'a, S> +where + S: chapter_state::State, + S::EntryList: chapter_state::IsUnset, +{ + /// Set the `entryList` field (required) + pub fn entry_list( + mut self, + value: impl Into>>, + ) -> ChapterBuilder<'a, chapter_state::SetEntryList> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ChapterBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ChapterBuilder<'a, S> +where + S: chapter_state::State, + S::Notebook: chapter_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> ChapterBuilder<'a, chapter_state::SetNotebook> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ChapterBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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.3 = 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.3 = value; + self + } +} + +impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { + /// Set the `title` field (optional) + pub fn title( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S> ChapterBuilder<'a, S> +where + S: chapter_state::State, + S::Notebook: chapter_state::IsSet, + S::Authors: chapter_state::IsSet, + S::EntryList: chapter_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Chapter<'a> { + Chapter { + created_at: self.__unsafe_private_named.0, + entry_list: self.__unsafe_private_named.1.unwrap(), + notebook: self.__unsafe_private_named.2.unwrap(), + tags: self.__unsafe_private_named.3, + title: self.__unsafe_private_named.4, + 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>, + >, + ) -> Chapter<'a> { + Chapter { + created_at: self.__unsafe_private_named.0, + entry_list: self.__unsafe_private_named.1.unwrap(), + notebook: self.__unsafe_private_named.2.unwrap(), + tags: self.__unsafe_private_named.3, + title: self.__unsafe_private_named.4, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Chapter<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ChapterRecord>, + 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 ChapterGetRecordOutput<'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: Chapter<'a>, +} + +impl From> for Chapter<'_> { + fn from(output: ChapterGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Chapter<'_> { + const NSID: &'static str = "sh.weaver.notebook.chapter"; + type Record = ChapterRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ChapterRecord; +impl jacquard_common::xrpc::XrpcResp for ChapterRecord { + const NSID: &'static str = "sh.weaver.notebook.chapter"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ChapterGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ChapterRecord { + const NSID: &'static str = "sh.weaver.notebook.chapter"; + type Record = ChapterRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Chapter<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.chapter" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_chapter() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_sh_weaver_notebook_chapter() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.chapter"), + 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( + "A grouping of entries in a notebook, intended to be displayed as a single page.", + ), + ), + 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("notebook"), + ::jacquard_common::smol_str::SmolStr::new_static("authors"), + ::jacquard_common::smol_str::SmolStr::new_static("entryList") + ], + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "Client-declared timestamp when this was originally created.", + ), + ), + 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( + "entryList", + ), + ::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( + "com.atproto.repo.strongRef", + ), + }), + 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( + "com.atproto.repo.strongRef", + ), + }), + ); + 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( + "sh.weaver.notebook.defs#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( + "sh.weaver.notebook.defs#title", + ), + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/entry.rs b/crates/weaver-api/src/sh_weaver/notebook/entry.rs new file mode 100644 index 0000000..fba643f --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/entry.rs @@ -0,0 +1,562 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.entry +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A notebook entry +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +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>, + /// 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. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub embeds: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: Option>, + #[serde(borrow)] + pub title: crate::sh_weaver::notebook::Title<'a>, +} + +pub mod 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 Content; + type Title; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Content = Unset; + type Title = Unset; + type CreatedAt = 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 Title = S::Title; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Content = S::Content; + type Title = 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 Content = S::Content; + type Title = S::Title; + type CreatedAt = 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 `title` field + pub struct title(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EntryBuilder<'a, S: 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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Entry<'a> { + /// Create a new builder for this type + pub fn new() -> EntryBuilder<'a, entry_state::Empty> { + EntryBuilder::new() + } +} + +impl<'a> EntryBuilder<'a, entry_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntryBuilder<'a, S> +where + S: entry_state::State, + S::Content: entry_state::IsUnset, +{ + /// Set the `content` field (required) + pub fn content( + mut self, + value: impl Into>, + ) -> EntryBuilder<'a, entry_state::SetContent> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntryBuilder<'a, S> +where + S: entry_state::State, + S::CreatedAt: entry_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> EntryBuilder<'a, entry_state::SetCreatedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + EntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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.2 = 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.2 = 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.3 = 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.3 = value; + self + } +} + +impl<'a, S> EntryBuilder<'a, S> +where + S: entry_state::State, + S::Title: entry_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into>, + ) -> EntryBuilder<'a, entry_state::SetTitle> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + EntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntryBuilder<'a, S> +where + S: entry_state::State, + S::Content: entry_state::IsSet, + S::Title: entry_state::IsSet, + S::CreatedAt: entry_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Entry<'a> { + Entry { + content: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + embeds: self.__unsafe_private_named.2, + tags: self.__unsafe_private_named.3, + title: 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>, + >, + ) -> Entry<'a> { + Entry { + content: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + embeds: self.__unsafe_private_named.2, + tags: self.__unsafe_private_named.3, + title: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Entry<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, EntryRecord>, + jacquard_common::types::uri::UriError, + > { + jacquard_common::types::uri::RecordUri::try_from_uri( + jacquard_common::types::string::AtUri::new_cow(uri.into())?, + ) + } +} + +/// The set of images and records, if any, embedded in the notebook entry. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct EntryEmbeds<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub externals: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub images: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub records: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub records_with_media: std::option::Option< + Vec>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub videos: std::option::Option>, +} + +fn lexicon_doc_sh_weaver_notebook_entry() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.entry"), + 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("A notebook entry"), + ), + 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("content"), + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::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("content"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The content of the notebook entry. This should be some flavor of Markdown.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(200000usize), + 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: Some( + ::jacquard_common::CowStr::new_static( + "Client-declared timestamp when this was originally created.", + ), + ), + 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("embeds"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "The set of images and records, if any, embedded in the notebook entry.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "externals", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.embed.external", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("images"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.embed.images", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("records"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.embed.records", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "recordsWithMedia", + ), + ::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.embed.recordWithMedia", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("videos"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.embed.video", + ), + }), + ); + map + }, + }), + ); + 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( + "sh.weaver.notebook.defs#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( + "sh.weaver.notebook.defs#title", + ), + }), + ); + map + }, + }), + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryEmbeds<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.entry" + } + fn def_name() -> &'static str { + "EntryEmbeds" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_entry() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// 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 EntryGetRecordOutput<'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: Entry<'a>, +} + +impl From> for Entry<'_> { + fn from(output: EntryGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Entry<'_> { + const NSID: &'static str = "sh.weaver.notebook.entry"; + type Record = EntryRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct EntryRecord; +impl jacquard_common::xrpc::XrpcResp for EntryRecord { + const NSID: &'static str = "sh.weaver.notebook.entry"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = EntryGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for EntryRecord { + const NSID: &'static str = "sh.weaver.notebook.entry"; + type Record = EntryRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Entry<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.entry" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_entry() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.content; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 200000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "content", + ), + max: 200000usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/publish.rs b/crates/weaver-api/src/sh_weaver/publish.rs new file mode 100644 index 0000000..7effcbd --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/publish.rs @@ -0,0 +1,6 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod blob; \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/publish/blob.rs b/crates/weaver-api/src/sh_weaver/publish/blob.rs new file mode 100644 index 0000000..4993bf1 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/publish/blob.rs @@ -0,0 +1,255 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.publish.blob +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A simple record referencing a file hosted on a PDS +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Blob<'a> { + /// Reference to the uploaded file + #[serde(borrow)] + pub upload: jacquard_common::types::blob::BlobRef<'a>, +} + +pub mod blob_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 Upload; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Upload = Unset; + } + ///State transition - sets the `upload` field to Set + pub struct SetUpload(PhantomData S>); + impl sealed::Sealed for SetUpload {} + impl State for SetUpload { + type Upload = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `upload` field + pub struct upload(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BlobBuilder<'a, S: blob_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Blob<'a> { + /// Create a new builder for this type + pub fn new() -> BlobBuilder<'a, blob_state::Empty> { + BlobBuilder::new() + } +} + +impl<'a> BlobBuilder<'a, blob_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BlobBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlobBuilder<'a, S> +where + S: blob_state::State, + S::Upload: blob_state::IsUnset, +{ + /// Set the `upload` field (required) + pub fn upload( + mut self, + value: impl Into>, + ) -> BlobBuilder<'a, blob_state::SetUpload> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BlobBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlobBuilder<'a, S> +where + S: blob_state::State, + S::Upload: blob_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Blob<'a> { + Blob { + upload: 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>, + >, + ) -> Blob<'a> { + Blob { + upload: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Blob<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, BlobRecord>, + 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 BlobGetRecordOutput<'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: Blob<'a>, +} + +impl From> for Blob<'_> { + fn from(output: BlobGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Blob<'_> { + const NSID: &'static str = "sh.weaver.publish.blob"; + type Record = BlobRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct BlobRecord; +impl jacquard_common::xrpc::XrpcResp for BlobRecord { + const NSID: &'static str = "sh.weaver.publish.blob"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = BlobGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for BlobRecord { + const NSID: &'static str = "sh.weaver.publish.blob"; + type Record = BlobRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Blob<'a> { + fn nsid() -> &'static str { + "sh.weaver.publish.blob" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_publish_blob() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_sh_weaver_publish_blob() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.publish.blob"), + 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( + "A simple record referencing a file hosted on a PDS", + ), + ), + 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("upload") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("upload"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { + description: None, + accept: None, + max_size: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone.rs b/crates/weaver-api/src/tools_ozone.rs new file mode 100644 index 0000000..ec0258d --- /dev/null +++ b/crates/weaver-api/src/tools_ozone.rs @@ -0,0 +1,16 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod communication; +pub mod hosting; +pub mod moderation; +pub mod report; +pub mod safelink; +pub mod server; +pub mod set; +pub mod setting; +pub mod signature; +pub mod team; +pub mod verification; \ 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 new file mode 100644 index 0000000..1c807c4 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/communication.rs @@ -0,0 +1,659 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.communication.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod create_template; +pub mod delete_template; +pub mod list_templates; +pub mod update_template; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct TemplateView<'a> { + /// Subject of the message, used in emails. + #[serde(borrow)] + pub content_markdown: jacquard_common::CowStr<'a>, + pub created_at: jacquard_common::types::string::Datetime, + pub disabled: bool, + #[serde(borrow)] + pub id: jacquard_common::CowStr<'a>, + /// Message language. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub lang: Option, + /// DID of the user who last updated the template. + #[serde(borrow)] + pub last_updated_by: jacquard_common::types::string::Did<'a>, + /// Name of the template. + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + /// Content of the template, can contain markdown and variable placeholders. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject: Option>, + pub updated_at: jacquard_common::types::string::Datetime, +} + +pub mod template_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 Id; + type Name; + type ContentMarkdown; + type Disabled; + type LastUpdatedBy; + type CreatedAt; + type UpdatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Id = Unset; + type Name = Unset; + type ContentMarkdown = Unset; + type Disabled = Unset; + type LastUpdatedBy = Unset; + type CreatedAt = Unset; + type UpdatedAt = 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 Name = S::Name; + type ContentMarkdown = S::ContentMarkdown; + type Disabled = S::Disabled; + type LastUpdatedBy = S::LastUpdatedBy; + type CreatedAt = S::CreatedAt; + 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 Id = S::Id; + type Name = Set; + type ContentMarkdown = S::ContentMarkdown; + type Disabled = S::Disabled; + type LastUpdatedBy = S::LastUpdatedBy; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + } + ///State transition - sets the `content_markdown` field to Set + pub struct SetContentMarkdown(PhantomData S>); + impl sealed::Sealed for SetContentMarkdown {} + impl State for SetContentMarkdown { + type Id = S::Id; + type Name = S::Name; + type ContentMarkdown = Set; + type Disabled = S::Disabled; + type LastUpdatedBy = S::LastUpdatedBy; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + } + ///State transition - sets the `disabled` field to Set + pub struct SetDisabled(PhantomData S>); + impl sealed::Sealed for SetDisabled {} + impl State for SetDisabled { + type Id = S::Id; + type Name = S::Name; + type ContentMarkdown = S::ContentMarkdown; + type Disabled = Set; + type LastUpdatedBy = S::LastUpdatedBy; + type CreatedAt = S::CreatedAt; + 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 Id = S::Id; + type Name = S::Name; + type ContentMarkdown = S::ContentMarkdown; + type Disabled = S::Disabled; + type LastUpdatedBy = Set; + type CreatedAt = S::CreatedAt; + 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 Id = S::Id; + type Name = S::Name; + type ContentMarkdown = S::ContentMarkdown; + type Disabled = S::Disabled; + type LastUpdatedBy = S::LastUpdatedBy; + type CreatedAt = Set; + type UpdatedAt = S::UpdatedAt; + } + ///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 Name = S::Name; + type ContentMarkdown = S::ContentMarkdown; + type Disabled = S::Disabled; + type LastUpdatedBy = S::LastUpdatedBy; + type CreatedAt = S::CreatedAt; + type UpdatedAt = 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 `name` field + pub struct name(()); + ///Marker type for the `content_markdown` field + pub struct content_markdown(()); + ///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 `created_at` field + pub struct created_at(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct TemplateViewBuilder<'a, S: template_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, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> TemplateView<'a> { + /// Create a new builder for this type + pub fn new() -> TemplateViewBuilder<'a, template_view_state::Empty> { + TemplateViewBuilder::new() + } +} + +impl<'a> TemplateViewBuilder<'a, template_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + TemplateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TemplateViewBuilder<'a, S> +where + S: template_view_state::State, + S::ContentMarkdown: template_view_state::IsUnset, +{ + /// Set the `contentMarkdown` field (required) + pub fn content_markdown( + mut self, + value: impl Into>, + ) -> TemplateViewBuilder<'a, template_view_state::SetContentMarkdown> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + TemplateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TemplateViewBuilder<'a, S> +where + S: template_view_state::State, + S::CreatedAt: template_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> TemplateViewBuilder<'a, template_view_state::SetCreatedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + TemplateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TemplateViewBuilder<'a, S> +where + S: template_view_state::State, + S::Disabled: template_view_state::IsUnset, +{ + /// Set the `disabled` field (required) + pub fn disabled( + mut self, + value: impl Into, + ) -> TemplateViewBuilder<'a, template_view_state::SetDisabled> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + TemplateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TemplateViewBuilder<'a, S> +where + S: template_view_state::State, + S::Id: template_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into>, + ) -> TemplateViewBuilder<'a, template_view_state::SetId> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + TemplateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: template_view_state::State> TemplateViewBuilder<'a, S> { + /// Set the `lang` field (optional) + pub fn lang( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `lang` field to an Option value (optional) + pub fn maybe_lang( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> TemplateViewBuilder<'a, S> +where + S: template_view_state::State, + S::LastUpdatedBy: template_view_state::IsUnset, +{ + /// Set the `lastUpdatedBy` field (required) + pub fn last_updated_by( + mut self, + value: impl Into>, + ) -> TemplateViewBuilder<'a, template_view_state::SetLastUpdatedBy> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + TemplateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TemplateViewBuilder<'a, S> +where + S: template_view_state::State, + S::Name: template_view_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> TemplateViewBuilder<'a, template_view_state::SetName> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + TemplateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: template_view_state::State> TemplateViewBuilder<'a, S> { + /// Set the `subject` field (optional) + pub fn subject( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `subject` field to an Option value (optional) + pub fn maybe_subject(mut self, value: Option>) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> TemplateViewBuilder<'a, S> +where + S: template_view_state::State, + S::UpdatedAt: template_view_state::IsUnset, +{ + /// Set the `updatedAt` field (required) + pub fn updated_at( + mut self, + value: impl Into, + ) -> TemplateViewBuilder<'a, template_view_state::SetUpdatedAt> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + TemplateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TemplateViewBuilder<'a, S> +where + S: template_view_state::State, + S::Id: template_view_state::IsSet, + S::Name: template_view_state::IsSet, + S::ContentMarkdown: template_view_state::IsSet, + S::Disabled: template_view_state::IsSet, + S::LastUpdatedBy: template_view_state::IsSet, + S::CreatedAt: template_view_state::IsSet, + S::UpdatedAt: template_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> TemplateView<'a> { + TemplateView { + content_markdown: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + disabled: self.__unsafe_private_named.2.unwrap(), + id: self.__unsafe_private_named.3.unwrap(), + lang: self.__unsafe_private_named.4, + last_updated_by: self.__unsafe_private_named.5.unwrap(), + name: self.__unsafe_private_named.6.unwrap(), + subject: self.__unsafe_private_named.7, + updated_at: 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>, + >, + ) -> TemplateView<'a> { + TemplateView { + content_markdown: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + disabled: self.__unsafe_private_named.2.unwrap(), + id: self.__unsafe_private_named.3.unwrap(), + lang: self.__unsafe_private_named.4, + last_updated_by: self.__unsafe_private_named.5.unwrap(), + name: self.__unsafe_private_named.6.unwrap(), + subject: self.__unsafe_private_named.7, + updated_at: self.__unsafe_private_named.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_communication_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.communication.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("templateView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_common::smol_str::SmolStr::new_static("contentMarkdown"), + ::jacquard_common::smol_str::SmolStr::new_static("disabled"), + ::jacquard_common::smol_str::SmolStr::new_static("lastUpdatedBy"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::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( + "contentMarkdown", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Subject of the message, used in emails.", + ), + ), + 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( + "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("disabled"), + ::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("id"), + ::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("lang"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static("Message language."), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Language, + ), + 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( + "lastUpdatedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the user who last updated the template.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Name of the template.", + ), + ), + 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("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Content of the template, can contain markdown and variable placeholders.", + ), + ), + 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( + "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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TemplateView<'a> { + fn nsid() -> &'static str { + "tools.ozone.communication.defs" + } + fn def_name() -> &'static str { + "templateView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_communication_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/tools_ozone/communication/create_template.rs b/crates/weaver-api/src/tools_ozone/communication/create_template.rs new file mode 100644 index 0000000..d9c69fa --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/communication/create_template.rs @@ -0,0 +1,118 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.communication.createTemplate +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct CreateTemplate<'a> { + /// Content of the template, markdown supported, can contain variable placeholders. + #[serde(borrow)] + pub content_markdown: jacquard_common::CowStr<'a>, + /// DID of the user who is creating the template. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub created_by: std::option::Option>, + /// Message language. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub lang: std::option::Option, + /// Name of the template. + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + /// Subject of the message, used in emails. + #[serde(borrow)] + pub subject: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct CreateTemplateOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::communication::TemplateView<'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 CreateTemplateError<'a> { + #[serde(rename = "DuplicateTemplateName")] + DuplicateTemplateName(std::option::Option), +} + +impl std::fmt::Display for CreateTemplateError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::DuplicateTemplateName(msg) => { + write!(f, "DuplicateTemplateName")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.communication.createTemplate +pub struct CreateTemplateResponse; +impl jacquard_common::xrpc::XrpcResp for CreateTemplateResponse { + const NSID: &'static str = "tools.ozone.communication.createTemplate"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CreateTemplateOutput<'de>; + type Err<'de> = CreateTemplateError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CreateTemplate<'a> { + const NSID: &'static str = "tools.ozone.communication.createTemplate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CreateTemplateResponse; +} + +/// Endpoint type for +///tools.ozone.communication.createTemplate +pub struct CreateTemplateRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CreateTemplateRequest { + const PATH: &'static str = "/xrpc/tools.ozone.communication.createTemplate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CreateTemplate<'de>; + type Response = CreateTemplateResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/communication/delete_template.rs b/crates/weaver-api/src/tools_ozone/communication/delete_template.rs new file mode 100644 index 0000000..4ebfe89 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/communication/delete_template.rs @@ -0,0 +1,53 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.communication.deleteTemplate +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DeleteTemplate<'a> { + #[serde(borrow)] + pub id: jacquard_common::CowStr<'a>, +} + +/// Response type for +///tools.ozone.communication.deleteTemplate +pub struct DeleteTemplateResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteTemplateResponse { + const NSID: &'static str = "tools.ozone.communication.deleteTemplate"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteTemplate<'a> { + const NSID: &'static str = "tools.ozone.communication.deleteTemplate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteTemplateResponse; +} + +/// Endpoint type for +///tools.ozone.communication.deleteTemplate +pub struct DeleteTemplateRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteTemplateRequest { + const PATH: &'static str = "/xrpc/tools.ozone.communication.deleteTemplate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteTemplate<'de>; + type Response = DeleteTemplateResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/communication/list_templates.rs b/crates/weaver-api/src/tools_ozone/communication/list_templates.rs new file mode 100644 index 0000000..f1177f4 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/communication/list_templates.rs @@ -0,0 +1,62 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.communication.listTemplates +// +// 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 ListTemplatesOutput<'a> { + #[serde(borrow)] + pub communication_templates: Vec< + crate::tools_ozone::communication::TemplateView<'a>, + >, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct ListTemplates; +/// Response type for +///tools.ozone.communication.listTemplates +pub struct ListTemplatesResponse; +impl jacquard_common::xrpc::XrpcResp for ListTemplatesResponse { + const NSID: &'static str = "tools.ozone.communication.listTemplates"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListTemplatesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for ListTemplates { + const NSID: &'static str = "tools.ozone.communication.listTemplates"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListTemplatesResponse; +} + +/// Endpoint type for +///tools.ozone.communication.listTemplates +pub struct ListTemplatesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListTemplatesRequest { + const PATH: &'static str = "/xrpc/tools.ozone.communication.listTemplates"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListTemplates; + type Response = ListTemplatesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/communication/update_template.rs b/crates/weaver-api/src/tools_ozone/communication/update_template.rs new file mode 100644 index 0000000..a19c3d6 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/communication/update_template.rs @@ -0,0 +1,126 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.communication.updateTemplate +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateTemplate<'a> { + /// Content of the template, markdown supported, can contain variable placeholders. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub content_markdown: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub disabled: std::option::Option, + /// ID of the template to be updated. + #[serde(borrow)] + pub id: jacquard_common::CowStr<'a>, + /// Message language. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub lang: std::option::Option, + /// Name of the template. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub name: std::option::Option>, + /// Subject of the message, used in emails. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject: std::option::Option>, + /// DID of the user who is updating the template. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub updated_by: std::option::Option>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateTemplateOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::communication::TemplateView<'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 UpdateTemplateError<'a> { + #[serde(rename = "DuplicateTemplateName")] + DuplicateTemplateName(std::option::Option), +} + +impl std::fmt::Display for UpdateTemplateError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::DuplicateTemplateName(msg) => { + write!(f, "DuplicateTemplateName")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.communication.updateTemplate +pub struct UpdateTemplateResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateTemplateResponse { + const NSID: &'static str = "tools.ozone.communication.updateTemplate"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpdateTemplateOutput<'de>; + type Err<'de> = UpdateTemplateError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateTemplate<'a> { + const NSID: &'static str = "tools.ozone.communication.updateTemplate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateTemplateResponse; +} + +/// Endpoint type for +///tools.ozone.communication.updateTemplate +pub struct UpdateTemplateRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateTemplateRequest { + const PATH: &'static str = "/xrpc/tools.ozone.communication.updateTemplate"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateTemplate<'de>; + type Response = UpdateTemplateResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/hosting.rs b/crates/weaver-api/src/tools_ozone/hosting.rs new file mode 100644 index 0000000..e7d9326 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/hosting.rs @@ -0,0 +1,6 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_account_history; \ No newline at end of file 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 new file mode 100644 index 0000000..68a3969 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs @@ -0,0 +1,1064 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.hosting.getAccountHistory +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AccountCreated<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub handle: std::option::Option>, +} + +fn lexicon_doc_tools_ozone_hosting_getAccountHistory() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "tools.ozone.hosting.getAccountHistory", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("accountCreated"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("email"), + ::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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("emailConfirmed"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("email")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("email"), + ::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("emailUpdated"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("email")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("email"), + ::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("event"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("details"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::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( + "createdBy", + ), + ::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("details"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#accountCreated"), + ::jacquard_common::CowStr::new_static("#emailUpdated"), + ::jacquard_common::CowStr::new_static("#emailConfirmed"), + ::jacquard_common::CowStr::new_static("#passwordUpdated"), + ::jacquard_common::CowStr::new_static("#handleUpdated") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handleUpdated"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("handle")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did") + ], + ), + 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("did"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("events"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Array(::jacquard_lexicon::lexicon::LexPrimitiveArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexPrimitiveArrayItem::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, + }), + min_length: None, + max_length: 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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("passwordUpdated"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AccountCreated<'a> { + fn nsid() -> &'static str { + "tools.ozone.hosting.getAccountHistory" + } + fn def_name() -> &'static str { + "accountCreated" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_hosting_getAccountHistory() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct EmailConfirmed<'a> { + #[serde(borrow)] + pub email: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EmailConfirmed<'a> { + fn nsid() -> &'static str { + "tools.ozone.hosting.getAccountHistory" + } + fn def_name() -> &'static str { + "emailConfirmed" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_hosting_getAccountHistory() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct EmailUpdated<'a> { + #[serde(borrow)] + pub email: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EmailUpdated<'a> { + fn nsid() -> &'static str { + "tools.ozone.hosting.getAccountHistory" + } + fn def_name() -> &'static str { + "emailUpdated" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_hosting_getAccountHistory() + } + 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 Event<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub created_by: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub details: EventDetails<'a>, +} + +pub mod event_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 Details; + type CreatedBy; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Details = Unset; + type CreatedBy = Unset; + type CreatedAt = Unset; + } + ///State transition - sets the `details` field to Set + pub struct SetDetails(PhantomData S>); + impl sealed::Sealed for SetDetails {} + impl State for SetDetails { + type Details = 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 Details = S::Details; + 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 Details = S::Details; + type CreatedBy = S::CreatedBy; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `details` field + pub struct details(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EventBuilder<'a, S: event_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> Event<'a> { + /// Create a new builder for this type + pub fn new() -> EventBuilder<'a, event_state::Empty> { + EventBuilder::new() + } +} + +impl<'a> EventBuilder<'a, event_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::CreatedAt: event_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> EventBuilder<'a, event_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::CreatedBy: event_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> EventBuilder<'a, event_state::SetCreatedBy> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::Details: event_state::IsUnset, +{ + /// Set the `details` field (required) + pub fn details( + mut self, + value: impl Into>, + ) -> EventBuilder<'a, event_state::SetDetails> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::Details: event_state::IsSet, + S::CreatedBy: event_state::IsSet, + S::CreatedAt: event_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Event<'a> { + Event { + created_at: self.__unsafe_private_named.0.unwrap(), + created_by: self.__unsafe_private_named.1.unwrap(), + details: 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>, + >, + ) -> Event<'a> { + Event { + created_at: self.__unsafe_private_named.0.unwrap(), + created_by: self.__unsafe_private_named.1.unwrap(), + details: self.__unsafe_private_named.2.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 EventDetails<'a> { + #[serde(rename = "tools.ozone.hosting.getAccountHistory#accountCreated")] + AccountCreated( + Box>, + ), + #[serde(rename = "tools.ozone.hosting.getAccountHistory#emailUpdated")] + EmailUpdated( + Box>, + ), + #[serde(rename = "tools.ozone.hosting.getAccountHistory#emailConfirmed")] + EmailConfirmed( + Box>, + ), + #[serde(rename = "tools.ozone.hosting.getAccountHistory#passwordUpdated")] + PasswordUpdated( + Box>, + ), + #[serde(rename = "tools.ozone.hosting.getAccountHistory#handleUpdated")] + HandleUpdated( + Box>, + ), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Event<'a> { + fn nsid() -> &'static str { + "tools.ozone.hosting.getAccountHistory" + } + fn def_name() -> &'static str { + "event" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_hosting_getAccountHistory() + } + 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 HandleUpdated<'a> { + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, +} + +pub mod handle_updated_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 Handle; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `handle` field + pub struct handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct HandleUpdatedBuilder<'a, S: handle_updated_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> HandleUpdated<'a> { + /// Create a new builder for this type + pub fn new() -> HandleUpdatedBuilder<'a, handle_updated_state::Empty> { + HandleUpdatedBuilder::new() + } +} + +impl<'a> HandleUpdatedBuilder<'a, handle_updated_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + HandleUpdatedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> HandleUpdatedBuilder<'a, S> +where + S: handle_updated_state::State, + S::Handle: handle_updated_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> HandleUpdatedBuilder<'a, handle_updated_state::SetHandle> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + HandleUpdatedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> HandleUpdatedBuilder<'a, S> +where + S: handle_updated_state::State, + S::Handle: handle_updated_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> HandleUpdated<'a> { + HandleUpdated { + handle: 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>, + >, + ) -> HandleUpdated<'a> { + HandleUpdated { + handle: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for HandleUpdated<'a> { + fn nsid() -> &'static str { + "tools.ozone.hosting.getAccountHistory" + } + fn def_name() -> &'static str { + "handleUpdated" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_hosting_getAccountHistory() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetAccountHistory<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub events: 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_account_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetAccountHistoryBuilder<'a, S: get_account_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> GetAccountHistory<'a> { + /// Create a new builder for this type + pub fn new() -> GetAccountHistoryBuilder<'a, get_account_history_state::Empty> { + GetAccountHistoryBuilder::new() + } +} + +impl<'a> GetAccountHistoryBuilder<'a, get_account_history_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetAccountHistoryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_account_history_state::State> GetAccountHistoryBuilder<'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> GetAccountHistoryBuilder<'a, S> +where + S: get_account_history_state::State, + S::Did: get_account_history_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetAccountHistoryBuilder<'a, get_account_history_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetAccountHistoryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_account_history_state::State> GetAccountHistoryBuilder<'a, S> { + /// Set the `events` field (optional) + pub fn events( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `events` field to an Option value (optional) + pub fn maybe_events( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_account_history_state::State> GetAccountHistoryBuilder<'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> GetAccountHistoryBuilder<'a, S> +where + S: get_account_history_state::State, + S::Did: get_account_history_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetAccountHistory<'a> { + GetAccountHistory { + cursor: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + events: 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 GetAccountHistoryOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub events: Vec>, +} + +/// Response type for +///tools.ozone.hosting.getAccountHistory +pub struct GetAccountHistoryResponse; +impl jacquard_common::xrpc::XrpcResp for GetAccountHistoryResponse { + const NSID: &'static str = "tools.ozone.hosting.getAccountHistory"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetAccountHistoryOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetAccountHistory<'a> { + const NSID: &'static str = "tools.ozone.hosting.getAccountHistory"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetAccountHistoryResponse; +} + +/// Endpoint type for +///tools.ozone.hosting.getAccountHistory +pub struct GetAccountHistoryRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetAccountHistoryRequest { + const PATH: &'static str = "/xrpc/tools.ozone.hosting.getAccountHistory"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetAccountHistory<'de>; + type Response = GetAccountHistoryResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct PasswordUpdated<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PasswordUpdated<'a> { + fn nsid() -> &'static str { + "tools.ozone.hosting.getAccountHistory" + } + fn def_name() -> &'static str { + "passwordUpdated" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_hosting_getAccountHistory() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation.rs b/crates/weaver-api/src/tools_ozone/moderation.rs new file mode 100644 index 0000000..2b972c7 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation.rs @@ -0,0 +1,13685 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod cancel_scheduled_actions; +pub mod emit_event; +pub mod get_account_timeline; +pub mod get_event; +pub mod get_record; +pub mod get_records; +pub mod get_repo; +pub mod get_reporter_stats; +pub mod get_repos; +pub mod get_subjects; +pub mod list_scheduled_actions; +pub mod query_events; +pub mod query_statuses; +pub mod schedule_action; +pub mod search_repos; + +/// Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AccountEvent<'a> { + /// Indicates that the account has a repository which can be fetched from the host that emitted this event. + pub active: bool, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + pub timestamp: jacquard_common::types::string::Datetime, +} + +pub mod account_event_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 Timestamp; + type Active; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Timestamp = Unset; + type Active = Unset; + } + ///State transition - sets the `timestamp` field to Set + pub struct SetTimestamp(PhantomData S>); + impl sealed::Sealed for SetTimestamp {} + impl State for SetTimestamp { + type Timestamp = Set; + type Active = S::Active; + } + ///State transition - sets the `active` field to Set + pub struct SetActive(PhantomData S>); + impl sealed::Sealed for SetActive {} + impl State for SetActive { + type Timestamp = S::Timestamp; + type Active = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `timestamp` field + pub struct timestamp(()); + ///Marker type for the `active` field + pub struct active(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AccountEventBuilder<'a, S: account_event_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> AccountEvent<'a> { + /// Create a new builder for this type + pub fn new() -> AccountEventBuilder<'a, account_event_state::Empty> { + AccountEventBuilder::new() + } +} + +impl<'a> AccountEventBuilder<'a, account_event_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AccountEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountEventBuilder<'a, S> +where + S: account_event_state::State, + S::Active: account_event_state::IsUnset, +{ + /// Set the `active` field (required) + pub fn active( + mut self, + value: impl Into, + ) -> AccountEventBuilder<'a, account_event_state::SetActive> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AccountEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: account_event_state::State> AccountEventBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: account_event_state::State> AccountEventBuilder<'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> AccountEventBuilder<'a, S> +where + S: account_event_state::State, + S::Timestamp: account_event_state::IsUnset, +{ + /// Set the `timestamp` field (required) + pub fn timestamp( + mut self, + value: impl Into, + ) -> AccountEventBuilder<'a, account_event_state::SetTimestamp> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + AccountEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AccountEventBuilder<'a, S> +where + S: account_event_state::State, + S::Timestamp: account_event_state::IsSet, + S::Active: account_event_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AccountEvent<'a> { + AccountEvent { + active: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + status: self.__unsafe_private_named.2, + timestamp: 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>, + >, + ) -> AccountEvent<'a> { + AccountEvent { + active: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + status: self.__unsafe_private_named.2, + timestamp: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_moderation_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("accountEvent"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Logs account status related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("timestamp"), + ::jacquard_common::smol_str::SmolStr::new_static("active") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("active"), + ::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("comment"), + ::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( + "timestamp", + ), + ::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("accountHosting"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::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( + "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( + "deactivatedAt", + ), + ::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( + "deletedAt", + ), + ::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( + "reactivatedAt", + ), + ::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.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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("accountStats"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Statistics about a particular account subject", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "appealCount", + ), + ::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( + "escalateCount", + ), + ::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( + "reportCount", + ), + ::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( + "suspendCount", + ), + ::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( + "takedownCount", + ), + ::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("accountStrike"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Strike information for an account", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "activeStrikeCount", + ), + ::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( + "firstStrikeAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp of the first strike received", + ), + ), + 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( + "lastStrikeAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp of the most recent strike received", + ), + ), + 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( + "totalStrikeCount", + ), + ::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("ageAssuranceEvent"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Age assurance info coming directly from users. Only works on DID subjects.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_common::smol_str::SmolStr::new_static("attemptId") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "attemptId", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The unique identifier for this instance of the age assurance flow, in UUID format.", + ), + ), + 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( + "completeIp", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The IP address used when completing the AA flow.", + ), + ), + 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( + "completeUa", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user agent used when completing the AA flow.", + ), + ), + 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( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The date and time of this write operation.", + ), + ), + 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("initIp"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The IP address used when initiating the AA flow.", + ), + ), + 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("initUa"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user agent used when initiating the AA flow.", + ), + ), + 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( + "The status of the age assurance process.", + ), + ), + 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( + "ageAssuranceOverrideEvent", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Age assurance status override by moderators. Only works on DID subjects.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Comment describing the reason for the override.", + ), + ), + 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( + "The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state.", + ), + ), + 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("blobView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("mimeType"), + ::jacquard_common::smol_str::SmolStr::new_static("size"), + ::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("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("details"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#imageDetails"), + ::jacquard_common::CowStr::new_static("#videoDetails") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("mimeType"), + ::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( + "moderation", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#moderation"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("size"), + ::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( + "cancelScheduledTakedownEvent", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Logs cancellation of a scheduled takedown action for an account.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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("identityEvent"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("timestamp") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("pdsHost"), + ::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( + "timestamp", + ), + ::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( + "tombstone", + ), + ::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("imageDetails"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("width"), + ::jacquard_common::smol_str::SmolStr::new_static("height") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("height"), + ::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("width"), + ::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("modEventAcknowledge"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "acknowledgeAccountSubjects", + ), + ::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("comment"), + ::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("modEventComment"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Add a comment to a subject. An empty comment will clear any previously set sticky comment.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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("sticky"), + ::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("modEventDivert"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Divert a record's blobs to a 3rd party service for further scanning/tagging", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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("modEventEmail"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Keep a log of outgoing email to a user", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("subjectLine") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Additional comment about the outgoing comm.", + ), + ), + 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("content"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The content of the email sent to the user.", + ), + ), + 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("policies"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Names/Keywords of the policies that necessitated the email.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "severityLevel", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense", + ), + ), + 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( + "strikeCount", + ), + ::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( + "strikeExpiresAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "When the strike should expire. If not provided, the strike never expires.", + ), + ), + 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( + "subjectLine", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The subject line of the email sent to the user.", + ), + ), + 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("modEventEscalate"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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("modEventLabel"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Apply/Negate labels on a subject", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("createLabelVals"), + ::jacquard_common::smol_str::SmolStr::new_static("negateLabelVals") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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( + "createLabelVals", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::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: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "durationInHours", + ), + ::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( + "negateLabelVals", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::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: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("modEventMute"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Mute incoming reports on a subject", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("durationInHours") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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( + "durationInHours", + ), + ::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("modEventMuteReporter"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Mute incoming reports from an account", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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( + "durationInHours", + ), + ::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( + "modEventPriorityScore", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Set priority score of the subject. Higher score means higher priority.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("score")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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("score"), + ::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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("modEventReport"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static("Report a subject"), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("reportType") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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( + "isReporterMuted", + ), + ::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( + "reportType", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.moderation.defs#reasonType", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "modEventResolveAppeal", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Resolve appeal on a subject", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Describe resolution.", + ), + ), + 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( + "modEventReverseTakedown", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Revert take down action on a subject", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Describe reasoning behind the reversal.", + ), + ), + 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("policies"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Names/Keywords of the policy infraction for which takedown is being reversed.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "severityLevel", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Severity level of the violation. Usually set from the last policy infraction's severity.", + ), + ), + 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( + "strikeCount", + ), + ::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("modEventTag"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Add/Remove a tag on a subject", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("add"), + ::jacquard_common::smol_str::SmolStr::new_static("remove") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("add"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Tags to be added to the subject. If already exists, won't be duplicated.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Additional comment about added/removed tags.", + ), + ), + 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("remove"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("modEventTakedown"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Take down a subject permanently or temporarily", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "acknowledgeAccountSubjects", + ), + ::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("comment"), + ::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( + "durationInHours", + ), + ::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("policies"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Names/Keywords of the policies that drove the decision.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "severityLevel", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.).", + ), + ), + 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( + "strikeCount", + ), + ::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( + "strikeExpiresAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "When the strike should expire. If not provided, the strike never expires.", + ), + ), + 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("modEventUnmute"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Unmute action on a subject", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Describe reasoning behind the reversal.", + ), + ), + 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( + "modEventUnmuteReporter", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Unmute incoming reports from an account", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Describe reasoning behind the reversal.", + ), + ), + 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("modEventView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("event"), + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("subjectBlobCids"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::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( + "createdBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "creatorHandle", + ), + ::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("event"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#modEventTakedown"), + ::jacquard_common::CowStr::new_static("#modEventReverseTakedown"), + ::jacquard_common::CowStr::new_static("#modEventComment"), + ::jacquard_common::CowStr::new_static("#modEventReport"), + ::jacquard_common::CowStr::new_static("#modEventLabel"), + ::jacquard_common::CowStr::new_static("#modEventAcknowledge"), + ::jacquard_common::CowStr::new_static("#modEventEscalate"), + ::jacquard_common::CowStr::new_static("#modEventMute"), + ::jacquard_common::CowStr::new_static("#modEventUnmute"), + ::jacquard_common::CowStr::new_static("#modEventMuteReporter"), + ::jacquard_common::CowStr::new_static("#modEventUnmuteReporter"), + ::jacquard_common::CowStr::new_static("#modEventEmail"), + ::jacquard_common::CowStr::new_static("#modEventResolveAppeal"), + ::jacquard_common::CowStr::new_static("#modEventDivert"), + ::jacquard_common::CowStr::new_static("#modEventTag"), + ::jacquard_common::CowStr::new_static("#accountEvent"), + ::jacquard_common::CowStr::new_static("#identityEvent"), + ::jacquard_common::CowStr::new_static("#recordEvent"), + ::jacquard_common::CowStr::new_static("#modEventPriorityScore"), + ::jacquard_common::CowStr::new_static("#ageAssuranceEvent"), + ::jacquard_common::CowStr::new_static("#ageAssuranceOverrideEvent"), + ::jacquard_common::CowStr::new_static("#revokeAccountCredentialsEvent"), + ::jacquard_common::CowStr::new_static("#scheduleTakedownEvent"), + ::jacquard_common::CowStr::new_static("#cancelScheduledTakedownEvent") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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("modTool"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#modTool"), + }), + ); + 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("com.atproto.admin.defs#repoRef"), + ::jacquard_common::CowStr::new_static("com.atproto.repo.strongRef"), + ::jacquard_common::CowStr::new_static("chat.bsky.convo.defs#messageRef") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectBlobCids", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::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: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectHandle", + ), + ::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("modEventViewDetail"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("event"), + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("subjectBlobs"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::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( + "createdBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("event"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#modEventTakedown"), + ::jacquard_common::CowStr::new_static("#modEventReverseTakedown"), + ::jacquard_common::CowStr::new_static("#modEventComment"), + ::jacquard_common::CowStr::new_static("#modEventReport"), + ::jacquard_common::CowStr::new_static("#modEventLabel"), + ::jacquard_common::CowStr::new_static("#modEventAcknowledge"), + ::jacquard_common::CowStr::new_static("#modEventEscalate"), + ::jacquard_common::CowStr::new_static("#modEventMute"), + ::jacquard_common::CowStr::new_static("#modEventUnmute"), + ::jacquard_common::CowStr::new_static("#modEventMuteReporter"), + ::jacquard_common::CowStr::new_static("#modEventUnmuteReporter"), + ::jacquard_common::CowStr::new_static("#modEventEmail"), + ::jacquard_common::CowStr::new_static("#modEventResolveAppeal"), + ::jacquard_common::CowStr::new_static("#modEventDivert"), + ::jacquard_common::CowStr::new_static("#modEventTag"), + ::jacquard_common::CowStr::new_static("#accountEvent"), + ::jacquard_common::CowStr::new_static("#identityEvent"), + ::jacquard_common::CowStr::new_static("#recordEvent"), + ::jacquard_common::CowStr::new_static("#modEventPriorityScore"), + ::jacquard_common::CowStr::new_static("#ageAssuranceEvent"), + ::jacquard_common::CowStr::new_static("#ageAssuranceOverrideEvent"), + ::jacquard_common::CowStr::new_static("#revokeAccountCredentialsEvent"), + ::jacquard_common::CowStr::new_static("#scheduleTakedownEvent"), + ::jacquard_common::CowStr::new_static("#cancelScheduledTakedownEvent") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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("modTool"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#modTool"), + }), + ); + 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("#repoView"), + ::jacquard_common::CowStr::new_static("#repoViewNotFound"), + ::jacquard_common::CowStr::new_static("#recordView"), + ::jacquard_common::CowStr::new_static("#recordViewNotFound") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectBlobs", + ), + ::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("#blobView"), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("modTool"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Moderation tool information for tracing the source of the action", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("name")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("meta"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Name/identifier of the source (e.g., 'automod', 'ozone/workspace')", + ), + ), + 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("moderation"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectStatus", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#subjectStatusView", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("moderationDetail"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectStatus", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#subjectStatusView", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("recordEvent"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("timestamp"), + ::jacquard_common::smol_str::SmolStr::new_static("op") + ], + ), + 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("comment"), + ::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("op"), + ::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( + "timestamp", + ), + ::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("recordHosting"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::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( + "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( + "deletedAt", + ), + ::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.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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("recordView"), + ::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("value"), + ::jacquard_common::smol_str::SmolStr::new_static("blobCids"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_common::smol_str::SmolStr::new_static("moderation"), + ::jacquard_common::smol_str::SmolStr::new_static("repo") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blobCids"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + 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( + "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( + "moderation", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#moderation"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#repoView"), + }), + ); + 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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("recordViewDetail"), + ::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("value"), + ::jacquard_common::smol_str::SmolStr::new_static("blobs"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_common::smol_str::SmolStr::new_static("moderation"), + ::jacquard_common::smol_str::SmolStr::new_static("repo") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blobs"), + ::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("#blobView"), + }), + 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( + "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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "moderation", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#moderationDetail", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#repoView"), + }), + ); + 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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("recordViewNotFound"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + 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("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("recordsStats"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Statistics about a set of record subject items", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "appealedCount", + ), + ::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( + "escalatedCount", + ), + ::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( + "pendingCount", + ), + ::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( + "processedCount", + ), + ::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( + "reportedCount", + ), + ::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( + "subjectCount", + ), + ::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( + "takendownCount", + ), + ::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( + "totalReports", + ), + ::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("repoView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_common::smol_str::SmolStr::new_static("relatedRecords"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_common::smol_str::SmolStr::new_static("moderation") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "deactivatedAt", + ), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("email"), + ::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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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( + "inviteNote", + ), + ::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( + "invitedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.server.defs#inviteCode", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "invitesDisabled", + ), + ::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( + "moderation", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#moderation"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "relatedRecords", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "threatSignatures", + ), + ::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( + "com.atproto.admin.defs#threatSignature", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repoViewDetail"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_common::smol_str::SmolStr::new_static("relatedRecords"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_common::smol_str::SmolStr::new_static("moderation") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "deactivatedAt", + ), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("email"), + ::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( + "emailConfirmedAt", + ), + ::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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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( + "inviteNote", + ), + ::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( + "invitedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.server.defs#inviteCode", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("invites"), + ::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( + "com.atproto.server.defs#inviteCode", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "invitesDisabled", + ), + ::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("labels"), + ::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( + "com.atproto.label.defs#label", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "moderation", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#moderationDetail", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "relatedRecords", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "threatSignatures", + ), + ::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( + "com.atproto.admin.defs#threatSignature", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repoViewNotFound"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("did")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("reporterStats"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("accountReportCount"), + ::jacquard_common::smol_str::SmolStr::new_static("recordReportCount"), + ::jacquard_common::smol_str::SmolStr::new_static("reportedAccountCount"), + ::jacquard_common::smol_str::SmolStr::new_static("reportedRecordCount"), + ::jacquard_common::smol_str::SmolStr::new_static("takendownAccountCount"), + ::jacquard_common::smol_str::SmolStr::new_static("takendownRecordCount"), + ::jacquard_common::smol_str::SmolStr::new_static("labeledAccountCount"), + ::jacquard_common::smol_str::SmolStr::new_static("labeledRecordCount") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "accountReportCount", + ), + ::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "labeledAccountCount", + ), + ::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( + "labeledRecordCount", + ), + ::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( + "recordReportCount", + ), + ::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( + "reportedAccountCount", + ), + ::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( + "reportedRecordCount", + ), + ::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( + "takendownAccountCount", + ), + ::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( + "takendownRecordCount", + ), + ::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("reviewClosed"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reviewEscalated"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reviewNone"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reviewOpen"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "revokeAccountCredentialsEvent", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Account credentials revocation by moderators. Only works on DID subjects.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("comment")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Comment describing the reason for the revocation.", + ), + ), + 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( + "scheduleTakedownEvent", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Logs a scheduled takedown action for an account.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::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( + "executeAfter", + ), + ::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( + "executeAt", + ), + ::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( + "executeUntil", + ), + ::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("scheduledActionView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "View of a scheduled moderation action", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("action"), + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::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("action"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Type of action to be executed", + ), + ), + 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( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "When the scheduled action was created", + ), + ), + 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( + "createdBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the user who created this scheduled action", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Subject DID for the action", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "eventData", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "executeAfter", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Earliest time to execute the action (for randomized scheduling)", + ), + ), + 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( + "executeAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Exact time to execute the action", + ), + ), + 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( + "executeUntil", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Latest time to execute the action (for randomized scheduling)", + ), + ), + 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( + "executionEventId", + ), + ::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("id"), + ::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( + "lastExecutedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "When the action was last attempted to be executed", + ), + ), + 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( + "lastFailureReason", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reason for the last execution failure", + ), + ), + 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( + "randomizeExecution", + ), + ::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("status"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Current status of the scheduled action", + ), + ), + 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( + "updatedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "When the scheduled action was last updated", + ), + ), + 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("subjectReviewState"), + ::jacquard_lexicon::lexicon::LexUserType::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("subjectStatusView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::jacquard_common::smol_str::SmolStr::new_static("updatedAt"), + ::jacquard_common::smol_str::SmolStr::new_static("reviewState") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "accountStats", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#accountStats", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "accountStrike", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#accountStrike", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "ageAssuranceState", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Current age assurance state of the subject.", + ), + ), + 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( + "ageAssuranceUpdatedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Whether or not the last successful update to age assurance was made by the user or admin.", + ), + ), + 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("appealed"), + ::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("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Sticky comment on the subject.", + ), + ), + 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( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp referencing the first moderation status impacting event was emitted on the subject", + ), + ), + 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("hosting"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#accountHosting"), + ::jacquard_common::CowStr::new_static("#recordHosting") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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( + "lastAppealedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp referencing when the author of the subject appealed a moderation action", + ), + ), + 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( + "lastReportedAt", + ), + ::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( + "lastReviewedAt", + ), + ::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( + "lastReviewedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "muteReportingUntil", + ), + ::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( + "muteUntil", + ), + ::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( + "priorityScore", + ), + ::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( + "recordsStats", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#recordsStats", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "reviewState", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#subjectReviewState", + ), + }), + ); + 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("com.atproto.admin.defs#repoRef"), + ::jacquard_common::CowStr::new_static("com.atproto.repo.strongRef"), + ::jacquard_common::CowStr::new_static("chat.bsky.convo.defs#messageRef") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectBlobCids", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectRepoHandle", + ), + ::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( + "suspendUntil", + ), + ::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("tags"), + ::jacquard_lexicon::lexicon::LexObjectProperty::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: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "takendown", + ), + ::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( + "updatedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp referencing when the last update was made to the moderation status of the subject", + ), + ), + 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("subjectView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Detailed view of a subject. For record subjects, the author's repo and profile will be returned.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("type"), + ::jacquard_common::smol_str::SmolStr::new_static("subject") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("profile"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![], + closed: 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( + "#recordViewDetail", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("repo"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#repoViewDetail", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#subjectStatusView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::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("type"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.moderation.defs#subjectType", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "timelineEventPlcCreate", + ), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "timelineEventPlcOperation", + ), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "timelineEventPlcTombstone", + ), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("videoDetails"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("width"), + ::jacquard_common::smol_str::SmolStr::new_static("height"), + ::jacquard_common::smol_str::SmolStr::new_static("length") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("height"), + ::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("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("width"), + ::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 AccountEvent<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "accountEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AccountHosting<'a> { + #[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 deactivated_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub deleted_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reactivated_at: std::option::Option, + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub updated_at: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AccountHosting<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "accountHosting" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Statistics about a particular account subject +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AccountStats<'a> { + /// Total number of appeals against a moderation action on the account + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub appeal_count: std::option::Option, + /// Number of times the account was escalated + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub escalate_count: std::option::Option, + /// Total number of reports on the account + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub report_count: std::option::Option, + /// Number of times the account was suspended + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub suspend_count: std::option::Option, + /// Number of times the account was taken down + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub takedown_count: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AccountStats<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "accountStats" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Strike information for an account +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AccountStrike<'a> { + /// Current number of active strikes (excluding expired strikes) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub active_strike_count: std::option::Option, + /// Timestamp of the first strike received + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub first_strike_at: std::option::Option, + /// Timestamp of the most recent strike received + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_strike_at: std::option::Option, + /// Total number of strikes ever received (including expired strikes) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub total_strike_count: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AccountStrike<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "accountStrike" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Age assurance info coming directly from users. Only works on DID subjects. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct AgeAssuranceEvent<'a> { + /// The unique identifier for this instance of the age assurance flow, in UUID format. + #[serde(borrow)] + pub attempt_id: jacquard_common::CowStr<'a>, + /// The IP address used when completing the AA flow. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub complete_ip: Option>, + /// The user agent used when completing the AA flow. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub complete_ua: Option>, + /// The date and time of this write operation. + pub created_at: jacquard_common::types::string::Datetime, + /// The IP address used when initiating the AA flow. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub init_ip: Option>, + /// The user agent used when initiating the AA flow. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub init_ua: Option>, + /// The status of the age assurance process. + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, +} + +pub mod age_assurance_event_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 CreatedAt; + type Status; + 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 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; + 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AgeAssuranceEventBuilder<'a, S: age_assurance_event_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> AgeAssuranceEvent<'a> { + /// Create a new builder for this type + pub fn new() -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> { + AgeAssuranceEventBuilder::new() + } +} + +impl<'a> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AgeAssuranceEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AgeAssuranceEventBuilder<'a, S> +where + S: age_assurance_event_state::State, + S::AttemptId: age_assurance_event_state::IsUnset, +{ + /// Set the `attemptId` field (required) + pub fn attempt_id( + mut self, + value: impl Into>, + ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetAttemptId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AgeAssuranceEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `completeIp` field (optional) + pub fn complete_ip( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `completeIp` field to an Option value (optional) + pub fn maybe_complete_ip( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `completeUa` field (optional) + pub fn complete_ua( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `completeUa` field to an Option value (optional) + pub fn maybe_complete_ua( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> AgeAssuranceEventBuilder<'a, S> +where + S: age_assurance_event_state::State, + S::CreatedAt: age_assurance_event_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetCreatedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + AgeAssuranceEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `initIp` field (optional) + pub fn init_ip( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `initIp` field to an Option value (optional) + pub fn maybe_init_ip(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> { + /// Set the `initUa` field (optional) + pub fn init_ua( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `initUa` field to an Option value (optional) + pub fn maybe_init_ua(mut self, value: Option>) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> AgeAssuranceEventBuilder<'a, S> +where + S: age_assurance_event_state::State, + S::Status: age_assurance_event_state::IsUnset, +{ + /// Set the `status` field (required) + pub fn status( + mut self, + value: impl Into>, + ) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetStatus> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + AgeAssuranceEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> AgeAssuranceEvent<'a> { + AgeAssuranceEvent { + attempt_id: self.__unsafe_private_named.0.unwrap(), + complete_ip: self.__unsafe_private_named.1, + complete_ua: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3.unwrap(), + init_ip: self.__unsafe_private_named.4, + init_ua: self.__unsafe_private_named.5, + status: 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>, + >, + ) -> AgeAssuranceEvent<'a> { + AgeAssuranceEvent { + attempt_id: self.__unsafe_private_named.0.unwrap(), + complete_ip: self.__unsafe_private_named.1, + complete_ua: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3.unwrap(), + init_ip: self.__unsafe_private_named.4, + init_ua: self.__unsafe_private_named.5, + status: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AgeAssuranceEvent<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "ageAssuranceEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Age assurance status override by moderators. Only works on DID subjects. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct AgeAssuranceOverrideEvent<'a> { + /// Comment describing the reason for the override. + #[serde(borrow)] + pub comment: jacquard_common::CowStr<'a>, + /// The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state. + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AgeAssuranceOverrideEvent<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "ageAssuranceOverrideEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 BlobView<'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")] + #[serde(borrow)] + pub details: Option>, + #[serde(borrow)] + pub mime_type: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub moderation: Option>, + pub size: i64, +} + +pub mod blob_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 Cid; + 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 Cid = Unset; + type MimeType = Unset; + 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 Cid = Set; + 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 Cid = S::Cid; + type MimeType = S::MimeType; + 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 CreatedAt = 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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BlobViewBuilder<'a, S: blob_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, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> BlobView<'a> { + /// Create a new builder for this type + pub fn new() -> BlobViewBuilder<'a, blob_view_state::Empty> { + BlobViewBuilder::new() + } +} + +impl<'a> BlobViewBuilder<'a, blob_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BlobViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlobViewBuilder<'a, S> +where + S: blob_view_state::State, + S::Cid: blob_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> BlobViewBuilder<'a, blob_view_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + BlobViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlobViewBuilder<'a, S> +where + S: blob_view_state::State, + S::CreatedAt: blob_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> BlobViewBuilder<'a, blob_view_state::SetCreatedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + BlobViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: blob_view_state::State> BlobViewBuilder<'a, S> { + /// Set the `details` field (optional) + pub fn details(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `details` field to an Option value (optional) + pub fn maybe_details(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> BlobViewBuilder<'a, S> +where + S: blob_view_state::State, + S::MimeType: blob_view_state::IsUnset, +{ + /// Set the `mimeType` field (required) + pub fn mime_type( + mut self, + value: impl Into>, + ) -> BlobViewBuilder<'a, blob_view_state::SetMimeType> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + BlobViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: blob_view_state::State> BlobViewBuilder<'a, S> { + /// Set the `moderation` field (optional) + pub fn moderation( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `moderation` field to an Option value (optional) + pub fn maybe_moderation( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> BlobViewBuilder<'a, S> +where + S: blob_view_state::State, + S::Size: blob_view_state::IsUnset, +{ + /// Set the `size` field (required) + pub fn size( + mut self, + value: impl Into, + ) -> BlobViewBuilder<'a, blob_view_state::SetSize> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + BlobViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlobViewBuilder<'a, S> +where + S: blob_view_state::State, + S::Cid: 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> { + BlobView { + cid: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + details: self.__unsafe_private_named.2, + mime_type: self.__unsafe_private_named.3.unwrap(), + moderation: self.__unsafe_private_named.4, + size: 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>, + >, + ) -> BlobView<'a> { + BlobView { + cid: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + details: self.__unsafe_private_named.2, + mime_type: self.__unsafe_private_named.3.unwrap(), + moderation: self.__unsafe_private_named.4, + size: 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 BlobViewDetails<'a> { + #[serde(rename = "tools.ozone.moderation.defs#imageDetails")] + ImageDetails(Box>), + #[serde(rename = "tools.ozone.moderation.defs#videoDetails")] + VideoDetails(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BlobView<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "blobView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Logs cancellation of a scheduled takedown action for an account. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct CancelScheduledTakedownEvent<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CancelScheduledTakedownEvent<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "cancelScheduledTakedownEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct IdentityEvent<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub handle: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pds_host: Option>, + pub timestamp: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub tombstone: Option, +} + +pub mod identity_event_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 Timestamp; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Timestamp = Unset; + } + ///State transition - sets the `timestamp` field to Set + pub struct SetTimestamp(PhantomData S>); + impl sealed::Sealed for SetTimestamp {} + impl State for SetTimestamp { + type Timestamp = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `timestamp` field + pub struct timestamp(()); + } +} + +/// Builder for constructing an instance of this type +pub struct IdentityEventBuilder<'a, S: identity_event_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> IdentityEvent<'a> { + /// Create a new builder for this type + pub fn new() -> IdentityEventBuilder<'a, identity_event_state::Empty> { + IdentityEventBuilder::new() + } +} + +impl<'a> IdentityEventBuilder<'a, identity_event_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + IdentityEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> { + /// Set the `handle` field (optional) + pub fn handle( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `handle` field to an Option value (optional) + pub fn maybe_handle( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> { + /// Set the `pdsHost` field (optional) + pub fn pds_host( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `pdsHost` field to an Option value (optional) + pub fn maybe_pds_host( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> IdentityEventBuilder<'a, S> +where + S: identity_event_state::State, + S::Timestamp: identity_event_state::IsUnset, +{ + /// Set the `timestamp` field (required) + pub fn timestamp( + mut self, + value: impl Into, + ) -> IdentityEventBuilder<'a, identity_event_state::SetTimestamp> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + IdentityEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: identity_event_state::State> IdentityEventBuilder<'a, S> { + /// Set the `tombstone` field (optional) + pub fn tombstone(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `tombstone` field to an Option value (optional) + pub fn maybe_tombstone(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> IdentityEventBuilder<'a, S> +where + S: identity_event_state::State, + S::Timestamp: identity_event_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> IdentityEvent<'a> { + IdentityEvent { + comment: self.__unsafe_private_named.0, + handle: self.__unsafe_private_named.1, + pds_host: self.__unsafe_private_named.2, + timestamp: self.__unsafe_private_named.3.unwrap(), + tombstone: self.__unsafe_private_named.4, + 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>, + >, + ) -> IdentityEvent<'a> { + IdentityEvent { + comment: self.__unsafe_private_named.0, + handle: self.__unsafe_private_named.1, + pds_host: self.__unsafe_private_named.2, + timestamp: self.__unsafe_private_named.3.unwrap(), + tombstone: self.__unsafe_private_named.4, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for IdentityEvent<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "identityEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 ImageDetails<'a> { + pub height: i64, + pub width: i64, +} + +pub mod image_details_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 Width; + type Height; + } + /// 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; + } + ///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 `width` field + pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ImageDetailsBuilder<'a, S: image_details_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ImageDetails<'a> { + /// Create a new builder for this type + pub fn new() -> ImageDetailsBuilder<'a, image_details_state::Empty> { + ImageDetailsBuilder::new() + } +} + +impl<'a> ImageDetailsBuilder<'a, image_details_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ImageDetailsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImageDetailsBuilder<'a, S> +where + S: image_details_state::State, + S::Height: image_details_state::IsUnset, +{ + /// Set the `height` field (required) + pub fn height( + mut self, + value: impl Into, + ) -> ImageDetailsBuilder<'a, image_details_state::SetHeight> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ImageDetailsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImageDetailsBuilder<'a, S> +where + S: image_details_state::State, + S::Width: image_details_state::IsUnset, +{ + /// Set the `width` field (required) + pub fn width( + mut self, + value: impl Into, + ) -> ImageDetailsBuilder<'a, image_details_state::SetWidth> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ImageDetailsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ImageDetailsBuilder<'a, S> +where + S: image_details_state::State, + S::Width: image_details_state::IsSet, + S::Height: image_details_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ImageDetails<'a> { + ImageDetails { + height: self.__unsafe_private_named.0.unwrap(), + width: 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>, + >, + ) -> ImageDetails<'a> { + ImageDetails { + height: self.__unsafe_private_named.0.unwrap(), + width: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ImageDetails<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "imageDetails" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventAcknowledge<'a> { + /// If true, all other reports on content authored by this account will be resolved (acknowledged). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub acknowledge_account_subjects: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventAcknowledge<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventAcknowledge" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Add a comment to a subject. An empty comment will clear any previously set sticky comment. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventComment<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, + /// Make the comment persistent on the subject + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub sticky: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventComment<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventComment" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Divert a record's blobs to a 3rd party service for further scanning/tagging +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventDivert<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventDivert<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventDivert" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Keep a log of outgoing email to a user +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventEmail<'a> { + /// Additional comment about the outgoing comm. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, + /// The content of the email sent to the user. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub content: std::option::Option>, + /// Names/Keywords of the policies that necessitated the email. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub policies: std::option::Option>>, + /// Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub severity_level: std::option::Option>, + /// Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub strike_count: std::option::Option, + /// When the strike should expire. If not provided, the strike never expires. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub strike_expires_at: std::option::Option, + /// The subject line of the email sent to the user. + #[serde(borrow)] + pub subject_line: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventEmail<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventEmail" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.policies { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "policies", + ), + max: 5usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventEscalate<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventEscalate<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventEscalate" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Apply/Negate labels on a subject +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventLabel<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + #[serde(borrow)] + pub create_label_vals: Vec>, + /// Indicates how long the label will remain on the subject. Only applies on labels that are being added. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub duration_in_hours: Option, + #[serde(borrow)] + pub negate_label_vals: Vec>, +} + +pub mod mod_event_label_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 CreateLabelVals; + type NegateLabelVals; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type CreateLabelVals = Unset; + type NegateLabelVals = Unset; + } + ///State transition - sets the `create_label_vals` field to Set + pub struct SetCreateLabelVals(PhantomData S>); + impl sealed::Sealed for SetCreateLabelVals {} + impl State for SetCreateLabelVals { + type CreateLabelVals = Set; + type NegateLabelVals = S::NegateLabelVals; + } + ///State transition - sets the `negate_label_vals` field to Set + pub struct SetNegateLabelVals(PhantomData S>); + impl sealed::Sealed for SetNegateLabelVals {} + impl State for SetNegateLabelVals { + type CreateLabelVals = S::CreateLabelVals; + type NegateLabelVals = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `create_label_vals` field + pub struct create_label_vals(()); + ///Marker type for the `negate_label_vals` field + pub struct negate_label_vals(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ModEventLabelBuilder<'a, S: mod_event_label_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> ModEventLabel<'a> { + /// Create a new builder for this type + pub fn new() -> ModEventLabelBuilder<'a, mod_event_label_state::Empty> { + ModEventLabelBuilder::new() + } +} + +impl<'a> ModEventLabelBuilder<'a, mod_event_label_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ModEventLabelBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_label_state::State> ModEventLabelBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ModEventLabelBuilder<'a, S> +where + S: mod_event_label_state::State, + S::CreateLabelVals: mod_event_label_state::IsUnset, +{ + /// Set the `createLabelVals` field (required) + pub fn create_label_vals( + mut self, + value: impl Into>>, + ) -> ModEventLabelBuilder<'a, mod_event_label_state::SetCreateLabelVals> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ModEventLabelBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_label_state::State> ModEventLabelBuilder<'a, S> { + /// Set the `durationInHours` field (optional) + pub fn duration_in_hours(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `durationInHours` field to an Option value (optional) + pub fn maybe_duration_in_hours(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ModEventLabelBuilder<'a, S> +where + S: mod_event_label_state::State, + S::NegateLabelVals: mod_event_label_state::IsUnset, +{ + /// Set the `negateLabelVals` field (required) + pub fn negate_label_vals( + mut self, + value: impl Into>>, + ) -> ModEventLabelBuilder<'a, mod_event_label_state::SetNegateLabelVals> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ModEventLabelBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventLabelBuilder<'a, S> +where + S: mod_event_label_state::State, + S::CreateLabelVals: mod_event_label_state::IsSet, + S::NegateLabelVals: mod_event_label_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ModEventLabel<'a> { + ModEventLabel { + comment: self.__unsafe_private_named.0, + create_label_vals: self.__unsafe_private_named.1.unwrap(), + duration_in_hours: self.__unsafe_private_named.2, + negate_label_vals: 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>, + >, + ) -> ModEventLabel<'a> { + ModEventLabel { + comment: self.__unsafe_private_named.0, + create_label_vals: self.__unsafe_private_named.1.unwrap(), + duration_in_hours: self.__unsafe_private_named.2, + negate_label_vals: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventLabel<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventLabel" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Mute incoming reports on a subject +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventMute<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Indicates how long the subject should remain muted. + pub duration_in_hours: i64, +} + +pub mod mod_event_mute_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 DurationInHours; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type DurationInHours = Unset; + } + ///State transition - sets the `duration_in_hours` field to Set + pub struct SetDurationInHours(PhantomData S>); + impl sealed::Sealed for SetDurationInHours {} + impl State for SetDurationInHours { + type DurationInHours = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `duration_in_hours` field + pub struct duration_in_hours(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ModEventMuteBuilder<'a, S: mod_event_mute_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ModEventMute<'a> { + /// Create a new builder for this type + pub fn new() -> ModEventMuteBuilder<'a, mod_event_mute_state::Empty> { + ModEventMuteBuilder::new() + } +} + +impl<'a> ModEventMuteBuilder<'a, mod_event_mute_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ModEventMuteBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_mute_state::State> ModEventMuteBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ModEventMuteBuilder<'a, S> +where + S: mod_event_mute_state::State, + S::DurationInHours: mod_event_mute_state::IsUnset, +{ + /// Set the `durationInHours` field (required) + pub fn duration_in_hours( + mut self, + value: impl Into, + ) -> ModEventMuteBuilder<'a, mod_event_mute_state::SetDurationInHours> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ModEventMuteBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventMuteBuilder<'a, S> +where + S: mod_event_mute_state::State, + S::DurationInHours: mod_event_mute_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ModEventMute<'a> { + ModEventMute { + comment: self.__unsafe_private_named.0, + duration_in_hours: 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>, + >, + ) -> ModEventMute<'a> { + ModEventMute { + comment: self.__unsafe_private_named.0, + duration_in_hours: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventMute<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventMute" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Mute incoming reports from an account +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventMuteReporter<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, + /// Indicates how long the account should remain muted. Falsy value here means a permanent mute. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub duration_in_hours: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventMuteReporter<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventMuteReporter" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Set priority score of the subject. Higher score means higher priority. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventPriorityScore<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + pub score: i64, +} + +pub mod mod_event_priority_score_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 Score; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Score = Unset; + } + ///State transition - sets the `score` field to Set + pub struct SetScore(PhantomData S>); + impl sealed::Sealed for SetScore {} + impl State for SetScore { + type Score = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `score` field + pub struct score(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ModEventPriorityScoreBuilder<'a, S: mod_event_priority_score_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ModEventPriorityScore<'a> { + /// Create a new builder for this type + pub fn new() -> ModEventPriorityScoreBuilder< + 'a, + mod_event_priority_score_state::Empty, + > { + ModEventPriorityScoreBuilder::new() + } +} + +impl<'a> ModEventPriorityScoreBuilder<'a, mod_event_priority_score_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ModEventPriorityScoreBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_priority_score_state::State> ModEventPriorityScoreBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ModEventPriorityScoreBuilder<'a, S> +where + S: mod_event_priority_score_state::State, + S::Score: mod_event_priority_score_state::IsUnset, +{ + /// Set the `score` field (required) + pub fn score( + mut self, + value: impl Into, + ) -> ModEventPriorityScoreBuilder<'a, mod_event_priority_score_state::SetScore> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ModEventPriorityScoreBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventPriorityScoreBuilder<'a, S> +where + S: mod_event_priority_score_state::State, + S::Score: mod_event_priority_score_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ModEventPriorityScore<'a> { + ModEventPriorityScore { + comment: self.__unsafe_private_named.0, + score: 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>, + >, + ) -> ModEventPriorityScore<'a> { + ModEventPriorityScore { + comment: self.__unsafe_private_named.0, + score: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventPriorityScore<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventPriorityScore" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.score; + if *value > 100i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "score", + ), + max: 100i64, + actual: *value, + }); + } + } + { + let value = &self.score; + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "score", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} + +/// Report a subject +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventReport<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Set to true if the reporter was muted from reporting at the time of the event. These reports won't impact the reviewState of the subject. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub is_reporter_muted: Option, + #[serde(borrow)] + pub report_type: crate::com_atproto::moderation::ReasonType<'a>, +} + +pub mod mod_event_report_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 ReportType; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ReportType = Unset; + } + ///State transition - sets the `report_type` field to Set + pub struct SetReportType(PhantomData S>); + impl sealed::Sealed for SetReportType {} + impl State for SetReportType { + type ReportType = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `report_type` field + pub struct report_type(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ModEventReportBuilder<'a, S: mod_event_report_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> ModEventReport<'a> { + /// Create a new builder for this type + pub fn new() -> ModEventReportBuilder<'a, mod_event_report_state::Empty> { + ModEventReportBuilder::new() + } +} + +impl<'a> ModEventReportBuilder<'a, mod_event_report_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ModEventReportBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_report_state::State> ModEventReportBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: mod_event_report_state::State> ModEventReportBuilder<'a, S> { + /// Set the `isReporterMuted` field (optional) + pub fn is_reporter_muted(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `isReporterMuted` field to an Option value (optional) + pub fn maybe_is_reporter_muted(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ModEventReportBuilder<'a, S> +where + S: mod_event_report_state::State, + S::ReportType: mod_event_report_state::IsUnset, +{ + /// Set the `reportType` field (required) + pub fn report_type( + mut self, + value: impl Into>, + ) -> ModEventReportBuilder<'a, mod_event_report_state::SetReportType> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ModEventReportBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventReportBuilder<'a, S> +where + S: mod_event_report_state::State, + S::ReportType: mod_event_report_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ModEventReport<'a> { + ModEventReport { + comment: self.__unsafe_private_named.0, + is_reporter_muted: self.__unsafe_private_named.1, + report_type: 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>, + >, + ) -> ModEventReport<'a> { + ModEventReport { + comment: self.__unsafe_private_named.0, + is_reporter_muted: self.__unsafe_private_named.1, + report_type: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventReport<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventReport" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Resolve appeal on a subject +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventResolveAppeal<'a> { + /// Describe resolution. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventResolveAppeal<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventResolveAppeal" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Revert take down action on a subject +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventReverseTakedown<'a> { + /// Describe reasoning behind the reversal. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, + /// Names/Keywords of the policy infraction for which takedown is being reversed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub policies: std::option::Option>>, + /// Severity level of the violation. Usually set from the last policy infraction's severity. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub severity_level: std::option::Option>, + /// Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub strike_count: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventReverseTakedown<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventReverseTakedown" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.policies { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "policies", + ), + max: 5usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +/// Add/Remove a tag on a subject +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventTag<'a> { + /// Tags to be added to the subject. If already exists, won't be duplicated. + #[serde(borrow)] + pub add: Vec>, + /// Additional comment about added/removed tags. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. + #[serde(borrow)] + pub remove: Vec>, +} + +pub mod mod_event_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 Add; + type Remove; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Add = Unset; + type Remove = Unset; + } + ///State transition - sets the `add` field to Set + pub struct SetAdd(PhantomData S>); + impl sealed::Sealed for SetAdd {} + impl State for SetAdd { + type Add = Set; + type Remove = S::Remove; + } + ///State transition - sets the `remove` field to Set + pub struct SetRemove(PhantomData S>); + impl sealed::Sealed for SetRemove {} + impl State for SetRemove { + type Add = S::Add; + type Remove = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `add` field + pub struct add(()); + ///Marker type for the `remove` field + pub struct remove(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ModEventTagBuilder<'a, S: mod_event_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> ModEventTag<'a> { + /// Create a new builder for this type + pub fn new() -> ModEventTagBuilder<'a, mod_event_tag_state::Empty> { + ModEventTagBuilder::new() + } +} + +impl<'a> ModEventTagBuilder<'a, mod_event_tag_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ModEventTagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventTagBuilder<'a, S> +where + S: mod_event_tag_state::State, + S::Add: mod_event_tag_state::IsUnset, +{ + /// Set the `add` field (required) + pub fn add( + mut self, + value: impl Into>>, + ) -> ModEventTagBuilder<'a, mod_event_tag_state::SetAdd> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ModEventTagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_tag_state::State> ModEventTagBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ModEventTagBuilder<'a, S> +where + S: mod_event_tag_state::State, + S::Remove: mod_event_tag_state::IsUnset, +{ + /// Set the `remove` field (required) + pub fn remove( + mut self, + value: impl Into>>, + ) -> ModEventTagBuilder<'a, mod_event_tag_state::SetRemove> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ModEventTagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventTagBuilder<'a, S> +where + S: mod_event_tag_state::State, + S::Add: mod_event_tag_state::IsSet, + S::Remove: mod_event_tag_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ModEventTag<'a> { + ModEventTag { + add: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + remove: 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>, + >, + ) -> ModEventTag<'a> { + ModEventTag { + add: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + remove: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventTag<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventTag" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Take down a subject permanently or temporarily +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventTakedown<'a> { + /// If true, all other reports on content authored by this account will be resolved (acknowledged). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub acknowledge_account_subjects: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, + /// Indicates how long the takedown should be in effect before automatically expiring. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub duration_in_hours: std::option::Option, + /// Names/Keywords of the policies that drove the decision. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub policies: std::option::Option>>, + /// Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub severity_level: std::option::Option>, + /// Number of strikes to assign to the user for this violation. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub strike_count: std::option::Option, + /// When the strike should expire. If not provided, the strike never expires. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub strike_expires_at: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventTakedown<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventTakedown" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.policies { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "policies", + ), + max: 5usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +/// Unmute action on a subject +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventUnmute<'a> { + /// Describe reasoning behind the reversal. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventUnmute<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventUnmute" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Unmute incoming reports from an account +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModEventUnmuteReporter<'a> { + /// Describe reasoning behind the reversal. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventUnmuteReporter<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventUnmuteReporter" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 ModEventView<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub created_by: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub creator_handle: Option>, + #[serde(borrow)] + pub event: ModEventViewEvent<'a>, + pub id: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub mod_tool: Option>, + #[serde(borrow)] + pub subject: ModEventViewSubject<'a>, + #[serde(borrow)] + pub subject_blob_cids: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_handle: Option>, +} + +pub mod mod_event_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 Id; + type Event; + type Subject; + type SubjectBlobCids; + type CreatedBy; + 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 Event = Unset; + type Subject = Unset; + type SubjectBlobCids = 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 Id = Set; + type Event = S::Event; + type Subject = S::Subject; + type SubjectBlobCids = S::SubjectBlobCids; + 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 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 Subject = Set; + type SubjectBlobCids = S::SubjectBlobCids; + 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 = S::Event; + type Subject = S::Subject; + type SubjectBlobCids = 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 = S::Subject; + type SubjectBlobCids = S::SubjectBlobCids; + 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 Subject = S::Subject; + type SubjectBlobCids = S::SubjectBlobCids; + type CreatedBy = S::CreatedBy; + 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 `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 `created_by` field + pub struct created_by(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ModEventViewBuilder<'a, S: mod_event_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ModEventView<'a> { + /// Create a new builder for this type + pub fn new() -> ModEventViewBuilder<'a, mod_event_view_state::Empty> { + ModEventViewBuilder::new() + } +} + +impl<'a> ModEventViewBuilder<'a, mod_event_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ModEventViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewBuilder<'a, S> +where + S: mod_event_view_state::State, + S::CreatedAt: mod_event_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ModEventViewBuilder<'a, mod_event_view_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ModEventViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewBuilder<'a, S> +where + S: mod_event_view_state::State, + S::CreatedBy: mod_event_view_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> ModEventViewBuilder<'a, mod_event_view_state::SetCreatedBy> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ModEventViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> { + /// Set the `creatorHandle` field (optional) + pub fn creator_handle( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `creatorHandle` field to an Option value (optional) + pub fn maybe_creator_handle( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ModEventViewBuilder<'a, S> +where + S: mod_event_view_state::State, + S::Event: mod_event_view_state::IsUnset, +{ + /// Set the `event` field (required) + pub fn event( + mut self, + value: impl Into>, + ) -> ModEventViewBuilder<'a, mod_event_view_state::SetEvent> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ModEventViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewBuilder<'a, S> +where + S: mod_event_view_state::State, + S::Id: mod_event_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> ModEventViewBuilder<'a, mod_event_view_state::SetId> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ModEventViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> { + /// Set the `modTool` field (optional) + pub fn mod_tool( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `modTool` field to an Option value (optional) + pub fn maybe_mod_tool( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> ModEventViewBuilder<'a, S> +where + S: mod_event_view_state::State, + S::Subject: mod_event_view_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> ModEventViewBuilder<'a, mod_event_view_state::SetSubject> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + ModEventViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewBuilder<'a, S> +where + S: mod_event_view_state::State, + S::SubjectBlobCids: mod_event_view_state::IsUnset, +{ + /// Set the `subjectBlobCids` field (required) + pub fn subject_blob_cids( + mut self, + value: impl Into>>, + ) -> ModEventViewBuilder<'a, mod_event_view_state::SetSubjectBlobCids> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + ModEventViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> { + /// Set the `subjectHandle` field (optional) + pub fn subject_handle( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `subjectHandle` field to an Option value (optional) + pub fn maybe_subject_handle( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> ModEventViewBuilder<'a, S> +where + S: mod_event_view_state::State, + 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::CreatedBy: mod_event_view_state::IsSet, + S::CreatedAt: mod_event_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ModEventView<'a> { + ModEventView { + created_at: self.__unsafe_private_named.0.unwrap(), + created_by: self.__unsafe_private_named.1.unwrap(), + creator_handle: self.__unsafe_private_named.2, + event: self.__unsafe_private_named.3.unwrap(), + id: self.__unsafe_private_named.4.unwrap(), + mod_tool: self.__unsafe_private_named.5, + subject: self.__unsafe_private_named.6.unwrap(), + subject_blob_cids: self.__unsafe_private_named.7.unwrap(), + subject_handle: self.__unsafe_private_named.8, + 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>, + >, + ) -> ModEventView<'a> { + ModEventView { + created_at: self.__unsafe_private_named.0.unwrap(), + created_by: self.__unsafe_private_named.1.unwrap(), + creator_handle: self.__unsafe_private_named.2, + event: self.__unsafe_private_named.3.unwrap(), + id: self.__unsafe_private_named.4.unwrap(), + mod_tool: self.__unsafe_private_named.5, + subject: self.__unsafe_private_named.6.unwrap(), + subject_blob_cids: self.__unsafe_private_named.7.unwrap(), + subject_handle: self.__unsafe_private_named.8, + 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 ModEventViewEvent<'a> { + #[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")] + ModEventTakedown(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")] + ModEventReverseTakedown( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventComment")] + ModEventComment(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventReport")] + ModEventReport(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventLabel")] + ModEventLabel(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")] + ModEventAcknowledge(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")] + ModEventEscalate(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventMute")] + ModEventMute(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")] + ModEventUnmute(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")] + ModEventMuteReporter(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")] + ModEventUnmuteReporter( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventEmail")] + ModEventEmail(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")] + ModEventResolveAppeal( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventDivert")] + ModEventDivert(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventTag")] + ModEventTag(Box>), + #[serde(rename = "tools.ozone.moderation.defs#accountEvent")] + AccountEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#identityEvent")] + IdentityEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#recordEvent")] + RecordEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")] + ModEventPriorityScore( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")] + AgeAssuranceEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")] + AgeAssuranceOverrideEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")] + RevokeAccountCredentialsEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")] + ScheduleTakedownEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")] + CancelScheduledTakedownEvent( + Box>, + ), +} + +#[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 ModEventViewSubject<'a> { + #[serde(rename = "com.atproto.admin.defs#repoRef")] + RepoRef(Box>), + #[serde(rename = "com.atproto.repo.strongRef")] + StrongRef(Box>), + #[serde(rename = "chat.bsky.convo.defs#messageRef")] + MessageRef(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventView<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 ModEventViewDetail<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub created_by: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub event: ModEventViewDetailEvent<'a>, + pub id: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub mod_tool: Option>, + #[serde(borrow)] + pub subject: ModEventViewDetailSubject<'a>, + #[serde(borrow)] + pub subject_blobs: Vec>, +} + +pub mod mod_event_view_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 Id; + type Event; + type Subject; + type SubjectBlobs; + type CreatedBy; + 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 Event = Unset; + type Subject = Unset; + type SubjectBlobs = 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 Id = Set; + type Event = S::Event; + type Subject = S::Subject; + type SubjectBlobs = S::SubjectBlobs; + 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 Subject = S::Subject; + type SubjectBlobs = S::SubjectBlobs; + 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 Subject = Set; + type SubjectBlobs = S::SubjectBlobs; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `subject_blobs` field to Set + pub struct SetSubjectBlobs(PhantomData S>); + impl sealed::Sealed for SetSubjectBlobs {} + impl State for SetSubjectBlobs { + type Id = S::Id; + type Event = S::Event; + type Subject = S::Subject; + type SubjectBlobs = 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 = S::Subject; + type SubjectBlobs = S::SubjectBlobs; + 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 Subject = S::Subject; + type SubjectBlobs = S::SubjectBlobs; + type CreatedBy = S::CreatedBy; + 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 `event` field + pub struct event(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `subject_blobs` field + pub struct subject_blobs(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ModEventViewDetailBuilder<'a, S: mod_event_view_detail_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> ModEventViewDetail<'a> { + /// Create a new builder for this type + pub fn new() -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::Empty> { + ModEventViewDetailBuilder::new() + } +} + +impl<'a> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ModEventViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewDetailBuilder<'a, S> +where + S: mod_event_view_detail_state::State, + S::CreatedAt: mod_event_view_detail_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ModEventViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewDetailBuilder<'a, S> +where + S: mod_event_view_detail_state::State, + S::CreatedBy: mod_event_view_detail_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetCreatedBy> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ModEventViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewDetailBuilder<'a, S> +where + S: mod_event_view_detail_state::State, + S::Event: mod_event_view_detail_state::IsUnset, +{ + /// Set the `event` field (required) + pub fn event( + mut self, + value: impl Into>, + ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetEvent> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ModEventViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewDetailBuilder<'a, S> +where + S: mod_event_view_detail_state::State, + S::Id: mod_event_view_detail_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetId> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ModEventViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: mod_event_view_detail_state::State> ModEventViewDetailBuilder<'a, S> { + /// Set the `modTool` field (optional) + pub fn mod_tool( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `modTool` field to an Option value (optional) + pub fn maybe_mod_tool( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ModEventViewDetailBuilder<'a, S> +where + S: mod_event_view_detail_state::State, + S::Subject: mod_event_view_detail_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetSubject> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + ModEventViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewDetailBuilder<'a, S> +where + S: mod_event_view_detail_state::State, + S::SubjectBlobs: mod_event_view_detail_state::IsUnset, +{ + /// Set the `subjectBlobs` field (required) + pub fn subject_blobs( + mut self, + value: impl Into>>, + ) -> ModEventViewDetailBuilder<'a, mod_event_view_detail_state::SetSubjectBlobs> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + ModEventViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ModEventViewDetailBuilder<'a, S> +where + S: mod_event_view_detail_state::State, + S::Id: mod_event_view_detail_state::IsSet, + S::Event: mod_event_view_detail_state::IsSet, + S::Subject: mod_event_view_detail_state::IsSet, + S::SubjectBlobs: mod_event_view_detail_state::IsSet, + S::CreatedBy: mod_event_view_detail_state::IsSet, + S::CreatedAt: mod_event_view_detail_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ModEventViewDetail<'a> { + ModEventViewDetail { + created_at: self.__unsafe_private_named.0.unwrap(), + created_by: self.__unsafe_private_named.1.unwrap(), + event: self.__unsafe_private_named.2.unwrap(), + id: self.__unsafe_private_named.3.unwrap(), + mod_tool: self.__unsafe_private_named.4, + subject: self.__unsafe_private_named.5.unwrap(), + subject_blobs: 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>, + >, + ) -> ModEventViewDetail<'a> { + ModEventViewDetail { + created_at: self.__unsafe_private_named.0.unwrap(), + created_by: self.__unsafe_private_named.1.unwrap(), + event: self.__unsafe_private_named.2.unwrap(), + id: self.__unsafe_private_named.3.unwrap(), + mod_tool: self.__unsafe_private_named.4, + subject: self.__unsafe_private_named.5.unwrap(), + subject_blobs: self.__unsafe_private_named.6.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 ModEventViewDetailEvent<'a> { + #[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")] + ModEventTakedown(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")] + ModEventReverseTakedown( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventComment")] + ModEventComment(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventReport")] + ModEventReport(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventLabel")] + ModEventLabel(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")] + ModEventAcknowledge(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")] + ModEventEscalate(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventMute")] + ModEventMute(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")] + ModEventUnmute(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")] + ModEventMuteReporter(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")] + ModEventUnmuteReporter( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventEmail")] + ModEventEmail(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")] + ModEventResolveAppeal( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventDivert")] + ModEventDivert(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventTag")] + ModEventTag(Box>), + #[serde(rename = "tools.ozone.moderation.defs#accountEvent")] + AccountEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#identityEvent")] + IdentityEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#recordEvent")] + RecordEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")] + ModEventPriorityScore( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")] + AgeAssuranceEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")] + AgeAssuranceOverrideEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")] + RevokeAccountCredentialsEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")] + ScheduleTakedownEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")] + CancelScheduledTakedownEvent( + Box>, + ), +} + +#[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 ModEventViewDetailSubject<'a> { + #[serde(rename = "tools.ozone.moderation.defs#repoView")] + RepoView(Box>), + #[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")] + RepoViewNotFound(Box>), + #[serde(rename = "tools.ozone.moderation.defs#recordView")] + RecordView(Box>), + #[serde(rename = "tools.ozone.moderation.defs#recordViewNotFound")] + RecordViewNotFound(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventViewDetail<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modEventViewDetail" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Moderation tool information for tracing the source of the action +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModTool<'a> { + /// Additional arbitrary metadata about the source + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub meta: std::option::Option>, + /// Name/identifier of the source (e.g., 'automod', 'ozone/workspace') + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModTool<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "modTool" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Moderation<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_status: std::option::Option< + crate::tools_ozone::moderation::SubjectStatusView<'a>, + >, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Moderation<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "moderation" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ModerationDetail<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_status: std::option::Option< + crate::tools_ozone::moderation::SubjectStatusView<'a>, + >, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModerationDetail<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "moderationDetail" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Logs lifecycle event on a record subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RecordEvent<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + #[serde(borrow)] + pub op: jacquard_common::CowStr<'a>, + pub timestamp: jacquard_common::types::string::Datetime, +} + +pub mod record_event_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 Timestamp; + type Op; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Timestamp = Unset; + type Op = Unset; + } + ///State transition - sets the `timestamp` field to Set + pub struct SetTimestamp(PhantomData S>); + impl sealed::Sealed for SetTimestamp {} + impl State for SetTimestamp { + type Timestamp = Set; + type Op = S::Op; + } + ///State transition - sets the `op` field to Set + pub struct SetOp(PhantomData S>); + impl sealed::Sealed for SetOp {} + impl State for SetOp { + type Timestamp = S::Timestamp; + type Op = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `timestamp` field + pub struct timestamp(()); + ///Marker type for the `op` field + pub struct op(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordEventBuilder<'a, S: record_event_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> RecordEvent<'a> { + /// Create a new builder for this type + pub fn new() -> RecordEventBuilder<'a, record_event_state::Empty> { + RecordEventBuilder::new() + } +} + +impl<'a> RecordEventBuilder<'a, record_event_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: record_event_state::State> RecordEventBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: record_event_state::State> RecordEventBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> RecordEventBuilder<'a, S> +where + S: record_event_state::State, + S::Op: record_event_state::IsUnset, +{ + /// Set the `op` field (required) + pub fn op( + mut self, + value: impl Into>, + ) -> RecordEventBuilder<'a, record_event_state::SetOp> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RecordEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordEventBuilder<'a, S> +where + S: record_event_state::State, + S::Timestamp: record_event_state::IsUnset, +{ + /// Set the `timestamp` field (required) + pub fn timestamp( + mut self, + value: impl Into, + ) -> RecordEventBuilder<'a, record_event_state::SetTimestamp> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + RecordEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordEventBuilder<'a, S> +where + S: record_event_state::State, + S::Timestamp: record_event_state::IsSet, + S::Op: record_event_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RecordEvent<'a> { + RecordEvent { + cid: self.__unsafe_private_named.0, + comment: self.__unsafe_private_named.1, + op: self.__unsafe_private_named.2.unwrap(), + timestamp: 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>, + >, + ) -> RecordEvent<'a> { + RecordEvent { + cid: self.__unsafe_private_named.0, + comment: self.__unsafe_private_named.1, + op: self.__unsafe_private_named.2.unwrap(), + timestamp: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordEvent<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "recordEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RecordHosting<'a> { + #[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 deleted_at: std::option::Option, + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub updated_at: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordHosting<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "recordHosting" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 RecordView<'a> { + #[serde(borrow)] + pub blob_cids: Vec>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub moderation: crate::tools_ozone::moderation::Moderation<'a>, + #[serde(borrow)] + pub repo: crate::tools_ozone::moderation::RepoView<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod record_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 Uri; + type Cid; + type Value; + type BlobCids; + type IndexedAt; + type Moderation; + type Repo; + } + /// 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; + type Value = Unset; + type BlobCids = Unset; + type IndexedAt = Unset; + type Moderation = Unset; + type Repo = 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 Value = S::Value; + type BlobCids = S::BlobCids; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + 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 Value = S::Value; + type BlobCids = S::BlobCids; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + 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 Value = Set; + type BlobCids = S::BlobCids; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; + } + ///State transition - sets the `blob_cids` field to Set + pub struct SetBlobCids(PhantomData S>); + impl sealed::Sealed for SetBlobCids {} + impl State for SetBlobCids { + type Uri = S::Uri; + type Cid = S::Cid; + type Value = S::Value; + type BlobCids = Set; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; + } + ///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 Value = S::Value; + type BlobCids = S::BlobCids; + type IndexedAt = Set; + type Moderation = S::Moderation; + type Repo = S::Repo; + } + ///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 Cid = S::Cid; + type Value = S::Value; + type BlobCids = S::BlobCids; + type IndexedAt = S::IndexedAt; + type Moderation = 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 { + type Uri = S::Uri; + type Cid = S::Cid; + type Value = S::Value; + type BlobCids = S::BlobCids; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = 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 `value` field + pub struct value(()); + ///Marker type for the `blob_cids` field + pub struct blob_cids(()); + ///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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordViewBuilder<'a, S: record_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> RecordView<'a> { + /// Create a new builder for this type + pub fn new() -> RecordViewBuilder<'a, record_view_state::Empty> { + RecordViewBuilder::new() + } +} + +impl<'a> RecordViewBuilder<'a, record_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewBuilder<'a, S> +where + S: record_view_state::State, + S::BlobCids: record_view_state::IsUnset, +{ + /// Set the `blobCids` field (required) + pub fn blob_cids( + mut self, + value: impl Into>>, + ) -> RecordViewBuilder<'a, record_view_state::SetBlobCids> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewBuilder<'a, S> +where + S: record_view_state::State, + S::Cid: record_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> RecordViewBuilder<'a, record_view_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RecordViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewBuilder<'a, S> +where + S: record_view_state::State, + S::IndexedAt: record_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> RecordViewBuilder<'a, record_view_state::SetIndexedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RecordViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewBuilder<'a, S> +where + S: record_view_state::State, + S::Moderation: record_view_state::IsUnset, +{ + /// Set the `moderation` field (required) + pub fn moderation( + mut self, + value: impl Into>, + ) -> RecordViewBuilder<'a, record_view_state::SetModeration> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + RecordViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewBuilder<'a, S> +where + S: record_view_state::State, + S::Repo: record_view_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> RecordViewBuilder<'a, record_view_state::SetRepo> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + RecordViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewBuilder<'a, S> +where + S: record_view_state::State, + S::Uri: record_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> RecordViewBuilder<'a, record_view_state::SetUri> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + RecordViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewBuilder<'a, S> +where + S: record_view_state::State, + S::Value: record_view_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> RecordViewBuilder<'a, record_view_state::SetValue> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + RecordViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewBuilder<'a, S> +where + S: record_view_state::State, + S::Uri: record_view_state::IsSet, + S::Cid: record_view_state::IsSet, + S::Value: record_view_state::IsSet, + S::BlobCids: record_view_state::IsSet, + S::IndexedAt: record_view_state::IsSet, + S::Moderation: record_view_state::IsSet, + S::Repo: record_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RecordView<'a> { + RecordView { + blob_cids: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + moderation: self.__unsafe_private_named.3.unwrap(), + repo: self.__unsafe_private_named.4.unwrap(), + uri: self.__unsafe_private_named.5.unwrap(), + value: 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>, + >, + ) -> RecordView<'a> { + RecordView { + blob_cids: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + moderation: self.__unsafe_private_named.3.unwrap(), + repo: self.__unsafe_private_named.4.unwrap(), + uri: self.__unsafe_private_named.5.unwrap(), + value: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordView<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "recordView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 RecordViewDetail<'a> { + #[serde(borrow)] + pub blobs: 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 labels: Option>>, + #[serde(borrow)] + pub moderation: crate::tools_ozone::moderation::ModerationDetail<'a>, + #[serde(borrow)] + pub repo: crate::tools_ozone::moderation::RepoView<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod record_view_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 Uri; + type Cid; + type Value; + type Blobs; + type IndexedAt; + type Moderation; + type Repo; + } + /// 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; + type Value = Unset; + type Blobs = Unset; + type IndexedAt = Unset; + type Moderation = Unset; + type Repo = 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 Value = S::Value; + type Blobs = S::Blobs; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + 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 Value = S::Value; + type Blobs = S::Blobs; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + 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 Value = Set; + type Blobs = S::Blobs; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; + } + ///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 Cid = S::Cid; + type Value = S::Value; + type Blobs = Set; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; + } + ///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 Value = S::Value; + type Blobs = S::Blobs; + type IndexedAt = Set; + type Moderation = S::Moderation; + type Repo = S::Repo; + } + ///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 Cid = S::Cid; + type Value = S::Value; + type Blobs = S::Blobs; + type IndexedAt = S::IndexedAt; + type Moderation = 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 { + type Uri = S::Uri; + type Cid = S::Cid; + type Value = S::Value; + type Blobs = S::Blobs; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = 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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RecordViewDetailBuilder<'a, S: record_view_detail_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> RecordViewDetail<'a> { + /// Create a new builder for this type + pub fn new() -> RecordViewDetailBuilder<'a, record_view_detail_state::Empty> { + RecordViewDetailBuilder::new() + } +} + +impl<'a> RecordViewDetailBuilder<'a, record_view_detail_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewDetailBuilder<'a, S> +where + S: record_view_detail_state::State, + S::Blobs: record_view_detail_state::IsUnset, +{ + /// Set the `blobs` field (required) + pub fn blobs( + mut self, + value: impl Into>>, + ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetBlobs> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewDetailBuilder<'a, S> +where + S: record_view_detail_state::State, + S::Cid: record_view_detail_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RecordViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewDetailBuilder<'a, S> +where + S: record_view_detail_state::State, + S::IndexedAt: record_view_detail_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetIndexedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RecordViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: record_view_detail_state::State> RecordViewDetailBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = 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.3 = value; + self + } +} + +impl<'a, S> RecordViewDetailBuilder<'a, S> +where + S: record_view_detail_state::State, + S::Moderation: record_view_detail_state::IsUnset, +{ + /// Set the `moderation` field (required) + pub fn moderation( + mut self, + value: impl Into>, + ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetModeration> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + RecordViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewDetailBuilder<'a, S> +where + S: record_view_detail_state::State, + S::Repo: record_view_detail_state::IsUnset, +{ + /// Set the `repo` field (required) + pub fn repo( + mut self, + value: impl Into>, + ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetRepo> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + RecordViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewDetailBuilder<'a, S> +where + S: record_view_detail_state::State, + S::Uri: record_view_detail_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetUri> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + RecordViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewDetailBuilder<'a, S> +where + S: record_view_detail_state::State, + S::Value: record_view_detail_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> RecordViewDetailBuilder<'a, record_view_detail_state::SetValue> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + RecordViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewDetailBuilder<'a, S> +where + S: record_view_detail_state::State, + S::Uri: record_view_detail_state::IsSet, + S::Cid: 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, +{ + /// Build the final struct + pub fn build(self) -> RecordViewDetail<'a> { + RecordViewDetail { + blobs: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + labels: self.__unsafe_private_named.3, + moderation: self.__unsafe_private_named.4.unwrap(), + repo: self.__unsafe_private_named.5.unwrap(), + uri: self.__unsafe_private_named.6.unwrap(), + value: 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>, + >, + ) -> RecordViewDetail<'a> { + RecordViewDetail { + blobs: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + labels: self.__unsafe_private_named.3, + moderation: self.__unsafe_private_named.4.unwrap(), + repo: self.__unsafe_private_named.5.unwrap(), + uri: self.__unsafe_private_named.6.unwrap(), + value: self.__unsafe_private_named.7.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordViewDetail<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "recordViewDetail" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 RecordViewNotFound<'a> { + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod record_view_not_found_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 RecordViewNotFoundBuilder<'a, S: record_view_not_found_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RecordViewNotFound<'a> { + /// Create a new builder for this type + pub fn new() -> RecordViewNotFoundBuilder<'a, record_view_not_found_state::Empty> { + RecordViewNotFoundBuilder::new() + } +} + +impl<'a> RecordViewNotFoundBuilder<'a, record_view_not_found_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RecordViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewNotFoundBuilder<'a, S> +where + S: record_view_not_found_state::State, + S::Uri: record_view_not_found_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> RecordViewNotFoundBuilder<'a, record_view_not_found_state::SetUri> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RecordViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RecordViewNotFoundBuilder<'a, S> +where + S: record_view_not_found_state::State, + S::Uri: record_view_not_found_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RecordViewNotFound<'a> { + RecordViewNotFound { + uri: 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>, + >, + ) -> RecordViewNotFound<'a> { + RecordViewNotFound { + uri: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordViewNotFound<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "recordViewNotFound" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Statistics about a set of record subject items +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RecordsStats<'a> { + /// Number of items that were appealed at least once + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub appealed_count: std::option::Option, + /// Number of items that were escalated at least once + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub escalated_count: std::option::Option, + /// Number of item currently in "reviewOpen" or "reviewEscalated" state + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub pending_count: std::option::Option, + /// Number of item currently in "reviewNone" or "reviewClosed" state + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub processed_count: std::option::Option, + /// Number of items that were reported at least once + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reported_count: std::option::Option, + /// Total number of item in the set + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub subject_count: std::option::Option, + /// Number of item currently taken down + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub takendown_count: std::option::Option, + /// Cumulative sum of the number of reports on the items in the set + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub total_reports: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordsStats<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "recordsStats" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 RepoView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub deactivated_at: Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: Option>, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invite_note: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invited_by: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub invites_disabled: Option, + #[serde(borrow)] + pub moderation: crate::tools_ozone::moderation::Moderation<'a>, + #[serde(borrow)] + pub related_records: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub threat_signatures: Option>>, +} + +pub mod repo_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 Did; + type Handle; + type RelatedRecords; + type IndexedAt; + 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 Handle = Unset; + type RelatedRecords = Unset; + type IndexedAt = 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 Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; + 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 Handle = Set; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + } + ///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 Handle = S::Handle; + type RelatedRecords = 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 Did = S::Did; + type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = 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 Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; + 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 `handle` field + pub struct handle(()); + ///Marker type for the `related_records` field + pub struct related_records(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `moderation` field + pub struct moderation(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepoViewBuilder<'a, S: repo_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> RepoView<'a> { + /// Create a new builder for this type + pub fn new() -> RepoViewBuilder<'a, repo_view_state::Empty> { + RepoViewBuilder::new() + } +} + +impl<'a> RepoViewBuilder<'a, repo_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepoViewBuilder { + _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: repo_view_state::State> RepoViewBuilder<'a, S> { + /// Set the `deactivatedAt` field (optional) + pub fn deactivated_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `deactivatedAt` field to an Option value (optional) + pub fn maybe_deactivated_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> RepoViewBuilder<'a, S> +where + S: repo_view_state::State, + S::Did: repo_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> RepoViewBuilder<'a, repo_view_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RepoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> { + /// Set the `email` field (optional) + pub fn email( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `email` field to an Option value (optional) + pub fn maybe_email(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> RepoViewBuilder<'a, S> +where + S: repo_view_state::State, + S::Handle: repo_view_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> RepoViewBuilder<'a, repo_view_state::SetHandle> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + RepoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoViewBuilder<'a, S> +where + S: repo_view_state::State, + S::IndexedAt: repo_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> RepoViewBuilder<'a, repo_view_state::SetIndexedAt> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + RepoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> { + /// Set the `inviteNote` field (optional) + pub fn invite_note( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `inviteNote` field to an Option value (optional) + pub fn maybe_invite_note( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> { + /// Set the `invitedBy` field (optional) + pub fn invited_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `invitedBy` field to an Option value (optional) + pub fn maybe_invited_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> { + /// Set the `invitesDisabled` field (optional) + pub fn invites_disabled(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `invitesDisabled` field to an Option value (optional) + pub fn maybe_invites_disabled(mut self, value: Option) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> RepoViewBuilder<'a, S> +where + S: repo_view_state::State, + S::Moderation: repo_view_state::IsUnset, +{ + /// Set the `moderation` field (required) + pub fn moderation( + mut self, + value: impl Into>, + ) -> RepoViewBuilder<'a, repo_view_state::SetModeration> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + RepoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoViewBuilder<'a, S> +where + S: repo_view_state::State, + S::RelatedRecords: repo_view_state::IsUnset, +{ + /// Set the `relatedRecords` field (required) + pub fn related_records( + mut self, + value: impl Into>>, + ) -> RepoViewBuilder<'a, repo_view_state::SetRelatedRecords> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + RepoViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> { + /// Set the `threatSignatures` field (optional) + pub fn threat_signatures( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `threatSignatures` field to an Option value (optional) + pub fn maybe_threat_signatures( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S> RepoViewBuilder<'a, S> +where + S: repo_view_state::State, + S::Did: repo_view_state::IsSet, + S::Handle: repo_view_state::IsSet, + S::RelatedRecords: repo_view_state::IsSet, + S::IndexedAt: repo_view_state::IsSet, + S::Moderation: repo_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RepoView<'a> { + RepoView { + deactivated_at: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + email: self.__unsafe_private_named.2, + handle: self.__unsafe_private_named.3.unwrap(), + indexed_at: self.__unsafe_private_named.4.unwrap(), + invite_note: self.__unsafe_private_named.5, + invited_by: self.__unsafe_private_named.6, + invites_disabled: self.__unsafe_private_named.7, + moderation: self.__unsafe_private_named.8.unwrap(), + related_records: self.__unsafe_private_named.9.unwrap(), + threat_signatures: 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>, + >, + ) -> RepoView<'a> { + RepoView { + deactivated_at: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + email: self.__unsafe_private_named.2, + handle: self.__unsafe_private_named.3.unwrap(), + indexed_at: self.__unsafe_private_named.4.unwrap(), + invite_note: self.__unsafe_private_named.5, + invited_by: self.__unsafe_private_named.6, + invites_disabled: self.__unsafe_private_named.7, + moderation: self.__unsafe_private_named.8.unwrap(), + related_records: self.__unsafe_private_named.9.unwrap(), + threat_signatures: self.__unsafe_private_named.10, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RepoView<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "repoView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 RepoViewDetail<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub deactivated_at: Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub email: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub email_confirmed_at: Option, + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invite_note: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invited_by: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invites: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub invites_disabled: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub labels: Option>>, + #[serde(borrow)] + pub moderation: crate::tools_ozone::moderation::ModerationDetail<'a>, + #[serde(borrow)] + pub related_records: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub threat_signatures: Option>>, +} + +pub mod repo_view_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 Did; + type Handle; + type RelatedRecords; + type IndexedAt; + 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 Handle = Unset; + type RelatedRecords = Unset; + type IndexedAt = 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 Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; + 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 Handle = Set; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + } + ///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 Handle = S::Handle; + type RelatedRecords = 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 Did = S::Did; + type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = 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 Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; + 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 `handle` field + pub struct handle(()); + ///Marker type for the `related_records` field + pub struct related_records(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `moderation` field + pub struct moderation(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepoViewDetailBuilder<'a, S: repo_view_detail_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> RepoViewDetail<'a> { + /// Create a new builder for this type + pub fn new() -> RepoViewDetailBuilder<'a, repo_view_detail_state::Empty> { + RepoViewDetailBuilder::new() + } +} + +impl<'a> RepoViewDetailBuilder<'a, repo_view_detail_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepoViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `deactivatedAt` field (optional) + pub fn deactivated_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `deactivatedAt` field to an Option value (optional) + pub fn maybe_deactivated_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> RepoViewDetailBuilder<'a, S> +where + S: repo_view_detail_state::State, + S::Did: repo_view_detail_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RepoViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `email` field (optional) + pub fn email( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `email` field to an Option value (optional) + pub fn maybe_email(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `emailConfirmedAt` field (optional) + pub fn email_confirmed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `emailConfirmedAt` field to an Option value (optional) + pub fn maybe_email_confirmed_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> RepoViewDetailBuilder<'a, S> +where + S: repo_view_detail_state::State, + S::Handle: repo_view_detail_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetHandle> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + RepoViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoViewDetailBuilder<'a, S> +where + S: repo_view_detail_state::State, + S::IndexedAt: repo_view_detail_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetIndexedAt> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + RepoViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `inviteNote` field (optional) + pub fn invite_note( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `inviteNote` field to an Option value (optional) + pub fn maybe_invite_note( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `invitedBy` field (optional) + pub fn invited_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `invitedBy` field to an Option value (optional) + pub fn maybe_invited_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `invites` field (optional) + pub fn invites( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `invites` field to an Option value (optional) + pub fn maybe_invites( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `invitesDisabled` field (optional) + pub fn invites_disabled(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `invitesDisabled` field to an Option value (optional) + pub fn maybe_invites_disabled(mut self, value: Option) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.10 = 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.10 = value; + self + } +} + +impl<'a, S> RepoViewDetailBuilder<'a, S> +where + S: repo_view_detail_state::State, + S::Moderation: repo_view_detail_state::IsUnset, +{ + /// Set the `moderation` field (required) + pub fn moderation( + mut self, + value: impl Into>, + ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetModeration> { + self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); + RepoViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoViewDetailBuilder<'a, S> +where + S: repo_view_detail_state::State, + S::RelatedRecords: repo_view_detail_state::IsUnset, +{ + /// Set the `relatedRecords` field (required) + pub fn related_records( + mut self, + value: impl Into>>, + ) -> RepoViewDetailBuilder<'a, repo_view_detail_state::SetRelatedRecords> { + self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); + RepoViewDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { + /// Set the `threatSignatures` field (optional) + pub fn threat_signatures( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.13 = value.into(); + self + } + /// Set the `threatSignatures` field to an Option value (optional) + pub fn maybe_threat_signatures( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.13 = value; + self + } +} + +impl<'a, S> RepoViewDetailBuilder<'a, S> +where + S: repo_view_detail_state::State, + S::Did: repo_view_detail_state::IsSet, + S::Handle: repo_view_detail_state::IsSet, + S::RelatedRecords: repo_view_detail_state::IsSet, + S::IndexedAt: repo_view_detail_state::IsSet, + S::Moderation: repo_view_detail_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RepoViewDetail<'a> { + RepoViewDetail { + deactivated_at: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + email: self.__unsafe_private_named.2, + email_confirmed_at: self.__unsafe_private_named.3, + handle: self.__unsafe_private_named.4.unwrap(), + indexed_at: self.__unsafe_private_named.5.unwrap(), + invite_note: self.__unsafe_private_named.6, + invited_by: self.__unsafe_private_named.7, + invites: self.__unsafe_private_named.8, + invites_disabled: self.__unsafe_private_named.9, + labels: self.__unsafe_private_named.10, + moderation: self.__unsafe_private_named.11.unwrap(), + related_records: self.__unsafe_private_named.12.unwrap(), + threat_signatures: self.__unsafe_private_named.13, + 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>, + >, + ) -> RepoViewDetail<'a> { + RepoViewDetail { + deactivated_at: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + email: self.__unsafe_private_named.2, + email_confirmed_at: self.__unsafe_private_named.3, + handle: self.__unsafe_private_named.4.unwrap(), + indexed_at: self.__unsafe_private_named.5.unwrap(), + invite_note: self.__unsafe_private_named.6, + invited_by: self.__unsafe_private_named.7, + invites: self.__unsafe_private_named.8, + invites_disabled: self.__unsafe_private_named.9, + labels: self.__unsafe_private_named.10, + moderation: self.__unsafe_private_named.11.unwrap(), + related_records: self.__unsafe_private_named.12.unwrap(), + threat_signatures: self.__unsafe_private_named.13, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RepoViewDetail<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "repoViewDetail" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 RepoViewNotFound<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod repo_view_not_found_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RepoViewNotFoundBuilder<'a, S: repo_view_not_found_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RepoViewNotFound<'a> { + /// Create a new builder for this type + pub fn new() -> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::Empty> { + RepoViewNotFoundBuilder::new() + } +} + +impl<'a> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RepoViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoViewNotFoundBuilder<'a, S> +where + S: repo_view_not_found_state::State, + S::Did: repo_view_not_found_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> RepoViewNotFoundBuilder<'a, repo_view_not_found_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RepoViewNotFoundBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RepoViewNotFoundBuilder<'a, S> +where + S: repo_view_not_found_state::State, + S::Did: repo_view_not_found_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RepoViewNotFound<'a> { + RepoViewNotFound { + did: 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>, + >, + ) -> RepoViewNotFound<'a> { + RepoViewNotFound { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RepoViewNotFound<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "repoViewNotFound" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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 ReporterStats<'a> { + /// The total number of reports made by the user on accounts. + pub account_report_count: i64, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// The total number of accounts labeled as a result of the user's reports. + pub labeled_account_count: i64, + /// The total number of records labeled as a result of the user's reports. + pub labeled_record_count: i64, + /// The total number of reports made by the user on records. + pub record_report_count: i64, + /// The total number of accounts reported by the user. + pub reported_account_count: i64, + /// The total number of records reported by the user. + pub reported_record_count: i64, + /// The total number of accounts taken down as a result of the user's reports. + pub takendown_account_count: i64, + /// The total number of records taken down as a result of the user's reports. + pub takendown_record_count: i64, +} + +pub mod reporter_stats_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 Did; + type AccountReportCount; + type RecordReportCount; + type ReportedAccountCount; + type ReportedRecordCount; + type TakendownAccountCount; + type TakendownRecordCount; + type LabeledAccountCount; + type LabeledRecordCount; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type AccountReportCount = Unset; + type RecordReportCount = Unset; + type ReportedAccountCount = Unset; + type ReportedRecordCount = Unset; + type TakendownAccountCount = Unset; + type TakendownRecordCount = Unset; + type LabeledAccountCount = Unset; + type LabeledRecordCount = 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 AccountReportCount = S::AccountReportCount; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + 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 Did = S::Did; + type AccountReportCount = Set; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + } + ///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 AccountReportCount = S::AccountReportCount; + type RecordReportCount = Set; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + } + ///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 Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = Set; + type ReportedRecordCount = S::ReportedRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + } + ///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 AccountReportCount = S::AccountReportCount; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = Set; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + } + ///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 Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type TakendownAccountCount = Set; + type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + 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 Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = Set; + type LabeledAccountCount = S::LabeledAccountCount; + 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 Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = Set; + type LabeledRecordCount = S::LabeledRecordCount; + } + ///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 Did = S::Did; + type AccountReportCount = S::AccountReportCount; + type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + type LabeledRecordCount = 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 `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 `reported_account_count` field + pub struct reported_account_count(()); + ///Marker type for the `reported_record_count` field + pub struct reported_record_count(()); + ///Marker type for the `takendown_account_count` field + pub struct takendown_account_count(()); + ///Marker type for the `takendown_record_count` field + pub struct takendown_record_count(()); + ///Marker type for the `labeled_account_count` field + pub struct labeled_account_count(()); + ///Marker type for the `labeled_record_count` field + pub struct labeled_record_count(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReporterStatsBuilder<'a, S: reporter_stats_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> ReporterStats<'a> { + /// Create a new builder for this type + pub fn new() -> ReporterStatsBuilder<'a, reporter_stats_state::Empty> { + ReporterStatsBuilder::new() + } +} + +impl<'a> ReporterStatsBuilder<'a, reporter_stats_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::AccountReportCount: reporter_stats_state::IsUnset, +{ + /// Set the `accountReportCount` field (required) + pub fn account_report_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetAccountReportCount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::Did: reporter_stats_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::LabeledAccountCount: reporter_stats_state::IsUnset, +{ + /// Set the `labeledAccountCount` field (required) + pub fn labeled_account_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetLabeledAccountCount> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::LabeledRecordCount: reporter_stats_state::IsUnset, +{ + /// Set the `labeledRecordCount` field (required) + pub fn labeled_record_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetLabeledRecordCount> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::RecordReportCount: reporter_stats_state::IsUnset, +{ + /// Set the `recordReportCount` field (required) + pub fn record_report_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetRecordReportCount> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::ReportedAccountCount: reporter_stats_state::IsUnset, +{ + /// Set the `reportedAccountCount` field (required) + pub fn reported_account_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetReportedAccountCount> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::ReportedRecordCount: reporter_stats_state::IsUnset, +{ + /// Set the `reportedRecordCount` field (required) + pub fn reported_record_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetReportedRecordCount> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::TakendownAccountCount: reporter_stats_state::IsUnset, +{ + /// Set the `takendownAccountCount` field (required) + pub fn takendown_account_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetTakendownAccountCount> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::TakendownRecordCount: reporter_stats_state::IsUnset, +{ + /// Set the `takendownRecordCount` field (required) + pub fn takendown_record_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder<'a, reporter_stats_state::SetTakendownRecordCount> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + ReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReporterStatsBuilder<'a, S> +where + S: reporter_stats_state::State, + S::Did: reporter_stats_state::IsSet, + S::AccountReportCount: reporter_stats_state::IsSet, + S::RecordReportCount: reporter_stats_state::IsSet, + S::ReportedAccountCount: reporter_stats_state::IsSet, + S::ReportedRecordCount: reporter_stats_state::IsSet, + S::TakendownAccountCount: reporter_stats_state::IsSet, + S::TakendownRecordCount: reporter_stats_state::IsSet, + S::LabeledAccountCount: reporter_stats_state::IsSet, + S::LabeledRecordCount: reporter_stats_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ReporterStats<'a> { + ReporterStats { + account_report_count: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + labeled_account_count: self.__unsafe_private_named.2.unwrap(), + labeled_record_count: self.__unsafe_private_named.3.unwrap(), + record_report_count: self.__unsafe_private_named.4.unwrap(), + reported_account_count: self.__unsafe_private_named.5.unwrap(), + reported_record_count: self.__unsafe_private_named.6.unwrap(), + takendown_account_count: self.__unsafe_private_named.7.unwrap(), + takendown_record_count: 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>, + >, + ) -> ReporterStats<'a> { + ReporterStats { + account_report_count: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + labeled_account_count: self.__unsafe_private_named.2.unwrap(), + labeled_record_count: self.__unsafe_private_named.3.unwrap(), + record_report_count: self.__unsafe_private_named.4.unwrap(), + reported_account_count: self.__unsafe_private_named.5.unwrap(), + reported_record_count: self.__unsafe_private_named.6.unwrap(), + takendown_account_count: self.__unsafe_private_named.7.unwrap(), + takendown_record_count: self.__unsafe_private_named.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReporterStats<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "reporterStats" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReviewClosed; +impl std::fmt::Display for ReviewClosed { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reviewClosed") + } +} + +/// Moderator review status of a subject: Escalated. Indicates that the subject was escalated for review by a moderator +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReviewEscalated; +impl std::fmt::Display for ReviewEscalated { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reviewEscalated") + } +} + +/// Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReviewNone; +impl std::fmt::Display for ReviewNone { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reviewNone") + } +} + +/// Moderator review status of a subject: Open. Indicates that the subject needs to be reviewed by a moderator +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReviewOpen; +impl std::fmt::Display for ReviewOpen { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reviewOpen") + } +} + +/// Account credentials revocation by moderators. Only works on DID subjects. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct RevokeAccountCredentialsEvent<'a> { + /// Comment describing the reason for the revocation. + #[serde(borrow)] + pub comment: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema +for RevokeAccountCredentialsEvent<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "revokeAccountCredentialsEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Logs a scheduled takedown action for an account. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ScheduleTakedownEvent<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_after: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_until: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ScheduleTakedownEvent<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "scheduleTakedownEvent" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// View of a scheduled moderation action +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ScheduledActionView<'a> { + /// Type of action to be executed + #[serde(borrow)] + pub action: jacquard_common::CowStr<'a>, + /// When the scheduled action was created + pub created_at: jacquard_common::types::string::Datetime, + /// DID of the user who created this scheduled action + #[serde(borrow)] + pub created_by: jacquard_common::types::string::Did<'a>, + /// Subject DID for the action + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// Serialized event object that will be propagated to the event when performed + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub event_data: Option>, + /// Earliest time to execute the action (for randomized scheduling) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_after: Option, + /// Exact time to execute the action + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_at: Option, + /// Latest time to execute the action (for randomized scheduling) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_until: Option, + /// ID of the moderation event created when action was successfully executed + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execution_event_id: Option, + /// Auto-incrementing row ID + pub id: i64, + /// When the action was last attempted to be executed + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_executed_at: Option, + /// Reason for the last execution failure + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub last_failure_reason: Option>, + /// Whether execution time should be randomized within the specified range + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub randomize_execution: Option, + /// Current status of the scheduled action + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, + /// When the scheduled action was last updated + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub updated_at: Option, +} + +pub mod scheduled_action_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 Id; + type Action; + type Did; + type CreatedBy; + type CreatedAt; + type Status; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Id = Unset; + type Action = Unset; + type Did = Unset; + type CreatedBy = Unset; + type CreatedAt = 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 Id = Set; + type Action = S::Action; + type Did = S::Did; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + 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 Action = Set; + type Did = S::Did; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + 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 CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + 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 Action = S::Action; + type Did = S::Did; + type CreatedBy = 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 Id = S::Id; + type Action = S::Action; + type Did = S::Did; + type CreatedBy = S::CreatedBy; + type CreatedAt = 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 Action = S::Action; + type Did = S::Did; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Status = 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 `action` field + pub struct action(()); + ///Marker type for the `did` field + pub struct did(()); + ///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 `status` field + pub struct status(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ScheduledActionViewBuilder<'a, S: scheduled_action_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> ScheduledActionView<'a> { + /// Create a new builder for this type + pub fn new() -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::Empty> { + ScheduledActionViewBuilder::new() + } +} + +impl<'a> ScheduledActionViewBuilder<'a, scheduled_action_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ScheduledActionViewBuilder { + _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> ScheduledActionViewBuilder<'a, S> +where + S: scheduled_action_view_state::State, + S::Action: scheduled_action_view_state::IsUnset, +{ + /// Set the `action` field (required) + pub fn action( + mut self, + value: impl Into>, + ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetAction> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ScheduledActionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduledActionViewBuilder<'a, S> +where + S: scheduled_action_view_state::State, + S::CreatedAt: scheduled_action_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetCreatedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ScheduledActionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduledActionViewBuilder<'a, S> +where + S: scheduled_action_view_state::State, + S::CreatedBy: scheduled_action_view_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetCreatedBy> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ScheduledActionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduledActionViewBuilder<'a, S> +where + S: scheduled_action_view_state::State, + S::Did: scheduled_action_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetDid> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ScheduledActionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `eventData` field (optional) + pub fn event_data( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `eventData` field to an Option value (optional) + pub fn maybe_event_data( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `executeAfter` field (optional) + pub fn execute_after( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `executeAfter` field to an Option value (optional) + pub fn maybe_execute_after( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `executeAt` field (optional) + pub fn execute_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `executeAt` field to an Option value (optional) + pub fn maybe_execute_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `executeUntil` field (optional) + pub fn execute_until( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `executeUntil` field to an Option value (optional) + pub fn maybe_execute_until( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `executionEventId` field (optional) + pub fn execution_event_id(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `executionEventId` field to an Option value (optional) + pub fn maybe_execution_event_id(mut self, value: Option) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> ScheduledActionViewBuilder<'a, S> +where + S: scheduled_action_view_state::State, + S::Id: scheduled_action_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetId> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + ScheduledActionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `lastExecutedAt` field (optional) + pub fn last_executed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `lastExecutedAt` field to an Option value (optional) + pub fn maybe_last_executed_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `lastFailureReason` field (optional) + pub fn last_failure_reason( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `lastFailureReason` field to an Option value (optional) + pub fn maybe_last_failure_reason( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `randomizeExecution` field (optional) + pub fn randomize_execution(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `randomizeExecution` field to an Option value (optional) + pub fn maybe_randomize_execution(mut self, value: Option) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S> ScheduledActionViewBuilder<'a, S> +where + S: scheduled_action_view_state::State, + S::Status: scheduled_action_view_state::IsUnset, +{ + /// Set the `status` field (required) + pub fn status( + mut self, + value: impl Into>, + ) -> ScheduledActionViewBuilder<'a, scheduled_action_view_state::SetStatus> { + self.__unsafe_private_named.13 = ::core::option::Option::Some(value.into()); + ScheduledActionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S> { + /// Set the `updatedAt` field (optional) + pub fn updated_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.14 = 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.14 = value; + self + } +} + +impl<'a, S> ScheduledActionViewBuilder<'a, S> +where + S: scheduled_action_view_state::State, + S::Id: scheduled_action_view_state::IsSet, + S::Action: scheduled_action_view_state::IsSet, + S::Did: scheduled_action_view_state::IsSet, + S::CreatedBy: scheduled_action_view_state::IsSet, + S::CreatedAt: scheduled_action_view_state::IsSet, + S::Status: scheduled_action_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ScheduledActionView<'a> { + ScheduledActionView { + action: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + created_by: self.__unsafe_private_named.2.unwrap(), + did: self.__unsafe_private_named.3.unwrap(), + event_data: self.__unsafe_private_named.4, + execute_after: self.__unsafe_private_named.5, + execute_at: self.__unsafe_private_named.6, + execute_until: self.__unsafe_private_named.7, + execution_event_id: self.__unsafe_private_named.8, + id: self.__unsafe_private_named.9.unwrap(), + last_executed_at: self.__unsafe_private_named.10, + last_failure_reason: self.__unsafe_private_named.11, + randomize_execution: self.__unsafe_private_named.12, + status: self.__unsafe_private_named.13.unwrap(), + updated_at: 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>, + >, + ) -> ScheduledActionView<'a> { + ScheduledActionView { + action: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + created_by: self.__unsafe_private_named.2.unwrap(), + did: self.__unsafe_private_named.3.unwrap(), + event_data: self.__unsafe_private_named.4, + execute_after: self.__unsafe_private_named.5, + execute_at: self.__unsafe_private_named.6, + execute_until: self.__unsafe_private_named.7, + execution_event_id: self.__unsafe_private_named.8, + id: self.__unsafe_private_named.9.unwrap(), + last_executed_at: self.__unsafe_private_named.10, + last_failure_reason: self.__unsafe_private_named.11, + randomize_execution: self.__unsafe_private_named.12, + status: self.__unsafe_private_named.13.unwrap(), + updated_at: self.__unsafe_private_named.14, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ScheduledActionView<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "scheduledActionView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum SubjectReviewState<'a> { + ReviewOpen, + ReviewEscalated, + ReviewClosed, + ReviewNone, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> SubjectReviewState<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::ReviewOpen => "#reviewOpen", + Self::ReviewEscalated => "#reviewEscalated", + Self::ReviewClosed => "#reviewClosed", + Self::ReviewNone => "#reviewNone", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for SubjectReviewState<'a> { + fn from(s: &'a str) -> Self { + match s { + "#reviewOpen" => Self::ReviewOpen, + "#reviewEscalated" => Self::ReviewEscalated, + "#reviewClosed" => Self::ReviewClosed, + "#reviewNone" => Self::ReviewNone, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for SubjectReviewState<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "#reviewOpen" => Self::ReviewOpen, + "#reviewEscalated" => Self::ReviewEscalated, + "#reviewClosed" => Self::ReviewClosed, + "#reviewNone" => Self::ReviewNone, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for SubjectReviewState<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for SubjectReviewState<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for SubjectReviewState<'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 SubjectReviewState<'_> { + type Output = SubjectReviewState<'static>; + fn into_static(self) -> Self::Output { + match self { + SubjectReviewState::ReviewOpen => SubjectReviewState::ReviewOpen, + SubjectReviewState::ReviewEscalated => SubjectReviewState::ReviewEscalated, + SubjectReviewState::ReviewClosed => SubjectReviewState::ReviewClosed, + SubjectReviewState::ReviewNone => SubjectReviewState::ReviewNone, + SubjectReviewState::Other(v) => SubjectReviewState::Other(v.into_static()), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SubjectStatusView<'a> { + /// Statistics related to the account subject + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub account_stats: Option>, + /// Strike information for the account (account-level only) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub account_strike: Option>, + /// Current age assurance state of the subject. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub age_assurance_state: Option>, + /// Whether or not the last successful update to age assurance was made by the user or admin. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub age_assurance_updated_by: Option>, + /// True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub appealed: Option, + /// Sticky comment on the subject. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Timestamp referencing the first moderation status impacting event was emitted on the subject + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub hosting: Option>, + pub id: i64, + /// Timestamp referencing when the author of the subject appealed a moderation action + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_appealed_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_reported_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_reviewed_at: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub last_reviewed_by: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub mute_reporting_until: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub mute_until: Option, + /// Numeric value representing the level of priority. Higher score means higher priority. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub priority_score: Option, + /// Statistics related to the record subjects authored by the subject's account + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub records_stats: Option>, + #[serde(borrow)] + pub review_state: crate::tools_ozone::moderation::SubjectReviewState<'a>, + #[serde(borrow)] + pub subject: SubjectStatusViewSubject<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_blob_cids: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_repo_handle: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub suspend_until: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub takendown: Option, + /// Timestamp referencing when the last update was made to the moderation status of the subject + pub updated_at: jacquard_common::types::string::Datetime, +} + +pub mod subject_status_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 Id; + type Subject; + type CreatedAt; + type UpdatedAt; + type ReviewState; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Id = Unset; + type Subject = Unset; + type CreatedAt = 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 Subject = S::Subject; + type CreatedAt = S::CreatedAt; + 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 Subject = Set; + type CreatedAt = S::CreatedAt; + 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 Subject = S::Subject; + type CreatedAt = Set; + type UpdatedAt = S::UpdatedAt; + type ReviewState = S::ReviewState; + } + ///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 Subject = S::Subject; + type CreatedAt = S::CreatedAt; + type UpdatedAt = Set; + type ReviewState = S::ReviewState; + } + ///State transition - sets the `review_state` field to Set + pub struct SetReviewState(PhantomData S>); + impl sealed::Sealed for SetReviewState {} + impl State for SetReviewState { + type Id = S::Id; + type Subject = S::Subject; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + type ReviewState = 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 `subject` field + pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); + ///Marker type for the `review_state` field + pub struct review_state(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SubjectStatusViewBuilder<'a, S: subject_status_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>, + ::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> SubjectStatusView<'a> { + /// Create a new builder for this type + pub fn new() -> SubjectStatusViewBuilder<'a, subject_status_view_state::Empty> { + SubjectStatusViewBuilder::new() + } +} + +impl<'a> SubjectStatusViewBuilder<'a, subject_status_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubjectStatusViewBuilder { + _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, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `accountStats` field (optional) + pub fn account_stats( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `accountStats` field to an Option value (optional) + pub fn maybe_account_stats( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `accountStrike` field (optional) + pub fn account_strike( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `accountStrike` field to an Option value (optional) + pub fn maybe_account_strike( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `ageAssuranceState` field (optional) + pub fn age_assurance_state( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `ageAssuranceState` field to an Option value (optional) + pub fn maybe_age_assurance_state( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `ageAssuranceUpdatedBy` field (optional) + pub fn age_assurance_updated_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `ageAssuranceUpdatedBy` field to an Option value (optional) + pub fn maybe_age_assurance_updated_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `appealed` field (optional) + pub fn appealed(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `appealed` field to an Option value (optional) + pub fn maybe_appealed(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> SubjectStatusViewBuilder<'a, S> +where + S: subject_status_view_state::State, + S::CreatedAt: subject_status_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetCreatedAt> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + SubjectStatusViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `hosting` field (optional) + pub fn hosting( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `hosting` field to an Option value (optional) + pub fn maybe_hosting(mut self, value: Option>) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> SubjectStatusViewBuilder<'a, S> +where + S: subject_status_view_state::State, + S::Id: subject_status_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetId> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + SubjectStatusViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `lastAppealedAt` field (optional) + pub fn last_appealed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `lastAppealedAt` field to an Option value (optional) + pub fn maybe_last_appealed_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `lastReportedAt` field (optional) + pub fn last_reported_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `lastReportedAt` field to an Option value (optional) + pub fn maybe_last_reported_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `lastReviewedAt` field (optional) + pub fn last_reviewed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `lastReviewedAt` field to an Option value (optional) + pub fn maybe_last_reviewed_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `lastReviewedBy` field (optional) + pub fn last_reviewed_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `lastReviewedBy` field to an Option value (optional) + pub fn maybe_last_reviewed_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `muteReportingUntil` field (optional) + pub fn mute_reporting_until( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.13 = value.into(); + self + } + /// Set the `muteReportingUntil` field to an Option value (optional) + pub fn maybe_mute_reporting_until( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.13 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `muteUntil` field (optional) + pub fn mute_until( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.14 = value.into(); + self + } + /// Set the `muteUntil` field to an Option value (optional) + pub fn maybe_mute_until( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.14 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `priorityScore` field (optional) + pub fn priority_score(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.15 = value.into(); + self + } + /// Set the `priorityScore` field to an Option value (optional) + pub fn maybe_priority_score(mut self, value: Option) -> Self { + self.__unsafe_private_named.15 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `recordsStats` field (optional) + pub fn records_stats( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.16 = value.into(); + self + } + /// Set the `recordsStats` field to an Option value (optional) + pub fn maybe_records_stats( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.16 = value; + self + } +} + +impl<'a, S> SubjectStatusViewBuilder<'a, S> +where + S: subject_status_view_state::State, + S::ReviewState: subject_status_view_state::IsUnset, +{ + /// Set the `reviewState` field (required) + pub fn review_state( + mut self, + value: impl Into>, + ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetReviewState> { + self.__unsafe_private_named.17 = ::core::option::Option::Some(value.into()); + SubjectStatusViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectStatusViewBuilder<'a, S> +where + S: subject_status_view_state::State, + S::Subject: subject_status_view_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetSubject> { + self.__unsafe_private_named.18 = ::core::option::Option::Some(value.into()); + SubjectStatusViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `subjectBlobCids` field (optional) + pub fn subject_blob_cids( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.19 = value.into(); + self + } + /// Set the `subjectBlobCids` field to an Option value (optional) + pub fn maybe_subject_blob_cids( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.19 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `subjectRepoHandle` field (optional) + pub fn subject_repo_handle( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.20 = value.into(); + self + } + /// Set the `subjectRepoHandle` field to an Option value (optional) + pub fn maybe_subject_repo_handle( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.20 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `suspendUntil` field (optional) + pub fn suspend_until( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.21 = value.into(); + self + } + /// Set the `suspendUntil` field to an Option value (optional) + pub fn maybe_suspend_until( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.21 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.22 = 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.22 = value; + self + } +} + +impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { + /// Set the `takendown` field (optional) + pub fn takendown(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.23 = value.into(); + self + } + /// Set the `takendown` field to an Option value (optional) + pub fn maybe_takendown(mut self, value: Option) -> Self { + self.__unsafe_private_named.23 = value; + self + } +} + +impl<'a, S> SubjectStatusViewBuilder<'a, S> +where + S: subject_status_view_state::State, + S::UpdatedAt: subject_status_view_state::IsUnset, +{ + /// Set the `updatedAt` field (required) + pub fn updated_at( + mut self, + value: impl Into, + ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetUpdatedAt> { + self.__unsafe_private_named.24 = ::core::option::Option::Some(value.into()); + SubjectStatusViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectStatusViewBuilder<'a, S> +where + S: subject_status_view_state::State, + S::Id: subject_status_view_state::IsSet, + S::Subject: subject_status_view_state::IsSet, + S::CreatedAt: subject_status_view_state::IsSet, + S::UpdatedAt: subject_status_view_state::IsSet, + S::ReviewState: subject_status_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SubjectStatusView<'a> { + SubjectStatusView { + account_stats: self.__unsafe_private_named.0, + account_strike: self.__unsafe_private_named.1, + age_assurance_state: self.__unsafe_private_named.2, + age_assurance_updated_by: self.__unsafe_private_named.3, + appealed: self.__unsafe_private_named.4, + comment: self.__unsafe_private_named.5, + created_at: self.__unsafe_private_named.6.unwrap(), + hosting: self.__unsafe_private_named.7, + id: self.__unsafe_private_named.8.unwrap(), + last_appealed_at: self.__unsafe_private_named.9, + last_reported_at: self.__unsafe_private_named.10, + last_reviewed_at: self.__unsafe_private_named.11, + last_reviewed_by: self.__unsafe_private_named.12, + mute_reporting_until: self.__unsafe_private_named.13, + mute_until: self.__unsafe_private_named.14, + priority_score: self.__unsafe_private_named.15, + records_stats: self.__unsafe_private_named.16, + review_state: self.__unsafe_private_named.17.unwrap(), + subject: self.__unsafe_private_named.18.unwrap(), + subject_blob_cids: self.__unsafe_private_named.19, + subject_repo_handle: self.__unsafe_private_named.20, + suspend_until: self.__unsafe_private_named.21, + tags: self.__unsafe_private_named.22, + takendown: self.__unsafe_private_named.23, + updated_at: self.__unsafe_private_named.24.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>, + >, + ) -> SubjectStatusView<'a> { + SubjectStatusView { + account_stats: self.__unsafe_private_named.0, + account_strike: self.__unsafe_private_named.1, + age_assurance_state: self.__unsafe_private_named.2, + age_assurance_updated_by: self.__unsafe_private_named.3, + appealed: self.__unsafe_private_named.4, + comment: self.__unsafe_private_named.5, + created_at: self.__unsafe_private_named.6.unwrap(), + hosting: self.__unsafe_private_named.7, + id: self.__unsafe_private_named.8.unwrap(), + last_appealed_at: self.__unsafe_private_named.9, + last_reported_at: self.__unsafe_private_named.10, + last_reviewed_at: self.__unsafe_private_named.11, + last_reviewed_by: self.__unsafe_private_named.12, + mute_reporting_until: self.__unsafe_private_named.13, + mute_until: self.__unsafe_private_named.14, + priority_score: self.__unsafe_private_named.15, + records_stats: self.__unsafe_private_named.16, + review_state: self.__unsafe_private_named.17.unwrap(), + subject: self.__unsafe_private_named.18.unwrap(), + subject_blob_cids: self.__unsafe_private_named.19, + subject_repo_handle: self.__unsafe_private_named.20, + suspend_until: self.__unsafe_private_named.21, + tags: self.__unsafe_private_named.22, + takendown: self.__unsafe_private_named.23, + updated_at: self.__unsafe_private_named.24.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 SubjectStatusViewHosting<'a> { + #[serde(rename = "tools.ozone.moderation.defs#accountHosting")] + AccountHosting(Box>), + #[serde(rename = "tools.ozone.moderation.defs#recordHosting")] + RecordHosting(Box>), +} + +#[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 SubjectStatusViewSubject<'a> { + #[serde(rename = "com.atproto.admin.defs#repoRef")] + RepoRef(Box>), + #[serde(rename = "com.atproto.repo.strongRef")] + StrongRef(Box>), + #[serde(rename = "chat.bsky.convo.defs#messageRef")] + MessageRef(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SubjectStatusView<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "subjectStatusView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.priority_score { + if *value > 100i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "priority_score", + ), + max: 100i64, + actual: *value, + }); + } + } + if let Some(ref value) = self.priority_score { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "priority_score", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} + +/// Detailed view of a subject. For record subjects, the author's repo and profile will be returned. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SubjectView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub profile: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub record: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub repo: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: Option>, + #[serde(borrow)] + pub subject: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub r#type: crate::com_atproto::moderation::SubjectType<'a>, +} + +pub mod subject_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 Type; + type Subject; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Type = Unset; + type Subject = 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 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 Type = S::Type; + type Subject = 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 `subject` field + pub struct subject(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SubjectViewBuilder<'a, S: subject_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SubjectView<'a> { + /// Create a new builder for this type + pub fn new() -> SubjectViewBuilder<'a, subject_view_state::Empty> { + SubjectViewBuilder::new() + } +} + +impl<'a> SubjectViewBuilder<'a, subject_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubjectViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> { + /// Set the `profile` field (optional) + pub fn profile( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `profile` field to an Option value (optional) + pub fn maybe_profile( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> { + /// Set the `record` field (optional) + pub fn record( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = 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.1 = value; + self + } +} + +impl<'a, S: subject_view_state::State> SubjectViewBuilder<'a, S> { + /// Set the `repo` field (optional) + pub fn repo( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `repo` field to an Option value (optional) + pub fn maybe_repo( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: subject_view_state::State> SubjectViewBuilder<'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> SubjectViewBuilder<'a, S> +where + S: subject_view_state::State, + S::Subject: subject_view_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> SubjectViewBuilder<'a, subject_view_state::SetSubject> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + SubjectViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectViewBuilder<'a, S> +where + S: subject_view_state::State, + S::Type: subject_view_state::IsUnset, +{ + /// Set the `type` field (required) + pub fn r#type( + mut self, + value: impl Into>, + ) -> SubjectViewBuilder<'a, subject_view_state::SetType> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + SubjectViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectViewBuilder<'a, S> +where + S: subject_view_state::State, + S::Type: subject_view_state::IsSet, + S::Subject: subject_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SubjectView<'a> { + SubjectView { + profile: self.__unsafe_private_named.0, + record: self.__unsafe_private_named.1, + repo: self.__unsafe_private_named.2, + status: self.__unsafe_private_named.3, + subject: self.__unsafe_private_named.4.unwrap(), + r#type: 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>, + >, + ) -> SubjectView<'a> { + SubjectView { + profile: self.__unsafe_private_named.0, + record: self.__unsafe_private_named.1, + repo: self.__unsafe_private_named.2, + status: self.__unsafe_private_named.3, + subject: self.__unsafe_private_named.4.unwrap(), + r#type: self.__unsafe_private_named.5.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SubjectView<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "subjectView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Moderation event timeline event for a PLC create operation +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct TimelineEventPlcCreate; +impl std::fmt::Display for TimelineEventPlcCreate { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "timelineEventPlcCreate") + } +} + +/// Moderation event timeline event for generic PLC operation +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct TimelineEventPlcOperation; +impl std::fmt::Display for TimelineEventPlcOperation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "timelineEventPlcOperation") + } +} + +/// Moderation event timeline event for a PLC tombstone operation +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct TimelineEventPlcTombstone; +impl std::fmt::Display for TimelineEventPlcTombstone { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "timelineEventPlcTombstone") + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct VideoDetails<'a> { + pub height: i64, + pub length: i64, + pub width: i64, +} + +pub mod video_details_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 Width; + type Height; + type Length; + } + /// 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; + type Length = 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 Length = S::Length; + } + ///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 Length = S::Length; + } + ///State transition - sets the `length` field to Set + pub struct SetLength(PhantomData S>); + impl sealed::Sealed for SetLength {} + impl State for SetLength { + type Width = S::Width; + type Height = S::Height; + type Length = 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 `length` field + pub struct length(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VideoDetailsBuilder<'a, S: video_details_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> VideoDetails<'a> { + /// Create a new builder for this type + pub fn new() -> VideoDetailsBuilder<'a, video_details_state::Empty> { + VideoDetailsBuilder::new() + } +} + +impl<'a> VideoDetailsBuilder<'a, video_details_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VideoDetailsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VideoDetailsBuilder<'a, S> +where + S: video_details_state::State, + S::Height: video_details_state::IsUnset, +{ + /// Set the `height` field (required) + pub fn height( + mut self, + value: impl Into, + ) -> VideoDetailsBuilder<'a, video_details_state::SetHeight> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + VideoDetailsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VideoDetailsBuilder<'a, S> +where + S: video_details_state::State, + S::Length: video_details_state::IsUnset, +{ + /// Set the `length` field (required) + pub fn length( + mut self, + value: impl Into, + ) -> VideoDetailsBuilder<'a, video_details_state::SetLength> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + VideoDetailsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VideoDetailsBuilder<'a, S> +where + S: video_details_state::State, + S::Width: video_details_state::IsUnset, +{ + /// Set the `width` field (required) + pub fn width( + mut self, + value: impl Into, + ) -> VideoDetailsBuilder<'a, video_details_state::SetWidth> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + VideoDetailsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VideoDetailsBuilder<'a, S> +where + S: video_details_state::State, + S::Width: video_details_state::IsSet, + S::Height: video_details_state::IsSet, + S::Length: video_details_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> VideoDetails<'a> { + VideoDetails { + height: self.__unsafe_private_named.0.unwrap(), + length: self.__unsafe_private_named.1.unwrap(), + width: 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>, + >, + ) -> VideoDetails<'a> { + VideoDetails { + height: self.__unsafe_private_named.0.unwrap(), + length: self.__unsafe_private_named.1.unwrap(), + width: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for VideoDetails<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "videoDetails" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_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/tools_ozone/moderation/cancel_scheduled_actions.rs b/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs new file mode 100644 index 0000000..e391e88 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs @@ -0,0 +1,821 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.cancelScheduledActions +// +// 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 CancellationResults<'a> { + /// DIDs for which cancellation failed with error details + #[serde(borrow)] + pub failed: Vec< + crate::tools_ozone::moderation::cancel_scheduled_actions::FailedCancellation<'a>, + >, + /// DIDs for which all pending scheduled actions were successfully cancelled + #[serde(borrow)] + pub succeeded: Vec>, +} + +pub mod cancellation_results_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 Succeeded; + type Failed; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Succeeded = Unset; + type Failed = Unset; + } + ///State transition - sets the `succeeded` field to Set + pub struct SetSucceeded(PhantomData S>); + impl sealed::Sealed for SetSucceeded {} + impl State for SetSucceeded { + type Succeeded = Set; + type Failed = S::Failed; + } + ///State transition - sets the `failed` field to Set + pub struct SetFailed(PhantomData S>); + impl sealed::Sealed for SetFailed {} + impl State for SetFailed { + type Succeeded = S::Succeeded; + type Failed = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `succeeded` field + pub struct succeeded(()); + ///Marker type for the `failed` field + pub struct failed(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CancellationResultsBuilder<'a, S: cancellation_results_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + Vec< + crate::tools_ozone::moderation::cancel_scheduled_actions::FailedCancellation< + 'a, + >, + >, + >, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> CancellationResults<'a> { + /// Create a new builder for this type + pub fn new() -> CancellationResultsBuilder<'a, cancellation_results_state::Empty> { + CancellationResultsBuilder::new() + } +} + +impl<'a> CancellationResultsBuilder<'a, cancellation_results_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CancellationResultsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CancellationResultsBuilder<'a, S> +where + S: cancellation_results_state::State, + S::Failed: cancellation_results_state::IsUnset, +{ + /// Set the `failed` field (required) + pub fn failed( + mut self, + value: impl Into< + Vec< + crate::tools_ozone::moderation::cancel_scheduled_actions::FailedCancellation< + 'a, + >, + >, + >, + ) -> CancellationResultsBuilder<'a, cancellation_results_state::SetFailed> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CancellationResultsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CancellationResultsBuilder<'a, S> +where + S: cancellation_results_state::State, + S::Succeeded: cancellation_results_state::IsUnset, +{ + /// Set the `succeeded` field (required) + pub fn succeeded( + mut self, + value: impl Into>>, + ) -> CancellationResultsBuilder<'a, cancellation_results_state::SetSucceeded> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CancellationResultsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CancellationResultsBuilder<'a, S> +where + S: cancellation_results_state::State, + S::Succeeded: cancellation_results_state::IsSet, + S::Failed: cancellation_results_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CancellationResults<'a> { + CancellationResults { + failed: self.__unsafe_private_named.0.unwrap(), + succeeded: 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>, + >, + ) -> CancellationResults<'a> { + CancellationResults { + failed: self.__unsafe_private_named.0.unwrap(), + succeeded: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_moderation_cancelScheduledActions() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "tools.ozone.moderation.cancelScheduledActions", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cancellationResults"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("succeeded"), + ::jacquard_common::smol_str::SmolStr::new_static("failed") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("failed"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "DIDs for which cancellation failed with error details", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#failedCancellation", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "succeeded", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "DIDs for which all pending scheduled actions were successfully cancelled", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("failedCancellation"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("error") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("error"), + ::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( + "errorCode", + ), + ::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("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("subjects") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Optional comment describing the reason for cancellation", + ), + ), + 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( + "subjects", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Array of DID subjects to cancel scheduled actions for", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: Some(100usize), + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CancellationResults<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.cancelScheduledActions" + } + fn def_name() -> &'static str { + "cancellationResults" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_cancelScheduledActions() + } + 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 FailedCancellation<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub error: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub error_code: Option>, +} + +pub mod failed_cancellation_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 Did; + type Error; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type Error = 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 Error = S::Error; + } + ///State transition - sets the `error` field to Set + pub struct SetError(PhantomData S>); + impl sealed::Sealed for SetError {} + impl State for SetError { + type Did = S::Did; + type Error = 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 `error` field + pub struct error(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FailedCancellationBuilder<'a, S: failed_cancellation_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> FailedCancellation<'a> { + /// Create a new builder for this type + pub fn new() -> FailedCancellationBuilder<'a, failed_cancellation_state::Empty> { + FailedCancellationBuilder::new() + } +} + +impl<'a> FailedCancellationBuilder<'a, failed_cancellation_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FailedCancellationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FailedCancellationBuilder<'a, S> +where + S: failed_cancellation_state::State, + S::Did: failed_cancellation_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> FailedCancellationBuilder<'a, failed_cancellation_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FailedCancellationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FailedCancellationBuilder<'a, S> +where + S: failed_cancellation_state::State, + S::Error: failed_cancellation_state::IsUnset, +{ + /// Set the `error` field (required) + pub fn error( + mut self, + value: impl Into>, + ) -> FailedCancellationBuilder<'a, failed_cancellation_state::SetError> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FailedCancellationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: failed_cancellation_state::State> FailedCancellationBuilder<'a, S> { + /// Set the `errorCode` field (optional) + pub fn error_code( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `errorCode` field to an Option value (optional) + pub fn maybe_error_code( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> FailedCancellationBuilder<'a, S> +where + S: failed_cancellation_state::State, + S::Did: failed_cancellation_state::IsSet, + S::Error: failed_cancellation_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FailedCancellation<'a> { + FailedCancellation { + did: self.__unsafe_private_named.0.unwrap(), + error: self.__unsafe_private_named.1.unwrap(), + error_code: 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>, + >, + ) -> FailedCancellation<'a> { + FailedCancellation { + did: self.__unsafe_private_named.0.unwrap(), + error: self.__unsafe_private_named.1.unwrap(), + error_code: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FailedCancellation<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.cancelScheduledActions" + } + fn def_name() -> &'static str { + "failedCancellation" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_cancelScheduledActions() + } + 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 CancelScheduledActions<'a> { + /// Optional comment describing the reason for cancellation + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Array of DID subjects to cancel scheduled actions for + #[serde(borrow)] + pub subjects: Vec>, +} + +pub mod cancel_scheduled_actions_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 Subjects; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Subjects = Unset; + } + ///State transition - sets the `subjects` field to Set + pub struct SetSubjects(PhantomData S>); + impl sealed::Sealed for SetSubjects {} + impl State for SetSubjects { + type Subjects = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `subjects` field + pub struct subjects(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CancelScheduledActionsBuilder<'a, S: cancel_scheduled_actions_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> CancelScheduledActions<'a> { + /// Create a new builder for this type + pub fn new() -> CancelScheduledActionsBuilder< + 'a, + cancel_scheduled_actions_state::Empty, + > { + CancelScheduledActionsBuilder::new() + } +} + +impl<'a> CancelScheduledActionsBuilder<'a, cancel_scheduled_actions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CancelScheduledActionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: cancel_scheduled_actions_state::State> CancelScheduledActionsBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> CancelScheduledActionsBuilder<'a, S> +where + S: cancel_scheduled_actions_state::State, + S::Subjects: cancel_scheduled_actions_state::IsUnset, +{ + /// Set the `subjects` field (required) + pub fn subjects( + mut self, + value: impl Into>>, + ) -> CancelScheduledActionsBuilder< + 'a, + cancel_scheduled_actions_state::SetSubjects, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CancelScheduledActionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CancelScheduledActionsBuilder<'a, S> +where + S: cancel_scheduled_actions_state::State, + S::Subjects: cancel_scheduled_actions_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CancelScheduledActions<'a> { + CancelScheduledActions { + comment: self.__unsafe_private_named.0, + subjects: 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>, + >, + ) -> CancelScheduledActions<'a> { + CancelScheduledActions { + comment: self.__unsafe_private_named.0, + subjects: self.__unsafe_private_named.1.unwrap(), + 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 CancelScheduledActionsOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +/// Response type for +///tools.ozone.moderation.cancelScheduledActions +pub struct CancelScheduledActionsResponse; +impl jacquard_common::xrpc::XrpcResp for CancelScheduledActionsResponse { + const NSID: &'static str = "tools.ozone.moderation.cancelScheduledActions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CancelScheduledActionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for CancelScheduledActions<'a> { + const NSID: &'static str = "tools.ozone.moderation.cancelScheduledActions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = CancelScheduledActionsResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.cancelScheduledActions +pub struct CancelScheduledActionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for CancelScheduledActionsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.cancelScheduledActions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = CancelScheduledActions<'de>; + type Response = CancelScheduledActionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs new file mode 100644 index 0000000..627c075 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs @@ -0,0 +1,468 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.emitEvent +// +// 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 EmitEvent<'a> { + #[serde(borrow)] + pub created_by: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub event: EmitEventEvent<'a>, + /// An optional external ID for the event, used to deduplicate events from external systems. Fails when an event of same type with the same external ID exists for the same subject. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub external_id: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub mod_tool: Option>, + #[serde(borrow)] + pub subject: EmitEventSubject<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_blob_cids: Option>>, +} + +pub mod emit_event_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 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 Event = Unset; + type Subject = Unset; + type CreatedBy = Unset; + } + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EmitEventBuilder<'a, S: emit_event_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> EmitEvent<'a> { + /// Create a new builder for this type + pub fn new() -> EmitEventBuilder<'a, emit_event_state::Empty> { + EmitEventBuilder::new() + } +} + +impl<'a> EmitEventBuilder<'a, emit_event_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EmitEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EmitEventBuilder<'a, S> +where + S: emit_event_state::State, + S::CreatedBy: emit_event_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> EmitEventBuilder<'a, emit_event_state::SetCreatedBy> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EmitEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EmitEventBuilder<'a, S> +where + S: emit_event_state::State, + S::Event: emit_event_state::IsUnset, +{ + /// Set the `event` field (required) + pub fn event( + mut self, + value: impl Into>, + ) -> EmitEventBuilder<'a, emit_event_state::SetEvent> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + EmitEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: emit_event_state::State> EmitEventBuilder<'a, S> { + /// Set the `externalId` field (optional) + pub fn external_id( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `externalId` field to an Option value (optional) + pub fn maybe_external_id( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: emit_event_state::State> EmitEventBuilder<'a, S> { + /// Set the `modTool` field (optional) + pub fn mod_tool( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `modTool` field to an Option value (optional) + pub fn maybe_mod_tool( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> EmitEventBuilder<'a, S> +where + S: emit_event_state::State, + S::Subject: emit_event_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> EmitEventBuilder<'a, emit_event_state::SetSubject> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + EmitEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: emit_event_state::State> EmitEventBuilder<'a, S> { + /// Set the `subjectBlobCids` field (optional) + pub fn subject_blob_cids( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `subjectBlobCids` field to an Option value (optional) + pub fn maybe_subject_blob_cids( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> EmitEventBuilder<'a, S> +where + S: emit_event_state::State, + 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> { + EmitEvent { + created_by: self.__unsafe_private_named.0.unwrap(), + event: self.__unsafe_private_named.1.unwrap(), + external_id: self.__unsafe_private_named.2, + mod_tool: self.__unsafe_private_named.3, + subject: self.__unsafe_private_named.4.unwrap(), + subject_blob_cids: self.__unsafe_private_named.5, + 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>, + >, + ) -> EmitEvent<'a> { + EmitEvent { + created_by: self.__unsafe_private_named.0.unwrap(), + event: self.__unsafe_private_named.1.unwrap(), + external_id: self.__unsafe_private_named.2, + mod_tool: self.__unsafe_private_named.3, + subject: self.__unsafe_private_named.4.unwrap(), + subject_blob_cids: self.__unsafe_private_named.5, + 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 EmitEventEvent<'a> { + #[serde(rename = "tools.ozone.moderation.defs#modEventTakedown")] + ModEventTakedown(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventAcknowledge")] + ModEventAcknowledge(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventEscalate")] + ModEventEscalate(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventComment")] + ModEventComment(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventLabel")] + ModEventLabel(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventReport")] + ModEventReport(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventMute")] + ModEventMute(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventUnmute")] + ModEventUnmute(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventMuteReporter")] + ModEventMuteReporter(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventUnmuteReporter")] + ModEventUnmuteReporter( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventReverseTakedown")] + ModEventReverseTakedown( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventResolveAppeal")] + ModEventResolveAppeal( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#modEventEmail")] + ModEventEmail(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventDivert")] + ModEventDivert(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventTag")] + ModEventTag(Box>), + #[serde(rename = "tools.ozone.moderation.defs#accountEvent")] + AccountEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#identityEvent")] + IdentityEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#recordEvent")] + RecordEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#modEventPriorityScore")] + ModEventPriorityScore( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceEvent")] + AgeAssuranceEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")] + AgeAssuranceOverrideEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")] + RevokeAccountCredentialsEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")] + ScheduleTakedownEvent( + Box>, + ), + #[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")] + CancelScheduledTakedownEvent( + Box>, + ), +} + +#[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 EmitEventSubject<'a> { + #[serde(rename = "com.atproto.admin.defs#repoRef")] + RepoRef(Box>), + #[serde(rename = "com.atproto.repo.strongRef")] + StrongRef(Box>), +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct EmitEventOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::moderation::ModEventView<'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 EmitEventError<'a> { + #[serde(rename = "SubjectHasAction")] + SubjectHasAction(std::option::Option), + /// An event with the same external ID already exists for the subject. + #[serde(rename = "DuplicateExternalId")] + DuplicateExternalId(std::option::Option), +} + +impl std::fmt::Display for EmitEventError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::SubjectHasAction(msg) => { + write!(f, "SubjectHasAction")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::DuplicateExternalId(msg) => { + write!(f, "DuplicateExternalId")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.moderation.emitEvent +pub struct EmitEventResponse; +impl jacquard_common::xrpc::XrpcResp for EmitEventResponse { + const NSID: &'static str = "tools.ozone.moderation.emitEvent"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = EmitEventOutput<'de>; + type Err<'de> = EmitEventError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for EmitEvent<'a> { + const NSID: &'static str = "tools.ozone.moderation.emitEvent"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = EmitEventResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.emitEvent +pub struct EmitEventRequest; +impl jacquard_common::xrpc::XrpcEndpoint for EmitEventRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.emitEvent"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = EmitEvent<'de>; + type Response = EmitEventResponse; +} \ No newline at end of file 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 new file mode 100644 index 0000000..919c99c --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs @@ -0,0 +1,763 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.getAccountTimeline +// +// 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 GetAccountTimeline<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_account_timeline_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetAccountTimelineBuilder<'a, S: get_account_timeline_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetAccountTimeline<'a> { + /// Create a new builder for this type + pub fn new() -> GetAccountTimelineBuilder<'a, get_account_timeline_state::Empty> { + GetAccountTimelineBuilder::new() + } +} + +impl<'a> GetAccountTimelineBuilder<'a, get_account_timeline_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetAccountTimelineBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetAccountTimelineBuilder<'a, S> +where + S: get_account_timeline_state::State, + S::Did: get_account_timeline_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetAccountTimelineBuilder<'a, get_account_timeline_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetAccountTimelineBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetAccountTimelineBuilder<'a, S> +where + S: get_account_timeline_state::State, + S::Did: get_account_timeline_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetAccountTimeline<'a> { + GetAccountTimeline { + did: 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 GetAccountTimelineOutput<'a> { + #[serde(borrow)] + pub timeline: Vec< + crate::tools_ozone::moderation::get_account_timeline::TimelineItem<'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 GetAccountTimelineError<'a> { + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), +} + +impl std::fmt::Display for GetAccountTimelineError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.moderation.getAccountTimeline +pub struct GetAccountTimelineResponse; +impl jacquard_common::xrpc::XrpcResp for GetAccountTimelineResponse { + const NSID: &'static str = "tools.ozone.moderation.getAccountTimeline"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetAccountTimelineOutput<'de>; + type Err<'de> = GetAccountTimelineError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetAccountTimeline<'a> { + const NSID: &'static str = "tools.ozone.moderation.getAccountTimeline"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetAccountTimelineResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.getAccountTimeline +pub struct GetAccountTimelineRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetAccountTimelineRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.getAccountTimeline"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetAccountTimeline<'de>; + type Response = GetAccountTimelineResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct TimelineItem<'a> { + #[serde(borrow)] + pub day: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub summary: Vec< + crate::tools_ozone::moderation::get_account_timeline::TimelineItemSummary<'a>, + >, +} + +pub mod timeline_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 Day; + type Summary; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Day = Unset; + type Summary = Unset; + } + ///State transition - sets the `day` field to Set + pub struct SetDay(PhantomData S>); + impl sealed::Sealed for SetDay {} + impl State for SetDay { + type Day = Set; + type Summary = S::Summary; + } + ///State transition - sets the `summary` field to Set + pub struct SetSummary(PhantomData S>); + impl sealed::Sealed for SetSummary {} + impl State for SetSummary { + type Day = S::Day; + type Summary = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `day` field + pub struct day(()); + ///Marker type for the `summary` field + pub struct summary(()); + } +} + +/// Builder for constructing an instance of this type +pub struct TimelineItemBuilder<'a, S: timeline_item_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option< + Vec< + crate::tools_ozone::moderation::get_account_timeline::TimelineItemSummary< + 'a, + >, + >, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> TimelineItem<'a> { + /// Create a new builder for this type + pub fn new() -> TimelineItemBuilder<'a, timeline_item_state::Empty> { + TimelineItemBuilder::new() + } +} + +impl<'a> TimelineItemBuilder<'a, timeline_item_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + TimelineItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TimelineItemBuilder<'a, S> +where + S: timeline_item_state::State, + S::Day: timeline_item_state::IsUnset, +{ + /// Set the `day` field (required) + pub fn day( + mut self, + value: impl Into>, + ) -> TimelineItemBuilder<'a, timeline_item_state::SetDay> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + TimelineItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TimelineItemBuilder<'a, S> +where + S: timeline_item_state::State, + S::Summary: timeline_item_state::IsUnset, +{ + /// Set the `summary` field (required) + pub fn summary( + mut self, + value: impl Into< + Vec< + crate::tools_ozone::moderation::get_account_timeline::TimelineItemSummary< + 'a, + >, + >, + >, + ) -> TimelineItemBuilder<'a, timeline_item_state::SetSummary> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + TimelineItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TimelineItemBuilder<'a, S> +where + S: timeline_item_state::State, + S::Day: timeline_item_state::IsSet, + S::Summary: timeline_item_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> TimelineItem<'a> { + TimelineItem { + day: self.__unsafe_private_named.0.unwrap(), + summary: 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>, + >, + ) -> TimelineItem<'a> { + TimelineItem { + day: self.__unsafe_private_named.0.unwrap(), + summary: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_moderation_getAccountTimeline() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "tools.ozone.moderation.getAccountTimeline", + ), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("timelineItem"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("day"), + ::jacquard_common::smol_str::SmolStr::new_static("summary") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("day"), + ::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("summary"), + ::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( + "#timelineItemSummary", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("timelineItemSummary"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("eventSubjectType"), + ::jacquard_common::smol_str::SmolStr::new_static("eventType"), + ::jacquard_common::smol_str::SmolStr::new_static("count") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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( + "eventSubjectType", + ), + ::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( + "eventType", + ), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TimelineItem<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.getAccountTimeline" + } + fn def_name() -> &'static str { + "timelineItem" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_getAccountTimeline() + } + 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 TimelineItemSummary<'a> { + pub count: i64, + #[serde(borrow)] + pub event_subject_type: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub event_type: jacquard_common::CowStr<'a>, +} + +pub mod timeline_item_summary_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 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 EventSubjectType = Unset; + type EventType = Unset; + type Count = Unset; + } + ///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 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 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_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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct TimelineItemSummaryBuilder<'a, S: timeline_item_summary_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> TimelineItemSummary<'a> { + /// Create a new builder for this type + pub fn new() -> TimelineItemSummaryBuilder<'a, timeline_item_summary_state::Empty> { + TimelineItemSummaryBuilder::new() + } +} + +impl<'a> TimelineItemSummaryBuilder<'a, timeline_item_summary_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + TimelineItemSummaryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TimelineItemSummaryBuilder<'a, S> +where + S: timeline_item_summary_state::State, + S::Count: timeline_item_summary_state::IsUnset, +{ + /// Set the `count` field (required) + pub fn count( + mut self, + value: impl Into, + ) -> TimelineItemSummaryBuilder<'a, timeline_item_summary_state::SetCount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + TimelineItemSummaryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TimelineItemSummaryBuilder<'a, S> +where + S: timeline_item_summary_state::State, + S::EventSubjectType: timeline_item_summary_state::IsUnset, +{ + /// Set the `eventSubjectType` field (required) + pub fn event_subject_type( + mut self, + value: impl Into>, + ) -> TimelineItemSummaryBuilder< + 'a, + timeline_item_summary_state::SetEventSubjectType, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + TimelineItemSummaryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TimelineItemSummaryBuilder<'a, S> +where + S: timeline_item_summary_state::State, + S::EventType: timeline_item_summary_state::IsUnset, +{ + /// Set the `eventType` field (required) + pub fn event_type( + mut self, + value: impl Into>, + ) -> TimelineItemSummaryBuilder<'a, timeline_item_summary_state::SetEventType> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + TimelineItemSummaryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TimelineItemSummaryBuilder<'a, S> +where + S: timeline_item_summary_state::State, + 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 + pub fn build(self) -> TimelineItemSummary<'a> { + TimelineItemSummary { + count: self.__unsafe_private_named.0.unwrap(), + event_subject_type: self.__unsafe_private_named.1.unwrap(), + event_type: 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>, + >, + ) -> TimelineItemSummary<'a> { + TimelineItemSummary { + count: self.__unsafe_private_named.0.unwrap(), + event_subject_type: self.__unsafe_private_named.1.unwrap(), + event_type: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TimelineItemSummary<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.getAccountTimeline" + } + fn def_name() -> &'static str { + "timelineItemSummary" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_getAccountTimeline() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_event.rs b/crates/weaver-api/src/tools_ozone/moderation/get_event.rs new file mode 100644 index 0000000..a815f98 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/get_event.rs @@ -0,0 +1,149 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.getEvent +// +// 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 GetEvent { + pub id: i64, +} + +pub mod get_event_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 Id; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Id = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `id` field + pub struct id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetEventBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl GetEvent { + /// Create a new builder for this type + pub fn new() -> GetEventBuilder { + GetEventBuilder::new() + } +} + +impl GetEventBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl GetEventBuilder +where + S: get_event_state::State, + S::Id: get_event_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> GetEventBuilder> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetEventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + } + } +} + +impl GetEventBuilder +where + S: get_event_state::State, + S::Id: get_event_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetEvent { + GetEvent { + id: 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 GetEventOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::moderation::ModEventViewDetail<'a>, +} + +/// Response type for +///tools.ozone.moderation.getEvent +pub struct GetEventResponse; +impl jacquard_common::xrpc::XrpcResp for GetEventResponse { + const NSID: &'static str = "tools.ozone.moderation.getEvent"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetEventOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetEvent { + const NSID: &'static str = "tools.ozone.moderation.getEvent"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetEventResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.getEvent +pub struct GetEventRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetEventRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.getEvent"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetEvent; + type Response = GetEventResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_record.rs b/crates/weaver-api/src/tools_ozone/moderation/get_record.rs new file mode 100644 index 0000000..706e0fa --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/get_record.rs @@ -0,0 +1,213 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.getRecord +// +// 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 GetRecord<'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>, +} + +pub mod get_record_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 GetRecordBuilder<'a, S: get_record_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRecord<'a> { + /// Create a new builder for this type + pub fn new() -> GetRecordBuilder<'a, get_record_state::Empty> { + GetRecordBuilder::new() + } +} + +impl<'a> GetRecordBuilder<'a, get_record_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_record_state::State> GetRecordBuilder<'a, S> { + /// Set the `cid` field (optional) + pub fn cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Uri: get_record_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> GetRecordBuilder<'a, get_record_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetRecordBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordBuilder<'a, S> +where + S: get_record_state::State, + S::Uri: get_record_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRecord<'a> { + GetRecord { + cid: self.__unsafe_private_named.0, + uri: 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 GetRecordOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::moderation::RecordViewDetail<'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 GetRecordError<'a> { + #[serde(rename = "RecordNotFound")] + RecordNotFound(std::option::Option), +} + +impl std::fmt::Display for GetRecordError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RecordNotFound(msg) => { + write!(f, "RecordNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.moderation.getRecord +pub struct GetRecordResponse; +impl jacquard_common::xrpc::XrpcResp for GetRecordResponse { + const NSID: &'static str = "tools.ozone.moderation.getRecord"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetRecordOutput<'de>; + type Err<'de> = GetRecordError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRecord<'a> { + const NSID: &'static str = "tools.ozone.moderation.getRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRecordResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.getRecord +pub struct GetRecordRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRecordRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.getRecord"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRecord<'de>; + type Response = GetRecordResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_records.rs b/crates/weaver-api/src/tools_ozone/moderation/get_records.rs new file mode 100644 index 0000000..d0798a4 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/get_records.rs @@ -0,0 +1,173 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.getRecords +// +// 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 GetRecords<'a> { + #[serde(borrow)] + pub uris: Vec>, +} + +pub mod get_records_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 GetRecordsBuilder<'a, S: get_records_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRecords<'a> { + /// Create a new builder for this type + pub fn new() -> GetRecordsBuilder<'a, get_records_state::Empty> { + GetRecordsBuilder::new() + } +} + +impl<'a> GetRecordsBuilder<'a, get_records_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRecordsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordsBuilder<'a, S> +where + S: get_records_state::State, + S::Uris: get_records_state::IsUnset, +{ + /// Set the `uris` field (required) + pub fn uris( + mut self, + value: impl Into>>, + ) -> GetRecordsBuilder<'a, get_records_state::SetUris> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetRecordsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRecordsBuilder<'a, S> +where + S: get_records_state::State, + S::Uris: get_records_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRecords<'a> { + GetRecords { + 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 GetRecordsOutput<'a> { + #[serde(borrow)] + pub records: Vec>, +} + +#[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 GetRecordsOutputRecordsItem<'a> { + #[serde(rename = "tools.ozone.moderation.defs#recordViewDetail")] + RecordViewDetail(Box>), + #[serde(rename = "tools.ozone.moderation.defs#recordViewNotFound")] + RecordViewNotFound(Box>), +} + +/// Response type for +///tools.ozone.moderation.getRecords +pub struct GetRecordsResponse; +impl jacquard_common::xrpc::XrpcResp for GetRecordsResponse { + const NSID: &'static str = "tools.ozone.moderation.getRecords"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetRecordsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRecords<'a> { + const NSID: &'static str = "tools.ozone.moderation.getRecords"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRecordsResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.getRecords +pub struct GetRecordsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRecordsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.getRecords"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRecords<'de>; + type Response = GetRecordsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_repo.rs b/crates/weaver-api/src/tools_ozone/moderation/get_repo.rs new file mode 100644 index 0000000..2fd5149 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/get_repo.rs @@ -0,0 +1,189 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.getRepo +// +// 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 GetRepo<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod get_repo_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetRepoBuilder<'a, S: get_repo_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRepo<'a> { + /// Create a new builder for this type + pub fn new() -> GetRepoBuilder<'a, get_repo_state::Empty> { + GetRepoBuilder::new() + } +} + +impl<'a> GetRepoBuilder<'a, get_repo_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetRepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRepoBuilder<'a, S> +where + S: get_repo_state::State, + S::Did: get_repo_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> GetRepoBuilder<'a, get_repo_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetRepoBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetRepoBuilder<'a, S> +where + S: get_repo_state::State, + S::Did: get_repo_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRepo<'a> { + GetRepo { + did: 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 GetRepoOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::moderation::RepoViewDetail<'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 GetRepoError<'a> { + #[serde(rename = "RepoNotFound")] + RepoNotFound(std::option::Option), +} + +impl std::fmt::Display for GetRepoError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RepoNotFound(msg) => { + write!(f, "RepoNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.moderation.getRepo +pub struct GetRepoResponse; +impl jacquard_common::xrpc::XrpcResp for GetRepoResponse { + const NSID: &'static str = "tools.ozone.moderation.getRepo"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetRepoOutput<'de>; + type Err<'de> = GetRepoError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRepo<'a> { + const NSID: &'static str = "tools.ozone.moderation.getRepo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetRepoResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.getRepo +pub struct GetRepoRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetRepoRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.getRepo"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRepo<'de>; + type Response = GetRepoResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_reporter_stats.rs b/crates/weaver-api/src/tools_ozone/moderation/get_reporter_stats.rs new file mode 100644 index 0000000..04ca183 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/get_reporter_stats.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.getReporterStats +// +// 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 GetReporterStats<'a> { + #[serde(borrow)] + pub dids: Vec>, +} + +pub mod get_reporter_stats_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 Dids; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Dids = Unset; + } + ///State transition - sets the `dids` field to Set + pub struct SetDids(PhantomData S>); + impl sealed::Sealed for SetDids {} + impl State for SetDids { + type Dids = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `dids` field + pub struct dids(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetReporterStatsBuilder<'a, S: get_reporter_stats_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetReporterStats<'a> { + /// Create a new builder for this type + pub fn new() -> GetReporterStatsBuilder<'a, get_reporter_stats_state::Empty> { + GetReporterStatsBuilder::new() + } +} + +impl<'a> GetReporterStatsBuilder<'a, get_reporter_stats_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetReporterStatsBuilder<'a, S> +where + S: get_reporter_stats_state::State, + S::Dids: get_reporter_stats_state::IsUnset, +{ + /// Set the `dids` field (required) + pub fn dids( + mut self, + value: impl Into>>, + ) -> GetReporterStatsBuilder<'a, get_reporter_stats_state::SetDids> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetReporterStatsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetReporterStatsBuilder<'a, S> +where + S: get_reporter_stats_state::State, + S::Dids: get_reporter_stats_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetReporterStats<'a> { + GetReporterStats { + dids: 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 GetReporterStatsOutput<'a> { + #[serde(borrow)] + pub stats: Vec>, +} + +/// Response type for +///tools.ozone.moderation.getReporterStats +pub struct GetReporterStatsResponse; +impl jacquard_common::xrpc::XrpcResp for GetReporterStatsResponse { + const NSID: &'static str = "tools.ozone.moderation.getReporterStats"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetReporterStatsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetReporterStats<'a> { + const NSID: &'static str = "tools.ozone.moderation.getReporterStats"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetReporterStatsResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.getReporterStats +pub struct GetReporterStatsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetReporterStatsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.getReporterStats"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetReporterStats<'de>; + type Response = GetReporterStatsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_repos.rs b/crates/weaver-api/src/tools_ozone/moderation/get_repos.rs new file mode 100644 index 0000000..ad66012 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/get_repos.rs @@ -0,0 +1,173 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.getRepos +// +// 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 GetRepos<'a> { + #[serde(borrow)] + pub dids: Vec>, +} + +pub mod get_repos_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 Dids; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Dids = Unset; + } + ///State transition - sets the `dids` field to Set + pub struct SetDids(PhantomData S>); + impl sealed::Sealed for SetDids {} + impl State for SetDids { + type Dids = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `dids` field + pub struct dids(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetReposBuilder<'a, S: get_repos_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetRepos<'a> { + /// Create a new builder for this type + pub fn new() -> GetReposBuilder<'a, get_repos_state::Empty> { + GetReposBuilder::new() + } +} + +impl<'a> GetReposBuilder<'a, get_repos_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetReposBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetReposBuilder<'a, S> +where + S: get_repos_state::State, + S::Dids: get_repos_state::IsUnset, +{ + /// Set the `dids` field (required) + pub fn dids( + mut self, + value: impl Into>>, + ) -> GetReposBuilder<'a, get_repos_state::SetDids> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetReposBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetReposBuilder<'a, S> +where + S: get_repos_state::State, + S::Dids: get_repos_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetRepos<'a> { + GetRepos { + dids: 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 GetReposOutput<'a> { + #[serde(borrow)] + pub repos: Vec>, +} + +#[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 GetReposOutputReposItem<'a> { + #[serde(rename = "tools.ozone.moderation.defs#repoViewDetail")] + RepoViewDetail(Box>), + #[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")] + RepoViewNotFound(Box>), +} + +/// Response type for +///tools.ozone.moderation.getRepos +pub struct GetReposResponse; +impl jacquard_common::xrpc::XrpcResp for GetReposResponse { + const NSID: &'static str = "tools.ozone.moderation.getRepos"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetReposOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetRepos<'a> { + const NSID: &'static str = "tools.ozone.moderation.getRepos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetReposResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.getRepos +pub struct GetReposRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetReposRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.getRepos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetRepos<'de>; + type Response = GetReposResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_subjects.rs b/crates/weaver-api/src/tools_ozone/moderation/get_subjects.rs new file mode 100644 index 0000000..5519520 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/get_subjects.rs @@ -0,0 +1,152 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.getSubjects +// +// 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 GetSubjects<'a> { + #[serde(borrow)] + pub subjects: Vec>, +} + +pub mod get_subjects_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 Subjects; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Subjects = Unset; + } + ///State transition - sets the `subjects` field to Set + pub struct SetSubjects(PhantomData S>); + impl sealed::Sealed for SetSubjects {} + impl State for SetSubjects { + type Subjects = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `subjects` field + pub struct subjects(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetSubjectsBuilder<'a, S: get_subjects_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSubjects<'a> { + /// Create a new builder for this type + pub fn new() -> GetSubjectsBuilder<'a, get_subjects_state::Empty> { + GetSubjectsBuilder::new() + } +} + +impl<'a> GetSubjectsBuilder<'a, get_subjects_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSubjectsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetSubjectsBuilder<'a, S> +where + S: get_subjects_state::State, + S::Subjects: get_subjects_state::IsUnset, +{ + /// Set the `subjects` field (required) + pub fn subjects( + mut self, + value: impl Into>>, + ) -> GetSubjectsBuilder<'a, get_subjects_state::SetSubjects> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetSubjectsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetSubjectsBuilder<'a, S> +where + S: get_subjects_state::State, + S::Subjects: get_subjects_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetSubjects<'a> { + GetSubjects { + subjects: 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 GetSubjectsOutput<'a> { + #[serde(borrow)] + pub subjects: Vec>, +} + +/// Response type for +///tools.ozone.moderation.getSubjects +pub struct GetSubjectsResponse; +impl jacquard_common::xrpc::XrpcResp for GetSubjectsResponse { + const NSID: &'static str = "tools.ozone.moderation.getSubjects"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSubjectsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSubjects<'a> { + const NSID: &'static str = "tools.ozone.moderation.getSubjects"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSubjectsResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.getSubjects +pub struct GetSubjectsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSubjectsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.getSubjects"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSubjects<'de>; + type Response = GetSubjectsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/list_scheduled_actions.rs b/crates/weaver-api/src/tools_ozone/moderation/list_scheduled_actions.rs new file mode 100644 index 0000000..b0432e9 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/list_scheduled_actions.rs @@ -0,0 +1,299 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.listScheduledActions +// +// 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 ListScheduledActions<'a> { + /// Cursor for pagination + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: Option>, + /// Filter actions scheduled to execute before this time + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub ends_before: Option, + /// Maximum number of results to return + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: Option, + /// Filter actions scheduled to execute after this time + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub starts_after: Option, + /// Filter actions by status + #[serde(borrow)] + pub statuses: Vec>, + /// Filter actions for specific DID subjects + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subjects: Option>>, +} + +pub mod list_scheduled_actions_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 Statuses; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Statuses = Unset; + } + ///State transition - sets the `statuses` field to Set + pub struct SetStatuses(PhantomData S>); + impl sealed::Sealed for SetStatuses {} + impl State for SetStatuses { + type Statuses = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `statuses` field + pub struct statuses(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListScheduledActionsBuilder<'a, S: list_scheduled_actions_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> ListScheduledActions<'a> { + /// Create a new builder for this type + pub fn new() -> ListScheduledActionsBuilder< + 'a, + list_scheduled_actions_state::Empty, + > { + ListScheduledActionsBuilder::new() + } +} + +impl<'a> ListScheduledActionsBuilder<'a, list_scheduled_actions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListScheduledActionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_scheduled_actions_state::State> ListScheduledActionsBuilder<'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: list_scheduled_actions_state::State> ListScheduledActionsBuilder<'a, S> { + /// Set the `endsBefore` field (optional) + pub fn ends_before( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `endsBefore` field to an Option value (optional) + pub fn maybe_ends_before( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: list_scheduled_actions_state::State> ListScheduledActionsBuilder<'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: list_scheduled_actions_state::State> ListScheduledActionsBuilder<'a, S> { + /// Set the `startsAfter` field (optional) + pub fn starts_after( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `startsAfter` field to an Option value (optional) + pub fn maybe_starts_after( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> ListScheduledActionsBuilder<'a, S> +where + S: list_scheduled_actions_state::State, + S::Statuses: list_scheduled_actions_state::IsUnset, +{ + /// Set the `statuses` field (required) + pub fn statuses( + mut self, + value: impl Into>>, + ) -> ListScheduledActionsBuilder<'a, list_scheduled_actions_state::SetStatuses> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ListScheduledActionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_scheduled_actions_state::State> ListScheduledActionsBuilder<'a, S> { + /// Set the `subjects` field (optional) + pub fn subjects( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `subjects` field to an Option value (optional) + pub fn maybe_subjects( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> ListScheduledActionsBuilder<'a, S> +where + S: list_scheduled_actions_state::State, + S::Statuses: list_scheduled_actions_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListScheduledActions<'a> { + ListScheduledActions { + cursor: self.__unsafe_private_named.0, + ends_before: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + starts_after: self.__unsafe_private_named.3, + statuses: self.__unsafe_private_named.4.unwrap(), + subjects: self.__unsafe_private_named.5, + 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>, + >, + ) -> ListScheduledActions<'a> { + ListScheduledActions { + cursor: self.__unsafe_private_named.0, + ends_before: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + starts_after: self.__unsafe_private_named.3, + statuses: self.__unsafe_private_named.4.unwrap(), + subjects: self.__unsafe_private_named.5, + 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 ListScheduledActionsOutput<'a> { + #[serde(borrow)] + pub actions: Vec>, + /// Cursor for next page of results + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///tools.ozone.moderation.listScheduledActions +pub struct ListScheduledActionsResponse; +impl jacquard_common::xrpc::XrpcResp for ListScheduledActionsResponse { + const NSID: &'static str = "tools.ozone.moderation.listScheduledActions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListScheduledActionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListScheduledActions<'a> { + const NSID: &'static str = "tools.ozone.moderation.listScheduledActions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = ListScheduledActionsResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.listScheduledActions +pub struct ListScheduledActionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListScheduledActionsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.listScheduledActions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = ListScheduledActions<'de>; + type Response = ListScheduledActionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/query_events.rs b/crates/weaver-api/src/tools_ozone/moderation/query_events.rs new file mode 100644 index 0000000..f59c7e8 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/query_events.rs @@ -0,0 +1,660 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.queryEvents +// +// 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 QueryEvents<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub added_labels: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub added_tags: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub age_assurance_state: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub batch_id: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub collections: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_after: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_before: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub created_by: 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")] + pub has_comment: std::option::Option, + /// (default: false) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_all_user_records: 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 mod_tool: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub policies: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub removed_labels: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub removed_tags: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub report_types: std::option::Option>>, + ///(default: "desc") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort_direction: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_type: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub types: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub with_strike: std::option::Option, +} + +pub mod query_events_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 QueryEventsBuilder<'a, S: query_events_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>>, + ::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> QueryEvents<'a> { + /// Create a new builder for this type + pub fn new() -> QueryEventsBuilder<'a, query_events_state::Empty> { + QueryEventsBuilder::new() + } +} + +impl<'a> QueryEventsBuilder<'a, query_events_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + QueryEventsBuilder { + _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, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `addedLabels` field (optional) + pub fn added_labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `addedLabels` field to an Option value (optional) + pub fn maybe_added_labels( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `addedTags` field (optional) + pub fn added_tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `addedTags` field to an Option value (optional) + pub fn maybe_added_tags( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `ageAssuranceState` field (optional) + pub fn age_assurance_state( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `ageAssuranceState` field to an Option value (optional) + pub fn maybe_age_assurance_state( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `batchId` field (optional) + pub fn batch_id( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `batchId` field to an Option value (optional) + pub fn maybe_batch_id(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `collections` field (optional) + pub fn collections( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `collections` field to an Option value (optional) + pub fn maybe_collections( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `createdAfter` field (optional) + pub fn created_after( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `createdAfter` field to an Option value (optional) + pub fn maybe_created_after( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `createdBefore` field (optional) + pub fn created_before( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `createdBefore` field to an Option value (optional) + pub fn maybe_created_before( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `createdBy` field (optional) + pub fn created_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `createdBy` field to an Option value (optional) + pub fn maybe_created_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.9 = 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.9 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `hasComment` field (optional) + pub fn has_comment(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `hasComment` field to an Option value (optional) + pub fn maybe_has_comment(mut self, value: Option) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `includeAllUserRecords` field (optional) + pub fn include_all_user_records(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `includeAllUserRecords` field to an Option value (optional) + pub fn maybe_include_all_user_records(mut self, value: Option) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.12 = 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.12 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `modTool` field (optional) + pub fn mod_tool( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.13 = value.into(); + self + } + /// Set the `modTool` field to an Option value (optional) + pub fn maybe_mod_tool( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.13 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `policies` field (optional) + pub fn policies( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.14 = value.into(); + self + } + /// Set the `policies` field to an Option value (optional) + pub fn maybe_policies( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.14 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `removedLabels` field (optional) + pub fn removed_labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.15 = value.into(); + self + } + /// Set the `removedLabels` field to an Option value (optional) + pub fn maybe_removed_labels( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.15 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `removedTags` field (optional) + pub fn removed_tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.16 = value.into(); + self + } + /// Set the `removedTags` field to an Option value (optional) + pub fn maybe_removed_tags( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.16 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `reportTypes` field (optional) + pub fn report_types( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.17 = value.into(); + self + } + /// Set the `reportTypes` field to an Option value (optional) + pub fn maybe_report_types( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.17 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `sortDirection` field (optional) + pub fn sort_direction( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.18 = value.into(); + self + } + /// Set the `sortDirection` field to an Option value (optional) + pub fn maybe_sort_direction( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.18 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `subject` field (optional) + pub fn subject( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.19 = value.into(); + self + } + /// Set the `subject` field to an Option value (optional) + pub fn maybe_subject( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.19 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `subjectType` field (optional) + pub fn subject_type( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.20 = value.into(); + self + } + /// Set the `subjectType` field to an Option value (optional) + pub fn maybe_subject_type( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.20 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `types` field (optional) + pub fn types( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.21 = value.into(); + self + } + /// Set the `types` field to an Option value (optional) + pub fn maybe_types( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.21 = value; + self + } +} + +impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { + /// Set the `withStrike` field (optional) + pub fn with_strike(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.22 = value.into(); + self + } + /// Set the `withStrike` field to an Option value (optional) + pub fn maybe_with_strike(mut self, value: Option) -> Self { + self.__unsafe_private_named.22 = value; + self + } +} + +impl<'a, S> QueryEventsBuilder<'a, S> +where + S: query_events_state::State, +{ + /// Build the final struct + pub fn build(self) -> QueryEvents<'a> { + QueryEvents { + added_labels: self.__unsafe_private_named.0, + added_tags: self.__unsafe_private_named.1, + age_assurance_state: self.__unsafe_private_named.2, + batch_id: self.__unsafe_private_named.3, + collections: self.__unsafe_private_named.4, + comment: self.__unsafe_private_named.5, + created_after: self.__unsafe_private_named.6, + created_before: self.__unsafe_private_named.7, + created_by: self.__unsafe_private_named.8, + cursor: self.__unsafe_private_named.9, + has_comment: self.__unsafe_private_named.10, + include_all_user_records: self.__unsafe_private_named.11, + limit: self.__unsafe_private_named.12, + mod_tool: self.__unsafe_private_named.13, + policies: self.__unsafe_private_named.14, + removed_labels: self.__unsafe_private_named.15, + removed_tags: self.__unsafe_private_named.16, + report_types: self.__unsafe_private_named.17, + sort_direction: self.__unsafe_private_named.18, + subject: self.__unsafe_private_named.19, + subject_type: self.__unsafe_private_named.20, + types: self.__unsafe_private_named.21, + with_strike: self.__unsafe_private_named.22, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct QueryEventsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub events: Vec>, +} + +/// Response type for +///tools.ozone.moderation.queryEvents +pub struct QueryEventsResponse; +impl jacquard_common::xrpc::XrpcResp for QueryEventsResponse { + const NSID: &'static str = "tools.ozone.moderation.queryEvents"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = QueryEventsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for QueryEvents<'a> { + const NSID: &'static str = "tools.ozone.moderation.queryEvents"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = QueryEventsResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.queryEvents +pub struct QueryEventsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for QueryEventsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.queryEvents"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = QueryEvents<'de>; + type Response = QueryEventsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/query_statuses.rs b/crates/weaver-api/src/tools_ozone/moderation/query_statuses.rs new file mode 100644 index 0000000..7fc3be1 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/query_statuses.rs @@ -0,0 +1,931 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.queryStatuses +// +// 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 QueryStatuses<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub age_assurance_state: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub appealed: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub collections: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: 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 exclude_tags: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hosting_deleted_after: std::option::Option< + jacquard_common::types::string::Datetime, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hosting_deleted_before: std::option::Option< + jacquard_common::types::string::Datetime, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub hosting_statuses: std::option::Option>>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hosting_updated_after: std::option::Option< + jacquard_common::types::string::Datetime, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub hosting_updated_before: std::option::Option< + jacquard_common::types::string::Datetime, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub ignore_subjects: std::option::Option< + Vec>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_all_user_records: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_muted: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub last_reviewed_by: 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")] + pub min_account_suspend_count: std::option::Option, + ///(min: 0, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub min_priority_score: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub min_reported_records_count: std::option::Option, + ///(min: 1) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub min_strike_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub min_takendown_records_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub only_muted: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub queue_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub queue_index: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub queue_seed: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reported_after: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reported_before: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub review_state: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reviewed_after: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub reviewed_before: std::option::Option, + ///(default: "desc") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort_direction: std::option::Option>, + ///(default: "lastReportedAt") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort_field: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_type: 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")] + pub takendown: std::option::Option, +} + +pub mod query_statuses_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 QueryStatusesBuilder<'a, S: query_statuses_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, + ::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>, + ::core::option::Option>>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> QueryStatuses<'a> { + /// Create a new builder for this type + pub fn new() -> QueryStatusesBuilder<'a, query_statuses_state::Empty> { + QueryStatusesBuilder::new() + } +} + +impl<'a> QueryStatusesBuilder<'a, query_statuses_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + QueryStatusesBuilder { + _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, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `ageAssuranceState` field (optional) + pub fn age_assurance_state( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `ageAssuranceState` field to an Option value (optional) + pub fn maybe_age_assurance_state( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `appealed` field (optional) + pub fn appealed(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `appealed` field to an Option value (optional) + pub fn maybe_appealed(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `collections` field (optional) + pub fn collections( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `collections` field to an Option value (optional) + pub fn maybe_collections( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `excludeTags` field (optional) + pub fn exclude_tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `excludeTags` field to an Option value (optional) + pub fn maybe_exclude_tags( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `hostingDeletedAfter` field (optional) + pub fn hosting_deleted_after( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `hostingDeletedAfter` field to an Option value (optional) + pub fn maybe_hosting_deleted_after( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `hostingDeletedBefore` field (optional) + pub fn hosting_deleted_before( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `hostingDeletedBefore` field to an Option value (optional) + pub fn maybe_hosting_deleted_before( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `hostingStatuses` field (optional) + pub fn hosting_statuses( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `hostingStatuses` field to an Option value (optional) + pub fn maybe_hosting_statuses( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `hostingUpdatedAfter` field (optional) + pub fn hosting_updated_after( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `hostingUpdatedAfter` field to an Option value (optional) + pub fn maybe_hosting_updated_after( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `hostingUpdatedBefore` field (optional) + pub fn hosting_updated_before( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `hostingUpdatedBefore` field to an Option value (optional) + pub fn maybe_hosting_updated_before( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `ignoreSubjects` field (optional) + pub fn ignore_subjects( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `ignoreSubjects` field to an Option value (optional) + pub fn maybe_ignore_subjects( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `includeAllUserRecords` field (optional) + pub fn include_all_user_records(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `includeAllUserRecords` field to an Option value (optional) + pub fn maybe_include_all_user_records(mut self, value: Option) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `includeMuted` field (optional) + pub fn include_muted(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.13 = value.into(); + self + } + /// Set the `includeMuted` field to an Option value (optional) + pub fn maybe_include_muted(mut self, value: Option) -> Self { + self.__unsafe_private_named.13 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `lastReviewedBy` field (optional) + pub fn last_reviewed_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.14 = value.into(); + self + } + /// Set the `lastReviewedBy` field to an Option value (optional) + pub fn maybe_last_reviewed_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.14 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.15 = 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.15 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `minAccountSuspendCount` field (optional) + pub fn min_account_suspend_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.16 = value.into(); + self + } + /// Set the `minAccountSuspendCount` field to an Option value (optional) + pub fn maybe_min_account_suspend_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.16 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `minPriorityScore` field (optional) + pub fn min_priority_score(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.17 = value.into(); + self + } + /// Set the `minPriorityScore` field to an Option value (optional) + pub fn maybe_min_priority_score(mut self, value: Option) -> Self { + self.__unsafe_private_named.17 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `minReportedRecordsCount` field (optional) + pub fn min_reported_records_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.18 = value.into(); + self + } + /// Set the `minReportedRecordsCount` field to an Option value (optional) + pub fn maybe_min_reported_records_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.18 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `minStrikeCount` field (optional) + pub fn min_strike_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.19 = value.into(); + self + } + /// Set the `minStrikeCount` field to an Option value (optional) + pub fn maybe_min_strike_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.19 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `minTakendownRecordsCount` field (optional) + pub fn min_takendown_records_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.20 = value.into(); + self + } + /// Set the `minTakendownRecordsCount` field to an Option value (optional) + pub fn maybe_min_takendown_records_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.20 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `onlyMuted` field (optional) + pub fn only_muted(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.21 = value.into(); + self + } + /// Set the `onlyMuted` field to an Option value (optional) + pub fn maybe_only_muted(mut self, value: Option) -> Self { + self.__unsafe_private_named.21 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `queueCount` field (optional) + pub fn queue_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.22 = value.into(); + self + } + /// Set the `queueCount` field to an Option value (optional) + pub fn maybe_queue_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.22 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `queueIndex` field (optional) + pub fn queue_index(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.23 = value.into(); + self + } + /// Set the `queueIndex` field to an Option value (optional) + pub fn maybe_queue_index(mut self, value: Option) -> Self { + self.__unsafe_private_named.23 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `queueSeed` field (optional) + pub fn queue_seed( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.24 = value.into(); + self + } + /// Set the `queueSeed` field to an Option value (optional) + pub fn maybe_queue_seed( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.24 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `reportedAfter` field (optional) + pub fn reported_after( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.25 = value.into(); + self + } + /// Set the `reportedAfter` field to an Option value (optional) + pub fn maybe_reported_after( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.25 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `reportedBefore` field (optional) + pub fn reported_before( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.26 = value.into(); + self + } + /// Set the `reportedBefore` field to an Option value (optional) + pub fn maybe_reported_before( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.26 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `reviewState` field (optional) + pub fn review_state( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.27 = value.into(); + self + } + /// Set the `reviewState` field to an Option value (optional) + pub fn maybe_review_state( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.27 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `reviewedAfter` field (optional) + pub fn reviewed_after( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.28 = value.into(); + self + } + /// Set the `reviewedAfter` field to an Option value (optional) + pub fn maybe_reviewed_after( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.28 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `reviewedBefore` field (optional) + pub fn reviewed_before( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.29 = value.into(); + self + } + /// Set the `reviewedBefore` field to an Option value (optional) + pub fn maybe_reviewed_before( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.29 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `sortDirection` field (optional) + pub fn sort_direction( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.30 = value.into(); + self + } + /// Set the `sortDirection` field to an Option value (optional) + pub fn maybe_sort_direction( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.30 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `sortField` field (optional) + pub fn sort_field( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.31 = value.into(); + self + } + /// Set the `sortField` field to an Option value (optional) + pub fn maybe_sort_field( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.31 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `subject` field (optional) + pub fn subject( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.32 = value.into(); + self + } + /// Set the `subject` field to an Option value (optional) + pub fn maybe_subject( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.32 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `subjectType` field (optional) + pub fn subject_type( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.33 = value.into(); + self + } + /// Set the `subjectType` field to an Option value (optional) + pub fn maybe_subject_type( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.33 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.34 = 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.34 = value; + self + } +} + +impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { + /// Set the `takendown` field (optional) + pub fn takendown(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.35 = value.into(); + self + } + /// Set the `takendown` field to an Option value (optional) + pub fn maybe_takendown(mut self, value: Option) -> Self { + self.__unsafe_private_named.35 = value; + self + } +} + +impl<'a, S> QueryStatusesBuilder<'a, S> +where + S: query_statuses_state::State, +{ + /// Build the final struct + pub fn build(self) -> QueryStatuses<'a> { + QueryStatuses { + age_assurance_state: self.__unsafe_private_named.0, + appealed: self.__unsafe_private_named.1, + collections: self.__unsafe_private_named.2, + comment: self.__unsafe_private_named.3, + cursor: self.__unsafe_private_named.4, + exclude_tags: self.__unsafe_private_named.5, + hosting_deleted_after: self.__unsafe_private_named.6, + hosting_deleted_before: self.__unsafe_private_named.7, + hosting_statuses: self.__unsafe_private_named.8, + hosting_updated_after: self.__unsafe_private_named.9, + hosting_updated_before: self.__unsafe_private_named.10, + ignore_subjects: self.__unsafe_private_named.11, + include_all_user_records: self.__unsafe_private_named.12, + include_muted: self.__unsafe_private_named.13, + last_reviewed_by: self.__unsafe_private_named.14, + limit: self.__unsafe_private_named.15, + min_account_suspend_count: self.__unsafe_private_named.16, + min_priority_score: self.__unsafe_private_named.17, + min_reported_records_count: self.__unsafe_private_named.18, + min_strike_count: self.__unsafe_private_named.19, + min_takendown_records_count: self.__unsafe_private_named.20, + only_muted: self.__unsafe_private_named.21, + queue_count: self.__unsafe_private_named.22, + queue_index: self.__unsafe_private_named.23, + queue_seed: self.__unsafe_private_named.24, + reported_after: self.__unsafe_private_named.25, + reported_before: self.__unsafe_private_named.26, + review_state: self.__unsafe_private_named.27, + reviewed_after: self.__unsafe_private_named.28, + reviewed_before: self.__unsafe_private_named.29, + sort_direction: self.__unsafe_private_named.30, + sort_field: self.__unsafe_private_named.31, + subject: self.__unsafe_private_named.32, + subject_type: self.__unsafe_private_named.33, + tags: self.__unsafe_private_named.34, + takendown: self.__unsafe_private_named.35, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct QueryStatusesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub subject_statuses: Vec>, +} + +/// Response type for +///tools.ozone.moderation.queryStatuses +pub struct QueryStatusesResponse; +impl jacquard_common::xrpc::XrpcResp for QueryStatusesResponse { + const NSID: &'static str = "tools.ozone.moderation.queryStatuses"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = QueryStatusesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for QueryStatuses<'a> { + const NSID: &'static str = "tools.ozone.moderation.queryStatuses"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = QueryStatusesResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.queryStatuses +pub struct QueryStatusesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for QueryStatusesRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.queryStatuses"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = QueryStatuses<'de>; + type Response = QueryStatusesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs new file mode 100644 index 0000000..3f7cefc --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs @@ -0,0 +1,1234 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.scheduleAction +// +// 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 FailedScheduling<'a> { + #[serde(borrow)] + pub error: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub error_code: Option>, + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +pub mod failed_scheduling_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 Error; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FailedSchedulingBuilder<'a, S: failed_scheduling_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> FailedScheduling<'a> { + /// Create a new builder for this type + pub fn new() -> FailedSchedulingBuilder<'a, failed_scheduling_state::Empty> { + FailedSchedulingBuilder::new() + } +} + +impl<'a> FailedSchedulingBuilder<'a, failed_scheduling_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FailedSchedulingBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FailedSchedulingBuilder<'a, S> +where + S: failed_scheduling_state::State, + S::Error: failed_scheduling_state::IsUnset, +{ + /// Set the `error` field (required) + pub fn error( + mut self, + value: impl Into>, + ) -> FailedSchedulingBuilder<'a, failed_scheduling_state::SetError> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FailedSchedulingBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: failed_scheduling_state::State> FailedSchedulingBuilder<'a, S> { + /// Set the `errorCode` field (optional) + pub fn error_code( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `errorCode` field to an Option value (optional) + pub fn maybe_error_code( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> FailedSchedulingBuilder<'a, S> +where + S: failed_scheduling_state::State, + S::Subject: failed_scheduling_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> FailedSchedulingBuilder<'a, failed_scheduling_state::SetSubject> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + FailedSchedulingBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FailedSchedulingBuilder<'a, S> +where + S: failed_scheduling_state::State, + S::Subject: failed_scheduling_state::IsSet, + S::Error: failed_scheduling_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FailedScheduling<'a> { + FailedScheduling { + error: self.__unsafe_private_named.0.unwrap(), + error_code: self.__unsafe_private_named.1, + subject: 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>, + >, + ) -> FailedScheduling<'a> { + FailedScheduling { + error: self.__unsafe_private_named.0.unwrap(), + error_code: self.__unsafe_private_named.1, + subject: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_moderation_scheduleAction() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "tools.ozone.moderation.scheduleAction", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("failedScheduling"), + ::jacquard_lexicon::lexicon::LexUserType::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("error") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("error"), + ::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( + "errorCode", + ), + ::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("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("action"), + ::jacquard_common::smol_str::SmolStr::new_static("subjects"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::jacquard_common::smol_str::SmolStr::new_static("scheduling") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("action"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#takedown") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("modTool"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "tools.ozone.moderation.defs#modTool", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "scheduling", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#schedulingConfig", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjects", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Array of DID subjects to schedule the action for", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: Some(100usize), + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "scheduledActionResults", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("succeeded"), + ::jacquard_common::smol_str::SmolStr::new_static("failed") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("failed"), + ::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( + "#failedScheduling", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "succeeded", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("schedulingConfig"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Configuration for when the action should be executed", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "executeAfter", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Earliest time to execute the action (for randomized scheduling)", + ), + ), + 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( + "executeAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Exact time to execute the action", + ), + ), + 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( + "executeUntil", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Latest time to execute the action (for randomized scheduling)", + ), + ), + 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("takedown"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Schedule a takedown action", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "acknowledgeAccountSubjects", + ), + ::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("comment"), + ::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( + "durationInHours", + ), + ::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("policies"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Names/Keywords of the policies that drove the decision.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FailedScheduling<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.scheduleAction" + } + fn def_name() -> &'static str { + "failedScheduling" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_scheduleAction() + } + 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 ScheduleAction<'a> { + #[serde(borrow)] + pub action: crate::tools_ozone::moderation::schedule_action::Takedown<'a>, + #[serde(borrow)] + pub created_by: jacquard_common::types::string::Did<'a>, + /// This will be propagated to the moderation event when it is applied + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub mod_tool: Option>, + #[serde(borrow)] + pub scheduling: crate::tools_ozone::moderation::schedule_action::SchedulingConfig< + 'a, + >, + /// Array of DID subjects to schedule the action for + #[serde(borrow)] + pub subjects: Vec>, +} + +pub mod schedule_action_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 Action; + type Subjects; + type CreatedBy; + type Scheduling; + } + /// 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; + } + ///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; + } + ///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 = Set; + type CreatedBy = S::CreatedBy; + type Scheduling = S::Scheduling; + } + ///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; + } + ///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 = S::Subjects; + type CreatedBy = S::CreatedBy; + type Scheduling = 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ScheduleActionBuilder<'a, S: schedule_action_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + crate::tools_ozone::moderation::schedule_action::Takedown<'a>, + >, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option< + crate::tools_ozone::moderation::schedule_action::SchedulingConfig<'a>, + >, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ScheduleAction<'a> { + /// Create a new builder for this type + pub fn new() -> ScheduleActionBuilder<'a, schedule_action_state::Empty> { + ScheduleActionBuilder::new() + } +} + +impl<'a> ScheduleActionBuilder<'a, schedule_action_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ScheduleActionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduleActionBuilder<'a, S> +where + S: schedule_action_state::State, + S::Action: schedule_action_state::IsUnset, +{ + /// Set the `action` field (required) + pub fn action( + mut self, + value: impl Into>, + ) -> ScheduleActionBuilder<'a, schedule_action_state::SetAction> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ScheduleActionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduleActionBuilder<'a, S> +where + S: schedule_action_state::State, + S::CreatedBy: schedule_action_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> ScheduleActionBuilder<'a, schedule_action_state::SetCreatedBy> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ScheduleActionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: schedule_action_state::State> ScheduleActionBuilder<'a, S> { + /// Set the `modTool` field (optional) + pub fn mod_tool( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `modTool` field to an Option value (optional) + pub fn maybe_mod_tool( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ScheduleActionBuilder<'a, S> +where + S: schedule_action_state::State, + S::Scheduling: schedule_action_state::IsUnset, +{ + /// Set the `scheduling` field (required) + pub fn scheduling( + mut self, + value: impl Into< + crate::tools_ozone::moderation::schedule_action::SchedulingConfig<'a>, + >, + ) -> ScheduleActionBuilder<'a, schedule_action_state::SetScheduling> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ScheduleActionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduleActionBuilder<'a, S> +where + S: schedule_action_state::State, + S::Subjects: schedule_action_state::IsUnset, +{ + /// Set the `subjects` field (required) + pub fn subjects( + mut self, + value: impl Into>>, + ) -> ScheduleActionBuilder<'a, schedule_action_state::SetSubjects> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ScheduleActionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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, +{ + /// Build the final struct + pub fn build(self) -> ScheduleAction<'a> { + ScheduleAction { + action: self.__unsafe_private_named.0.unwrap(), + created_by: self.__unsafe_private_named.1.unwrap(), + mod_tool: self.__unsafe_private_named.2, + scheduling: self.__unsafe_private_named.3.unwrap(), + subjects: 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>, + >, + ) -> ScheduleAction<'a> { + ScheduleAction { + action: self.__unsafe_private_named.0.unwrap(), + created_by: self.__unsafe_private_named.1.unwrap(), + mod_tool: self.__unsafe_private_named.2, + scheduling: self.__unsafe_private_named.3.unwrap(), + subjects: self.__unsafe_private_named.4.unwrap(), + 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 ScheduleActionOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +/// Response type for +///tools.ozone.moderation.scheduleAction +pub struct ScheduleActionResponse; +impl jacquard_common::xrpc::XrpcResp for ScheduleActionResponse { + const NSID: &'static str = "tools.ozone.moderation.scheduleAction"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ScheduleActionOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ScheduleAction<'a> { + const NSID: &'static str = "tools.ozone.moderation.scheduleAction"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = ScheduleActionResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.scheduleAction +pub struct ScheduleActionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ScheduleActionRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.scheduleAction"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = ScheduleAction<'de>; + type Response = ScheduleActionResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ScheduledActionResults<'a> { + #[serde(borrow)] + pub failed: Vec< + crate::tools_ozone::moderation::schedule_action::FailedScheduling<'a>, + >, + #[serde(borrow)] + pub succeeded: Vec>, +} + +pub mod scheduled_action_results_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 Succeeded; + type Failed; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Succeeded = Unset; + type Failed = Unset; + } + ///State transition - sets the `succeeded` field to Set + pub struct SetSucceeded(PhantomData S>); + impl sealed::Sealed for SetSucceeded {} + impl State for SetSucceeded { + type Succeeded = Set; + type Failed = S::Failed; + } + ///State transition - sets the `failed` field to Set + pub struct SetFailed(PhantomData S>); + impl sealed::Sealed for SetFailed {} + impl State for SetFailed { + type Succeeded = S::Succeeded; + type Failed = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `succeeded` field + pub struct succeeded(()); + ///Marker type for the `failed` field + pub struct failed(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ScheduledActionResultsBuilder<'a, S: scheduled_action_results_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + Vec>, + >, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ScheduledActionResults<'a> { + /// Create a new builder for this type + pub fn new() -> ScheduledActionResultsBuilder< + 'a, + scheduled_action_results_state::Empty, + > { + ScheduledActionResultsBuilder::new() + } +} + +impl<'a> ScheduledActionResultsBuilder<'a, scheduled_action_results_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ScheduledActionResultsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduledActionResultsBuilder<'a, S> +where + S: scheduled_action_results_state::State, + S::Failed: scheduled_action_results_state::IsUnset, +{ + /// Set the `failed` field (required) + pub fn failed( + mut self, + value: impl Into< + Vec>, + >, + ) -> ScheduledActionResultsBuilder< + 'a, + scheduled_action_results_state::SetFailed, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ScheduledActionResultsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduledActionResultsBuilder<'a, S> +where + S: scheduled_action_results_state::State, + S::Succeeded: scheduled_action_results_state::IsUnset, +{ + /// Set the `succeeded` field (required) + pub fn succeeded( + mut self, + value: impl Into>>, + ) -> ScheduledActionResultsBuilder< + 'a, + scheduled_action_results_state::SetSucceeded, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ScheduledActionResultsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ScheduledActionResultsBuilder<'a, S> +where + S: scheduled_action_results_state::State, + S::Succeeded: scheduled_action_results_state::IsSet, + S::Failed: scheduled_action_results_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ScheduledActionResults<'a> { + ScheduledActionResults { + failed: self.__unsafe_private_named.0.unwrap(), + succeeded: 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>, + >, + ) -> ScheduledActionResults<'a> { + ScheduledActionResults { + failed: self.__unsafe_private_named.0.unwrap(), + succeeded: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ScheduledActionResults<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.scheduleAction" + } + fn def_name() -> &'static str { + "scheduledActionResults" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_scheduleAction() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Configuration for when the action should be executed +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct SchedulingConfig<'a> { + /// Earliest time to execute the action (for randomized scheduling) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_after: std::option::Option, + /// Exact time to execute the action + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_at: std::option::Option, + /// Latest time to execute the action (for randomized scheduling) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub execute_until: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SchedulingConfig<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.scheduleAction" + } + fn def_name() -> &'static str { + "schedulingConfig" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_scheduleAction() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Schedule a takedown action +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Takedown<'a> { + /// If true, all other reports on content authored by this account will be resolved (acknowledged). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub acknowledge_account_subjects: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: std::option::Option>, + /// Indicates how long the takedown should be in effect before automatically expiring. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub duration_in_hours: std::option::Option, + /// Names/Keywords of the policies that drove the decision. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub policies: std::option::Option>>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Takedown<'a> { + fn nsid() -> &'static str { + "tools.ozone.moderation.scheduleAction" + } + fn def_name() -> &'static str { + "takedown" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_scheduleAction() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.policies { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "policies", + ), + max: 5usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/moderation/search_repos.rs b/crates/weaver-api/src/tools_ozone/moderation/search_repos.rs new file mode 100644 index 0000000..e02c07d --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/moderation/search_repos.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.moderation.searchRepos +// +// 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 SearchRepos<'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 q: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub term: std::option::Option>, +} + +pub mod search_repos_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 SearchReposBuilder<'a, S: search_repos_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> SearchRepos<'a> { + /// Create a new builder for this type + pub fn new() -> SearchReposBuilder<'a, search_repos_state::Empty> { + SearchReposBuilder::new() + } +} + +impl<'a> SearchReposBuilder<'a, search_repos_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchReposBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_repos_state::State> SearchReposBuilder<'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_repos_state::State> SearchReposBuilder<'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: search_repos_state::State> SearchReposBuilder<'a, S> { + /// Set the `q` field (optional) + pub fn q(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `q` field to an Option value (optional) + pub fn maybe_q(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: search_repos_state::State> SearchReposBuilder<'a, S> { + /// Set the `term` field (optional) + pub fn term( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `term` field to an Option value (optional) + pub fn maybe_term(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> SearchReposBuilder<'a, S> +where + S: search_repos_state::State, +{ + /// Build the final struct + pub fn build(self) -> SearchRepos<'a> { + SearchRepos { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + q: self.__unsafe_private_named.2, + term: 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 SearchReposOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub repos: Vec>, +} + +/// Response type for +///tools.ozone.moderation.searchRepos +pub struct SearchReposResponse; +impl jacquard_common::xrpc::XrpcResp for SearchReposResponse { + const NSID: &'static str = "tools.ozone.moderation.searchRepos"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchReposOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchRepos<'a> { + const NSID: &'static str = "tools.ozone.moderation.searchRepos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchReposResponse; +} + +/// Endpoint type for +///tools.ozone.moderation.searchRepos +pub struct SearchReposRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchReposRequest { + const PATH: &'static str = "/xrpc/tools.ozone.moderation.searchRepos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchRepos<'de>; + type Response = SearchReposResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/report.rs b/crates/weaver-api/src/tools_ozone/report.rs new file mode 100644 index 0000000..20d899f --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/report.rs @@ -0,0 +1,1312 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.report.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Appeal a previously taken moderation action +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonAppeal; +impl std::fmt::Display for ReasonAppeal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonAppeal") + } +} + +/// Child sexual abuse material (CSAM). These reports will be sent only be sent to the application's Moderation Authority. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonChildSafetyCsam; +impl std::fmt::Display for ReasonChildSafetyCsam { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonChildSafetyCSAM") + } +} + +/// Grooming or predatory behavior. These reports will be sent only be sent to the application's Moderation Authority. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonChildSafetyGroom; +impl std::fmt::Display for ReasonChildSafetyGroom { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonChildSafetyGroom") + } +} + +/// Harassment or bullying of minors +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonChildSafetyHarassment; +impl std::fmt::Display for ReasonChildSafetyHarassment { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonChildSafetyHarassment") + } +} + +/// Other child safety. These reports will be sent only be sent to the application's Moderation Authority. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonChildSafetyOther; +impl std::fmt::Display for ReasonChildSafetyOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonChildSafetyOther") + } +} + +/// Privacy violation involving a minor +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonChildSafetyPrivacy; +impl std::fmt::Display for ReasonChildSafetyPrivacy { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonChildSafetyPrivacy") + } +} + +/// Doxxing +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonHarassmentDoxxing; +impl std::fmt::Display for ReasonHarassmentDoxxing { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonHarassmentDoxxing") + } +} + +/// Hate speech +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonHarassmentHateSpeech; +impl std::fmt::Display for ReasonHarassmentHateSpeech { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonHarassmentHateSpeech") + } +} + +/// Other harassing or hateful content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonHarassmentOther; +impl std::fmt::Display for ReasonHarassmentOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonHarassmentOther") + } +} + +/// Targeted harassment +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonHarassmentTargeted; +impl std::fmt::Display for ReasonHarassmentTargeted { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonHarassmentTargeted") + } +} + +/// Trolling +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonHarassmentTroll; +impl std::fmt::Display for ReasonHarassmentTroll { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonHarassmentTroll") + } +} + +/// Fake account or bot +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonMisleadingBot; +impl std::fmt::Display for ReasonMisleadingBot { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonMisleadingBot") + } +} + +/// False information about elections +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonMisleadingElections; +impl std::fmt::Display for ReasonMisleadingElections { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonMisleadingElections") + } +} + +/// Impersonation +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonMisleadingImpersonation; +impl std::fmt::Display for ReasonMisleadingImpersonation { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonMisleadingImpersonation") + } +} + +/// Other misleading content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonMisleadingOther; +impl std::fmt::Display for ReasonMisleadingOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonMisleadingOther") + } +} + +/// Scam +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonMisleadingScam; +impl std::fmt::Display for ReasonMisleadingScam { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonMisleadingScam") + } +} + +/// Spam +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonMisleadingSpam; +impl std::fmt::Display for ReasonMisleadingSpam { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonMisleadingSpam") + } +} + +/// An issue not included in these options +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonOther; +impl std::fmt::Display for ReasonOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonOther") + } +} + +/// Banned user returning +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonRuleBanEvasion; +impl std::fmt::Display for ReasonRuleBanEvasion { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonRuleBanEvasion") + } +} + +/// Other +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonRuleOther; +impl std::fmt::Display for ReasonRuleOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonRuleOther") + } +} + +/// Promoting or selling prohibited items or services +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonRuleProhibitedSales; +impl std::fmt::Display for ReasonRuleProhibitedSales { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonRuleProhibitedSales") + } +} + +/// Hacking or system attacks +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonRuleSiteSecurity; +impl std::fmt::Display for ReasonRuleSiteSecurity { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonRuleSiteSecurity") + } +} + +/// Content promoting or depicting self-harm +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSelfHarmContent; +impl std::fmt::Display for ReasonSelfHarmContent { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSelfHarmContent") + } +} + +/// Eating disorders +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSelfHarmEd; +impl std::fmt::Display for ReasonSelfHarmEd { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSelfHarmED") + } +} + +/// Other dangerous content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSelfHarmOther; +impl std::fmt::Display for ReasonSelfHarmOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSelfHarmOther") + } +} + +/// Dangerous challenges or activities +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSelfHarmStunts; +impl std::fmt::Display for ReasonSelfHarmStunts { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSelfHarmStunts") + } +} + +/// Dangerous substances or drug abuse +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSelfHarmSubstances; +impl std::fmt::Display for ReasonSelfHarmSubstances { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSelfHarmSubstances") + } +} + +/// Adult sexual abuse content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSexualAbuseContent; +impl std::fmt::Display for ReasonSexualAbuseContent { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSexualAbuseContent") + } +} + +/// Animal sexual abuse +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSexualAnimal; +impl std::fmt::Display for ReasonSexualAnimal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSexualAnimal") + } +} + +/// Deepfake adult content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSexualDeepfake; +impl std::fmt::Display for ReasonSexualDeepfake { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSexualDeepfake") + } +} + +/// Non-consensual intimate imagery +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSexualNcii; +impl std::fmt::Display for ReasonSexualNcii { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSexualNCII") + } +} + +/// Other sexual violence content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSexualOther; +impl std::fmt::Display for ReasonSexualOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSexualOther") + } +} + +/// Unlabelled adult content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonSexualUnlabeled; +impl std::fmt::Display for ReasonSexualUnlabeled { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonSexualUnlabeled") + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ReasonType<'a> { + ToolsOzoneReportDefsReasonAppeal, + ToolsOzoneReportDefsReasonOther, + ToolsOzoneReportDefsReasonViolenceAnimal, + ToolsOzoneReportDefsReasonViolenceThreats, + ToolsOzoneReportDefsReasonViolenceGraphicContent, + ToolsOzoneReportDefsReasonViolenceGlorification, + ToolsOzoneReportDefsReasonViolenceExtremistContent, + ToolsOzoneReportDefsReasonViolenceTrafficking, + ToolsOzoneReportDefsReasonViolenceOther, + ToolsOzoneReportDefsReasonSexualAbuseContent, + ToolsOzoneReportDefsReasonSexualNcii, + ToolsOzoneReportDefsReasonSexualDeepfake, + ToolsOzoneReportDefsReasonSexualAnimal, + ToolsOzoneReportDefsReasonSexualUnlabeled, + ToolsOzoneReportDefsReasonSexualOther, + ToolsOzoneReportDefsReasonChildSafetyCsam, + ToolsOzoneReportDefsReasonChildSafetyGroom, + ToolsOzoneReportDefsReasonChildSafetyPrivacy, + ToolsOzoneReportDefsReasonChildSafetyHarassment, + ToolsOzoneReportDefsReasonChildSafetyOther, + ToolsOzoneReportDefsReasonHarassmentTroll, + ToolsOzoneReportDefsReasonHarassmentTargeted, + ToolsOzoneReportDefsReasonHarassmentHateSpeech, + ToolsOzoneReportDefsReasonHarassmentDoxxing, + ToolsOzoneReportDefsReasonHarassmentOther, + ToolsOzoneReportDefsReasonMisleadingBot, + ToolsOzoneReportDefsReasonMisleadingImpersonation, + ToolsOzoneReportDefsReasonMisleadingSpam, + ToolsOzoneReportDefsReasonMisleadingScam, + ToolsOzoneReportDefsReasonMisleadingElections, + ToolsOzoneReportDefsReasonMisleadingOther, + ToolsOzoneReportDefsReasonRuleSiteSecurity, + ToolsOzoneReportDefsReasonRuleProhibitedSales, + ToolsOzoneReportDefsReasonRuleBanEvasion, + ToolsOzoneReportDefsReasonRuleOther, + ToolsOzoneReportDefsReasonSelfHarmContent, + ToolsOzoneReportDefsReasonSelfHarmEd, + ToolsOzoneReportDefsReasonSelfHarmStunts, + ToolsOzoneReportDefsReasonSelfHarmSubstances, + ToolsOzoneReportDefsReasonSelfHarmOther, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> ReasonType<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::ToolsOzoneReportDefsReasonAppeal => { + "tools.ozone.report.defs#reasonAppeal" + } + Self::ToolsOzoneReportDefsReasonOther => { + "tools.ozone.report.defs#reasonOther" + } + Self::ToolsOzoneReportDefsReasonViolenceAnimal => { + "tools.ozone.report.defs#reasonViolenceAnimal" + } + Self::ToolsOzoneReportDefsReasonViolenceThreats => { + "tools.ozone.report.defs#reasonViolenceThreats" + } + Self::ToolsOzoneReportDefsReasonViolenceGraphicContent => { + "tools.ozone.report.defs#reasonViolenceGraphicContent" + } + Self::ToolsOzoneReportDefsReasonViolenceGlorification => { + "tools.ozone.report.defs#reasonViolenceGlorification" + } + Self::ToolsOzoneReportDefsReasonViolenceExtremistContent => { + "tools.ozone.report.defs#reasonViolenceExtremistContent" + } + Self::ToolsOzoneReportDefsReasonViolenceTrafficking => { + "tools.ozone.report.defs#reasonViolenceTrafficking" + } + Self::ToolsOzoneReportDefsReasonViolenceOther => { + "tools.ozone.report.defs#reasonViolenceOther" + } + Self::ToolsOzoneReportDefsReasonSexualAbuseContent => { + "tools.ozone.report.defs#reasonSexualAbuseContent" + } + Self::ToolsOzoneReportDefsReasonSexualNcii => { + "tools.ozone.report.defs#reasonSexualNCII" + } + Self::ToolsOzoneReportDefsReasonSexualDeepfake => { + "tools.ozone.report.defs#reasonSexualDeepfake" + } + Self::ToolsOzoneReportDefsReasonSexualAnimal => { + "tools.ozone.report.defs#reasonSexualAnimal" + } + Self::ToolsOzoneReportDefsReasonSexualUnlabeled => { + "tools.ozone.report.defs#reasonSexualUnlabeled" + } + Self::ToolsOzoneReportDefsReasonSexualOther => { + "tools.ozone.report.defs#reasonSexualOther" + } + Self::ToolsOzoneReportDefsReasonChildSafetyCsam => { + "tools.ozone.report.defs#reasonChildSafetyCSAM" + } + Self::ToolsOzoneReportDefsReasonChildSafetyGroom => { + "tools.ozone.report.defs#reasonChildSafetyGroom" + } + Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy => { + "tools.ozone.report.defs#reasonChildSafetyPrivacy" + } + Self::ToolsOzoneReportDefsReasonChildSafetyHarassment => { + "tools.ozone.report.defs#reasonChildSafetyHarassment" + } + Self::ToolsOzoneReportDefsReasonChildSafetyOther => { + "tools.ozone.report.defs#reasonChildSafetyOther" + } + Self::ToolsOzoneReportDefsReasonHarassmentTroll => { + "tools.ozone.report.defs#reasonHarassmentTroll" + } + Self::ToolsOzoneReportDefsReasonHarassmentTargeted => { + "tools.ozone.report.defs#reasonHarassmentTargeted" + } + Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech => { + "tools.ozone.report.defs#reasonHarassmentHateSpeech" + } + Self::ToolsOzoneReportDefsReasonHarassmentDoxxing => { + "tools.ozone.report.defs#reasonHarassmentDoxxing" + } + Self::ToolsOzoneReportDefsReasonHarassmentOther => { + "tools.ozone.report.defs#reasonHarassmentOther" + } + Self::ToolsOzoneReportDefsReasonMisleadingBot => { + "tools.ozone.report.defs#reasonMisleadingBot" + } + Self::ToolsOzoneReportDefsReasonMisleadingImpersonation => { + "tools.ozone.report.defs#reasonMisleadingImpersonation" + } + Self::ToolsOzoneReportDefsReasonMisleadingSpam => { + "tools.ozone.report.defs#reasonMisleadingSpam" + } + Self::ToolsOzoneReportDefsReasonMisleadingScam => { + "tools.ozone.report.defs#reasonMisleadingScam" + } + Self::ToolsOzoneReportDefsReasonMisleadingElections => { + "tools.ozone.report.defs#reasonMisleadingElections" + } + Self::ToolsOzoneReportDefsReasonMisleadingOther => { + "tools.ozone.report.defs#reasonMisleadingOther" + } + Self::ToolsOzoneReportDefsReasonRuleSiteSecurity => { + "tools.ozone.report.defs#reasonRuleSiteSecurity" + } + Self::ToolsOzoneReportDefsReasonRuleProhibitedSales => { + "tools.ozone.report.defs#reasonRuleProhibitedSales" + } + Self::ToolsOzoneReportDefsReasonRuleBanEvasion => { + "tools.ozone.report.defs#reasonRuleBanEvasion" + } + Self::ToolsOzoneReportDefsReasonRuleOther => { + "tools.ozone.report.defs#reasonRuleOther" + } + Self::ToolsOzoneReportDefsReasonSelfHarmContent => { + "tools.ozone.report.defs#reasonSelfHarmContent" + } + Self::ToolsOzoneReportDefsReasonSelfHarmEd => { + "tools.ozone.report.defs#reasonSelfHarmED" + } + Self::ToolsOzoneReportDefsReasonSelfHarmStunts => { + "tools.ozone.report.defs#reasonSelfHarmStunts" + } + Self::ToolsOzoneReportDefsReasonSelfHarmSubstances => { + "tools.ozone.report.defs#reasonSelfHarmSubstances" + } + Self::ToolsOzoneReportDefsReasonSelfHarmOther => { + "tools.ozone.report.defs#reasonSelfHarmOther" + } + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for ReasonType<'a> { + fn from(s: &'a str) -> Self { + match s { + "tools.ozone.report.defs#reasonAppeal" => { + Self::ToolsOzoneReportDefsReasonAppeal + } + "tools.ozone.report.defs#reasonOther" => { + Self::ToolsOzoneReportDefsReasonOther + } + "tools.ozone.report.defs#reasonViolenceAnimal" => { + Self::ToolsOzoneReportDefsReasonViolenceAnimal + } + "tools.ozone.report.defs#reasonViolenceThreats" => { + Self::ToolsOzoneReportDefsReasonViolenceThreats + } + "tools.ozone.report.defs#reasonViolenceGraphicContent" => { + Self::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + "tools.ozone.report.defs#reasonViolenceGlorification" => { + Self::ToolsOzoneReportDefsReasonViolenceGlorification + } + "tools.ozone.report.defs#reasonViolenceExtremistContent" => { + Self::ToolsOzoneReportDefsReasonViolenceExtremistContent + } + "tools.ozone.report.defs#reasonViolenceTrafficking" => { + Self::ToolsOzoneReportDefsReasonViolenceTrafficking + } + "tools.ozone.report.defs#reasonViolenceOther" => { + Self::ToolsOzoneReportDefsReasonViolenceOther + } + "tools.ozone.report.defs#reasonSexualAbuseContent" => { + Self::ToolsOzoneReportDefsReasonSexualAbuseContent + } + "tools.ozone.report.defs#reasonSexualNCII" => { + Self::ToolsOzoneReportDefsReasonSexualNcii + } + "tools.ozone.report.defs#reasonSexualDeepfake" => { + Self::ToolsOzoneReportDefsReasonSexualDeepfake + } + "tools.ozone.report.defs#reasonSexualAnimal" => { + Self::ToolsOzoneReportDefsReasonSexualAnimal + } + "tools.ozone.report.defs#reasonSexualUnlabeled" => { + Self::ToolsOzoneReportDefsReasonSexualUnlabeled + } + "tools.ozone.report.defs#reasonSexualOther" => { + Self::ToolsOzoneReportDefsReasonSexualOther + } + "tools.ozone.report.defs#reasonChildSafetyCSAM" => { + Self::ToolsOzoneReportDefsReasonChildSafetyCsam + } + "tools.ozone.report.defs#reasonChildSafetyGroom" => { + Self::ToolsOzoneReportDefsReasonChildSafetyGroom + } + "tools.ozone.report.defs#reasonChildSafetyPrivacy" => { + Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy + } + "tools.ozone.report.defs#reasonChildSafetyHarassment" => { + Self::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + "tools.ozone.report.defs#reasonChildSafetyOther" => { + Self::ToolsOzoneReportDefsReasonChildSafetyOther + } + "tools.ozone.report.defs#reasonHarassmentTroll" => { + Self::ToolsOzoneReportDefsReasonHarassmentTroll + } + "tools.ozone.report.defs#reasonHarassmentTargeted" => { + Self::ToolsOzoneReportDefsReasonHarassmentTargeted + } + "tools.ozone.report.defs#reasonHarassmentHateSpeech" => { + Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech + } + "tools.ozone.report.defs#reasonHarassmentDoxxing" => { + Self::ToolsOzoneReportDefsReasonHarassmentDoxxing + } + "tools.ozone.report.defs#reasonHarassmentOther" => { + Self::ToolsOzoneReportDefsReasonHarassmentOther + } + "tools.ozone.report.defs#reasonMisleadingBot" => { + Self::ToolsOzoneReportDefsReasonMisleadingBot + } + "tools.ozone.report.defs#reasonMisleadingImpersonation" => { + Self::ToolsOzoneReportDefsReasonMisleadingImpersonation + } + "tools.ozone.report.defs#reasonMisleadingSpam" => { + Self::ToolsOzoneReportDefsReasonMisleadingSpam + } + "tools.ozone.report.defs#reasonMisleadingScam" => { + Self::ToolsOzoneReportDefsReasonMisleadingScam + } + "tools.ozone.report.defs#reasonMisleadingElections" => { + Self::ToolsOzoneReportDefsReasonMisleadingElections + } + "tools.ozone.report.defs#reasonMisleadingOther" => { + Self::ToolsOzoneReportDefsReasonMisleadingOther + } + "tools.ozone.report.defs#reasonRuleSiteSecurity" => { + Self::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + "tools.ozone.report.defs#reasonRuleProhibitedSales" => { + Self::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + "tools.ozone.report.defs#reasonRuleBanEvasion" => { + Self::ToolsOzoneReportDefsReasonRuleBanEvasion + } + "tools.ozone.report.defs#reasonRuleOther" => { + Self::ToolsOzoneReportDefsReasonRuleOther + } + "tools.ozone.report.defs#reasonSelfHarmContent" => { + Self::ToolsOzoneReportDefsReasonSelfHarmContent + } + "tools.ozone.report.defs#reasonSelfHarmED" => { + Self::ToolsOzoneReportDefsReasonSelfHarmEd + } + "tools.ozone.report.defs#reasonSelfHarmStunts" => { + Self::ToolsOzoneReportDefsReasonSelfHarmStunts + } + "tools.ozone.report.defs#reasonSelfHarmSubstances" => { + Self::ToolsOzoneReportDefsReasonSelfHarmSubstances + } + "tools.ozone.report.defs#reasonSelfHarmOther" => { + Self::ToolsOzoneReportDefsReasonSelfHarmOther + } + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for ReasonType<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "tools.ozone.report.defs#reasonAppeal" => { + Self::ToolsOzoneReportDefsReasonAppeal + } + "tools.ozone.report.defs#reasonOther" => { + Self::ToolsOzoneReportDefsReasonOther + } + "tools.ozone.report.defs#reasonViolenceAnimal" => { + Self::ToolsOzoneReportDefsReasonViolenceAnimal + } + "tools.ozone.report.defs#reasonViolenceThreats" => { + Self::ToolsOzoneReportDefsReasonViolenceThreats + } + "tools.ozone.report.defs#reasonViolenceGraphicContent" => { + Self::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + "tools.ozone.report.defs#reasonViolenceGlorification" => { + Self::ToolsOzoneReportDefsReasonViolenceGlorification + } + "tools.ozone.report.defs#reasonViolenceExtremistContent" => { + Self::ToolsOzoneReportDefsReasonViolenceExtremistContent + } + "tools.ozone.report.defs#reasonViolenceTrafficking" => { + Self::ToolsOzoneReportDefsReasonViolenceTrafficking + } + "tools.ozone.report.defs#reasonViolenceOther" => { + Self::ToolsOzoneReportDefsReasonViolenceOther + } + "tools.ozone.report.defs#reasonSexualAbuseContent" => { + Self::ToolsOzoneReportDefsReasonSexualAbuseContent + } + "tools.ozone.report.defs#reasonSexualNCII" => { + Self::ToolsOzoneReportDefsReasonSexualNcii + } + "tools.ozone.report.defs#reasonSexualDeepfake" => { + Self::ToolsOzoneReportDefsReasonSexualDeepfake + } + "tools.ozone.report.defs#reasonSexualAnimal" => { + Self::ToolsOzoneReportDefsReasonSexualAnimal + } + "tools.ozone.report.defs#reasonSexualUnlabeled" => { + Self::ToolsOzoneReportDefsReasonSexualUnlabeled + } + "tools.ozone.report.defs#reasonSexualOther" => { + Self::ToolsOzoneReportDefsReasonSexualOther + } + "tools.ozone.report.defs#reasonChildSafetyCSAM" => { + Self::ToolsOzoneReportDefsReasonChildSafetyCsam + } + "tools.ozone.report.defs#reasonChildSafetyGroom" => { + Self::ToolsOzoneReportDefsReasonChildSafetyGroom + } + "tools.ozone.report.defs#reasonChildSafetyPrivacy" => { + Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy + } + "tools.ozone.report.defs#reasonChildSafetyHarassment" => { + Self::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + "tools.ozone.report.defs#reasonChildSafetyOther" => { + Self::ToolsOzoneReportDefsReasonChildSafetyOther + } + "tools.ozone.report.defs#reasonHarassmentTroll" => { + Self::ToolsOzoneReportDefsReasonHarassmentTroll + } + "tools.ozone.report.defs#reasonHarassmentTargeted" => { + Self::ToolsOzoneReportDefsReasonHarassmentTargeted + } + "tools.ozone.report.defs#reasonHarassmentHateSpeech" => { + Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech + } + "tools.ozone.report.defs#reasonHarassmentDoxxing" => { + Self::ToolsOzoneReportDefsReasonHarassmentDoxxing + } + "tools.ozone.report.defs#reasonHarassmentOther" => { + Self::ToolsOzoneReportDefsReasonHarassmentOther + } + "tools.ozone.report.defs#reasonMisleadingBot" => { + Self::ToolsOzoneReportDefsReasonMisleadingBot + } + "tools.ozone.report.defs#reasonMisleadingImpersonation" => { + Self::ToolsOzoneReportDefsReasonMisleadingImpersonation + } + "tools.ozone.report.defs#reasonMisleadingSpam" => { + Self::ToolsOzoneReportDefsReasonMisleadingSpam + } + "tools.ozone.report.defs#reasonMisleadingScam" => { + Self::ToolsOzoneReportDefsReasonMisleadingScam + } + "tools.ozone.report.defs#reasonMisleadingElections" => { + Self::ToolsOzoneReportDefsReasonMisleadingElections + } + "tools.ozone.report.defs#reasonMisleadingOther" => { + Self::ToolsOzoneReportDefsReasonMisleadingOther + } + "tools.ozone.report.defs#reasonRuleSiteSecurity" => { + Self::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + "tools.ozone.report.defs#reasonRuleProhibitedSales" => { + Self::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + "tools.ozone.report.defs#reasonRuleBanEvasion" => { + Self::ToolsOzoneReportDefsReasonRuleBanEvasion + } + "tools.ozone.report.defs#reasonRuleOther" => { + Self::ToolsOzoneReportDefsReasonRuleOther + } + "tools.ozone.report.defs#reasonSelfHarmContent" => { + Self::ToolsOzoneReportDefsReasonSelfHarmContent + } + "tools.ozone.report.defs#reasonSelfHarmED" => { + Self::ToolsOzoneReportDefsReasonSelfHarmEd + } + "tools.ozone.report.defs#reasonSelfHarmStunts" => { + Self::ToolsOzoneReportDefsReasonSelfHarmStunts + } + "tools.ozone.report.defs#reasonSelfHarmSubstances" => { + Self::ToolsOzoneReportDefsReasonSelfHarmSubstances + } + "tools.ozone.report.defs#reasonSelfHarmOther" => { + Self::ToolsOzoneReportDefsReasonSelfHarmOther + } + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for ReasonType<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for ReasonType<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for ReasonType<'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 ReasonType<'_> { + type Output = ReasonType<'static>; + fn into_static(self) -> Self::Output { + match self { + ReasonType::ToolsOzoneReportDefsReasonAppeal => { + ReasonType::ToolsOzoneReportDefsReasonAppeal + } + ReasonType::ToolsOzoneReportDefsReasonOther => { + ReasonType::ToolsOzoneReportDefsReasonOther + } + ReasonType::ToolsOzoneReportDefsReasonViolenceAnimal => { + ReasonType::ToolsOzoneReportDefsReasonViolenceAnimal + } + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats => { + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats + } + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent => { + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + ReasonType::ToolsOzoneReportDefsReasonViolenceGlorification => { + ReasonType::ToolsOzoneReportDefsReasonViolenceGlorification + } + ReasonType::ToolsOzoneReportDefsReasonViolenceExtremistContent => { + ReasonType::ToolsOzoneReportDefsReasonViolenceExtremistContent + } + ReasonType::ToolsOzoneReportDefsReasonViolenceTrafficking => { + ReasonType::ToolsOzoneReportDefsReasonViolenceTrafficking + } + ReasonType::ToolsOzoneReportDefsReasonViolenceOther => { + ReasonType::ToolsOzoneReportDefsReasonViolenceOther + } + ReasonType::ToolsOzoneReportDefsReasonSexualAbuseContent => { + ReasonType::ToolsOzoneReportDefsReasonSexualAbuseContent + } + ReasonType::ToolsOzoneReportDefsReasonSexualNcii => { + ReasonType::ToolsOzoneReportDefsReasonSexualNcii + } + ReasonType::ToolsOzoneReportDefsReasonSexualDeepfake => { + ReasonType::ToolsOzoneReportDefsReasonSexualDeepfake + } + ReasonType::ToolsOzoneReportDefsReasonSexualAnimal => { + ReasonType::ToolsOzoneReportDefsReasonSexualAnimal + } + ReasonType::ToolsOzoneReportDefsReasonSexualUnlabeled => { + ReasonType::ToolsOzoneReportDefsReasonSexualUnlabeled + } + ReasonType::ToolsOzoneReportDefsReasonSexualOther => { + ReasonType::ToolsOzoneReportDefsReasonSexualOther + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyCsam => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyCsam + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyGroom => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyGroom + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPrivacy => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPrivacy + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyOther => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyOther + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentTroll => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentTroll + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentTargeted => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentTargeted + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentHateSpeech => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentHateSpeech + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentDoxxing => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentDoxxing + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentOther => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentOther + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingBot => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingBot + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingImpersonation => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingImpersonation + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingSpam => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingSpam + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingScam => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingScam + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingElections => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingElections + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther + } + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity => { + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales => { + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion => { + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion + } + ReasonType::ToolsOzoneReportDefsReasonRuleOther => { + ReasonType::ToolsOzoneReportDefsReasonRuleOther + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmContent => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmContent + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmEd => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmEd + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmStunts => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmStunts + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmSubstances => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmSubstances + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmOther => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmOther + } + ReasonType::Other(v) => ReasonType::Other(v.into_static()), + } + } +} + +/// Animal welfare violations +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonViolenceAnimal; +impl std::fmt::Display for ReasonViolenceAnimal { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonViolenceAnimal") + } +} + +/// Extremist content. These reports will be sent only be sent to the application's Moderation Authority. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonViolenceExtremistContent; +impl std::fmt::Display for ReasonViolenceExtremistContent { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonViolenceExtremistContent") + } +} + +/// Glorification of violence +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonViolenceGlorification; +impl std::fmt::Display for ReasonViolenceGlorification { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonViolenceGlorification") + } +} + +/// Graphic violent content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonViolenceGraphicContent; +impl std::fmt::Display for ReasonViolenceGraphicContent { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonViolenceGraphicContent") + } +} + +/// Other violent content +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonViolenceOther; +impl std::fmt::Display for ReasonViolenceOther { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonViolenceOther") + } +} + +/// Threats or incitement +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonViolenceThreats; +impl std::fmt::Display for ReasonViolenceThreats { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonViolenceThreats") + } +} + +/// Human trafficking +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct ReasonViolenceTrafficking; +impl std::fmt::Display for ReasonViolenceTrafficking { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "reasonViolenceTrafficking") + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/safelink.rs b/crates/weaver-api/src/tools_ozone/safelink.rs new file mode 100644 index 0000000..fcfc4e8 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/safelink.rs @@ -0,0 +1,1605 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.safelink.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod add_rule; +pub mod query_events; +pub mod query_rules; +pub mod remove_rule; +pub mod update_rule; + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ActionType<'a> { + Block, + Warn, + Whitelist, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> ActionType<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Block => "block", + Self::Warn => "warn", + Self::Whitelist => "whitelist", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for ActionType<'a> { + fn from(s: &'a str) -> Self { + match s { + "block" => Self::Block, + "warn" => Self::Warn, + "whitelist" => Self::Whitelist, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for ActionType<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "block" => Self::Block, + "warn" => Self::Warn, + "whitelist" => Self::Whitelist, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for ActionType<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for ActionType<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for ActionType<'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 ActionType<'_> { + type Output = ActionType<'static>; + fn into_static(self) -> Self::Output { + match self { + ActionType::Block => ActionType::Block, + ActionType::Warn => ActionType::Warn, + ActionType::Whitelist => ActionType::Whitelist, + ActionType::Other(v) => ActionType::Other(v.into_static()), + } + } +} + +/// An event for URL safety decisions +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Event<'a> { + #[serde(borrow)] + pub action: crate::tools_ozone::safelink::ActionType<'a>, + /// Optional comment about the decision + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + pub created_at: jacquard_common::types::string::Datetime, + /// DID of the user who created this rule + #[serde(borrow)] + pub created_by: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub event_type: crate::tools_ozone::safelink::EventType<'a>, + /// Auto-incrementing row ID + pub id: i64, + #[serde(borrow)] + pub pattern: crate::tools_ozone::safelink::PatternType<'a>, + #[serde(borrow)] + pub reason: crate::tools_ozone::safelink::ReasonType<'a>, + /// The URL that this rule applies to + #[serde(borrow)] + pub url: jacquard_common::CowStr<'a>, +} + +pub mod event_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 Id; + type EventType; + type Url; + type Pattern; + type Action; + type Reason; + type CreatedBy; + 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 EventType = Unset; + type Url = Unset; + type Pattern = Unset; + type Action = Unset; + type Reason = 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 Id = Set; + type EventType = S::EventType; + type Url = S::Url; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `event_type` field to Set + pub struct SetEventType(PhantomData S>); + impl sealed::Sealed for SetEventType {} + impl State for SetEventType { + type Id = S::Id; + type EventType = Set; + type Url = S::Url; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Id = S::Id; + type EventType = S::EventType; + type Url = Set; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData S>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { + type Id = S::Id; + type EventType = S::EventType; + type Url = S::Url; + type Pattern = Set; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + 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 Id = S::Id; + type EventType = S::EventType; + type Url = S::Url; + type Pattern = S::Pattern; + type Action = Set; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Id = S::Id; + type EventType = S::EventType; + type Url = S::Url; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = 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 EventType = S::EventType; + type Url = S::Url; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = S::Reason; + 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 EventType = S::EventType; + type Url = S::Url; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + 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 `event_type` field + pub struct event_type(()); + ///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(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EventBuilder<'a, S: event_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> Event<'a> { + /// Create a new builder for this type + pub fn new() -> EventBuilder<'a, event_state::Empty> { + EventBuilder::new() + } +} + +impl<'a> EventBuilder<'a, event_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::Action: event_state::IsUnset, +{ + /// Set the `action` field (required) + pub fn action( + mut self, + value: impl Into>, + ) -> EventBuilder<'a, event_state::SetAction> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: event_state::State> EventBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::CreatedAt: event_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> EventBuilder<'a, event_state::SetCreatedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::CreatedBy: event_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> EventBuilder<'a, event_state::SetCreatedBy> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::EventType: event_state::IsUnset, +{ + /// Set the `eventType` field (required) + pub fn event_type( + mut self, + value: impl Into>, + ) -> EventBuilder<'a, event_state::SetEventType> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::Id: event_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> EventBuilder<'a, event_state::SetId> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::Pattern: event_state::IsUnset, +{ + /// Set the `pattern` field (required) + pub fn pattern( + mut self, + value: impl Into>, + ) -> EventBuilder<'a, event_state::SetPattern> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::Reason: event_state::IsUnset, +{ + /// Set the `reason` field (required) + pub fn reason( + mut self, + value: impl Into>, + ) -> EventBuilder<'a, event_state::SetReason> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::Url: event_state::IsUnset, +{ + /// Set the `url` field (required) + pub fn url( + mut self, + value: impl Into>, + ) -> EventBuilder<'a, event_state::SetUrl> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + EventBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EventBuilder<'a, S> +where + S: event_state::State, + S::Id: event_state::IsSet, + S::EventType: event_state::IsSet, + S::Url: event_state::IsSet, + S::Pattern: event_state::IsSet, + S::Action: event_state::IsSet, + S::Reason: event_state::IsSet, + S::CreatedBy: event_state::IsSet, + S::CreatedAt: event_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Event<'a> { + Event { + action: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2.unwrap(), + created_by: self.__unsafe_private_named.3.unwrap(), + event_type: self.__unsafe_private_named.4.unwrap(), + id: self.__unsafe_private_named.5.unwrap(), + pattern: self.__unsafe_private_named.6.unwrap(), + reason: self.__unsafe_private_named.7.unwrap(), + url: 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>, + >, + ) -> Event<'a> { + Event { + action: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2.unwrap(), + created_by: self.__unsafe_private_named.3.unwrap(), + event_type: self.__unsafe_private_named.4.unwrap(), + id: self.__unsafe_private_named.5.unwrap(), + pattern: self.__unsafe_private_named.6.unwrap(), + reason: self.__unsafe_private_named.7.unwrap(), + url: self.__unsafe_private_named.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_safelink_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.safelink.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("actionType"), + ::jacquard_lexicon::lexicon::LexUserType::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("event"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "An event for URL safety decisions", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_common::smol_str::SmolStr::new_static("eventType"), + ::jacquard_common::smol_str::SmolStr::new_static("url"), + ::jacquard_common::smol_str::SmolStr::new_static("pattern"), + ::jacquard_common::smol_str::SmolStr::new_static("action"), + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::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("action"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#actionType"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Optional comment about the decision", + ), + ), + 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( + "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( + "createdBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the user who created this rule", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "eventType", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#eventType"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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("pattern"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#patternType"), + }), + ); + 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("#reasonType"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("url"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The URL that this rule applies to", + ), + ), + 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("eventType"), + ::jacquard_lexicon::lexicon::LexUserType::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("patternType"), + ::jacquard_lexicon::lexicon::LexUserType::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("reasonType"), + ::jacquard_lexicon::lexicon::LexUserType::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("urlRule"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Input for creating a URL safety rule", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("url"), + ::jacquard_common::smol_str::SmolStr::new_static("pattern"), + ::jacquard_common::smol_str::SmolStr::new_static("action"), + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::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("action"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#actionType"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("comment"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Optional comment about the decision", + ), + ), + 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( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp when the rule was created", + ), + ), + 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( + "createdBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the user added the rule.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("pattern"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#patternType"), + }), + ); + 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("#reasonType"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "updatedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp when the rule was last updated", + ), + ), + 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("url"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The URL or domain to apply the rule to", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Event<'a> { + fn nsid() -> &'static str { + "tools.ozone.safelink.defs" + } + fn def_name() -> &'static str { + "event" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_safelink_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum EventType<'a> { + AddRule, + UpdateRule, + RemoveRule, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> EventType<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::AddRule => "addRule", + Self::UpdateRule => "updateRule", + Self::RemoveRule => "removeRule", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for EventType<'a> { + fn from(s: &'a str) -> Self { + match s { + "addRule" => Self::AddRule, + "updateRule" => Self::UpdateRule, + "removeRule" => Self::RemoveRule, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for EventType<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "addRule" => Self::AddRule, + "updateRule" => Self::UpdateRule, + "removeRule" => Self::RemoveRule, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for EventType<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for EventType<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for EventType<'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 EventType<'_> { + type Output = EventType<'static>; + fn into_static(self) -> Self::Output { + match self { + EventType::AddRule => EventType::AddRule, + EventType::UpdateRule => EventType::UpdateRule, + EventType::RemoveRule => EventType::RemoveRule, + EventType::Other(v) => EventType::Other(v.into_static()), + } + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum PatternType<'a> { + Domain, + Url, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> PatternType<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Domain => "domain", + Self::Url => "url", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for PatternType<'a> { + fn from(s: &'a str) -> Self { + match s { + "domain" => Self::Domain, + "url" => Self::Url, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for PatternType<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "domain" => Self::Domain, + "url" => Self::Url, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for PatternType<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for PatternType<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for PatternType<'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 PatternType<'_> { + type Output = PatternType<'static>; + fn into_static(self) -> Self::Output { + match self { + PatternType::Domain => PatternType::Domain, + PatternType::Url => PatternType::Url, + PatternType::Other(v) => PatternType::Other(v.into_static()), + } + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ReasonType<'a> { + Csam, + Spam, + Phishing, + None, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> ReasonType<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Csam => "csam", + Self::Spam => "spam", + Self::Phishing => "phishing", + Self::None => "none", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for ReasonType<'a> { + fn from(s: &'a str) -> Self { + match s { + "csam" => Self::Csam, + "spam" => Self::Spam, + "phishing" => Self::Phishing, + "none" => Self::None, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for ReasonType<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "csam" => Self::Csam, + "spam" => Self::Spam, + "phishing" => Self::Phishing, + "none" => Self::None, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for ReasonType<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for ReasonType<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for ReasonType<'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 ReasonType<'_> { + type Output = ReasonType<'static>; + fn into_static(self) -> Self::Output { + match self { + ReasonType::Csam => ReasonType::Csam, + ReasonType::Spam => ReasonType::Spam, + ReasonType::Phishing => ReasonType::Phishing, + ReasonType::None => ReasonType::None, + ReasonType::Other(v) => ReasonType::Other(v.into_static()), + } + } +} + +/// Input for creating a URL safety rule +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UrlRule<'a> { + #[serde(borrow)] + pub action: crate::tools_ozone::safelink::ActionType<'a>, + /// Optional comment about the decision + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Timestamp when the rule was created + pub created_at: jacquard_common::types::string::Datetime, + /// DID of the user added the rule. + #[serde(borrow)] + pub created_by: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub pattern: crate::tools_ozone::safelink::PatternType<'a>, + #[serde(borrow)] + pub reason: crate::tools_ozone::safelink::ReasonType<'a>, + /// Timestamp when the rule was last updated + pub updated_at: jacquard_common::types::string::Datetime, + /// The URL or domain to apply the rule to + #[serde(borrow)] + pub url: jacquard_common::CowStr<'a>, +} + +pub mod url_rule_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 Url; + type Pattern; + type Action; + type Reason; + type CreatedBy; + type CreatedAt; + type UpdatedAt; + } + /// 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; + type Action = Unset; + type Reason = Unset; + type CreatedBy = Unset; + type CreatedAt = Unset; + type UpdatedAt = 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 CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + } + ///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; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + } + ///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; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + } + ///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 Pattern = S::Pattern; + type Action = S::Action; + type Reason = Set; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Url = S::Url; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = Set; + type CreatedAt = S::CreatedAt; + 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 Url = S::Url; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + type CreatedAt = Set; + type UpdatedAt = S::UpdatedAt; + } + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData S>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { + type Url = S::Url; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type UpdatedAt = 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 `action` field + pub struct action(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///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 `updated_at` field + pub struct updated_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UrlRuleBuilder<'a, S: url_rule_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> UrlRule<'a> { + /// Create a new builder for this type + pub fn new() -> UrlRuleBuilder<'a, url_rule_state::Empty> { + UrlRuleBuilder::new() + } +} + +impl<'a> UrlRuleBuilder<'a, url_rule_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UrlRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UrlRuleBuilder<'a, S> +where + S: url_rule_state::State, + S::Action: url_rule_state::IsUnset, +{ + /// Set the `action` field (required) + pub fn action( + mut self, + value: impl Into>, + ) -> UrlRuleBuilder<'a, url_rule_state::SetAction> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UrlRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: url_rule_state::State> UrlRuleBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> UrlRuleBuilder<'a, S> +where + S: url_rule_state::State, + S::CreatedAt: url_rule_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> UrlRuleBuilder<'a, url_rule_state::SetCreatedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + UrlRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UrlRuleBuilder<'a, S> +where + S: url_rule_state::State, + S::CreatedBy: url_rule_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> UrlRuleBuilder<'a, url_rule_state::SetCreatedBy> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + UrlRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UrlRuleBuilder<'a, S> +where + S: url_rule_state::State, + S::Pattern: url_rule_state::IsUnset, +{ + /// Set the `pattern` field (required) + pub fn pattern( + mut self, + value: impl Into>, + ) -> UrlRuleBuilder<'a, url_rule_state::SetPattern> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + UrlRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UrlRuleBuilder<'a, S> +where + S: url_rule_state::State, + S::Reason: url_rule_state::IsUnset, +{ + /// Set the `reason` field (required) + pub fn reason( + mut self, + value: impl Into>, + ) -> UrlRuleBuilder<'a, url_rule_state::SetReason> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + UrlRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UrlRuleBuilder<'a, S> +where + S: url_rule_state::State, + S::UpdatedAt: url_rule_state::IsUnset, +{ + /// Set the `updatedAt` field (required) + pub fn updated_at( + mut self, + value: impl Into, + ) -> UrlRuleBuilder<'a, url_rule_state::SetUpdatedAt> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + UrlRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UrlRuleBuilder<'a, S> +where + S: url_rule_state::State, + S::Url: url_rule_state::IsUnset, +{ + /// Set the `url` field (required) + pub fn url( + mut self, + value: impl Into>, + ) -> UrlRuleBuilder<'a, url_rule_state::SetUrl> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + UrlRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UrlRuleBuilder<'a, S> +where + S: url_rule_state::State, + S::Url: url_rule_state::IsSet, + S::Pattern: url_rule_state::IsSet, + S::Action: url_rule_state::IsSet, + S::Reason: url_rule_state::IsSet, + S::CreatedBy: url_rule_state::IsSet, + S::CreatedAt: url_rule_state::IsSet, + S::UpdatedAt: url_rule_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UrlRule<'a> { + UrlRule { + action: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2.unwrap(), + created_by: self.__unsafe_private_named.3.unwrap(), + pattern: self.__unsafe_private_named.4.unwrap(), + reason: self.__unsafe_private_named.5.unwrap(), + updated_at: self.__unsafe_private_named.6.unwrap(), + url: 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>, + >, + ) -> UrlRule<'a> { + UrlRule { + action: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2.unwrap(), + created_by: self.__unsafe_private_named.3.unwrap(), + pattern: self.__unsafe_private_named.4.unwrap(), + reason: self.__unsafe_private_named.5.unwrap(), + updated_at: self.__unsafe_private_named.6.unwrap(), + url: self.__unsafe_private_named.7.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for UrlRule<'a> { + fn nsid() -> &'static str { + "tools.ozone.safelink.defs" + } + fn def_name() -> &'static str { + "urlRule" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_safelink_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/tools_ozone/safelink/add_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs new file mode 100644 index 0000000..9f2397b --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs @@ -0,0 +1,386 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.safelink.addRule +// +// 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 AddRule<'a> { + #[serde(borrow)] + pub action: crate::tools_ozone::safelink::ActionType<'a>, + /// Optional comment about the decision + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Author DID. Only respected when using admin auth + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub created_by: Option>, + #[serde(borrow)] + pub pattern: crate::tools_ozone::safelink::PatternType<'a>, + #[serde(borrow)] + pub reason: crate::tools_ozone::safelink::ReasonType<'a>, + /// The URL or domain to apply the rule to + #[serde(borrow)] + pub url: jacquard_common::CowStr<'a>, +} + +pub mod add_rule_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 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 Url = Unset; + type Pattern = Unset; + type Action = Unset; + 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; + } + ///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 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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AddRuleBuilder<'a, S: add_rule_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> AddRule<'a> { + /// Create a new builder for this type + pub fn new() -> AddRuleBuilder<'a, add_rule_state::Empty> { + AddRuleBuilder::new() + } +} + +impl<'a> AddRuleBuilder<'a, add_rule_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AddRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddRuleBuilder<'a, S> +where + S: add_rule_state::State, + S::Action: add_rule_state::IsUnset, +{ + /// Set the `action` field (required) + pub fn action( + mut self, + value: impl Into>, + ) -> AddRuleBuilder<'a, add_rule_state::SetAction> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AddRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: add_rule_state::State> AddRuleBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: add_rule_state::State> AddRuleBuilder<'a, S> { + /// Set the `createdBy` field (optional) + pub fn created_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `createdBy` field to an Option value (optional) + pub fn maybe_created_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> AddRuleBuilder<'a, S> +where + S: add_rule_state::State, + S::Pattern: add_rule_state::IsUnset, +{ + /// Set the `pattern` field (required) + pub fn pattern( + mut self, + value: impl Into>, + ) -> AddRuleBuilder<'a, add_rule_state::SetPattern> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + AddRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddRuleBuilder<'a, S> +where + S: add_rule_state::State, + S::Reason: add_rule_state::IsUnset, +{ + /// Set the `reason` field (required) + pub fn reason( + mut self, + value: impl Into>, + ) -> AddRuleBuilder<'a, add_rule_state::SetReason> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + AddRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddRuleBuilder<'a, S> +where + S: add_rule_state::State, + S::Url: add_rule_state::IsUnset, +{ + /// Set the `url` field (required) + pub fn url( + mut self, + value: impl Into>, + ) -> AddRuleBuilder<'a, add_rule_state::SetUrl> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + AddRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddRuleBuilder<'a, S> +where + S: add_rule_state::State, + S::Url: add_rule_state::IsSet, + S::Pattern: add_rule_state::IsSet, + S::Action: add_rule_state::IsSet, + S::Reason: add_rule_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AddRule<'a> { + AddRule { + action: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + created_by: self.__unsafe_private_named.2, + pattern: self.__unsafe_private_named.3.unwrap(), + reason: self.__unsafe_private_named.4.unwrap(), + url: 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>, + >, + ) -> AddRule<'a> { + AddRule { + action: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + created_by: self.__unsafe_private_named.2, + pattern: self.__unsafe_private_named.3.unwrap(), + reason: self.__unsafe_private_named.4.unwrap(), + url: self.__unsafe_private_named.5.unwrap(), + 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 AddRuleOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::safelink::Event<'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 AddRuleError<'a> { + /// The provided URL is invalid + #[serde(rename = "InvalidUrl")] + InvalidUrl(std::option::Option), + /// A rule for this URL/domain already exists + #[serde(rename = "RuleAlreadyExists")] + RuleAlreadyExists(std::option::Option), +} + +impl std::fmt::Display for AddRuleError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::InvalidUrl(msg) => { + write!(f, "InvalidUrl")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RuleAlreadyExists(msg) => { + write!(f, "RuleAlreadyExists")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.safelink.addRule +pub struct AddRuleResponse; +impl jacquard_common::xrpc::XrpcResp for AddRuleResponse { + const NSID: &'static str = "tools.ozone.safelink.addRule"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = AddRuleOutput<'de>; + type Err<'de> = AddRuleError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for AddRule<'a> { + const NSID: &'static str = "tools.ozone.safelink.addRule"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = AddRuleResponse; +} + +/// Endpoint type for +///tools.ozone.safelink.addRule +pub struct AddRuleRequest; +impl jacquard_common::xrpc::XrpcEndpoint for AddRuleRequest { + const PATH: &'static str = "/xrpc/tools.ozone.safelink.addRule"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = AddRule<'de>; + type Response = AddRuleResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/safelink/query_events.rs b/crates/weaver-api/src/tools_ozone/safelink/query_events.rs new file mode 100644 index 0000000..04285a3 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/safelink/query_events.rs @@ -0,0 +1,90 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.safelink.queryEvents +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct QueryEvents<'a> { + /// Cursor for pagination + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Maximum number of results to return + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + /// Filter by pattern type + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pattern_type: std::option::Option>, + /// Sort direction + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort_direction: std::option::Option>, + /// Filter by specific URLs or domains + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub urls: std::option::Option>>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct QueryEventsOutput<'a> { + /// Next cursor for pagination. Only present if there are more results. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub events: Vec>, +} + +/// Response type for +///tools.ozone.safelink.queryEvents +pub struct QueryEventsResponse; +impl jacquard_common::xrpc::XrpcResp for QueryEventsResponse { + const NSID: &'static str = "tools.ozone.safelink.queryEvents"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = QueryEventsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for QueryEvents<'a> { + const NSID: &'static str = "tools.ozone.safelink.queryEvents"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = QueryEventsResponse; +} + +/// Endpoint type for +///tools.ozone.safelink.queryEvents +pub struct QueryEventsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for QueryEventsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.safelink.queryEvents"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = QueryEvents<'de>; + type Response = QueryEventsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/safelink/query_rules.rs b/crates/weaver-api/src/tools_ozone/safelink/query_rules.rs new file mode 100644 index 0000000..c9af39e --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/safelink/query_rules.rs @@ -0,0 +1,102 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.safelink.queryRules +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct QueryRules<'a> { + /// Filter by action types + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub actions: std::option::Option>>, + /// Filter by rule creator + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub created_by: std::option::Option>, + /// Cursor for pagination + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// Maximum number of results to return + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + /// Filter by pattern type + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pattern_type: std::option::Option>, + /// Filter by reason type + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason: std::option::Option>, + /// Sort direction + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort_direction: std::option::Option>, + /// Filter by specific URLs or domains + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub urls: std::option::Option>>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct QueryRulesOutput<'a> { + /// Next cursor for pagination. Only present if there are more results. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub rules: Vec>, +} + +/// Response type for +///tools.ozone.safelink.queryRules +pub struct QueryRulesResponse; +impl jacquard_common::xrpc::XrpcResp for QueryRulesResponse { + const NSID: &'static str = "tools.ozone.safelink.queryRules"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = QueryRulesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for QueryRules<'a> { + const NSID: &'static str = "tools.ozone.safelink.queryRules"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = QueryRulesResponse; +} + +/// Endpoint type for +///tools.ozone.safelink.queryRules +pub struct QueryRulesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for QueryRulesRequest { + const PATH: &'static str = "/xrpc/tools.ozone.safelink.queryRules"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = QueryRules<'de>; + type Response = QueryRulesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs new file mode 100644 index 0000000..85a6a1d --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs @@ -0,0 +1,296 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.safelink.removeRule +// +// 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 RemoveRule<'a> { + /// Optional comment about why the rule is being removed + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Optional DID of the user. Only respected when using admin auth. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub created_by: Option>, + #[serde(borrow)] + pub pattern: crate::tools_ozone::safelink::PatternType<'a>, + /// The URL or domain to remove the rule for + #[serde(borrow)] + pub url: jacquard_common::CowStr<'a>, +} + +pub mod remove_rule_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 Url; + type Pattern; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RemoveRuleBuilder<'a, S: remove_rule_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> RemoveRule<'a> { + /// Create a new builder for this type + pub fn new() -> RemoveRuleBuilder<'a, remove_rule_state::Empty> { + RemoveRuleBuilder::new() + } +} + +impl<'a> RemoveRuleBuilder<'a, remove_rule_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RemoveRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: remove_rule_state::State> RemoveRuleBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: remove_rule_state::State> RemoveRuleBuilder<'a, S> { + /// Set the `createdBy` field (optional) + pub fn created_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `createdBy` field to an Option value (optional) + pub fn maybe_created_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> RemoveRuleBuilder<'a, S> +where + S: remove_rule_state::State, + S::Pattern: remove_rule_state::IsUnset, +{ + /// Set the `pattern` field (required) + pub fn pattern( + mut self, + value: impl Into>, + ) -> RemoveRuleBuilder<'a, remove_rule_state::SetPattern> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + RemoveRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RemoveRuleBuilder<'a, S> +where + S: remove_rule_state::State, + S::Url: remove_rule_state::IsUnset, +{ + /// Set the `url` field (required) + pub fn url( + mut self, + value: impl Into>, + ) -> RemoveRuleBuilder<'a, remove_rule_state::SetUrl> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + RemoveRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RemoveRuleBuilder<'a, S> +where + S: remove_rule_state::State, + S::Url: remove_rule_state::IsSet, + S::Pattern: remove_rule_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RemoveRule<'a> { + RemoveRule { + comment: self.__unsafe_private_named.0, + created_by: self.__unsafe_private_named.1, + pattern: self.__unsafe_private_named.2.unwrap(), + url: 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>, + >, + ) -> RemoveRule<'a> { + RemoveRule { + comment: self.__unsafe_private_named.0, + created_by: self.__unsafe_private_named.1, + pattern: self.__unsafe_private_named.2.unwrap(), + url: self.__unsafe_private_named.3.unwrap(), + 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 RemoveRuleOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::safelink::Event<'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 RemoveRuleError<'a> { + /// No active rule found for this URL/domain + #[serde(rename = "RuleNotFound")] + RuleNotFound(std::option::Option), +} + +impl std::fmt::Display for RemoveRuleError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RuleNotFound(msg) => { + write!(f, "RuleNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.safelink.removeRule +pub struct RemoveRuleResponse; +impl jacquard_common::xrpc::XrpcResp for RemoveRuleResponse { + const NSID: &'static str = "tools.ozone.safelink.removeRule"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RemoveRuleOutput<'de>; + type Err<'de> = RemoveRuleError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RemoveRule<'a> { + const NSID: &'static str = "tools.ozone.safelink.removeRule"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RemoveRuleResponse; +} + +/// Endpoint type for +///tools.ozone.safelink.removeRule +pub struct RemoveRuleRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RemoveRuleRequest { + const PATH: &'static str = "/xrpc/tools.ozone.safelink.removeRule"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RemoveRule<'de>; + type Response = RemoveRuleResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs new file mode 100644 index 0000000..6829a0f --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs @@ -0,0 +1,376 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.safelink.updateRule +// +// 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 UpdateRule<'a> { + #[serde(borrow)] + pub action: crate::tools_ozone::safelink::ActionType<'a>, + /// Optional comment about the update + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub comment: Option>, + /// Optional DID to credit as the creator. Only respected for admin_token authentication. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub created_by: Option>, + #[serde(borrow)] + pub pattern: crate::tools_ozone::safelink::PatternType<'a>, + #[serde(borrow)] + pub reason: crate::tools_ozone::safelink::ReasonType<'a>, + /// The URL or domain to update the rule for + #[serde(borrow)] + pub url: jacquard_common::CowStr<'a>, +} + +pub mod update_rule_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 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 Url = Unset; + type Pattern = Unset; + type Action = Unset; + 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; + } + ///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 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 `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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateRuleBuilder<'a, S: update_rule_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> UpdateRule<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateRuleBuilder<'a, update_rule_state::Empty> { + UpdateRuleBuilder::new() + } +} + +impl<'a> UpdateRuleBuilder<'a, update_rule_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateRuleBuilder<'a, S> +where + S: update_rule_state::State, + S::Action: update_rule_state::IsUnset, +{ + /// Set the `action` field (required) + pub fn action( + mut self, + value: impl Into>, + ) -> UpdateRuleBuilder<'a, update_rule_state::SetAction> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: update_rule_state::State> UpdateRuleBuilder<'a, S> { + /// Set the `comment` field (optional) + pub fn comment( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `comment` field to an Option value (optional) + pub fn maybe_comment(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: update_rule_state::State> UpdateRuleBuilder<'a, S> { + /// Set the `createdBy` field (optional) + pub fn created_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `createdBy` field to an Option value (optional) + pub fn maybe_created_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> UpdateRuleBuilder<'a, S> +where + S: update_rule_state::State, + S::Pattern: update_rule_state::IsUnset, +{ + /// Set the `pattern` field (required) + pub fn pattern( + mut self, + value: impl Into>, + ) -> UpdateRuleBuilder<'a, update_rule_state::SetPattern> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + UpdateRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateRuleBuilder<'a, S> +where + S: update_rule_state::State, + S::Reason: update_rule_state::IsUnset, +{ + /// Set the `reason` field (required) + pub fn reason( + mut self, + value: impl Into>, + ) -> UpdateRuleBuilder<'a, update_rule_state::SetReason> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + UpdateRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateRuleBuilder<'a, S> +where + S: update_rule_state::State, + S::Url: update_rule_state::IsUnset, +{ + /// Set the `url` field (required) + pub fn url( + mut self, + value: impl Into>, + ) -> UpdateRuleBuilder<'a, update_rule_state::SetUrl> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + UpdateRuleBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateRuleBuilder<'a, S> +where + S: update_rule_state::State, + 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> { + UpdateRule { + action: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + created_by: self.__unsafe_private_named.2, + pattern: self.__unsafe_private_named.3.unwrap(), + reason: self.__unsafe_private_named.4.unwrap(), + url: 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>, + >, + ) -> UpdateRule<'a> { + UpdateRule { + action: self.__unsafe_private_named.0.unwrap(), + comment: self.__unsafe_private_named.1, + created_by: self.__unsafe_private_named.2, + pattern: self.__unsafe_private_named.3.unwrap(), + reason: self.__unsafe_private_named.4.unwrap(), + url: self.__unsafe_private_named.5.unwrap(), + 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 UpdateRuleOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::safelink::Event<'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 UpdateRuleError<'a> { + /// No active rule found for this URL/domain + #[serde(rename = "RuleNotFound")] + RuleNotFound(std::option::Option), +} + +impl std::fmt::Display for UpdateRuleError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::RuleNotFound(msg) => { + write!(f, "RuleNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.safelink.updateRule +pub struct UpdateRuleResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateRuleResponse { + const NSID: &'static str = "tools.ozone.safelink.updateRule"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpdateRuleOutput<'de>; + type Err<'de> = UpdateRuleError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateRule<'a> { + const NSID: &'static str = "tools.ozone.safelink.updateRule"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateRuleResponse; +} + +/// Endpoint type for +///tools.ozone.safelink.updateRule +pub struct UpdateRuleRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateRuleRequest { + const PATH: &'static str = "/xrpc/tools.ozone.safelink.updateRule"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateRule<'de>; + type Response = UpdateRuleResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/server.rs b/crates/weaver-api/src/tools_ozone/server.rs new file mode 100644 index 0000000..8e473b5 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/server.rs @@ -0,0 +1,6 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_config; \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/server/get_config.rs b/crates/weaver-api/src/tools_ozone/server/get_config.rs new file mode 100644 index 0000000..00b235c --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/server/get_config.rs @@ -0,0 +1,240 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.server.getConfig +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct GetConfigOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub appview: std::option::Option< + crate::tools_ozone::server::get_config::ServiceConfig<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub blob_divert: std::option::Option< + crate::tools_ozone::server::get_config::ServiceConfig<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub chat: std::option::Option< + crate::tools_ozone::server::get_config::ServiceConfig<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub pds: std::option::Option< + crate::tools_ozone::server::get_config::ServiceConfig<'a>, + >, + /// The did of the verifier used for verification. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub verifier_did: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: std::option::Option< + crate::tools_ozone::server::get_config::ViewerConfig<'a>, + >, +} + +/// XRPC request marker type +#[derive( + Debug, + Clone, + Copy, + PartialEq, + Eq, + serde::Serialize, + serde::Deserialize, + jacquard_derive::IntoStatic +)] +pub struct GetConfig; +/// Response type for +///tools.ozone.server.getConfig +pub struct GetConfigResponse; +impl jacquard_common::xrpc::XrpcResp for GetConfigResponse { + const NSID: &'static str = "tools.ozone.server.getConfig"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetConfigOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetConfig { + const NSID: &'static str = "tools.ozone.server.getConfig"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetConfigResponse; +} + +/// Endpoint type for +///tools.ozone.server.getConfig +pub struct GetConfigRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetConfigRequest { + const PATH: &'static str = "/xrpc/tools.ozone.server.getConfig"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetConfig; + type Response = GetConfigResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ServiceConfig<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub url: std::option::Option>, +} + +fn lexicon_doc_tools_ozone_server_getConfig() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.server.getConfig"), + 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: None, + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("serviceConfig"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("url"), + ::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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewerConfig"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ServiceConfig<'a> { + fn nsid() -> &'static str { + "tools.ozone.server.getConfig" + } + fn def_name() -> &'static str { + "serviceConfig" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_server_getConfig() + } + 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ViewerConfig<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub role: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewerConfig<'a> { + fn nsid() -> &'static str { + "tools.ozone.server.getConfig" + } + fn def_name() -> &'static str { + "viewerConfig" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_server_getConfig() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/set.rs b/crates/weaver-api/src/tools_ozone/set.rs new file mode 100644 index 0000000..695b890 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/set.rs @@ -0,0 +1,602 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.set.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod add_values; +pub mod delete_set; +pub mod delete_values; +pub mod get_values; +pub mod query_sets; +pub mod upsert_set; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct Set<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: std::option::Option>, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +fn lexicon_doc_tools_ozone_set_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.set.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("set"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("name")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(10240usize), + min_graphemes: None, + max_graphemes: Some(1024usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: Some(3usize), + max_length: Some(128usize), + 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("setView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_common::smol_str::SmolStr::new_static("setSize"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::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( + "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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(10240usize), + min_graphemes: None, + max_graphemes: Some(1024usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: Some(3usize), + max_length: Some(128usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("setSize"), + ::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( + "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 + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Set<'a> { + fn nsid() -> &'static str { + "tools.ozone.set.defs" + } + fn def_name() -> &'static str { + "set" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_set_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10240usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 10240usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1024usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 1024usize, + actual: count, + }); + } + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 3usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + min: 3usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SetView<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + pub set_size: i64, + pub updated_at: jacquard_common::types::string::Datetime, +} + +pub mod set_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 Name; + type SetSize; + type CreatedAt; + type UpdatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Name = Unset; + type SetSize = Unset; + type CreatedAt = Unset; + type UpdatedAt = 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 SetSize = S::SetSize; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + } + ///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 SetSize = Set; + type CreatedAt = S::CreatedAt; + 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 Name = S::Name; + type SetSize = S::SetSize; + type CreatedAt = Set; + type UpdatedAt = S::UpdatedAt; + } + ///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 SetSize = S::SetSize; + type CreatedAt = S::CreatedAt; + type UpdatedAt = 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 `set_size` field + pub struct set_size(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SetViewBuilder<'a, S: set_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> SetView<'a> { + /// Create a new builder for this type + pub fn new() -> SetViewBuilder<'a, set_view_state::Empty> { + SetViewBuilder::new() + } +} + +impl<'a> SetViewBuilder<'a, set_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SetViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SetViewBuilder<'a, S> +where + S: set_view_state::State, + S::CreatedAt: set_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> SetViewBuilder<'a, set_view_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SetViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: set_view_state::State> SetViewBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> SetViewBuilder<'a, S> +where + S: set_view_state::State, + S::Name: set_view_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> SetViewBuilder<'a, set_view_state::SetName> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SetViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SetViewBuilder<'a, S> +where + S: set_view_state::State, + S::SetSize: set_view_state::IsUnset, +{ + /// Set the `setSize` field (required) + pub fn set_size( + mut self, + value: impl Into, + ) -> SetViewBuilder<'a, set_view_state::SetSetSize> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + SetViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SetViewBuilder<'a, S> +where + S: set_view_state::State, + S::UpdatedAt: set_view_state::IsUnset, +{ + /// Set the `updatedAt` field (required) + pub fn updated_at( + mut self, + value: impl Into, + ) -> SetViewBuilder<'a, set_view_state::SetUpdatedAt> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + SetViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SetViewBuilder<'a, S> +where + S: set_view_state::State, + S::Name: set_view_state::IsSet, + S::SetSize: set_view_state::IsSet, + S::CreatedAt: set_view_state::IsSet, + S::UpdatedAt: set_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SetView<'a> { + SetView { + created_at: self.__unsafe_private_named.0.unwrap(), + description: self.__unsafe_private_named.1, + name: self.__unsafe_private_named.2.unwrap(), + set_size: self.__unsafe_private_named.3.unwrap(), + updated_at: 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>, + >, + ) -> SetView<'a> { + SetView { + created_at: self.__unsafe_private_named.0.unwrap(), + description: self.__unsafe_private_named.1, + name: self.__unsafe_private_named.2.unwrap(), + set_size: self.__unsafe_private_named.3.unwrap(), + updated_at: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SetView<'a> { + fn nsid() -> &'static str { + "tools.ozone.set.defs" + } + fn def_name() -> &'static str { + "setView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_set_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10240usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 10240usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1024usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 1024usize, + actual: count, + }); + } + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 3usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "name", + ), + min: 3usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/set/add_values.rs b/crates/weaver-api/src/tools_ozone/set/add_values.rs new file mode 100644 index 0000000..06c548b --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/set/add_values.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.set.addValues +// +// 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 AddValues<'a> { + /// Name of the set to add values to + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + /// Array of string values to add to the set + #[serde(borrow)] + pub values: Vec>, +} + +pub mod add_values_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 Name; + type Values; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Name = Unset; + type Values = 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 Values = S::Values; + } + ///State transition - sets the `values` field to Set + pub struct SetValues(PhantomData S>); + impl sealed::Sealed for SetValues {} + impl State for SetValues { + type Name = S::Name; + type Values = 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 `values` field + pub struct values(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AddValuesBuilder<'a, S: add_values_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> AddValues<'a> { + /// Create a new builder for this type + pub fn new() -> AddValuesBuilder<'a, add_values_state::Empty> { + AddValuesBuilder::new() + } +} + +impl<'a> AddValuesBuilder<'a, add_values_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AddValuesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddValuesBuilder<'a, S> +where + S: add_values_state::State, + S::Name: add_values_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> AddValuesBuilder<'a, add_values_state::SetName> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AddValuesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddValuesBuilder<'a, S> +where + S: add_values_state::State, + S::Values: add_values_state::IsUnset, +{ + /// Set the `values` field (required) + pub fn values( + mut self, + value: impl Into>>, + ) -> AddValuesBuilder<'a, add_values_state::SetValues> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AddValuesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddValuesBuilder<'a, S> +where + S: add_values_state::State, + S::Name: add_values_state::IsSet, + S::Values: add_values_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AddValues<'a> { + AddValues { + name: self.__unsafe_private_named.0.unwrap(), + values: 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>, + >, + ) -> AddValues<'a> { + AddValues { + name: self.__unsafe_private_named.0.unwrap(), + values: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +/// Response type for +///tools.ozone.set.addValues +pub struct AddValuesResponse; +impl jacquard_common::xrpc::XrpcResp for AddValuesResponse { + const NSID: &'static str = "tools.ozone.set.addValues"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for AddValues<'a> { + const NSID: &'static str = "tools.ozone.set.addValues"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = AddValuesResponse; +} + +/// Endpoint type for +///tools.ozone.set.addValues +pub struct AddValuesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for AddValuesRequest { + const PATH: &'static str = "/xrpc/tools.ozone.set.addValues"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = AddValues<'de>; + type Response = AddValuesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/set/delete_set.rs b/crates/weaver-api/src/tools_ozone/set/delete_set.rs new file mode 100644 index 0000000..2f4b1df --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/set/delete_set.rs @@ -0,0 +1,102 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.set.deleteSet +// +// 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, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DeleteSet<'a> { + /// Name of the set to delete + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct DeleteSetOutput<'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 DeleteSetError<'a> { + /// set with the given name does not exist + #[serde(rename = "SetNotFound")] + SetNotFound(std::option::Option), +} + +impl std::fmt::Display for DeleteSetError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::SetNotFound(msg) => { + write!(f, "SetNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.set.deleteSet +pub struct DeleteSetResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteSetResponse { + const NSID: &'static str = "tools.ozone.set.deleteSet"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DeleteSetOutput<'de>; + type Err<'de> = DeleteSetError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteSet<'a> { + const NSID: &'static str = "tools.ozone.set.deleteSet"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteSetResponse; +} + +/// Endpoint type for +///tools.ozone.set.deleteSet +pub struct DeleteSetRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteSetRequest { + const PATH: &'static str = "/xrpc/tools.ozone.set.deleteSet"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteSet<'de>; + type Response = DeleteSetResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/set/delete_values.rs b/crates/weaver-api/src/tools_ozone/set/delete_values.rs new file mode 100644 index 0000000..e81aea4 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/set/delete_values.rs @@ -0,0 +1,231 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.set.deleteValues +// +// 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 DeleteValues<'a> { + /// Name of the set to delete values from + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + /// Array of string values to delete from the set + #[serde(borrow)] + pub values: Vec>, +} + +pub mod delete_values_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 Name; + type Values; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Name = Unset; + type Values = 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 Values = S::Values; + } + ///State transition - sets the `values` field to Set + pub struct SetValues(PhantomData S>); + impl sealed::Sealed for SetValues {} + impl State for SetValues { + type Name = S::Name; + type Values = 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 `values` field + pub struct values(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeleteValuesBuilder<'a, S: delete_values_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DeleteValues<'a> { + /// Create a new builder for this type + pub fn new() -> DeleteValuesBuilder<'a, delete_values_state::Empty> { + DeleteValuesBuilder::new() + } +} + +impl<'a> DeleteValuesBuilder<'a, delete_values_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeleteValuesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteValuesBuilder<'a, S> +where + S: delete_values_state::State, + S::Name: delete_values_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> DeleteValuesBuilder<'a, delete_values_state::SetName> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeleteValuesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteValuesBuilder<'a, S> +where + S: delete_values_state::State, + S::Values: delete_values_state::IsUnset, +{ + /// Set the `values` field (required) + pub fn values( + mut self, + value: impl Into>>, + ) -> DeleteValuesBuilder<'a, delete_values_state::SetValues> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DeleteValuesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteValuesBuilder<'a, S> +where + S: delete_values_state::State, + S::Name: delete_values_state::IsSet, + S::Values: delete_values_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DeleteValues<'a> { + DeleteValues { + name: self.__unsafe_private_named.0.unwrap(), + values: 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>, + >, + ) -> DeleteValues<'a> { + DeleteValues { + name: self.__unsafe_private_named.0.unwrap(), + values: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[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 DeleteValuesError<'a> { + /// set with the given name does not exist + #[serde(rename = "SetNotFound")] + SetNotFound(std::option::Option), +} + +impl std::fmt::Display for DeleteValuesError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::SetNotFound(msg) => { + write!(f, "SetNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.set.deleteValues +pub struct DeleteValuesResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteValuesResponse { + const NSID: &'static str = "tools.ozone.set.deleteValues"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = DeleteValuesError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteValues<'a> { + const NSID: &'static str = "tools.ozone.set.deleteValues"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteValuesResponse; +} + +/// Endpoint type for +///tools.ozone.set.deleteValues +pub struct DeleteValuesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteValuesRequest { + const PATH: &'static str = "/xrpc/tools.ozone.set.deleteValues"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteValues<'de>; + type Response = DeleteValuesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/set/get_values.rs b/crates/weaver-api/src/tools_ozone/set/get_values.rs new file mode 100644 index 0000000..02bd355 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/set/get_values.rs @@ -0,0 +1,233 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.set.getValues +// +// 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 GetValues<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 100, min: 1, max: 1000) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +pub mod get_values_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 Name; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `name` field + pub struct name(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetValuesBuilder<'a, S: get_values_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> GetValues<'a> { + /// Create a new builder for this type + pub fn new() -> GetValuesBuilder<'a, get_values_state::Empty> { + GetValuesBuilder::new() + } +} + +impl<'a> GetValuesBuilder<'a, get_values_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetValuesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_values_state::State> GetValuesBuilder<'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_values_state::State> GetValuesBuilder<'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> GetValuesBuilder<'a, S> +where + S: get_values_state::State, + S::Name: get_values_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> GetValuesBuilder<'a, get_values_state::SetName> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetValuesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetValuesBuilder<'a, S> +where + S: get_values_state::State, + S::Name: get_values_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetValues<'a> { + GetValues { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + name: 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 GetValuesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub set: crate::tools_ozone::set::SetView<'a>, + #[serde(borrow)] + pub values: 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 GetValuesError<'a> { + /// set with the given name does not exist + #[serde(rename = "SetNotFound")] + SetNotFound(std::option::Option), +} + +impl std::fmt::Display for GetValuesError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::SetNotFound(msg) => { + write!(f, "SetNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.set.getValues +pub struct GetValuesResponse; +impl jacquard_common::xrpc::XrpcResp for GetValuesResponse { + const NSID: &'static str = "tools.ozone.set.getValues"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetValuesOutput<'de>; + type Err<'de> = GetValuesError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetValues<'a> { + const NSID: &'static str = "tools.ozone.set.getValues"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetValuesResponse; +} + +/// Endpoint type for +///tools.ozone.set.getValues +pub struct GetValuesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetValuesRequest { + const PATH: &'static str = "/xrpc/tools.ozone.set.getValues"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetValues<'de>; + type Response = GetValuesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/set/query_sets.rs b/crates/weaver-api/src/tools_ozone/set/query_sets.rs new file mode 100644 index 0000000..04f833e --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/set/query_sets.rs @@ -0,0 +1,230 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.set.querySets +// +// 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 QuerySets<'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 name_prefix: std::option::Option>, + ///(default: "name") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort_by: std::option::Option>, + ///(default: "asc") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort_direction: std::option::Option>, +} + +pub mod query_sets_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 QuerySetsBuilder<'a, S: query_sets_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> QuerySets<'a> { + /// Create a new builder for this type + pub fn new() -> QuerySetsBuilder<'a, query_sets_state::Empty> { + QuerySetsBuilder::new() + } +} + +impl<'a> QuerySetsBuilder<'a, query_sets_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + QuerySetsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: query_sets_state::State> QuerySetsBuilder<'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: query_sets_state::State> QuerySetsBuilder<'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: query_sets_state::State> QuerySetsBuilder<'a, S> { + /// Set the `namePrefix` field (optional) + pub fn name_prefix( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `namePrefix` field to an Option value (optional) + pub fn maybe_name_prefix( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: query_sets_state::State> QuerySetsBuilder<'a, S> { + /// Set the `sortBy` field (optional) + pub fn sort_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `sortBy` field to an Option value (optional) + pub fn maybe_sort_by(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: query_sets_state::State> QuerySetsBuilder<'a, S> { + /// Set the `sortDirection` field (optional) + pub fn sort_direction( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `sortDirection` field to an Option value (optional) + pub fn maybe_sort_direction( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> QuerySetsBuilder<'a, S> +where + S: query_sets_state::State, +{ + /// Build the final struct + pub fn build(self) -> QuerySets<'a> { + QuerySets { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + name_prefix: self.__unsafe_private_named.2, + sort_by: self.__unsafe_private_named.3, + sort_direction: 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 QuerySetsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub sets: Vec>, +} + +/// Response type for +///tools.ozone.set.querySets +pub struct QuerySetsResponse; +impl jacquard_common::xrpc::XrpcResp for QuerySetsResponse { + const NSID: &'static str = "tools.ozone.set.querySets"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = QuerySetsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for QuerySets<'a> { + const NSID: &'static str = "tools.ozone.set.querySets"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = QuerySetsResponse; +} + +/// Endpoint type for +///tools.ozone.set.querySets +pub struct QuerySetsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for QuerySetsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.set.querySets"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = QuerySets<'de>; + type Response = QuerySetsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/set/upsert_set.rs b/crates/weaver-api/src/tools_ozone/set/upsert_set.rs new file mode 100644 index 0000000..9a2bafe --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/set/upsert_set.rs @@ -0,0 +1,70 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.set.upsertSet +// +// 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 UpsertSet<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::set::Set<'a>, +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UpsertSetOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::set::SetView<'a>, +} + +/// Response type for +///tools.ozone.set.upsertSet +pub struct UpsertSetResponse; +impl jacquard_common::xrpc::XrpcResp for UpsertSetResponse { + const NSID: &'static str = "tools.ozone.set.upsertSet"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpsertSetOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpsertSet<'a> { + const NSID: &'static str = "tools.ozone.set.upsertSet"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpsertSetResponse; +} + +/// Endpoint type for +///tools.ozone.set.upsertSet +pub struct UpsertSetRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpsertSetRequest { + const PATH: &'static str = "/xrpc/tools.ozone.set.upsertSet"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpsertSet<'de>; + type Response = UpsertSetResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/setting.rs b/crates/weaver-api/src/tools_ozone/setting.rs new file mode 100644 index 0000000..22849d1 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/setting.rs @@ -0,0 +1,694 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.setting.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod list_options; +pub mod remove_options; +pub mod upsert_option; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct DefsOption<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + #[serde(borrow)] + pub created_by: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub key: jacquard_common::types::string::Nsid<'a>, + #[serde(borrow)] + pub last_updated_by: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub manager_role: Option>, + #[serde(borrow)] + pub scope: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub updated_at: Option, + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod defs_option_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 Key; + type Value; + type Did; + type Scope; + type CreatedBy; + type LastUpdatedBy; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Key = Unset; + type Value = Unset; + type Did = Unset; + type Scope = Unset; + type CreatedBy = Unset; + type LastUpdatedBy = 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 Value = S::Value; + type Did = S::Did; + type Scope = S::Scope; + type CreatedBy = S::CreatedBy; + type LastUpdatedBy = S::LastUpdatedBy; + } + ///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 Value = Set; + type Did = S::Did; + type Scope = S::Scope; + type CreatedBy = S::CreatedBy; + type LastUpdatedBy = S::LastUpdatedBy; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Key = S::Key; + type Value = S::Value; + type Did = Set; + type Scope = S::Scope; + type CreatedBy = S::CreatedBy; + type LastUpdatedBy = S::LastUpdatedBy; + } + ///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 Value = S::Value; + type Did = S::Did; + type Scope = Set; + type CreatedBy = S::CreatedBy; + type LastUpdatedBy = S::LastUpdatedBy; + } + ///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 Value = S::Value; + type Did = S::Did; + type Scope = S::Scope; + type CreatedBy = Set; + type LastUpdatedBy = S::LastUpdatedBy; + } + ///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 Key = S::Key; + type Value = S::Value; + type Did = S::Did; + type Scope = S::Scope; + type CreatedBy = S::CreatedBy; + type LastUpdatedBy = 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 `value` field + pub struct value(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `scope` field + pub struct scope(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `last_updated_by` field + pub struct last_updated_by(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DefsOptionBuilder<'a, S: defs_option_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DefsOption<'a> { + /// Create a new builder for this type + pub fn new() -> DefsOptionBuilder<'a, defs_option_state::Empty> { + DefsOptionBuilder::new() + } +} + +impl<'a> DefsOptionBuilder<'a, defs_option_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DefsOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: defs_option_state::State> DefsOptionBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = 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.0 = value; + self + } +} + +impl<'a, S> DefsOptionBuilder<'a, S> +where + S: defs_option_state::State, + S::CreatedBy: defs_option_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> DefsOptionBuilder<'a, defs_option_state::SetCreatedBy> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DefsOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: defs_option_state::State> DefsOptionBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> DefsOptionBuilder<'a, S> +where + S: defs_option_state::State, + S::Did: defs_option_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> DefsOptionBuilder<'a, defs_option_state::SetDid> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + DefsOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DefsOptionBuilder<'a, S> +where + S: defs_option_state::State, + S::Key: defs_option_state::IsUnset, +{ + /// Set the `key` field (required) + pub fn key( + mut self, + value: impl Into>, + ) -> DefsOptionBuilder<'a, defs_option_state::SetKey> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + DefsOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DefsOptionBuilder<'a, S> +where + S: defs_option_state::State, + S::LastUpdatedBy: defs_option_state::IsUnset, +{ + /// Set the `lastUpdatedBy` field (required) + pub fn last_updated_by( + mut self, + value: impl Into>, + ) -> DefsOptionBuilder<'a, defs_option_state::SetLastUpdatedBy> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + DefsOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: defs_option_state::State> DefsOptionBuilder<'a, S> { + /// Set the `managerRole` field (optional) + pub fn manager_role( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `managerRole` field to an Option value (optional) + pub fn maybe_manager_role( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> DefsOptionBuilder<'a, S> +where + S: defs_option_state::State, + S::Scope: defs_option_state::IsUnset, +{ + /// Set the `scope` field (required) + pub fn scope( + mut self, + value: impl Into>, + ) -> DefsOptionBuilder<'a, defs_option_state::SetScope> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + DefsOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: defs_option_state::State> DefsOptionBuilder<'a, S> { + /// Set the `updatedAt` field (optional) + pub fn updated_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.8 = 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.8 = value; + self + } +} + +impl<'a, S> DefsOptionBuilder<'a, S> +where + S: defs_option_state::State, + S::Value: defs_option_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> DefsOptionBuilder<'a, defs_option_state::SetValue> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + DefsOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DefsOptionBuilder<'a, S> +where + S: defs_option_state::State, + S::Key: defs_option_state::IsSet, + S::Value: defs_option_state::IsSet, + S::Did: defs_option_state::IsSet, + S::Scope: defs_option_state::IsSet, + S::CreatedBy: defs_option_state::IsSet, + S::LastUpdatedBy: defs_option_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DefsOption<'a> { + DefsOption { + created_at: self.__unsafe_private_named.0, + created_by: self.__unsafe_private_named.1.unwrap(), + description: self.__unsafe_private_named.2, + did: self.__unsafe_private_named.3.unwrap(), + key: self.__unsafe_private_named.4.unwrap(), + last_updated_by: self.__unsafe_private_named.5.unwrap(), + manager_role: self.__unsafe_private_named.6, + scope: self.__unsafe_private_named.7.unwrap(), + updated_at: self.__unsafe_private_named.8, + value: self.__unsafe_private_named.9.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>, + >, + ) -> DefsOption<'a> { + DefsOption { + created_at: self.__unsafe_private_named.0, + created_by: self.__unsafe_private_named.1.unwrap(), + description: self.__unsafe_private_named.2, + did: self.__unsafe_private_named.3.unwrap(), + key: self.__unsafe_private_named.4.unwrap(), + last_updated_by: self.__unsafe_private_named.5.unwrap(), + manager_role: self.__unsafe_private_named.6, + scope: self.__unsafe_private_named.7.unwrap(), + updated_at: self.__unsafe_private_named.8, + value: self.__unsafe_private_named.9.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_setting_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.setting.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("option"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("key"), + ::jacquard_common::smol_str::SmolStr::new_static("value"), + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("scope"), + ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), + ::jacquard_common::smol_str::SmolStr::new_static("lastUpdatedBy") + ], + ), + 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( + "createdBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(10240usize), + min_graphemes: None, + max_graphemes: Some(1024usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("key"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, + ), + 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( + "lastUpdatedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "managerRole", + ), + ::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( + "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("value"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DefsOption<'a> { + fn nsid() -> &'static str { + "tools.ozone.setting.defs" + } + fn def_name() -> &'static str { + "option" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_setting_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.description { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10240usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 10240usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.description { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 1024usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "description", + ), + max: 1024usize, + actual: count, + }); + } + } + } + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/setting/list_options.rs b/crates/weaver-api/src/tools_ozone/setting/list_options.rs new file mode 100644 index 0000000..23f9a4d --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/setting/list_options.rs @@ -0,0 +1,226 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.setting.listOptions +// +// 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 ListOptions<'a> { + #[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 keys: 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 prefix: std::option::Option>, + ///(default: "instance") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub scope: std::option::Option>, +} + +pub mod list_options_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 ListOptionsBuilder<'a, S: list_options_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> ListOptions<'a> { + /// Create a new builder for this type + pub fn new() -> ListOptionsBuilder<'a, list_options_state::Empty> { + ListOptionsBuilder::new() + } +} + +impl<'a> ListOptionsBuilder<'a, list_options_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListOptionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_options_state::State> ListOptionsBuilder<'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: list_options_state::State> ListOptionsBuilder<'a, S> { + /// Set the `keys` field (optional) + pub fn keys( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `keys` field to an Option value (optional) + pub fn maybe_keys( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: list_options_state::State> ListOptionsBuilder<'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: list_options_state::State> ListOptionsBuilder<'a, S> { + /// Set the `prefix` field (optional) + pub fn prefix( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `prefix` field to an Option value (optional) + pub fn maybe_prefix(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: list_options_state::State> ListOptionsBuilder<'a, S> { + /// Set the `scope` field (optional) + pub fn scope( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = 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.4 = value; + self + } +} + +impl<'a, S> ListOptionsBuilder<'a, S> +where + S: list_options_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListOptions<'a> { + ListOptions { + cursor: self.__unsafe_private_named.0, + keys: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + prefix: self.__unsafe_private_named.3, + scope: 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 ListOptionsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub options: Vec>, +} + +/// Response type for +///tools.ozone.setting.listOptions +pub struct ListOptionsResponse; +impl jacquard_common::xrpc::XrpcResp for ListOptionsResponse { + const NSID: &'static str = "tools.ozone.setting.listOptions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListOptionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListOptions<'a> { + const NSID: &'static str = "tools.ozone.setting.listOptions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListOptionsResponse; +} + +/// Endpoint type for +///tools.ozone.setting.listOptions +pub struct ListOptionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListOptionsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.setting.listOptions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListOptions<'de>; + type Response = ListOptionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/setting/remove_options.rs b/crates/weaver-api/src/tools_ozone/setting/remove_options.rs new file mode 100644 index 0000000..70b0fdf --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/setting/remove_options.rs @@ -0,0 +1,207 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.setting.removeOptions +// +// 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 RemoveOptions<'a> { + #[serde(borrow)] + pub keys: Vec>, + #[serde(borrow)] + pub scope: jacquard_common::CowStr<'a>, +} + +pub mod remove_options_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 Keys; + type Scope; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Keys = Unset; + type Scope = Unset; + } + ///State transition - sets the `keys` field to Set + pub struct SetKeys(PhantomData S>); + impl sealed::Sealed for SetKeys {} + impl State for SetKeys { + type Keys = Set; + type Scope = S::Scope; + } + ///State transition - sets the `scope` field to Set + pub struct SetScope(PhantomData S>); + impl sealed::Sealed for SetScope {} + impl State for SetScope { + type Keys = S::Keys; + type Scope = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `keys` field + pub struct keys(()); + ///Marker type for the `scope` field + pub struct scope(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RemoveOptionsBuilder<'a, S: remove_options_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RemoveOptions<'a> { + /// Create a new builder for this type + pub fn new() -> RemoveOptionsBuilder<'a, remove_options_state::Empty> { + RemoveOptionsBuilder::new() + } +} + +impl<'a> RemoveOptionsBuilder<'a, remove_options_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RemoveOptionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RemoveOptionsBuilder<'a, S> +where + S: remove_options_state::State, + S::Keys: remove_options_state::IsUnset, +{ + /// Set the `keys` field (required) + pub fn keys( + mut self, + value: impl Into>>, + ) -> RemoveOptionsBuilder<'a, remove_options_state::SetKeys> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RemoveOptionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RemoveOptionsBuilder<'a, S> +where + S: remove_options_state::State, + S::Scope: remove_options_state::IsUnset, +{ + /// Set the `scope` field (required) + pub fn scope( + mut self, + value: impl Into>, + ) -> RemoveOptionsBuilder<'a, remove_options_state::SetScope> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RemoveOptionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RemoveOptionsBuilder<'a, S> +where + S: remove_options_state::State, + S::Keys: remove_options_state::IsSet, + S::Scope: remove_options_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RemoveOptions<'a> { + RemoveOptions { + keys: self.__unsafe_private_named.0.unwrap(), + scope: 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>, + >, + ) -> RemoveOptions<'a> { + RemoveOptions { + keys: self.__unsafe_private_named.0.unwrap(), + scope: self.__unsafe_private_named.1.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 RemoveOptionsOutput<'a> {} +/// Response type for +///tools.ozone.setting.removeOptions +pub struct RemoveOptionsResponse; +impl jacquard_common::xrpc::XrpcResp for RemoveOptionsResponse { + const NSID: &'static str = "tools.ozone.setting.removeOptions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RemoveOptionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RemoveOptions<'a> { + const NSID: &'static str = "tools.ozone.setting.removeOptions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RemoveOptionsResponse; +} + +/// Endpoint type for +///tools.ozone.setting.removeOptions +pub struct RemoveOptionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RemoveOptionsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.setting.removeOptions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RemoveOptions<'de>; + type Response = RemoveOptionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs new file mode 100644 index 0000000..6522603 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs @@ -0,0 +1,299 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.setting.upsertOption +// +// 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 UpsertOption<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub description: Option>, + #[serde(borrow)] + pub key: jacquard_common::types::string::Nsid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub manager_role: Option>, + #[serde(borrow)] + pub scope: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +pub mod upsert_option_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 Key; + type Scope; + 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 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 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 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 `value` field + pub struct value(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpsertOptionBuilder<'a, S: upsert_option_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> UpsertOption<'a> { + /// Create a new builder for this type + pub fn new() -> UpsertOptionBuilder<'a, upsert_option_state::Empty> { + UpsertOptionBuilder::new() + } +} + +impl<'a> UpsertOptionBuilder<'a, upsert_option_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpsertOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: upsert_option_state::State> UpsertOptionBuilder<'a, S> { + /// Set the `description` field (optional) + pub fn description( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> UpsertOptionBuilder<'a, S> +where + S: upsert_option_state::State, + S::Key: upsert_option_state::IsUnset, +{ + /// Set the `key` field (required) + pub fn key( + mut self, + value: impl Into>, + ) -> UpsertOptionBuilder<'a, upsert_option_state::SetKey> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpsertOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: upsert_option_state::State> UpsertOptionBuilder<'a, S> { + /// Set the `managerRole` field (optional) + pub fn manager_role( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `managerRole` field to an Option value (optional) + pub fn maybe_manager_role( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> UpsertOptionBuilder<'a, S> +where + S: upsert_option_state::State, + S::Scope: upsert_option_state::IsUnset, +{ + /// Set the `scope` field (required) + pub fn scope( + mut self, + value: impl Into>, + ) -> UpsertOptionBuilder<'a, upsert_option_state::SetScope> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + UpsertOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpsertOptionBuilder<'a, S> +where + S: upsert_option_state::State, + S::Value: upsert_option_state::IsUnset, +{ + /// Set the `value` field (required) + pub fn value( + mut self, + value: impl Into>, + ) -> UpsertOptionBuilder<'a, upsert_option_state::SetValue> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + UpsertOptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +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::Value: upsert_option_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpsertOption<'a> { + UpsertOption { + description: self.__unsafe_private_named.0, + key: self.__unsafe_private_named.1.unwrap(), + manager_role: self.__unsafe_private_named.2, + scope: self.__unsafe_private_named.3.unwrap(), + value: 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>, + >, + ) -> UpsertOption<'a> { + UpsertOption { + description: self.__unsafe_private_named.0, + key: self.__unsafe_private_named.1.unwrap(), + manager_role: self.__unsafe_private_named.2, + scope: self.__unsafe_private_named.3.unwrap(), + value: self.__unsafe_private_named.4.unwrap(), + 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 UpsertOptionOutput<'a> { + #[serde(borrow)] + pub option: crate::tools_ozone::setting::DefsOption<'a>, +} + +/// Response type for +///tools.ozone.setting.upsertOption +pub struct UpsertOptionResponse; +impl jacquard_common::xrpc::XrpcResp for UpsertOptionResponse { + const NSID: &'static str = "tools.ozone.setting.upsertOption"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpsertOptionOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpsertOption<'a> { + const NSID: &'static str = "tools.ozone.setting.upsertOption"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpsertOptionResponse; +} + +/// Endpoint type for +///tools.ozone.setting.upsertOption +pub struct UpsertOptionRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpsertOptionRequest { + const PATH: &'static str = "/xrpc/tools.ozone.setting.upsertOption"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpsertOption<'de>; + type Response = UpsertOptionResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/signature.rs b/crates/weaver-api/src/tools_ozone/signature.rs new file mode 100644 index 0000000..2db98ab --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/signature.rs @@ -0,0 +1,109 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.signature.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod find_correlation; +pub mod find_related_accounts; +pub mod search_accounts; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct SigDetail<'a> { + #[serde(borrow)] + pub property: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub value: jacquard_common::CowStr<'a>, +} + +fn lexicon_doc_tools_ozone_signature_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.signature.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("sigDetail"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("property"), + ::jacquard_common::smol_str::SmolStr::new_static("value") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("property"), + ::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("value"), + ::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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SigDetail<'a> { + fn nsid() -> &'static str { + "tools.ozone.signature.defs" + } + fn def_name() -> &'static str { + "sigDetail" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_signature_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/tools_ozone/signature/find_correlation.rs b/crates/weaver-api/src/tools_ozone/signature/find_correlation.rs new file mode 100644 index 0000000..fefd701 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/signature/find_correlation.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.signature.findCorrelation +// +// 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 FindCorrelation<'a> { + #[serde(borrow)] + pub dids: Vec>, +} + +pub mod find_correlation_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 Dids; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Dids = Unset; + } + ///State transition - sets the `dids` field to Set + pub struct SetDids(PhantomData S>); + impl sealed::Sealed for SetDids {} + impl State for SetDids { + type Dids = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `dids` field + pub struct dids(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FindCorrelationBuilder<'a, S: find_correlation_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> FindCorrelation<'a> { + /// Create a new builder for this type + pub fn new() -> FindCorrelationBuilder<'a, find_correlation_state::Empty> { + FindCorrelationBuilder::new() + } +} + +impl<'a> FindCorrelationBuilder<'a, find_correlation_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FindCorrelationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FindCorrelationBuilder<'a, S> +where + S: find_correlation_state::State, + S::Dids: find_correlation_state::IsUnset, +{ + /// Set the `dids` field (required) + pub fn dids( + mut self, + value: impl Into>>, + ) -> FindCorrelationBuilder<'a, find_correlation_state::SetDids> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FindCorrelationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FindCorrelationBuilder<'a, S> +where + S: find_correlation_state::State, + S::Dids: find_correlation_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FindCorrelation<'a> { + FindCorrelation { + dids: 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 FindCorrelationOutput<'a> { + #[serde(borrow)] + pub details: Vec>, +} + +/// Response type for +///tools.ozone.signature.findCorrelation +pub struct FindCorrelationResponse; +impl jacquard_common::xrpc::XrpcResp for FindCorrelationResponse { + const NSID: &'static str = "tools.ozone.signature.findCorrelation"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = FindCorrelationOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for FindCorrelation<'a> { + const NSID: &'static str = "tools.ozone.signature.findCorrelation"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = FindCorrelationResponse; +} + +/// Endpoint type for +///tools.ozone.signature.findCorrelation +pub struct FindCorrelationRequest; +impl jacquard_common::xrpc::XrpcEndpoint for FindCorrelationRequest { + const PATH: &'static str = "/xrpc/tools.ozone.signature.findCorrelation"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = FindCorrelation<'de>; + type Response = FindCorrelationResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/signature/find_related_accounts.rs b/crates/weaver-api/src/tools_ozone/signature/find_related_accounts.rs new file mode 100644 index 0000000..70169a6 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/signature/find_related_accounts.rs @@ -0,0 +1,484 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.signature.findRelatedAccounts +// +// 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 FindRelatedAccounts<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod find_related_accounts_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FindRelatedAccountsBuilder<'a, S: find_related_accounts_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> FindRelatedAccounts<'a> { + /// Create a new builder for this type + pub fn new() -> FindRelatedAccountsBuilder<'a, find_related_accounts_state::Empty> { + FindRelatedAccountsBuilder::new() + } +} + +impl<'a> FindRelatedAccountsBuilder<'a, find_related_accounts_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FindRelatedAccountsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: find_related_accounts_state::State> FindRelatedAccountsBuilder<'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> FindRelatedAccountsBuilder<'a, S> +where + S: find_related_accounts_state::State, + S::Did: find_related_accounts_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> FindRelatedAccountsBuilder<'a, find_related_accounts_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FindRelatedAccountsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: find_related_accounts_state::State> FindRelatedAccountsBuilder<'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> FindRelatedAccountsBuilder<'a, S> +where + S: find_related_accounts_state::State, + S::Did: find_related_accounts_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FindRelatedAccounts<'a> { + FindRelatedAccounts { + cursor: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + 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 FindRelatedAccountsOutput<'a> { + #[serde(borrow)] + pub accounts: Vec< + crate::tools_ozone::signature::find_related_accounts::RelatedAccount<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///tools.ozone.signature.findRelatedAccounts +pub struct FindRelatedAccountsResponse; +impl jacquard_common::xrpc::XrpcResp for FindRelatedAccountsResponse { + const NSID: &'static str = "tools.ozone.signature.findRelatedAccounts"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = FindRelatedAccountsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for FindRelatedAccounts<'a> { + const NSID: &'static str = "tools.ozone.signature.findRelatedAccounts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = FindRelatedAccountsResponse; +} + +/// Endpoint type for +///tools.ozone.signature.findRelatedAccounts +pub struct FindRelatedAccountsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for FindRelatedAccountsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.signature.findRelatedAccounts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = FindRelatedAccounts<'de>; + type Response = FindRelatedAccountsResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RelatedAccount<'a> { + #[serde(borrow)] + pub account: crate::com_atproto::admin::AccountView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub similarities: Option>>, +} + +pub mod related_account_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 Account; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Account = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `account` field + pub struct account(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RelatedAccountBuilder<'a, S: related_account_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RelatedAccount<'a> { + /// Create a new builder for this type + pub fn new() -> RelatedAccountBuilder<'a, related_account_state::Empty> { + RelatedAccountBuilder::new() + } +} + +impl<'a> RelatedAccountBuilder<'a, related_account_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RelatedAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RelatedAccountBuilder<'a, S> +where + S: related_account_state::State, + S::Account: related_account_state::IsUnset, +{ + /// Set the `account` field (required) + pub fn account( + mut self, + value: impl Into>, + ) -> RelatedAccountBuilder<'a, related_account_state::SetAccount> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RelatedAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: related_account_state::State> RelatedAccountBuilder<'a, S> { + /// Set the `similarities` field (optional) + pub fn similarities( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `similarities` field to an Option value (optional) + pub fn maybe_similarities( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> RelatedAccountBuilder<'a, S> +where + S: related_account_state::State, + S::Account: related_account_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RelatedAccount<'a> { + RelatedAccount { + account: self.__unsafe_private_named.0.unwrap(), + similarities: 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>, + >, + ) -> RelatedAccount<'a> { + RelatedAccount { + account: self.__unsafe_private_named.0.unwrap(), + similarities: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_signature_findRelatedAccounts() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "tools.ozone.signature.findRelatedAccounts", + ), + 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: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did") + ], + ), + 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("did"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("relatedAccount"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("account")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("account"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.admin.defs#accountView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "similarities", + ), + ::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( + "tools.ozone.signature.defs#sigDetail", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RelatedAccount<'a> { + fn nsid() -> &'static str { + "tools.ozone.signature.findRelatedAccounts" + } + fn def_name() -> &'static str { + "relatedAccount" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_signature_findRelatedAccounts() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/signature/search_accounts.rs b/crates/weaver-api/src/tools_ozone/signature/search_accounts.rs new file mode 100644 index 0000000..e15dc44 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/signature/search_accounts.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.signature.searchAccounts +// +// 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 SearchAccounts<'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 values: Vec>, +} + +pub mod search_accounts_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 Values; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Values = Unset; + } + ///State transition - sets the `values` field to Set + pub struct SetValues(PhantomData S>); + impl sealed::Sealed for SetValues {} + impl State for SetValues { + type Values = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `values` field + pub struct values(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SearchAccountsBuilder<'a, S: search_accounts_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> SearchAccounts<'a> { + /// Create a new builder for this type + pub fn new() -> SearchAccountsBuilder<'a, search_accounts_state::Empty> { + SearchAccountsBuilder::new() + } +} + +impl<'a> SearchAccountsBuilder<'a, search_accounts_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchAccountsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_accounts_state::State> SearchAccountsBuilder<'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_accounts_state::State> SearchAccountsBuilder<'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> SearchAccountsBuilder<'a, S> +where + S: search_accounts_state::State, + S::Values: search_accounts_state::IsUnset, +{ + /// Set the `values` field (required) + pub fn values( + mut self, + value: impl Into>>, + ) -> SearchAccountsBuilder<'a, search_accounts_state::SetValues> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SearchAccountsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SearchAccountsBuilder<'a, S> +where + S: search_accounts_state::State, + S::Values: search_accounts_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchAccounts<'a> { + SearchAccounts { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + values: 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 SearchAccountsOutput<'a> { + #[serde(borrow)] + pub accounts: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///tools.ozone.signature.searchAccounts +pub struct SearchAccountsResponse; +impl jacquard_common::xrpc::XrpcResp for SearchAccountsResponse { + const NSID: &'static str = "tools.ozone.signature.searchAccounts"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchAccountsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchAccounts<'a> { + const NSID: &'static str = "tools.ozone.signature.searchAccounts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchAccountsResponse; +} + +/// Endpoint type for +///tools.ozone.signature.searchAccounts +pub struct SearchAccountsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchAccountsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.signature.searchAccounts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchAccounts<'de>; + type Response = SearchAccountsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/team.rs b/crates/weaver-api/src/tools_ozone/team.rs new file mode 100644 index 0000000..7329f05 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/team.rs @@ -0,0 +1,535 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.team.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod add_member; +pub mod delete_member; +pub mod list_members; +pub mod update_member; + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Member<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub disabled: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub last_updated_by: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub profile: Option>, + #[serde(borrow)] + pub role: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub updated_at: Option, +} + +pub mod member_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 Did; + type Role; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct MemberBuilder<'a, S: member_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> Member<'a> { + /// Create a new builder for this type + pub fn new() -> MemberBuilder<'a, member_state::Empty> { + MemberBuilder::new() + } +} + +impl<'a> MemberBuilder<'a, member_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + MemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: member_state::State> MemberBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = 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.0 = value; + self + } +} + +impl<'a, S> MemberBuilder<'a, S> +where + S: member_state::State, + S::Did: member_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> MemberBuilder<'a, member_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + MemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: member_state::State> MemberBuilder<'a, S> { + /// Set the `disabled` field (optional) + pub fn disabled(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `disabled` field to an Option value (optional) + pub fn maybe_disabled(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: member_state::State> MemberBuilder<'a, S> { + /// Set the `lastUpdatedBy` field (optional) + pub fn last_updated_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `lastUpdatedBy` field to an Option value (optional) + pub fn maybe_last_updated_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: member_state::State> MemberBuilder<'a, S> { + /// Set the `profile` field (optional) + pub fn profile( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `profile` field to an Option value (optional) + pub fn maybe_profile( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> MemberBuilder<'a, S> +where + S: member_state::State, + S::Role: member_state::IsUnset, +{ + /// Set the `role` field (required) + pub fn role( + mut self, + value: impl Into>, + ) -> MemberBuilder<'a, member_state::SetRole> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + MemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: member_state::State> MemberBuilder<'a, S> { + /// Set the `updatedAt` field (optional) + pub fn updated_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.6 = 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.6 = value; + self + } +} + +impl<'a, S> MemberBuilder<'a, S> +where + S: member_state::State, + S::Did: member_state::IsSet, + S::Role: member_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Member<'a> { + Member { + created_at: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + disabled: self.__unsafe_private_named.2, + last_updated_by: self.__unsafe_private_named.3, + profile: self.__unsafe_private_named.4, + role: self.__unsafe_private_named.5.unwrap(), + updated_at: 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>, + >, + ) -> Member<'a> { + Member { + created_at: self.__unsafe_private_named.0, + did: self.__unsafe_private_named.1.unwrap(), + disabled: self.__unsafe_private_named.2, + last_updated_by: self.__unsafe_private_named.3, + profile: self.__unsafe_private_named.4, + role: self.__unsafe_private_named.5.unwrap(), + updated_at: self.__unsafe_private_named.6, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_team_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.team.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("member"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("role") + ], + ), + 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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("disabled"), + ::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( + "lastUpdatedBy", + ), + ::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("profile"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "app.bsky.actor.defs#profileViewDetailed", + ), + }), + ); + 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( + "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 + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("roleAdmin"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("roleModerator"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("roleTriage"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("roleVerifier"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Member<'a> { + fn nsid() -> &'static str { + "tools.ozone.team.defs" + } + fn def_name() -> &'static str { + "member" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_team_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Admin role. Highest level of access, can perform all actions. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct RoleAdmin; +impl std::fmt::Display for RoleAdmin { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "roleAdmin") + } +} + +/// Moderator role. Can perform most actions. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct RoleModerator; +impl std::fmt::Display for RoleModerator { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "roleModerator") + } +} + +/// Triage role. Mostly intended for monitoring and escalating issues. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct RoleTriage; +impl std::fmt::Display for RoleTriage { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "roleTriage") + } +} + +/// Verifier role. Only allowed to issue verifications. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + Hash, + jacquard_derive::IntoStatic +)] +pub struct RoleVerifier; +impl std::fmt::Display for RoleVerifier { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "roleVerifier") + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/team/add_member.rs b/crates/weaver-api/src/tools_ozone/team/add_member.rs new file mode 100644 index 0000000..0697889 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/team/add_member.rs @@ -0,0 +1,246 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.team.addMember +// +// 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 AddMember<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub role: jacquard_common::CowStr<'a>, +} + +pub mod add_member_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 Did; + type Role; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AddMemberBuilder<'a, S: add_member_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> AddMember<'a> { + /// Create a new builder for this type + pub fn new() -> AddMemberBuilder<'a, add_member_state::Empty> { + AddMemberBuilder::new() + } +} + +impl<'a> AddMemberBuilder<'a, add_member_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AddMemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddMemberBuilder<'a, S> +where + S: add_member_state::State, + S::Did: add_member_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> AddMemberBuilder<'a, add_member_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AddMemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddMemberBuilder<'a, S> +where + S: add_member_state::State, + S::Role: add_member_state::IsUnset, +{ + /// Set the `role` field (required) + pub fn role( + mut self, + value: impl Into>, + ) -> AddMemberBuilder<'a, add_member_state::SetRole> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + AddMemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AddMemberBuilder<'a, S> +where + S: add_member_state::State, + S::Did: add_member_state::IsSet, + S::Role: add_member_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AddMember<'a> { + AddMember { + did: self.__unsafe_private_named.0.unwrap(), + role: 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>, + >, + ) -> AddMember<'a> { + AddMember { + did: self.__unsafe_private_named.0.unwrap(), + role: self.__unsafe_private_named.1.unwrap(), + 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 AddMemberOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::team::Member<'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 AddMemberError<'a> { + /// Member already exists in the team. + #[serde(rename = "MemberAlreadyExists")] + MemberAlreadyExists(std::option::Option), +} + +impl std::fmt::Display for AddMemberError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::MemberAlreadyExists(msg) => { + write!(f, "MemberAlreadyExists")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.team.addMember +pub struct AddMemberResponse; +impl jacquard_common::xrpc::XrpcResp for AddMemberResponse { + const NSID: &'static str = "tools.ozone.team.addMember"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = AddMemberOutput<'de>; + type Err<'de> = AddMemberError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for AddMember<'a> { + const NSID: &'static str = "tools.ozone.team.addMember"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = AddMemberResponse; +} + +/// Endpoint type for +///tools.ozone.team.addMember +pub struct AddMemberRequest; +impl jacquard_common::xrpc::XrpcEndpoint for AddMemberRequest { + const PATH: &'static str = "/xrpc/tools.ozone.team.addMember"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = AddMember<'de>; + type Response = AddMemberResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/team/delete_member.rs b/crates/weaver-api/src/tools_ozone/team/delete_member.rs new file mode 100644 index 0000000..c9986c9 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/team/delete_member.rs @@ -0,0 +1,202 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.team.deleteMember +// +// 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 DeleteMember<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod delete_member_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DeleteMemberBuilder<'a, S: delete_member_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DeleteMember<'a> { + /// Create a new builder for this type + pub fn new() -> DeleteMemberBuilder<'a, delete_member_state::Empty> { + DeleteMemberBuilder::new() + } +} + +impl<'a> DeleteMemberBuilder<'a, delete_member_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DeleteMemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteMemberBuilder<'a, S> +where + S: delete_member_state::State, + S::Did: delete_member_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> DeleteMemberBuilder<'a, delete_member_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DeleteMemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DeleteMemberBuilder<'a, S> +where + S: delete_member_state::State, + S::Did: delete_member_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DeleteMember<'a> { + DeleteMember { + did: 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>, + >, + ) -> DeleteMember<'a> { + DeleteMember { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[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 DeleteMemberError<'a> { + /// The member being deleted does not exist + #[serde(rename = "MemberNotFound")] + MemberNotFound(std::option::Option), + /// You can not delete yourself from the team + #[serde(rename = "CannotDeleteSelf")] + CannotDeleteSelf(std::option::Option), +} + +impl std::fmt::Display for DeleteMemberError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::MemberNotFound(msg) => { + write!(f, "MemberNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::CannotDeleteSelf(msg) => { + write!(f, "CannotDeleteSelf")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.team.deleteMember +pub struct DeleteMemberResponse; +impl jacquard_common::xrpc::XrpcResp for DeleteMemberResponse { + const NSID: &'static str = "tools.ozone.team.deleteMember"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = (); + type Err<'de> = DeleteMemberError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for DeleteMember<'a> { + const NSID: &'static str = "tools.ozone.team.deleteMember"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = DeleteMemberResponse; +} + +/// Endpoint type for +///tools.ozone.team.deleteMember +pub struct DeleteMemberRequest; +impl jacquard_common::xrpc::XrpcEndpoint for DeleteMemberRequest { + const PATH: &'static str = "/xrpc/tools.ozone.team.deleteMember"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = DeleteMember<'de>; + type Response = DeleteMemberResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/team/list_members.rs b/crates/weaver-api/src/tools_ozone/team/list_members.rs new file mode 100644 index 0000000..7f00e69 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/team/list_members.rs @@ -0,0 +1,218 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.team.listMembers +// +// 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 ListMembers<'a> { + #[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")] + pub disabled: 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 q: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub roles: std::option::Option>>, +} + +pub mod list_members_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 ListMembersBuilder<'a, S: list_members_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> ListMembers<'a> { + /// Create a new builder for this type + pub fn new() -> ListMembersBuilder<'a, list_members_state::Empty> { + ListMembersBuilder::new() + } +} + +impl<'a> ListMembersBuilder<'a, list_members_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListMembersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_members_state::State> ListMembersBuilder<'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: list_members_state::State> ListMembersBuilder<'a, S> { + /// Set the `disabled` field (optional) + pub fn disabled(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `disabled` field to an Option value (optional) + pub fn maybe_disabled(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: list_members_state::State> ListMembersBuilder<'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: list_members_state::State> ListMembersBuilder<'a, S> { + /// Set the `q` field (optional) + pub fn q(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `q` field to an Option value (optional) + pub fn maybe_q(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: list_members_state::State> ListMembersBuilder<'a, S> { + /// Set the `roles` field (optional) + pub fn roles( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `roles` field to an Option value (optional) + pub fn maybe_roles( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> ListMembersBuilder<'a, S> +where + S: list_members_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListMembers<'a> { + ListMembers { + cursor: self.__unsafe_private_named.0, + disabled: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + q: self.__unsafe_private_named.3, + roles: 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 ListMembersOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub members: Vec>, +} + +/// Response type for +///tools.ozone.team.listMembers +pub struct ListMembersResponse; +impl jacquard_common::xrpc::XrpcResp for ListMembersResponse { + const NSID: &'static str = "tools.ozone.team.listMembers"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListMembersOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListMembers<'a> { + const NSID: &'static str = "tools.ozone.team.listMembers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListMembersResponse; +} + +/// Endpoint type for +///tools.ozone.team.listMembers +pub struct ListMembersRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListMembersRequest { + const PATH: &'static str = "/xrpc/tools.ozone.team.listMembers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListMembers<'de>; + type Response = ListMembersResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/team/update_member.rs b/crates/weaver-api/src/tools_ozone/team/update_member.rs new file mode 100644 index 0000000..f587669 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/team/update_member.rs @@ -0,0 +1,249 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.team.updateMember +// +// 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 UpdateMember<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub disabled: Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub role: Option>, +} + +pub mod update_member_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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateMemberBuilder<'a, S: update_member_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> UpdateMember<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateMemberBuilder<'a, update_member_state::Empty> { + UpdateMemberBuilder::new() + } +} + +impl<'a> UpdateMemberBuilder<'a, update_member_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateMemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateMemberBuilder<'a, S> +where + S: update_member_state::State, + S::Did: update_member_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> UpdateMemberBuilder<'a, update_member_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateMemberBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: update_member_state::State> UpdateMemberBuilder<'a, S> { + /// Set the `disabled` field (optional) + pub fn disabled(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `disabled` field to an Option value (optional) + pub fn maybe_disabled(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: update_member_state::State> UpdateMemberBuilder<'a, S> { + /// Set the `role` field (optional) + pub fn role( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `role` field to an Option value (optional) + pub fn maybe_role(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> UpdateMemberBuilder<'a, S> +where + S: update_member_state::State, + S::Did: update_member_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpdateMember<'a> { + UpdateMember { + did: self.__unsafe_private_named.0.unwrap(), + disabled: self.__unsafe_private_named.1, + role: 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>, + >, + ) -> UpdateMember<'a> { + UpdateMember { + did: self.__unsafe_private_named.0.unwrap(), + disabled: self.__unsafe_private_named.1, + role: self.__unsafe_private_named.2, + 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 UpdateMemberOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::tools_ozone::team::Member<'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 UpdateMemberError<'a> { + /// The member being updated does not exist in the team + #[serde(rename = "MemberNotFound")] + MemberNotFound(std::option::Option), +} + +impl std::fmt::Display for UpdateMemberError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::MemberNotFound(msg) => { + write!(f, "MemberNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///tools.ozone.team.updateMember +pub struct UpdateMemberResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateMemberResponse { + const NSID: &'static str = "tools.ozone.team.updateMember"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpdateMemberOutput<'de>; + type Err<'de> = UpdateMemberError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateMember<'a> { + const NSID: &'static str = "tools.ozone.team.updateMember"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateMemberResponse; +} + +/// Endpoint type for +///tools.ozone.team.updateMember +pub struct UpdateMemberRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateMemberRequest { + const PATH: &'static str = "/xrpc/tools.ozone.team.updateMember"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateMember<'de>; + type Response = UpdateMemberResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/verification.rs b/crates/weaver-api/src/tools_ozone/verification.rs new file mode 100644 index 0000000..e8d524b --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/verification.rs @@ -0,0 +1,870 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.verification.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod grant_verifications; +pub mod list_verifications; +pub mod revoke_verifications; + +/// Verification data for the associated subject. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct VerificationView<'a> { + /// Timestamp when the verification was created. + pub created_at: jacquard_common::types::string::Datetime, + /// Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying. + #[serde(borrow)] + pub display_name: jacquard_common::CowStr<'a>, + /// Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying. + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + /// The user who issued this verification. + #[serde(borrow)] + pub issuer: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub issuer_profile: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub issuer_repo: Option>, + /// Describes the reason for revocation, also indicating that the verification is no longer valid. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub revoke_reason: Option>, + /// Timestamp when the verification was revoked. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub revoked_at: Option, + /// The user who revoked this verification. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub revoked_by: Option>, + /// The subject of the verification. + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_profile: Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject_repo: Option>, + /// The AT-URI of the verification record. + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod verification_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 Issuer; + type Uri; + type Subject; + type Handle; + type DisplayName; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Issuer = Unset; + type Uri = Unset; + type Subject = Unset; + type Handle = Unset; + type DisplayName = Unset; + type CreatedAt = Unset; + } + ///State transition - sets the `issuer` field to Set + pub struct SetIssuer(PhantomData S>); + impl sealed::Sealed for SetIssuer {} + impl State for SetIssuer { + type Issuer = Set; + type Uri = S::Uri; + type Subject = S::Subject; + type Handle = S::Handle; + type DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Issuer = S::Issuer; + type Uri = Set; + type Subject = S::Subject; + type Handle = S::Handle; + type DisplayName = S::DisplayName; + 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 Issuer = S::Issuer; + type Uri = S::Uri; + type Subject = Set; + type Handle = S::Handle; + type DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Issuer = S::Issuer; + type Uri = S::Uri; + type Subject = S::Subject; + type Handle = Set; + type DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type Issuer = S::Issuer; + type Uri = S::Uri; + type Subject = S::Subject; + type Handle = S::Handle; + type DisplayName = 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 Issuer = S::Issuer; + type Uri = S::Uri; + type Subject = S::Subject; + type Handle = S::Handle; + type DisplayName = S::DisplayName; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `issuer` field + pub struct issuer(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `handle` field + pub struct handle(()); + ///Marker type for the `display_name` field + pub struct display_name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VerificationViewBuilder<'a, S: verification_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> VerificationView<'a> { + /// Create a new builder for this type + pub fn new() -> VerificationViewBuilder<'a, verification_view_state::Empty> { + VerificationViewBuilder::new() + } +} + +impl<'a> VerificationViewBuilder<'a, verification_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VerificationViewBuilder { + _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> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::CreatedAt: verification_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> VerificationViewBuilder<'a, verification_view_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::DisplayName: verification_view_state::IsUnset, +{ + /// Set the `displayName` field (required) + pub fn display_name( + mut self, + value: impl Into>, + ) -> VerificationViewBuilder<'a, verification_view_state::SetDisplayName> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::Handle: verification_view_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> VerificationViewBuilder<'a, verification_view_state::SetHandle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::Issuer: verification_view_state::IsUnset, +{ + /// Set the `issuer` field (required) + pub fn issuer( + mut self, + value: impl Into>, + ) -> VerificationViewBuilder<'a, verification_view_state::SetIssuer> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { + /// Set the `issuerProfile` field (optional) + pub fn issuer_profile( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `issuerProfile` field to an Option value (optional) + pub fn maybe_issuer_profile( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { + /// Set the `issuerRepo` field (optional) + pub fn issuer_repo( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `issuerRepo` field to an Option value (optional) + pub fn maybe_issuer_repo( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { + /// Set the `revokeReason` field (optional) + pub fn revoke_reason( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `revokeReason` field to an Option value (optional) + pub fn maybe_revoke_reason( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { + /// Set the `revokedAt` field (optional) + pub fn revoked_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `revokedAt` field to an Option value (optional) + pub fn maybe_revoked_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { + /// Set the `revokedBy` field (optional) + pub fn revoked_by( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `revokedBy` field to an Option value (optional) + pub fn maybe_revoked_by( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::Subject: verification_view_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> VerificationViewBuilder<'a, verification_view_state::SetSubject> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { + /// Set the `subjectProfile` field (optional) + pub fn subject_profile( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `subjectProfile` field to an Option value (optional) + pub fn maybe_subject_profile( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { + /// Set the `subjectRepo` field (optional) + pub fn subject_repo( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `subjectRepo` field to an Option value (optional) + pub fn maybe_subject_repo( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::Uri: verification_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> VerificationViewBuilder<'a, verification_view_state::SetUri> { + self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); + VerificationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationViewBuilder<'a, S> +where + S: verification_view_state::State, + S::Issuer: verification_view_state::IsSet, + S::Uri: verification_view_state::IsSet, + S::Subject: verification_view_state::IsSet, + S::Handle: verification_view_state::IsSet, + S::DisplayName: verification_view_state::IsSet, + S::CreatedAt: verification_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> VerificationView<'a> { + VerificationView { + created_at: self.__unsafe_private_named.0.unwrap(), + display_name: self.__unsafe_private_named.1.unwrap(), + handle: self.__unsafe_private_named.2.unwrap(), + issuer: self.__unsafe_private_named.3.unwrap(), + issuer_profile: self.__unsafe_private_named.4, + issuer_repo: self.__unsafe_private_named.5, + revoke_reason: self.__unsafe_private_named.6, + revoked_at: self.__unsafe_private_named.7, + revoked_by: self.__unsafe_private_named.8, + subject: self.__unsafe_private_named.9.unwrap(), + subject_profile: self.__unsafe_private_named.10, + subject_repo: self.__unsafe_private_named.11, + 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>, + >, + ) -> VerificationView<'a> { + VerificationView { + created_at: self.__unsafe_private_named.0.unwrap(), + display_name: self.__unsafe_private_named.1.unwrap(), + handle: self.__unsafe_private_named.2.unwrap(), + issuer: self.__unsafe_private_named.3.unwrap(), + issuer_profile: self.__unsafe_private_named.4, + issuer_repo: self.__unsafe_private_named.5, + revoke_reason: self.__unsafe_private_named.6, + revoked_at: self.__unsafe_private_named.7, + revoked_by: self.__unsafe_private_named.8, + subject: self.__unsafe_private_named.9.unwrap(), + subject_profile: self.__unsafe_private_named.10, + subject_repo: self.__unsafe_private_named.11, + uri: self.__unsafe_private_named.12.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 VerificationViewIssuerRepo<'a> { + #[serde(rename = "tools.ozone.moderation.defs#repoViewDetail")] + RepoViewDetail(Box>), + #[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")] + RepoViewNotFound(Box>), +} + +#[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 VerificationViewSubjectRepo<'a> { + #[serde(rename = "tools.ozone.moderation.defs#repoViewDetail")] + RepoViewDetail(Box>), + #[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")] + RepoViewNotFound(Box>), +} + +fn lexicon_doc_tools_ozone_verification_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("tools.ozone.verification.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("verificationView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Verification data for the associated subject.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("issuer"), + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("handle"), + ::jacquard_common::smol_str::SmolStr::new_static("displayName"), + ::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: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp when the verification was created.", + ), + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying.", + ), + ), + 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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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("issuer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user who issued this verification.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "issuerProfile", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "issuerRepo", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs#repoViewDetail"), + ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs#repoViewNotFound") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "revokeReason", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Describes the reason for revocation, also indicating that the verification is no longer valid.", + ), + ), + 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( + "revokedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp when the verification was revoked.", + ), + ), + 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( + "revokedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The user who revoked this verification.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The subject of the verification.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "subjectProfile", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subjectRepo", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs#repoViewDetail"), + ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs#repoViewNotFound") + ], + closed: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The AT-URI of the verification record.", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for VerificationView<'a> { + fn nsid() -> &'static str { + "tools.ozone.verification.defs" + } + fn def_name() -> &'static str { + "verificationView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_verification_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/tools_ozone/verification/grant_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs new file mode 100644 index 0000000..9c63d32 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs @@ -0,0 +1,847 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.verification.grantVerifications +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Error object for failed verifications. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GrantError<'a> { + /// Error message describing the reason for failure. + #[serde(borrow)] + pub error: jacquard_common::CowStr<'a>, + /// The did of the subject being verified + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +pub mod grant_error_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 Error; + type Subject; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Error = Unset; + 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 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 `error` field + pub struct error(()); + ///Marker type for the `subject` field + pub struct subject(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GrantErrorBuilder<'a, S: grant_error_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GrantError<'a> { + /// Create a new builder for this type + pub fn new() -> GrantErrorBuilder<'a, grant_error_state::Empty> { + GrantErrorBuilder::new() + } +} + +impl<'a> GrantErrorBuilder<'a, grant_error_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GrantErrorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GrantErrorBuilder<'a, S> +where + S: grant_error_state::State, + S::Error: grant_error_state::IsUnset, +{ + /// Set the `error` field (required) + pub fn error( + mut self, + value: impl Into>, + ) -> GrantErrorBuilder<'a, grant_error_state::SetError> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GrantErrorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GrantErrorBuilder<'a, S> +where + S: grant_error_state::State, + S::Subject: grant_error_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> GrantErrorBuilder<'a, grant_error_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GrantErrorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GrantErrorBuilder<'a, S> +where + S: grant_error_state::State, + S::Error: grant_error_state::IsSet, + S::Subject: grant_error_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GrantError<'a> { + GrantError { + error: self.__unsafe_private_named.0.unwrap(), + subject: 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>, + >, + ) -> GrantError<'a> { + GrantError { + error: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_verification_grantVerifications() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "tools.ozone.verification.grantVerifications", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("grantError"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Error object for failed verifications.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("error"), + ::jacquard_common::smol_str::SmolStr::new_static("subject") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("error"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Error message describing the reason for failure.", + ), + ), + 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("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The did of the subject being verified", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("verifications") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "verifications", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Array of verification requests to process", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#verificationInput", + ), + }), + min_length: None, + max_length: Some(100usize), + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("verificationInput"), + ::jacquard_lexicon::lexicon::LexUserType::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("handle"), + ::jacquard_common::smol_str::SmolStr::new_static("displayName") + ], + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp for verification record. Defaults to current time when not specified.", + ), + ), + 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( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Display name of the subject the verification applies to at the moment of verifying.", + ), + ), + 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("handle"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Handle of the subject the verification applies to at the moment of verifying.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The did of the subject being verified", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for GrantError<'a> { + fn nsid() -> &'static str { + "tools.ozone.verification.grantVerifications" + } + fn def_name() -> &'static str { + "grantError" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_verification_grantVerifications() + } + 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 GrantVerifications<'a> { + /// Array of verification requests to process + #[serde(borrow)] + pub verifications: Vec< + crate::tools_ozone::verification::grant_verifications::VerificationInput<'a>, + >, +} + +pub mod grant_verifications_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 Verifications; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Verifications = 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `verifications` field + pub struct verifications(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GrantVerificationsBuilder<'a, S: grant_verifications_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option< + Vec< + crate::tools_ozone::verification::grant_verifications::VerificationInput< + 'a, + >, + >, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GrantVerifications<'a> { + /// Create a new builder for this type + pub fn new() -> GrantVerificationsBuilder<'a, grant_verifications_state::Empty> { + GrantVerificationsBuilder::new() + } +} + +impl<'a> GrantVerificationsBuilder<'a, grant_verifications_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GrantVerificationsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GrantVerificationsBuilder<'a, S> +where + S: grant_verifications_state::State, + S::Verifications: grant_verifications_state::IsUnset, +{ + /// Set the `verifications` field (required) + pub fn verifications( + mut self, + value: impl Into< + Vec< + crate::tools_ozone::verification::grant_verifications::VerificationInput< + 'a, + >, + >, + >, + ) -> GrantVerificationsBuilder<'a, grant_verifications_state::SetVerifications> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GrantVerificationsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GrantVerificationsBuilder<'a, S> +where + S: grant_verifications_state::State, + S::Verifications: grant_verifications_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GrantVerifications<'a> { + GrantVerifications { + verifications: 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>, + >, + ) -> GrantVerifications<'a> { + GrantVerifications { + verifications: 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 +)] +#[serde(rename_all = "camelCase")] +pub struct GrantVerificationsOutput<'a> { + #[serde(borrow)] + pub failed_verifications: Vec< + crate::tools_ozone::verification::grant_verifications::GrantError<'a>, + >, + #[serde(borrow)] + pub verifications: Vec>, +} + +/// Response type for +///tools.ozone.verification.grantVerifications +pub struct GrantVerificationsResponse; +impl jacquard_common::xrpc::XrpcResp for GrantVerificationsResponse { + const NSID: &'static str = "tools.ozone.verification.grantVerifications"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GrantVerificationsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GrantVerifications<'a> { + const NSID: &'static str = "tools.ozone.verification.grantVerifications"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = GrantVerificationsResponse; +} + +/// Endpoint type for +///tools.ozone.verification.grantVerifications +pub struct GrantVerificationsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GrantVerificationsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.verification.grantVerifications"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = GrantVerifications<'de>; + type Response = GrantVerificationsResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct VerificationInput<'a> { + /// Timestamp for verification record. Defaults to current time when not specified. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: Option, + /// Display name of the subject the verification applies to at the moment of verifying. + #[serde(borrow)] + pub display_name: jacquard_common::CowStr<'a>, + /// Handle of the subject the verification applies to at the moment of verifying. + #[serde(borrow)] + pub handle: jacquard_common::types::string::Handle<'a>, + /// The did of the subject being verified + #[serde(borrow)] + pub subject: jacquard_common::types::string::Did<'a>, +} + +pub mod verification_input_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 Handle; + 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 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; + type Handle = S::Handle; + 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 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 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 `display_name` field + pub struct display_name(()); + } +} + +/// Builder for constructing an instance of this type +pub struct VerificationInputBuilder<'a, S: verification_input_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> VerificationInput<'a> { + /// Create a new builder for this type + pub fn new() -> VerificationInputBuilder<'a, verification_input_state::Empty> { + VerificationInputBuilder::new() + } +} + +impl<'a> VerificationInputBuilder<'a, verification_input_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + VerificationInputBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: verification_input_state::State> VerificationInputBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = 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.0 = value; + self + } +} + +impl<'a, S> VerificationInputBuilder<'a, S> +where + S: verification_input_state::State, + S::DisplayName: verification_input_state::IsUnset, +{ + /// Set the `displayName` field (required) + pub fn display_name( + mut self, + value: impl Into>, + ) -> VerificationInputBuilder<'a, verification_input_state::SetDisplayName> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + VerificationInputBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationInputBuilder<'a, S> +where + S: verification_input_state::State, + S::Handle: verification_input_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> VerificationInputBuilder<'a, verification_input_state::SetHandle> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + VerificationInputBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationInputBuilder<'a, S> +where + S: verification_input_state::State, + S::Subject: verification_input_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> VerificationInputBuilder<'a, verification_input_state::SetSubject> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + VerificationInputBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> VerificationInputBuilder<'a, S> +where + S: verification_input_state::State, + S::Subject: verification_input_state::IsSet, + S::Handle: verification_input_state::IsSet, + S::DisplayName: verification_input_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> VerificationInput<'a> { + VerificationInput { + created_at: self.__unsafe_private_named.0, + display_name: self.__unsafe_private_named.1.unwrap(), + handle: self.__unsafe_private_named.2.unwrap(), + subject: 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>, + >, + ) -> VerificationInput<'a> { + VerificationInput { + created_at: self.__unsafe_private_named.0, + display_name: self.__unsafe_private_named.1.unwrap(), + handle: self.__unsafe_private_named.2.unwrap(), + subject: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for VerificationInput<'a> { + fn nsid() -> &'static str { + "tools.ozone.verification.grantVerifications" + } + fn def_name() -> &'static str { + "verificationInput" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_verification_grantVerifications() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/verification/list_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/list_verifications.rs new file mode 100644 index 0000000..d9f402d --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/verification/list_verifications.rs @@ -0,0 +1,295 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.verification.listVerifications +// +// 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 ListVerifications<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_after: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_before: 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")] + pub is_revoked: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub issuers: std::option::Option>>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + ///(default: "desc") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort_direction: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subjects: std::option::Option>>, +} + +pub mod list_verifications_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 ListVerificationsBuilder<'a, S: list_verifications_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> ListVerifications<'a> { + /// Create a new builder for this type + pub fn new() -> ListVerificationsBuilder<'a, list_verifications_state::Empty> { + ListVerificationsBuilder::new() + } +} + +impl<'a> ListVerificationsBuilder<'a, list_verifications_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListVerificationsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_verifications_state::State> ListVerificationsBuilder<'a, S> { + /// Set the `createdAfter` field (optional) + pub fn created_after( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `createdAfter` field to an Option value (optional) + pub fn maybe_created_after( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: list_verifications_state::State> ListVerificationsBuilder<'a, S> { + /// Set the `createdBefore` field (optional) + pub fn created_before( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `createdBefore` field to an Option value (optional) + pub fn maybe_created_before( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: list_verifications_state::State> ListVerificationsBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = 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.2 = value; + self + } +} + +impl<'a, S: list_verifications_state::State> ListVerificationsBuilder<'a, S> { + /// Set the `isRevoked` field (optional) + pub fn is_revoked(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `isRevoked` field to an Option value (optional) + pub fn maybe_is_revoked(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: list_verifications_state::State> ListVerificationsBuilder<'a, S> { + /// Set the `issuers` field (optional) + pub fn issuers( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `issuers` field to an Option value (optional) + pub fn maybe_issuers( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: list_verifications_state::State> ListVerificationsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.5 = 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.5 = value; + self + } +} + +impl<'a, S: list_verifications_state::State> ListVerificationsBuilder<'a, S> { + /// Set the `sortDirection` field (optional) + pub fn sort_direction( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `sortDirection` field to an Option value (optional) + pub fn maybe_sort_direction( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: list_verifications_state::State> ListVerificationsBuilder<'a, S> { + /// Set the `subjects` field (optional) + pub fn subjects( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `subjects` field to an Option value (optional) + pub fn maybe_subjects( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> ListVerificationsBuilder<'a, S> +where + S: list_verifications_state::State, +{ + /// Build the final struct + pub fn build(self) -> ListVerifications<'a> { + ListVerifications { + created_after: self.__unsafe_private_named.0, + created_before: self.__unsafe_private_named.1, + cursor: self.__unsafe_private_named.2, + is_revoked: self.__unsafe_private_named.3, + issuers: self.__unsafe_private_named.4, + limit: self.__unsafe_private_named.5, + sort_direction: self.__unsafe_private_named.6, + subjects: self.__unsafe_private_named.7, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListVerificationsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub verifications: Vec>, +} + +/// Response type for +///tools.ozone.verification.listVerifications +pub struct ListVerificationsResponse; +impl jacquard_common::xrpc::XrpcResp for ListVerificationsResponse { + const NSID: &'static str = "tools.ozone.verification.listVerifications"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListVerificationsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListVerifications<'a> { + const NSID: &'static str = "tools.ozone.verification.listVerifications"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListVerificationsResponse; +} + +/// Endpoint type for +///tools.ozone.verification.listVerifications +pub struct ListVerificationsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListVerificationsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.verification.listVerifications"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListVerifications<'de>; + type Response = ListVerificationsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs new file mode 100644 index 0000000..e7841d4 --- /dev/null +++ b/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs @@ -0,0 +1,545 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: tools.ozone.verification.revokeVerifications +// +// 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 RevokeVerifications<'a> { + /// Reason for revoking the verification. This is optional and can be omitted if not needed. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub revoke_reason: Option>, + /// Array of verification record uris to revoke + #[serde(borrow)] + pub uris: Vec>, +} + +pub mod revoke_verifications_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 RevokeVerificationsBuilder<'a, S: revoke_verifications_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RevokeVerifications<'a> { + /// Create a new builder for this type + pub fn new() -> RevokeVerificationsBuilder<'a, revoke_verifications_state::Empty> { + RevokeVerificationsBuilder::new() + } +} + +impl<'a> RevokeVerificationsBuilder<'a, revoke_verifications_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RevokeVerificationsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: revoke_verifications_state::State> RevokeVerificationsBuilder<'a, S> { + /// Set the `revokeReason` field (optional) + pub fn revoke_reason( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `revokeReason` field to an Option value (optional) + pub fn maybe_revoke_reason( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> RevokeVerificationsBuilder<'a, S> +where + S: revoke_verifications_state::State, + S::Uris: revoke_verifications_state::IsUnset, +{ + /// Set the `uris` field (required) + pub fn uris( + mut self, + value: impl Into>>, + ) -> RevokeVerificationsBuilder<'a, revoke_verifications_state::SetUris> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RevokeVerificationsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RevokeVerificationsBuilder<'a, S> +where + S: revoke_verifications_state::State, + S::Uris: revoke_verifications_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RevokeVerifications<'a> { + RevokeVerifications { + revoke_reason: self.__unsafe_private_named.0, + uris: 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>, + >, + ) -> RevokeVerifications<'a> { + RevokeVerifications { + revoke_reason: self.__unsafe_private_named.0, + uris: self.__unsafe_private_named.1.unwrap(), + 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 RevokeVerificationsOutput<'a> { + /// List of verification uris that couldn't be revoked, including failure reasons + #[serde(borrow)] + pub failed_revocations: Vec< + crate::tools_ozone::verification::revoke_verifications::RevokeError<'a>, + >, + /// List of verification uris successfully revoked + #[serde(borrow)] + pub revoked_verifications: Vec>, +} + +/// Response type for +///tools.ozone.verification.revokeVerifications +pub struct RevokeVerificationsResponse; +impl jacquard_common::xrpc::XrpcResp for RevokeVerificationsResponse { + const NSID: &'static str = "tools.ozone.verification.revokeVerifications"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = RevokeVerificationsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for RevokeVerifications<'a> { + const NSID: &'static str = "tools.ozone.verification.revokeVerifications"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = RevokeVerificationsResponse; +} + +/// Endpoint type for +///tools.ozone.verification.revokeVerifications +pub struct RevokeVerificationsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for RevokeVerificationsRequest { + const PATH: &'static str = "/xrpc/tools.ozone.verification.revokeVerifications"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = RevokeVerifications<'de>; + type Response = RevokeVerificationsResponse; +} + +/// Error object for failed revocations +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct RevokeError<'a> { + /// Description of the error that occurred during revocation. + #[serde(borrow)] + pub error: jacquard_common::CowStr<'a>, + /// The AT-URI of the verification record that failed to revoke. + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod revoke_error_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 Error; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct RevokeErrorBuilder<'a, S: revoke_error_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> RevokeError<'a> { + /// Create a new builder for this type + pub fn new() -> RevokeErrorBuilder<'a, revoke_error_state::Empty> { + RevokeErrorBuilder::new() + } +} + +impl<'a> RevokeErrorBuilder<'a, revoke_error_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + RevokeErrorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RevokeErrorBuilder<'a, S> +where + S: revoke_error_state::State, + S::Error: revoke_error_state::IsUnset, +{ + /// Set the `error` field (required) + pub fn error( + mut self, + value: impl Into>, + ) -> RevokeErrorBuilder<'a, revoke_error_state::SetError> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + RevokeErrorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RevokeErrorBuilder<'a, S> +where + S: revoke_error_state::State, + S::Uri: revoke_error_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> RevokeErrorBuilder<'a, revoke_error_state::SetUri> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + RevokeErrorBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> RevokeErrorBuilder<'a, S> +where + S: revoke_error_state::State, + S::Uri: revoke_error_state::IsSet, + S::Error: revoke_error_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> RevokeError<'a> { + RevokeError { + error: self.__unsafe_private_named.0.unwrap(), + uri: 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>, + >, + ) -> RevokeError<'a> { + RevokeError { + error: self.__unsafe_private_named.0.unwrap(), + uri: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_tools_ozone_verification_revokeVerifications() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "tools.ozone.verification.revokeVerifications", + ), + 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::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uris") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "revokeReason", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reason for revoking the verification. This is optional and can be omitted if not needed.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(1000usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uris"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Array of verification record uris to revoke", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The AT-URI of the verification record to revoke.", + ), + ), + 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, + }), + min_length: None, + max_length: Some(100usize), + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("revokeError"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Error object for failed revocations", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("error") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("error"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Description of the error that occurred during revocation.", + ), + ), + 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: Some( + ::jacquard_common::CowStr::new_static( + "The AT-URI of the verification record that failed to revoke.", + ), + ), + 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 + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RevokeError<'a> { + fn nsid() -> &'static str { + "tools.ozone.verification.revokeVerifications" + } + fn def_name() -> &'static str { + "revokeError" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_tools_ozone_verification_revokeVerifications() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-workspace-hack/Cargo.toml b/crates/weaver-workspace-hack/Cargo.toml index ef7bba5..4a7825e 100644 --- a/crates/weaver-workspace-hack/Cargo.toml +++ b/crates/weaver-workspace-hack/Cargo.toml @@ -19,12 +19,10 @@ publish = false aho-corasick = { version = "1" } byteorder = { version = "1" } bytes = { version = "1", features = ["serde"] } -chrono = { version = "0.4", features = ["serde"] } data-encoding = { version = "2" } diesel = { version = "2", features = ["chrono", "i-implement-a-third-party-backend-and-opt-into-breaking-changes", "postgres", "serde_json", "sqlite"] } diesel-async = { version = "0.5", features = ["deadpool", "postgres", "sync-connection-wrapper"] } elliptic-curve = { version = "0.13", features = ["digest", "hazmat", "jwk", "pem", "std"] } -fastrand = { version = "2" } futures-channel = { version = "0.3", features = ["sink"] } futures-core = { version = "0.3" } futures-task = { version = "0.3", default-features = false, features = ["std"] } @@ -35,30 +33,29 @@ idna = { version = "1" } jacquard = { git = "https://tangled.org/@nonbinary.computer/jacquard", default-features = false, features = ["api_bluesky", "derive", "dns", "loopback", "tracing", "websocket", "zstd"] } jacquard-api = { git = "https://tangled.org/@nonbinary.computer/jacquard", features = ["bluesky", "sh_weaver"] } jacquard-common = { git = "https://tangled.org/@nonbinary.computer/jacquard", features = ["tracing", "websocket", "zstd"] } -jacquard-identity = { git = "https://tangled.org/@nonbinary.computer/jacquard", default-features = false, features = ["dns", "tracing"] } +jacquard-identity = { git = "https://tangled.org/@nonbinary.computer/jacquard", default-features = false, features = ["cache", "dns", "tracing"] } jacquard-lexicon = { git = "https://tangled.org/@nonbinary.computer/jacquard" } jacquard-oauth = { git = "https://tangled.org/@nonbinary.computer/jacquard", features = ["browser-open", "loopback", "tracing"] } log = { version = "0.4", default-features = false, features = ["std"] } -memchr = { version = "2", features = ["use_std"] } +memchr = { version = "2" } miette = { version = "7", features = ["fancy", "syntect-highlighter"] } -mime_guess = { version = "2" } minijinja = { version = "2" } +minimal-lexical = { version = "0.2", default-features = false, features = ["std"] } +nom = { version = "7" } num-traits = { version = "0.2", default-features = false, features = ["i128", "libm", "std"] } p384 = { version = "0.13", default-features = false, features = ["ecdsa"] } percent-encoding = { version = "2" } rand = { version = "0.8", features = ["small_rng"] } -regex-automata = { version = "0.4", default-features = false, features = ["dfa-onepass", "hybrid", "meta", "nfa", "perf", "std", "unicode"] } +regex-automata = { version = "0.4", default-features = false, features = ["dfa", "hybrid", "meta", "nfa", "perf", "std", "unicode"] } reqwest = { version = "0.12", features = ["gzip", "json", "rustls-tls", "stream"] } sec1 = { version = "0.7", features = ["pem", "serde", "std", "subtle"] } -serde_core = { version = "1", features = ["alloc"] } serde_json = { version = "1", features = ["alloc", "preserve_order", "raw_value"] } sha2 = { version = "0.10", features = ["oid"] } smallvec = { version = "1", default-features = false, features = ["const_new"] } -spin = { version = "0.9", default-features = false, features = ["once", "spin_mutex"] } subtle = { version = "2" } syn = { version = "2", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } syntect = { version = "5", features = ["default-fancy"] } -time = { version = "0.3", features = ["formatting", "local-offset", "macros", "parsing"] } +time = { version = "0.3", features = ["formatting", "macros", "parsing"] } tokio = { version = "1", features = ["full"] } tokio-util = { version = "0.7", features = ["codec", "io"] } toml = { version = "0.8", features = ["preserve_order"] } @@ -66,49 +63,48 @@ tower-http = { version = "0.6", features = ["cors", "fs", "normalize-path", "req tracing = { version = "0.1", features = ["log"] } tracing-core = { version = "0.1" } uuid = { version = "1", features = ["serde", "v4", "v7"] } +winnow = { version = "0.7" } +zerocopy = { version = "0.8", default-features = false, features = ["derive", "simd"] } zeroize = { version = "1", features = ["derive", "serde"] } [build-dependencies] aho-corasick = { version = "1" } bytes = { version = "1", features = ["serde"] } -cc = { version = "1", default-features = false, features = ["parallel"] } -chrono = { version = "0.4", features = ["serde"] } data-encoding = { version = "2" } diesel_derives = { version = "2", features = ["32-column-tables", "chrono", "postgres", "sqlite", "with-deprecated"] } elliptic-curve = { version = "0.13", features = ["digest", "hazmat", "jwk", "pem", "std"] } -fastrand = { version = "2" } futures-channel = { version = "0.3", features = ["sink"] } futures-core = { version = "0.3" } futures-task = { version = "0.3", default-features = false, features = ["std"] } futures-util = { version = "0.3", features = ["channel", "io", "sink"] } generic-array = { version = "0.14", default-features = false, features = ["more_lengths", "serde", "zeroize"] } -hashbrown = { version = "0.15", features = ["serde"] } idna = { version = "1" } jacquard-common = { git = "https://tangled.org/@nonbinary.computer/jacquard", features = ["tracing", "websocket", "zstd"] } jacquard-lexicon = { git = "https://tangled.org/@nonbinary.computer/jacquard" } log = { version = "0.4", default-features = false, features = ["std"] } -memchr = { version = "2", features = ["use_std"] } +memchr = { version = "2" } miette = { version = "7", features = ["fancy", "syntect-highlighter"] } +minimal-lexical = { version = "0.2", default-features = false, features = ["std"] } +nom = { version = "7" } num-traits = { version = "0.2", default-features = false, features = ["i128", "libm", "std"] } percent-encoding = { version = "2" } rand = { version = "0.8", features = ["small_rng"] } -regex-automata = { version = "0.4", default-features = false, features = ["dfa-onepass", "hybrid", "meta", "nfa", "perf", "std", "unicode"] } +regex-automata = { version = "0.4", default-features = false, features = ["dfa", "hybrid", "meta", "nfa", "perf", "std", "unicode"] } reqwest = { version = "0.12", features = ["gzip", "json", "rustls-tls", "stream"] } sec1 = { version = "0.7", features = ["pem", "serde", "std", "subtle"] } -serde_core = { version = "1", features = ["alloc"] } serde_json = { version = "1", features = ["alloc", "preserve_order", "raw_value"] } sha2 = { version = "0.10", features = ["oid"] } smallvec = { version = "1", default-features = false, features = ["const_new"] } -spin = { version = "0.9", default-features = false, features = ["once", "spin_mutex"] } subtle = { version = "2" } syn = { version = "2", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } syntect = { version = "5", features = ["default-fancy"] } -time = { version = "0.3", features = ["formatting", "local-offset", "macros", "parsing"] } +time = { version = "0.3", features = ["formatting", "macros", "parsing"] } tokio = { version = "1", features = ["full"] } tokio-util = { version = "0.7", features = ["codec", "io"] } -toml = { version = "0.8", features = ["preserve_order"] } tracing = { version = "0.1", features = ["log"] } tracing-core = { version = "0.1" } +winnow = { version = "0.7" } +zerocopy = { version = "0.8", default-features = false, features = ["derive", "simd"] } zeroize = { version = "1", features = ["derive", "serde"] } ### END HAKARI SECTION diff --git a/lexicons.kdl b/lexicons.kdl new file mode 100644 index 0000000..646e06c --- /dev/null +++ b/lexicons.kdl @@ -0,0 +1,16 @@ +output { + lexicons "crates/weaver-api/lexicons" + codegen "crates/weaver-api/src" + cargo-toml "crates/weaver-api/Cargo.toml" +} + + +source "bluesky" type="git" priority=101 { + repo "https://github.com/bluesky-social/atproto" + pattern "**/*.json" +} + +source "weaver" type="local" priority=200 { + path "./lexicons" + +} diff --git a/lexicons/sh/weaver/embed/external.json b/lexicons/sh/weaver/embed/external.json index 67043cb..f8a645d 100644 --- a/lexicons/sh/weaver/embed/external.json +++ b/lexicons/sh/weaver/embed/external.json @@ -9,12 +9,12 @@ "properties": { "embeds": { "type": "array", - "items": { "type": "ref", "ref": "#external" }, + "items": { "type": "ref", "ref": "#externalEmbed" }, "maxLength": 48 } } }, - "external": { + "externalEmbed": { "type": "object", "required": ["uri", "title", "description"], "properties": { @@ -33,8 +33,9 @@ "required": ["external"], "properties": { "external": { - "type": "ref", - "ref": "#viewExternal" + "type": "array", + "items": { "type": "ref", "ref": "#viewExternal" }, + "maxLength": 48 } } }, diff --git a/lexicons/sh/weaver/embed/recordWithMedia.json b/lexicons/sh/weaver/embed/recordWithMedia.json index 8f510c3..63ffa57 100644 --- a/lexicons/sh/weaver/embed/recordWithMedia.json +++ b/lexicons/sh/weaver/embed/recordWithMedia.json @@ -13,7 +13,14 @@ }, "media": { "type": "union", - "refs": ["sh.weaver.embed.images", "sh.weaver.embed.external", "app.bsky.embed.images", "app.bsky.embed.video", "app.bsky.embed.external"] + "refs": [ + "sh.weaver.embed.images", + "sh.weaver.embed.external", + "sh.weaver.embed.video", + "app.bsky.embed.images", + "app.bsky.embed.video", + "app.bsky.embed.external" + ] } } }, @@ -28,8 +35,9 @@ "media": { "type": "union", "refs": [ - "sh.weaver.embed.images", + "sh.weaver.embed.images#view", "sh.weaver.embed.external#view", + "sh.weaver.embed.video#view", "app.bsky.embed.images#view", "app.bsky.embed.video#view", "app.bsky.embed.external#view" diff --git a/lexicons/sh/weaver/embed/records.json b/lexicons/sh/weaver/embed/records.json index 1fe2ec9..75a071b 100644 --- a/lexicons/sh/weaver/embed/records.json +++ b/lexicons/sh/weaver/embed/records.json @@ -41,7 +41,9 @@ "app.bsky.embed.record#view", "app.bsky.embed.recordWithMedia#view", "sh.weaver.embed.records#view", - "sh.weaver.embed.images#view" + "sh.weaver.embed.images#view", + "sh.weaver.embed.recordWithMedia#view", + "sh.weaver.embed.video#view" ] }, "name": { diff --git a/lexicons/sh/weaver/embed/video.json b/lexicons/sh/weaver/embed/video.json index f31ce52..25ffab6 100644 --- a/lexicons/sh/weaver/embed/video.json +++ b/lexicons/sh/weaver/embed/video.json @@ -4,6 +4,18 @@ "description": "A video embedded in a Weaver record (eg, a notebook entry).", "defs": { "main": { + "type": "object", + "required": ["videos"], + "properties": { + "videos": { + "type": "array", + "items": { "type": "ref", "ref": "#video" }, + "minItems": 1, + "maxItems": 10 + } + } + }, + "video": { "type": "object", "required": ["video"], "properties": { diff --git a/lexicons/sh/weaver/notebook/entry.json b/lexicons/sh/weaver/notebook/entry.json index 3a96d0a..c0823fb 100644 --- a/lexicons/sh/weaver/notebook/entry.json +++ b/lexicons/sh/weaver/notebook/entry.json @@ -24,10 +24,34 @@ "format": "datetime", "description": "Client-declared timestamp when this was originally created." }, - "images": { - "type": "ref", - "ref": "sh.weaver.embed.images", - "description": "The set of images, if any, embedded in the notebook entry." + "embeds": { + "type": "object", + "description": "The set of images and records, if any, embedded in the notebook entry.", + "properties": { + "images": { + "type": "ref", + "ref": "sh.weaver.embed.images" + }, + "records": { + "type": "ref", + "ref": "sh.weaver.embed.records" + }, + "videos": { + "type": "ref", + "ref": "sh.weaver.embed.video" + }, + "externals": { + "type": "ref", + "ref": "sh.weaver.embed.external" + }, + "recordsWithMedia": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.embed.recordWithMedia" + } + } + } } } } -- 2.51.2