From 32f38c8a55e5c891d9e17a21510b732d06128435 Mon Sep 17 00:00:00 2001 From: Orual Date: Fri, 3 Oct 2025 19:25:46 -0400 Subject: [PATCH] further codegen improvements, beginnings of xrpc client impl --- .claude/settings.local.json | 3 +- CLAUDE.md | 27 +- Cargo.lock | 150 +++- crates/jacquard-api/src/app_bsky/actor.rs | 412 ++++++++++ .../src/app_bsky/actor/get_preferences.rs | 19 +- .../src/app_bsky/actor/get_profile.rs | 21 +- .../src/app_bsky/actor/get_profiles.rs | 21 +- .../src/app_bsky/actor/get_suggestions.rs | 28 +- .../src/app_bsky/actor/profile.rs | 33 + .../src/app_bsky/actor/put_preferences.rs | 12 +- .../src/app_bsky/actor/search_actors.rs | 31 +- .../app_bsky/actor/search_actors_typeahead.rs | 28 +- .../jacquard-api/src/app_bsky/actor/status.rs | 25 + crates/jacquard-api/src/app_bsky/bookmark.rs | 42 ++ .../src/app_bsky/bookmark/create_bookmark.rs | 25 + .../src/app_bsky/bookmark/delete_bookmark.rs | 24 + .../src/app_bsky/bookmark/get_bookmarks.rs | 27 +- crates/jacquard-api/src/app_bsky/embed.rs | 11 + .../src/app_bsky/embed/external.rs | 46 ++ .../jacquard-api/src/app_bsky/embed/images.rs | 45 ++ .../jacquard-api/src/app_bsky/embed/record.rs | 95 +++ .../src/app_bsky/embed/record_with_media.rs | 58 ++ .../jacquard-api/src/app_bsky/embed/video.rs | 38 + crates/jacquard-api/src/app_bsky/feed.rs | 315 ++++++++ .../app_bsky/feed/describe_feed_generator.rs | 35 +- .../src/app_bsky/feed/generator.rs | 32 + .../src/app_bsky/feed/get_actor_feeds.rs | 29 +- .../src/app_bsky/feed/get_actor_likes.rs | 44 +- .../src/app_bsky/feed/get_author_feed.rs | 50 +- .../src/app_bsky/feed/get_feed.rs | 37 +- .../src/app_bsky/feed/get_feed_generator.rs | 23 +- .../src/app_bsky/feed/get_feed_generators.rs | 21 +- .../src/app_bsky/feed/get_feed_skeleton.rs | 42 +- .../src/app_bsky/feed/get_likes.rs | 45 +- .../src/app_bsky/feed/get_list_feed.rs | 39 +- .../src/app_bsky/feed/get_post_thread.rs | 62 +- .../src/app_bsky/feed/get_posts.rs | 21 +- .../src/app_bsky/feed/get_quotes.rs | 33 +- .../src/app_bsky/feed/get_reposted_by.rs | 33 +- .../src/app_bsky/feed/get_suggested_feeds.rs | 32 +- .../src/app_bsky/feed/get_timeline.rs | 29 +- crates/jacquard-api/src/app_bsky/feed/like.rs | 12 + crates/jacquard-api/src/app_bsky/feed/post.rs | 80 ++ .../src/app_bsky/feed/postgate.rs | 22 + .../jacquard-api/src/app_bsky/feed/repost.rs | 12 + .../src/app_bsky/feed/search_posts.rs | 59 +- .../src/app_bsky/feed/send_interactions.rs | 21 +- .../src/app_bsky/feed/threadgate.rs | 51 +- crates/jacquard-api/src/app_bsky/graph.rs | 138 ++++ .../jacquard-api/src/app_bsky/graph/block.rs | 11 + .../jacquard-api/src/app_bsky/graph/follow.rs | 11 + .../app_bsky/graph/get_actor_starter_packs.rs | 29 +- .../src/app_bsky/graph/get_blocks.rs | 27 +- .../src/app_bsky/graph/get_followers.rs | 30 +- .../src/app_bsky/graph/get_follows.rs | 30 +- .../src/app_bsky/graph/get_known_followers.rs | 30 +- .../src/app_bsky/graph/get_list.rs | 30 +- .../src/app_bsky/graph/get_list_blocks.rs | 27 +- .../src/app_bsky/graph/get_list_mutes.rs | 27 +- .../src/app_bsky/graph/get_lists.rs | 31 +- .../graph/get_lists_with_membership.rs | 42 +- .../src/app_bsky/graph/get_mutes.rs | 27 +- .../src/app_bsky/graph/get_relationships.rs | 35 + .../src/app_bsky/graph/get_starter_pack.rs | 21 +- .../src/app_bsky/graph/get_starter_packs.rs | 21 +- .../get_starter_packs_with_membership.rs | 42 +- .../graph/get_suggested_follows_by_actor.rs | 23 +- .../jacquard-api/src/app_bsky/graph/list.rs | 28 + .../src/app_bsky/graph/listblock.rs | 11 + .../src/app_bsky/graph/listitem.rs | 12 + .../src/app_bsky/graph/mute_actor.rs | 12 +- .../src/app_bsky/graph/mute_actor_list.rs | 12 +- .../src/app_bsky/graph/mute_thread.rs | 12 +- .../app_bsky/graph/search_starter_packs.rs | 29 +- .../src/app_bsky/graph/starterpack.rs | 25 + .../src/app_bsky/graph/unmute_actor.rs | 12 +- .../src/app_bsky/graph/unmute_actor_list.rs | 12 +- .../src/app_bsky/graph/unmute_thread.rs | 12 +- .../src/app_bsky/graph/verification.rs | 13 + crates/jacquard-api/src/app_bsky/labeler.rs | 57 ++ .../src/app_bsky/labeler/get_services.rs | 26 +- .../src/app_bsky/labeler/service.rs | 29 + .../jacquard-api/src/app_bsky/notification.rs | 87 +++ .../src/app_bsky/notification/declaration.rs | 10 + .../app_bsky/notification/get_preferences.rs | 19 +- .../app_bsky/notification/get_unread_count.rs | 19 +- .../list_activity_subscriptions.rs | 27 +- .../notification/list_notifications.rs | 53 +- .../notification/put_activity_subscription.rs | 24 +- .../app_bsky/notification/put_preferences.rs | 12 +- .../notification/put_preferences_v2.rs | 34 +- .../app_bsky/notification/register_push.rs | 16 +- .../app_bsky/notification/unregister_push.rs | 15 +- .../src/app_bsky/notification/update_seen.rs | 12 +- .../src/app_bsky/richtext/facet.rs | 52 ++ crates/jacquard-api/src/app_bsky/unspecced.rs | 148 ++++ .../unspecced/get_age_assurance_state.rs | 12 +- .../src/app_bsky/unspecced/get_config.rs | 24 +- .../get_onboarding_suggested_starter_packs.rs | 27 +- ...arding_suggested_starter_packs_skeleton.rs | 27 +- .../unspecced/get_popular_feed_generators.rs | 29 +- .../unspecced/get_post_thread_other_v2.rs | 52 +- .../app_bsky/unspecced/get_post_thread_v2.rs | 75 +- .../app_bsky/unspecced/get_suggested_feeds.rs | 22 +- .../unspecced/get_suggested_feeds_skeleton.rs | 26 +- .../unspecced/get_suggested_starter_packs.rs | 22 +- .../get_suggested_starter_packs_skeleton.rs | 26 +- .../app_bsky/unspecced/get_suggested_users.rs | 26 +- .../unspecced/get_suggested_users_skeleton.rs | 28 +- .../unspecced/get_suggestions_skeleton.rs | 33 +- .../unspecced/get_tagged_suggestions.rs | 31 +- .../app_bsky/unspecced/get_trending_topics.rs | 27 +- .../src/app_bsky/unspecced/get_trends.rs | 22 +- .../app_bsky/unspecced/get_trends_skeleton.rs | 26 +- .../app_bsky/unspecced/init_age_assurance.rs | 42 ++ .../unspecced/search_actors_skeleton.rs | 46 +- .../unspecced/search_posts_skeleton.rs | 63 +- .../search_starter_packs_skeleton.rs | 44 +- crates/jacquard-api/src/app_bsky/video.rs | 16 + .../src/app_bsky/video/get_job_status.rs | 21 +- .../src/app_bsky/video/get_upload_limits.rs | 16 +- .../src/app_bsky/video/upload_video.rs | 21 +- crates/jacquard-api/src/chat_bsky/actor.rs | 18 + .../src/chat_bsky/actor/declaration.rs | 10 + .../src/chat_bsky/actor/delete_account.rs | 11 +- .../chat_bsky/actor/export_account_data.rs | 11 +- crates/jacquard-api/src/chat_bsky/convo.rs | 336 +++++++++ .../src/chat_bsky/convo/accept_convo.rs | 22 +- .../src/chat_bsky/convo/add_reaction.rs | 40 + .../convo/delete_message_for_self.rs | 23 +- .../src/chat_bsky/convo/get_convo.rs | 21 +- .../chat_bsky/convo/get_convo_availability.rs | 22 +- .../chat_bsky/convo/get_convo_for_members.rs | 21 +- .../src/chat_bsky/convo/get_log.rs | 22 +- .../src/chat_bsky/convo/get_messages.rs | 29 +- .../src/chat_bsky/convo/leave_convo.rs | 23 +- .../src/chat_bsky/convo/list_convos.rs | 31 +- .../src/chat_bsky/convo/mute_convo.rs | 22 +- .../src/chat_bsky/convo/remove_reaction.rs | 39 + .../src/chat_bsky/convo/send_message.rs | 23 +- .../src/chat_bsky/convo/send_message_batch.rs | 33 +- .../src/chat_bsky/convo/unmute_convo.rs | 22 +- .../src/chat_bsky/convo/update_all_read.rs | 22 +- .../src/chat_bsky/convo/update_read.rs | 23 +- .../moderation/get_actor_metadata.rs | 36 +- .../moderation/get_message_context.rs | 31 +- .../moderation/update_actor_access.rs | 14 +- crates/jacquard-api/src/com_atproto/admin.rs | 65 ++ .../src/com_atproto/admin/delete_account.rs | 12 +- .../admin/disable_account_invites.rs | 13 +- .../com_atproto/admin/disable_invite_codes.rs | 13 +- .../admin/enable_account_invites.rs | 13 +- .../src/com_atproto/admin/get_account_info.rs | 21 +- .../com_atproto/admin/get_account_infos.rs | 21 +- .../src/com_atproto/admin/get_invite_codes.rs | 30 +- .../com_atproto/admin/get_subject_status.rs | 45 +- .../src/com_atproto/admin/search_accounts.rs | 29 +- .../src/com_atproto/admin/send_email.rs | 26 +- .../com_atproto/admin/update_account_email.rs | 13 +- .../admin/update_account_handle.rs | 13 +- .../admin/update_account_password.rs | 13 +- .../admin/update_account_signing_key.rs | 13 +- .../admin/update_subject_status.rs | 65 +- .../jacquard-api/src/com_atproto/identity.rs | 12 + .../get_recommended_did_credentials.rs | 15 +- .../com_atproto/identity/refresh_identity.rs | 40 + .../request_plc_operation_signature.rs | 2 +- .../src/com_atproto/identity/resolve_did.rs | 34 + .../com_atproto/identity/resolve_handle.rs | 33 + .../com_atproto/identity/resolve_identity.rs | 39 + .../identity/sign_plc_operation.rs | 26 +- .../identity/submit_plc_operation.rs | 12 +- .../src/com_atproto/identity/update_handle.rs | 12 +- crates/jacquard-api/src/com_atproto/label.rs | 85 +++ .../src/com_atproto/label/query_labels.rs | 31 +- .../src/com_atproto/label/subscribe_labels.rs | 60 ++ .../src/com_atproto/lexicon/schema.rs | 10 + .../src/com_atproto/moderation.rs | 177 +++++ .../com_atproto/moderation/create_report.rs | 75 +- crates/jacquard-api/src/com_atproto/repo.rs | 11 + .../src/com_atproto/repo/apply_writes.rs | 104 +++ .../src/com_atproto/repo/create_record.rs | 40 + .../src/com_atproto/repo/delete_record.rs | 36 + .../src/com_atproto/repo/describe_repo.rs | 25 +- .../src/com_atproto/repo/get_record.rs | 36 + .../src/com_atproto/repo/import_repo.rs | 11 +- .../com_atproto/repo/list_missing_blobs.rs | 38 +- .../src/com_atproto/repo/list_records.rs | 45 +- .../src/com_atproto/repo/put_record.rs | 41 + .../src/com_atproto/repo/strong_ref.rs | 11 + .../src/com_atproto/repo/upload_blob.rs | 21 +- crates/jacquard-api/src/com_atproto/server.rs | 27 + .../com_atproto/server/activate_account.rs | 2 +- .../server/check_account_status.rs | 20 +- .../src/com_atproto/server/confirm_email.rs | 32 + .../src/com_atproto/server/create_account.rs | 64 ++ .../com_atproto/server/create_app_password.rs | 48 ++ .../com_atproto/server/create_invite_code.rs | 23 +- .../com_atproto/server/create_invite_codes.rs | 35 +- .../src/com_atproto/server/create_session.rs | 49 ++ .../com_atproto/server/deactivate_account.rs | 12 +- .../src/com_atproto/server/delete_account.rs | 29 + .../src/com_atproto/server/delete_session.rs | 2 +- .../src/com_atproto/server/describe_server.rs | 38 +- .../server/get_account_invite_codes.rs | 35 +- .../com_atproto/server/get_service_auth.rs | 35 + .../src/com_atproto/server/get_session.rs | 19 +- .../com_atproto/server/list_app_passwords.rs | 36 + .../src/com_atproto/server/refresh_session.rs | 30 + .../server/request_account_delete.rs | 2 +- .../server/request_email_confirmation.rs | 2 +- .../server/request_email_update.rs | 12 +- .../server/request_password_reset.rs | 12 +- .../com_atproto/server/reserve_signing_key.rs | 22 +- .../src/com_atproto/server/reset_password.rs | 28 + .../com_atproto/server/revoke_app_password.rs | 12 +- .../src/com_atproto/server/update_email.rs | 30 + crates/jacquard-api/src/com_atproto/sync.rs | 14 + .../src/com_atproto/sync/get_blob.rs | 39 + .../src/com_atproto/sync/get_blocks.rs | 43 ++ .../src/com_atproto/sync/get_checkout.rs | 20 +- .../src/com_atproto/sync/get_head.rs | 29 + .../src/com_atproto/sync/get_host_status.rs | 36 + .../src/com_atproto/sync/get_latest_commit.rs | 43 ++ .../src/com_atproto/sync/get_record.rs | 44 ++ .../src/com_atproto/sync/get_repo.rs | 38 + .../src/com_atproto/sync/get_repo_status.rs | 36 + .../src/com_atproto/sync/list_blobs.rs | 50 +- .../src/com_atproto/sync/list_hosts.rs | 40 +- .../src/com_atproto/sync/list_repos.rs | 41 +- .../sync/list_repos_by_collection.rs | 39 +- .../src/com_atproto/sync/notify_of_update.rs | 12 +- .../src/com_atproto/sync/request_crawl.rs | 22 + .../src/com_atproto/sync/subscribe_repos.rs | 136 ++++ .../com_atproto/temp/add_reserved_handle.rs | 21 +- .../temp/check_handle_availability.rs | 77 ++ .../com_atproto/temp/check_signup_queue.rs | 14 +- .../src/com_atproto/temp/dereference_scope.rs | 33 + .../src/com_atproto/temp/fetch_labels.rs | 22 +- .../temp/request_phone_verification.rs | 12 +- .../temp/revoke_account_credentials.rs | 12 +- .../src/tools_ozone/communication.rs | 18 + .../communication/create_template.rs | 38 + .../communication/delete_template.rs | 12 +- .../communication/list_templates.rs | 12 +- .../communication/update_template.rs | 40 + .../hosting/get_account_history.rs | 105 ++- .../src/tools_ozone/moderation.rs | 701 ++++++++++++++++++ .../src/tools_ozone/moderation/emit_event.rs | 134 ++++ .../moderation/get_account_timeline.rs | 56 ++ .../src/tools_ozone/moderation/get_event.rs | 19 +- .../src/tools_ozone/moderation/get_record.rs | 32 + .../src/tools_ozone/moderation/get_records.rs | 21 +- .../src/tools_ozone/moderation/get_repo.rs | 29 + .../moderation/get_reporter_stats.rs | 21 +- .../src/tools_ozone/moderation/get_repos.rs | 21 +- .../tools_ozone/moderation/get_subjects.rs | 21 +- .../tools_ozone/moderation/query_events.rs | 69 +- .../tools_ozone/moderation/query_statuses.rs | 96 ++- .../tools_ozone/moderation/search_repos.rs | 31 +- crates/jacquard-api/src/tools_ozone/report.rs | 144 ++++ .../jacquard-api/src/tools_ozone/safelink.rs | 83 +++ .../src/tools_ozone/safelink/add_rule.rs | 38 + .../src/tools_ozone/safelink/query_events.rs | 27 +- .../src/tools_ozone/safelink/query_rules.rs | 30 +- .../src/tools_ozone/safelink/remove_rule.rs | 35 + .../src/tools_ozone/safelink/update_rule.rs | 37 + .../src/tools_ozone/server/get_config.rs | 37 +- crates/jacquard-api/src/tools_ozone/set.rs | 25 + .../src/tools_ozone/set/add_values.rs | 13 +- .../src/tools_ozone/set/delete_set.rs | 31 + .../src/tools_ozone/set/delete_values.rs | 23 + .../src/tools_ozone/set/get_values.rs | 40 +- .../src/tools_ozone/set/query_sets.rs | 35 +- .../src/tools_ozone/set/upsert_set.rs | 22 +- .../jacquard-api/src/tools_ozone/setting.rs | 19 + .../src/tools_ozone/setting/list_options.rs | 34 +- .../src/tools_ozone/setting/remove_options.rs | 22 +- .../src/tools_ozone/setting/upsert_option.rs | 26 +- .../jacquard-api/src/tools_ozone/signature.rs | 11 + .../tools_ozone/signature/find_correlation.rs | 21 +- .../signature/find_related_accounts.rs | 40 +- .../tools_ozone/signature/search_accounts.rs | 29 +- crates/jacquard-api/src/tools_ozone/team.rs | 16 + .../src/tools_ozone/team/add_member.rs | 33 + .../src/tools_ozone/team/delete_member.rs | 25 + .../src/tools_ozone/team/list_members.rs | 33 +- .../src/tools_ozone/team/update_member.rs | 34 + .../src/tools_ozone/verification.rs | 78 ++ .../verification/grant_verifications.rs | 47 +- .../verification/list_verifications.rs | 40 +- .../verification/revoke_verifications.rs | 35 +- crates/jacquard-common/src/into_static.rs | 16 + crates/jacquard-common/src/types/datetime.rs | 8 + crates/jacquard-common/src/types/language.rs | 8 + crates/jacquard-common/src/types/tid.rs | 8 + crates/jacquard-common/src/types/value.rs | 36 +- crates/jacquard-common/src/types/xrpc.rs | 22 +- crates/jacquard-derive/src/lib.rs | 6 +- crates/jacquard-lexicon/Cargo.toml | 2 +- crates/jacquard-lexicon/src/codegen.rs | 509 +++++++++++-- crates/jacquard/Cargo.toml | 16 + crates/jacquard/src/client.rs | 171 +++++ crates/jacquard/src/client/error.rs | 149 ++++ crates/jacquard/src/client/response.rs | 93 +++ crates/jacquard/src/lib.rs | 4 + 306 files changed, 11422 insertions(+), 852 deletions(-) create mode 100644 crates/jacquard/src/client.rs create mode 100644 crates/jacquard/src/client/error.rs create mode 100644 crates/jacquard/src/client/response.rs create mode 100644 crates/jacquard/src/lib.rs diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 05fcac47f..22b93b2f3 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -4,7 +4,8 @@ "WebSearch", "WebFetch(domain:atproto.com)", "WebFetch(domain:github.com)", - "WebFetch(domain:raw.githubusercontent.com)" + "WebFetch(domain:raw.githubusercontent.com)", + "WebFetch(domain:docs.rs)" ], "deny": [], "ask": [] diff --git a/CLAUDE.md b/CLAUDE.md index 246d2737a..cc25ee457 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -117,6 +117,9 @@ The `jacquard-codegen` binary generates Rust types from AT Protocol Lexicon sche - Adds header comments with `@generated` marker and lexicon NSID - Handles XRPC queries, procedures, subscriptions, and errors - Generates proper module tree with Rust 2018 style +- **XrpcRequest trait**: Implemented directly on params/input structs (not marker types), with GATs for Output<'de> and Err<'de> +- **IntoStatic trait**: All generated types implement `IntoStatic` to convert borrowed types to owned ('static) variants +- **Collection trait**: Implemented on record types directly, with const NSID ## Current State & Next Steps @@ -128,13 +131,21 @@ The `jacquard-codegen` binary generates Rust types from AT Protocol Lexicon sche - ✅ CidLink wrapper type with automatic `{"$link": "cid"}` serialization in JSON - ✅ Integration test with real Bluesky thread data validates round-trip correctness - ✅ Lexicon code generation with forward compatibility and proper lifetime handling +- ✅ IntoStatic implementations for all generated types (structs, enums, unions) +- ✅ XrpcRequest trait with GATs, implemented on params/input types directly +- ✅ HttpClient and XrpcClient traits with generic send_xrpc implementation +- ✅ Response wrapper with parse() (borrowed) and into_output() (owned) methods +- ✅ Structured error types (ClientError, TransportError, EncodeError, DecodeError, HttpError, AuthError) ### Next Steps -1. **Lexicon Resolution**: Fetch lexicons from web sources (atproto authorities, git repositories) and parse into corpus -2. **Custom Lexicon Support**: Allow users to plug in their own generated lexicons alongside jacquard-api types in the client/server layer -3. **Client Implementation**: Build HTTP client layer for XRPC operations in the main `jacquard` crate -4. **Public API**: Design the main API surface in `jacquard` that re-exports and wraps generated types -5. **DID Document Support**: Parsing, validation, and resolution of DID documents -6. **OAuth Implementation**: OAuth flow support for authentication -7. **Examples & Documentation**: Create examples and improve documentation -8. **Testing**: Comprehensive tests for generated code and round-trip serialization +1. **Concrete HttpClient Implementation**: Implement HttpClient for reqwest::Client and potentially other HTTP clients +2. **Error Handling Improvements**: Add XRPC error parsing, better HTTP status code handling, structured error responses +3. **Authentication**: Session management, token refresh, DPoP support +4. **Body Encoding**: Support for non-JSON encodings (CBOR, multipart, etc.) in procedures +5. **Lexicon Resolution**: Fetch lexicons from web sources (atproto authorities, git repositories) and parse into corpus +6. **Custom Lexicon Support**: Allow users to plug in their own generated lexicons alongside jacquard-api types in the client/server layer +7. **Public API**: Design the main API surface in `jacquard` that re-exports and wraps generated types +8. **DID Document Support**: Parsing, validation, and resolution of DID documents +9. **OAuth Implementation**: OAuth flow support for authentication +10. **Examples & Documentation**: Create examples and improve documentation +11. **Testing**: Comprehensive tests for generated code and round-trip serialization diff --git a/Cargo.lock b/Cargo.lock index 11cc41f3d..40dc689cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,6 +150,15 @@ dependencies = [ "windows-link 0.2.0", ] +[[package]] +name = "backtrace-ext" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" +dependencies = [ + "backtrace", +] + [[package]] name = "base-x" version = "0.2.11" @@ -225,6 +234,15 @@ dependencies = [ "serde", ] +[[package]] +name = "cbor4ii" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544cf8c89359205f4f990d0e6f3828db42df85b5dac95d09157a250eb0749c4" +dependencies = [ + "serde", +] + [[package]] name = "cc" version = "1.2.39" @@ -564,6 +582,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "find-msvc-tools" version = "0.1.2" @@ -1051,6 +1079,12 @@ dependencies = [ "serde", ] +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -1076,10 +1110,18 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" name = "jacquard" version = "0.1.0" dependencies = [ + "bytes", "clap", + "http", "jacquard-api", "jacquard-common", + "miette", "reqwest", + "serde", + "serde_html_form", + "serde_ipld_dagcbor", + "serde_json", + "thiserror 2.0.17", ] [[package]] @@ -1185,6 +1227,12 @@ version = "0.2.176" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + [[package]] name = "litemap" version = "0.8.0" @@ -1215,9 +1263,17 @@ version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ + "backtrace", + "backtrace-ext", "cfg-if", "miette-derive", - "unicode-width", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap", + "unicode-width 0.1.14", ] [[package]] @@ -1355,6 +1411,12 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "owo-colors" +version = "4.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e" + [[package]] name = "percent-encoding" version = "2.3.2" @@ -1505,7 +1567,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -1677,6 +1739,19 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +[[package]] +name = "rustix" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "rustls" version = "0.23.32" @@ -1748,6 +1823,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "serde" version = "1.0.228" @@ -1800,6 +1881,18 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_ipld_dagcbor" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46182f4f08349a02b45c998ba3215d3f9de826246ba02bb9dddfe9a2a2100778" +dependencies = [ + "cbor4ii", + "ipld-core", + "scopeguard", + "serde", +] + [[package]] name = "serde_json" version = "1.0.145" @@ -1961,6 +2054,27 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "supports-color" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" +dependencies = [ + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" + +[[package]] +name = "supports-unicode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" + [[package]] name = "syn" version = "1.0.109" @@ -2023,6 +2137,26 @@ dependencies = [ "libc", ] +[[package]] +name = "terminal_size" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" +dependencies = [ + "rustix", + "windows-sys 0.60.2", +] + +[[package]] +name = "textwrap" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" +dependencies = [ + "unicode-linebreak", + "unicode-width 0.2.1", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -2241,12 +2375,24 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + [[package]] name = "unicode-width" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" + [[package]] name = "unsigned-varint" version = "0.8.0" diff --git a/crates/jacquard-api/src/app_bsky/actor.rs b/crates/jacquard-api/src/app_bsky/actor.rs index 1ad9b265e..4fc10802c 100644 --- a/crates/jacquard-api/src/app_bsky/actor.rs +++ b/crates/jacquard-api/src/app_bsky/actor.rs @@ -22,6 +22,16 @@ pub struct AdultContentPref<'a> { pub enabled: bool, } +impl jacquard_common::IntoStatic for AdultContentPref<'_> { + type Output = AdultContentPref<'static>; + fn into_static(self) -> Self::Output { + AdultContentPref { + enabled: self.enabled.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -31,6 +41,16 @@ pub struct BskyAppProgressGuide<'a> { pub guide: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for BskyAppProgressGuide<'_> { + type Output = BskyAppProgressGuide<'static>; + fn into_static(self) -> Self::Output { + BskyAppProgressGuide { + guide: self.guide.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -51,6 +71,18 @@ pub struct BskyAppStatePref<'a> { pub queued_nudges: std::option::Option>>, } +impl jacquard_common::IntoStatic for BskyAppStatePref<'_> { + type Output = BskyAppStatePref<'static>; + fn into_static(self) -> Self::Output { + BskyAppStatePref { + active_progress_guide: self.active_progress_guide.into_static(), + nuxs: self.nuxs.into_static(), + queued_nudges: self.queued_nudges.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -65,6 +97,18 @@ pub struct ContentLabelPref<'a> { pub visibility: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ContentLabelPref<'_> { + type Output = ContentLabelPref<'static>; + fn into_static(self) -> Self::Output { + ContentLabelPref { + label: self.label.into_static(), + labeler_did: self.labeler_did.into_static(), + visibility: self.visibility.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -89,6 +133,21 @@ pub struct FeedViewPref<'a> { pub hide_reposts: std::option::Option, } +impl jacquard_common::IntoStatic for FeedViewPref<'_> { + type Output = FeedViewPref<'static>; + fn into_static(self) -> Self::Output { + FeedViewPref { + feed: self.feed.into_static(), + hide_quote_posts: self.hide_quote_posts.into_static(), + hide_replies: self.hide_replies.into_static(), + hide_replies_by_like_count: self.hide_replies_by_like_count.into_static(), + hide_replies_by_unfollowed: self.hide_replies_by_unfollowed.into_static(), + hide_reposts: self.hide_reposts.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -98,6 +157,16 @@ pub struct HiddenPostsPref<'a> { pub items: Vec>, } +impl jacquard_common::IntoStatic for HiddenPostsPref<'_> { + type Output = HiddenPostsPref<'static>; + fn into_static(self) -> Self::Output { + HiddenPostsPref { + items: self.items.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -107,6 +176,16 @@ pub struct InterestsPref<'a> { pub tags: Vec>, } +impl jacquard_common::IntoStatic for InterestsPref<'_> { + type Output = InterestsPref<'static>; + fn into_static(self) -> Self::Output { + InterestsPref { + tags: self.tags.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///The subject's followers whom you also follow #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -117,6 +196,17 @@ pub struct KnownFollowers<'a> { pub followers: Vec>, } +impl jacquard_common::IntoStatic for KnownFollowers<'_> { + type Output = KnownFollowers<'static>; + fn into_static(self) -> Self::Output { + KnownFollowers { + count: self.count.into_static(), + followers: self.followers.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -125,6 +215,16 @@ pub struct LabelerPrefItem<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for LabelerPrefItem<'_> { + type Output = LabelerPrefItem<'static>; + fn into_static(self) -> Self::Output { + LabelerPrefItem { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -133,6 +233,16 @@ pub struct LabelersPref<'a> { pub labelers: Vec>, } +impl jacquard_common::IntoStatic for LabelersPref<'_> { + type Output = LabelersPref<'static>; + fn into_static(self) -> Self::Output { + LabelersPref { + labelers: self.labelers.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///A word that the account owner has muted. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -156,6 +266,20 @@ pub struct MutedWord<'a> { pub value: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for MutedWord<'_> { + type Output = MutedWord<'static>; + fn into_static(self) -> Self::Output { + MutedWord { + actor_target: self.actor_target.into_static(), + expires_at: self.expires_at.into_static(), + id: self.id.into_static(), + targets: self.targets.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum MutedWordTarget<'a> { Content, @@ -221,6 +345,17 @@ where } } +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)] #[serde(rename_all = "camelCase")] @@ -230,6 +365,16 @@ pub struct MutedWordsPref<'a> { pub items: Vec>, } +impl jacquard_common::IntoStatic for MutedWordsPref<'_> { + type Output = MutedWordsPref<'static>; + fn into_static(self) -> Self::Output { + MutedWordsPref { + items: self.items.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///A new user experiences (NUX) storage object #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -247,6 +392,19 @@ pub struct Nux<'a> { pub id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for Nux<'_> { + type Output = Nux<'static>; + fn into_static(self) -> Self::Output { + Nux { + completed: self.completed.into_static(), + data: self.data.into_static(), + expires_at: self.expires_at.into_static(), + id: self.id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -256,6 +414,16 @@ pub struct PersonalDetailsPref<'a> { pub birth_date: std::option::Option, } +impl jacquard_common::IntoStatic for PersonalDetailsPref<'_> { + type Output = PersonalDetailsPref<'static>; + fn into_static(self) -> Self::Output { + PersonalDetailsPref { + birth_date: self.birth_date.into_static(), + extra_data: self.extra_data.into_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. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -275,6 +443,17 @@ pub struct PostInteractionSettingsPref<'a> { >, } +impl jacquard_common::IntoStatic for PostInteractionSettingsPref<'_> { + type Output = PostInteractionSettingsPref<'static>; + fn into_static(self) -> Self::Output { + PostInteractionSettingsPref { + postgate_embedding_rules: self.postgate_embedding_rules.into_static(), + threadgate_allow_rules: self.threadgate_allow_rules.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + pub type Preferences<'a> = Vec>; #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -298,6 +477,21 @@ pub struct ProfileAssociated<'a> { pub starter_packs: std::option::Option, } +impl jacquard_common::IntoStatic for ProfileAssociated<'_> { + type Output = ProfileAssociated<'static>; + fn into_static(self) -> Self::Output { + ProfileAssociated { + activity_subscription: self.activity_subscription.into_static(), + chat: self.chat.into_static(), + feedgens: self.feedgens.into_static(), + labeler: self.labeler.into_static(), + lists: self.lists.into_static(), + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -306,6 +500,16 @@ pub struct ProfileAssociatedActivitySubscription<'a> { pub allow_subscriptions: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ProfileAssociatedActivitySubscription<'_> { + type Output = ProfileAssociatedActivitySubscription<'static>; + fn into_static(self) -> Self::Output { + ProfileAssociatedActivitySubscription { + allow_subscriptions: self.allow_subscriptions.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -314,6 +518,16 @@ pub struct ProfileAssociatedChat<'a> { pub allow_incoming: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ProfileAssociatedChat<'_> { + type Output = ProfileAssociatedChat<'static>; + fn into_static(self) -> Self::Output { + ProfileAssociatedChat { + allow_incoming: self.allow_incoming.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -355,6 +569,28 @@ pub struct ProfileView<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for ProfileView<'_> { + type Output = ProfileView<'static>; + fn into_static(self) -> Self::Output { + ProfileView { + associated: self.associated.into_static(), + avatar: self.avatar.into_static(), + created_at: self.created_at.into_static(), + description: self.description.into_static(), + did: self.did.into_static(), + display_name: self.display_name.into_static(), + handle: self.handle.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + pronouns: self.pronouns.into_static(), + status: self.status.into_static(), + verification: self.verification.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -391,6 +627,26 @@ pub struct ProfileViewBasic<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for ProfileViewBasic<'_> { + type Output = ProfileViewBasic<'static>; + fn into_static(self) -> Self::Output { + ProfileViewBasic { + associated: self.associated.into_static(), + avatar: self.avatar.into_static(), + created_at: self.created_at.into_static(), + did: self.did.into_static(), + display_name: self.display_name.into_static(), + handle: self.handle.into_static(), + labels: self.labels.into_static(), + pronouns: self.pronouns.into_static(), + status: self.status.into_static(), + verification: self.verification.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -454,6 +710,35 @@ pub struct ProfileViewDetailed<'a> { pub website: std::option::Option>, } +impl jacquard_common::IntoStatic for ProfileViewDetailed<'_> { + type Output = ProfileViewDetailed<'static>; + fn into_static(self) -> Self::Output { + ProfileViewDetailed { + associated: self.associated.into_static(), + avatar: self.avatar.into_static(), + banner: self.banner.into_static(), + created_at: self.created_at.into_static(), + description: self.description.into_static(), + did: self.did.into_static(), + display_name: self.display_name.into_static(), + followers_count: self.followers_count.into_static(), + follows_count: self.follows_count.into_static(), + handle: self.handle.into_static(), + indexed_at: self.indexed_at.into_static(), + joined_via_starter_pack: self.joined_via_starter_pack.into_static(), + labels: self.labels.into_static(), + pinned_post: self.pinned_post.into_static(), + posts_count: self.posts_count.into_static(), + pronouns: self.pronouns.into_static(), + status: self.status.into_static(), + verification: self.verification.into_static(), + viewer: self.viewer.into_static(), + website: self.website.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -467,6 +752,19 @@ pub struct SavedFeed<'a> { pub value: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for SavedFeed<'_> { + type Output = SavedFeed<'static>; + fn into_static(self) -> Self::Output { + SavedFeed { + id: self.id.into_static(), + pinned: self.pinned.into_static(), + r#type: self.r#type.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -479,6 +777,18 @@ pub struct SavedFeedsPref<'a> { pub timeline_index: std::option::Option, } +impl jacquard_common::IntoStatic for SavedFeedsPref<'_> { + type Output = SavedFeedsPref<'static>; + fn into_static(self) -> Self::Output { + SavedFeedsPref { + pinned: self.pinned.into_static(), + saved: self.saved.into_static(), + timeline_index: self.timeline_index.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -487,6 +797,16 @@ pub struct SavedFeedsPrefV2<'a> { pub items: Vec>, } +impl jacquard_common::IntoStatic for SavedFeedsPrefV2<'_> { + type Output = SavedFeedsPrefV2<'static>; + fn into_static(self) -> Self::Output { + SavedFeedsPrefV2 { + items: self.items.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -517,6 +837,34 @@ pub enum StatusViewRecordEmbed<'a> { ExternalView(Box>), } +impl jacquard_common::IntoStatic for StatusViewRecordEmbed<'_> { + type Output = StatusViewRecordEmbed<'static>; + fn into_static(self) -> Self::Output { + match self { + StatusViewRecordEmbed::ExternalView(v) => { + StatusViewRecordEmbed::ExternalView(v.into_static()) + } + StatusViewRecordEmbed::Unknown(v) => { + StatusViewRecordEmbed::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for StatusView<'_> { + type Output = StatusView<'static>; + fn into_static(self) -> Self::Output { + StatusView { + embed: self.embed.into_static(), + expires_at: self.expires_at.into_static(), + is_active: self.is_active.into_static(), + record: self.record.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -530,6 +878,17 @@ pub struct ThreadViewPref<'a> { pub sort: std::option::Option>, } +impl jacquard_common::IntoStatic for ThreadViewPref<'_> { + type Output = ThreadViewPref<'static>; + fn into_static(self) -> Self::Output { + ThreadViewPref { + prioritize_followed_users: self.prioritize_followed_users.into_static(), + sort: self.sort.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Preferences for how verified accounts appear in the app. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -540,6 +899,16 @@ pub struct VerificationPrefs<'a> { pub hide_badges: std::option::Option, } +impl jacquard_common::IntoStatic for VerificationPrefs<'_> { + type Output = VerificationPrefs<'static>; + fn into_static(self) -> Self::Output { + VerificationPrefs { + hide_badges: self.hide_badges.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Represents the verification information about the user this object is attached to. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -556,6 +925,18 @@ pub struct VerificationState<'a> { pub verified_status: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for VerificationState<'_> { + type Output = VerificationState<'static>; + fn into_static(self) -> Self::Output { + VerificationState { + trusted_verifier_status: self.trusted_verifier_status.into_static(), + verifications: self.verifications.into_static(), + verified_status: self.verified_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///An individual verification for an associated subject. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -573,6 +954,19 @@ pub struct VerificationView<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for VerificationView<'_> { + type Output = VerificationView<'static>; + fn into_static(self) -> Self::Output { + VerificationView { + created_at: self.created_at.into_static(), + is_valid: self.is_valid.into_static(), + issuer: self.issuer.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -607,4 +1001,22 @@ pub struct ViewerState<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub muted_by_list: std::option::Option>, +} + +impl jacquard_common::IntoStatic for ViewerState<'_> { + type Output = ViewerState<'static>; + fn into_static(self) -> Self::Output { + ViewerState { + activity_subscription: self.activity_subscription.into_static(), + blocked_by: self.blocked_by.into_static(), + blocking: self.blocking.into_static(), + blocking_by_list: self.blocking_by_list.into_static(), + followed_by: self.followed_by.into_static(), + following: self.following.into_static(), + known_followers: self.known_followers.into_static(), + muted: self.muted.into_static(), + muted_by_list: self.muted_by_list.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/get_preferences.rs b/crates/jacquard-api/src/app_bsky/actor/get_preferences.rs index 47350611e..03abdbc01 100644 --- a/crates/jacquard-api/src/app_bsky/actor/get_preferences.rs +++ b/crates/jacquard-api/src/app_bsky/actor/get_preferences.rs @@ -8,6 +8,13 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetPreferences {} +impl jacquard_common::IntoStatic for GetPreferences { + type Output = GetPreferences; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -16,10 +23,20 @@ pub struct GetPreferencesOutput<'a> { pub preferences: crate::app_bsky::actor::Preferences<'a>, } +impl jacquard_common::IntoStatic for GetPreferencesOutput<'_> { + type Output = GetPreferencesOutput<'static>; + fn into_static(self) -> Self::Output { + GetPreferencesOutput { + preferences: self.preferences.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetPreferences { const NSID: &'static str = "app.bsky.actor.getPreferences"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetPreferencesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/get_profile.rs b/crates/jacquard-api/src/app_bsky/actor/get_profile.rs index e20d9f443..a37942beb 100644 --- a/crates/jacquard-api/src/app_bsky/actor/get_profile.rs +++ b/crates/jacquard-api/src/app_bsky/actor/get_profile.rs @@ -12,6 +12,15 @@ pub struct GetProfile<'a> { pub actor: jacquard_common::types::ident::AtIdentifier<'a>, } +impl jacquard_common::IntoStatic for GetProfile<'_> { + type Output = GetProfile<'static>; + fn into_static(self) -> Self::Output { + GetProfile { + actor: self.actor.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,10 +30,20 @@ pub struct GetProfileOutput<'a> { pub value: crate::app_bsky::actor::ProfileViewDetailed<'a>, } +impl jacquard_common::IntoStatic for GetProfileOutput<'_> { + type Output = GetProfileOutput<'static>; + fn into_static(self) -> Self::Output { + GetProfileOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetProfile<'_> { const NSID: &'static str = "app.bsky.actor.getProfile"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetProfileOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/get_profiles.rs b/crates/jacquard-api/src/app_bsky/actor/get_profiles.rs index 5480edf54..6447edb48 100644 --- a/crates/jacquard-api/src/app_bsky/actor/get_profiles.rs +++ b/crates/jacquard-api/src/app_bsky/actor/get_profiles.rs @@ -12,6 +12,15 @@ pub struct GetProfiles<'a> { pub actors: Vec>, } +impl jacquard_common::IntoStatic for GetProfiles<'_> { + type Output = GetProfiles<'static>; + fn into_static(self) -> Self::Output { + GetProfiles { + actors: self.actors.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetProfilesOutput<'a> { pub profiles: Vec>, } +impl jacquard_common::IntoStatic for GetProfilesOutput<'_> { + type Output = GetProfilesOutput<'static>; + fn into_static(self) -> Self::Output { + GetProfilesOutput { + profiles: self.profiles.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetProfiles<'_> { const NSID: &'static str = "app.bsky.actor.getProfiles"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetProfilesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/get_suggestions.rs b/crates/jacquard-api/src/app_bsky/actor/get_suggestions.rs index 267e0e4d4..fd52382a0 100644 --- a/crates/jacquard-api/src/app_bsky/actor/get_suggestions.rs +++ b/crates/jacquard-api/src/app_bsky/actor/get_suggestions.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetSuggestions<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetSuggestions<'_> { + type Output = GetSuggestions<'static>; + fn into_static(self) -> Self::Output { + GetSuggestions { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -38,10 +40,22 @@ pub struct GetSuggestionsOutput<'a> { pub rec_id: std::option::Option, } +impl jacquard_common::IntoStatic for GetSuggestionsOutput<'_> { + type Output = GetSuggestionsOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestionsOutput { + actors: self.actors.into_static(), + cursor: self.cursor.into_static(), + rec_id: self.rec_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestions<'_> { const NSID: &'static str = "app.bsky.actor.getSuggestions"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestionsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/profile.rs b/crates/jacquard-api/src/app_bsky/actor/profile.rs index 9da756657..0e9262caa 100644 --- a/crates/jacquard-api/src/app_bsky/actor/profile.rs +++ b/crates/jacquard-api/src/app_bsky/actor/profile.rs @@ -59,6 +59,39 @@ pub enum ProfileRecordLabels<'a> { DefsSelfLabels(Box>), } +impl jacquard_common::IntoStatic for ProfileRecordLabels<'_> { + type Output = ProfileRecordLabels<'static>; + fn into_static(self) -> Self::Output { + match self { + ProfileRecordLabels::DefsSelfLabels(v) => { + ProfileRecordLabels::DefsSelfLabels(v.into_static()) + } + ProfileRecordLabels::Unknown(v) => { + ProfileRecordLabels::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::collection::Collection for Profile<'_> { const NSID: &'static str = "app.bsky.actor.profile"; +} + +impl jacquard_common::IntoStatic for Profile<'_> { + type Output = Profile<'static>; + fn into_static(self) -> Self::Output { + Profile { + avatar: self.avatar.into_static(), + banner: self.banner.into_static(), + created_at: self.created_at.into_static(), + description: self.description.into_static(), + display_name: self.display_name.into_static(), + joined_via_starter_pack: self.joined_via_starter_pack.into_static(), + labels: self.labels.into_static(), + pinned_post: self.pinned_post.into_static(), + pronouns: self.pronouns.into_static(), + website: self.website.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/put_preferences.rs b/crates/jacquard-api/src/app_bsky/actor/put_preferences.rs index fb4a75368..2f8fa7935 100644 --- a/crates/jacquard-api/src/app_bsky/actor/put_preferences.rs +++ b/crates/jacquard-api/src/app_bsky/actor/put_preferences.rs @@ -13,6 +13,16 @@ pub struct PutPreferences<'a> { pub preferences: crate::app_bsky::actor::Preferences<'a>, } +impl jacquard_common::IntoStatic for PutPreferences<'_> { + type Output = PutPreferences<'static>; + fn into_static(self) -> Self::Output { + PutPreferences { + preferences: self.preferences.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for PutPreferences<'_> { const NSID: &'static str = "app.bsky.actor.putPreferences"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for PutPreferences<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/search_actors.rs b/crates/jacquard-api/src/app_bsky/actor/search_actors.rs index 4d196a515..a75bac35e 100644 --- a/crates/jacquard-api/src/app_bsky/actor/search_actors.rs +++ b/crates/jacquard-api/src/app_bsky/actor/search_actors.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -21,13 +22,14 @@ pub struct SearchActors<'a> { pub term: std::option::Option>, } -impl Default for SearchActors<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(25i64), - q: Default::default(), - term: Default::default(), +impl jacquard_common::IntoStatic for SearchActors<'_> { + type Output = SearchActors<'static>; + fn into_static(self) -> Self::Output { + SearchActors { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + q: self.q.into_static(), + term: self.term.into_static(), } } } @@ -43,10 +45,21 @@ pub struct SearchActorsOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for SearchActorsOutput<'_> { + type Output = SearchActorsOutput<'static>; + fn into_static(self) -> Self::Output { + SearchActorsOutput { + actors: self.actors.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchActors<'_> { const NSID: &'static str = "app.bsky.actor.searchActors"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SearchActorsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/search_actors_typeahead.rs b/crates/jacquard-api/src/app_bsky/actor/search_actors_typeahead.rs index e11fdf3e7..abaf7b02c 100644 --- a/crates/jacquard-api/src/app_bsky/actor/search_actors_typeahead.rs +++ b/crates/jacquard-api/src/app_bsky/actor/search_actors_typeahead.rs @@ -5,9 +5,10 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -18,12 +19,13 @@ pub struct SearchActorsTypeahead<'a> { pub term: std::option::Option>, } -impl Default for SearchActorsTypeahead<'_> { - fn default() -> Self { - Self { - limit: Some(10i64), - q: Default::default(), - term: Default::default(), +impl jacquard_common::IntoStatic for SearchActorsTypeahead<'_> { + type Output = SearchActorsTypeahead<'static>; + fn into_static(self) -> Self::Output { + SearchActorsTypeahead { + limit: self.limit.into_static(), + q: self.q.into_static(), + term: self.term.into_static(), } } } @@ -36,10 +38,20 @@ pub struct SearchActorsTypeaheadOutput<'a> { pub actors: Vec>, } +impl jacquard_common::IntoStatic for SearchActorsTypeaheadOutput<'_> { + type Output = SearchActorsTypeaheadOutput<'static>; + fn into_static(self) -> Self::Output { + SearchActorsTypeaheadOutput { + actors: self.actors.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchActorsTypeahead<'_> { const NSID: &'static str = "app.bsky.actor.searchActorsTypeahead"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SearchActorsTypeaheadOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/actor/status.rs b/crates/jacquard-api/src/app_bsky/actor/status.rs index 93405f8a2..f5bb3a1ac 100644 --- a/crates/jacquard-api/src/app_bsky/actor/status.rs +++ b/crates/jacquard-api/src/app_bsky/actor/status.rs @@ -32,6 +32,31 @@ pub enum StatusRecordEmbed<'a> { External(Box>), } +impl jacquard_common::IntoStatic for StatusRecordEmbed<'_> { + type Output = StatusRecordEmbed<'static>; + fn into_static(self) -> Self::Output { + match self { + StatusRecordEmbed::External(v) => { + StatusRecordEmbed::External(v.into_static()) + } + StatusRecordEmbed::Unknown(v) => StatusRecordEmbed::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::collection::Collection for Status<'_> { const NSID: &'static str = "app.bsky.actor.status"; +} + +impl jacquard_common::IntoStatic for Status<'_> { + type Output = Status<'static>; + fn into_static(self) -> Self::Output { + Status { + created_at: self.created_at.into_static(), + duration_minutes: self.duration_minutes.into_static(), + embed: self.embed.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/bookmark.rs b/crates/jacquard-api/src/app_bsky/bookmark.rs index eb1d2e4e3..57170facd 100644 --- a/crates/jacquard-api/src/app_bsky/bookmark.rs +++ b/crates/jacquard-api/src/app_bsky/bookmark.rs @@ -19,6 +19,16 @@ pub struct Bookmark<'a> { pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, } +impl jacquard_common::IntoStatic for Bookmark<'_> { + type Output = Bookmark<'static>; + fn into_static(self) -> Self::Output { + Bookmark { + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -43,4 +53,36 @@ pub enum BookmarkViewRecordItem<'a> { DefsNotFoundPost(Box>), #[serde(rename = "app.bsky.feed.defs#postView")] DefsPostView(Box>), +} + +impl jacquard_common::IntoStatic for BookmarkViewRecordItem<'_> { + type Output = BookmarkViewRecordItem<'static>; + fn into_static(self) -> Self::Output { + match self { + BookmarkViewRecordItem::DefsBlockedPost(v) => { + BookmarkViewRecordItem::DefsBlockedPost(v.into_static()) + } + BookmarkViewRecordItem::DefsNotFoundPost(v) => { + BookmarkViewRecordItem::DefsNotFoundPost(v.into_static()) + } + BookmarkViewRecordItem::DefsPostView(v) => { + BookmarkViewRecordItem::DefsPostView(v.into_static()) + } + BookmarkViewRecordItem::Unknown(v) => { + BookmarkViewRecordItem::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for BookmarkView<'_> { + type Output = BookmarkView<'static>; + fn into_static(self) -> Self::Output { + BookmarkView { + created_at: self.created_at.into_static(), + item: self.item.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/bookmark/create_bookmark.rs b/crates/jacquard-api/src/app_bsky/bookmark/create_bookmark.rs index b6905fe35..e3f37d262 100644 --- a/crates/jacquard-api/src/app_bsky/bookmark/create_bookmark.rs +++ b/crates/jacquard-api/src/app_bsky/bookmark/create_bookmark.rs @@ -15,6 +15,17 @@ pub struct CreateBookmark<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for CreateBookmark<'_> { + type Output = CreateBookmark<'static>; + fn into_static(self) -> Self::Output { + CreateBookmark { + cid: self.cid.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -49,6 +60,20 @@ impl std::fmt::Display for CreateBookmarkError<'_> { } } +impl jacquard_common::IntoStatic for CreateBookmarkError<'_> { + type Output = CreateBookmarkError<'static>; + fn into_static(self) -> Self::Output { + match self { + CreateBookmarkError::UnsupportedCollection(v) => { + CreateBookmarkError::UnsupportedCollection(v.into_static()) + } + CreateBookmarkError::Unknown(v) => { + CreateBookmarkError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateBookmark<'_> { const NSID: &'static str = "app.bsky.bookmark.createBookmark"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/app_bsky/bookmark/delete_bookmark.rs b/crates/jacquard-api/src/app_bsky/bookmark/delete_bookmark.rs index 97496e3b9..d4f391234 100644 --- a/crates/jacquard-api/src/app_bsky/bookmark/delete_bookmark.rs +++ b/crates/jacquard-api/src/app_bsky/bookmark/delete_bookmark.rs @@ -13,6 +13,16 @@ pub struct DeleteBookmark<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for DeleteBookmark<'_> { + type Output = DeleteBookmark<'static>; + fn into_static(self) -> Self::Output { + DeleteBookmark { + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -47,6 +57,20 @@ impl std::fmt::Display for DeleteBookmarkError<'_> { } } +impl jacquard_common::IntoStatic for DeleteBookmarkError<'_> { + type Output = DeleteBookmarkError<'static>; + fn into_static(self) -> Self::Output { + match self { + DeleteBookmarkError::UnsupportedCollection(v) => { + DeleteBookmarkError::UnsupportedCollection(v.into_static()) + } + DeleteBookmarkError::Unknown(v) => { + DeleteBookmarkError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteBookmark<'_> { const NSID: &'static str = "app.bsky.bookmark.deleteBookmark"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/app_bsky/bookmark/get_bookmarks.rs b/crates/jacquard-api/src/app_bsky/bookmark/get_bookmarks.rs index ddb490f11..2834c1989 100644 --- a/crates/jacquard-api/src/app_bsky/bookmark/get_bookmarks.rs +++ b/crates/jacquard-api/src/app_bsky/bookmark/get_bookmarks.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetBookmarks<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetBookmarks<'_> { + type Output = GetBookmarks<'static>; + fn into_static(self) -> Self::Output { + GetBookmarks { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,10 +37,21 @@ pub struct GetBookmarksOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for GetBookmarksOutput<'_> { + type Output = GetBookmarksOutput<'static>; + fn into_static(self) -> Self::Output { + GetBookmarksOutput { + bookmarks: self.bookmarks.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetBookmarks<'_> { const NSID: &'static str = "app.bsky.bookmark.getBookmarks"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetBookmarksOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/embed.rs b/crates/jacquard-api/src/app_bsky/embed.rs index deb6967d3..208abeda6 100644 --- a/crates/jacquard-api/src/app_bsky/embed.rs +++ b/crates/jacquard-api/src/app_bsky/embed.rs @@ -18,4 +18,15 @@ pub mod video; pub struct AspectRatio<'a> { pub height: i64, pub width: i64, +} + +impl jacquard_common::IntoStatic for AspectRatio<'_> { + type Output = AspectRatio<'static>; + fn into_static(self) -> Self::Output { + AspectRatio { + height: self.height.into_static(), + width: self.width.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/embed/external.rs b/crates/jacquard-api/src/app_bsky/embed/external.rs index 661f47220..94d993a47 100644 --- a/crates/jacquard-api/src/app_bsky/embed/external.rs +++ b/crates/jacquard-api/src/app_bsky/embed/external.rs @@ -20,6 +20,19 @@ pub struct External<'a> { pub uri: jacquard_common::types::string::Uri<'a>, } +impl jacquard_common::IntoStatic for External<'_> { + type Output = External<'static>; + fn into_static(self) -> Self::Output { + External { + description: self.description.into_static(), + thumb: self.thumb.into_static(), + title: self.title.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -29,6 +42,16 @@ pub struct ExternalRecord<'a> { pub external: crate::app_bsky::embed::external::External<'a>, } +impl jacquard_common::IntoStatic for ExternalRecord<'_> { + type Output = ExternalRecord<'static>; + fn into_static(self) -> Self::Output { + ExternalRecord { + external: self.external.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -37,6 +60,16 @@ pub struct View<'a> { pub external: crate::app_bsky::embed::external::ViewExternal<'a>, } +impl jacquard_common::IntoStatic for View<'_> { + type Output = View<'static>; + fn into_static(self) -> Self::Output { + View { + external: self.external.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -50,4 +83,17 @@ pub struct ViewExternal<'a> { pub title: jacquard_common::CowStr<'a>, #[serde(borrow)] pub uri: jacquard_common::types::string::Uri<'a>, +} + +impl jacquard_common::IntoStatic for ViewExternal<'_> { + type Output = ViewExternal<'static>; + fn into_static(self) -> Self::Output { + ViewExternal { + description: self.description.into_static(), + thumb: self.thumb.into_static(), + title: self.title.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/embed/images.rs b/crates/jacquard-api/src/app_bsky/embed/images.rs index c375968b6..d56cfe826 100644 --- a/crates/jacquard-api/src/app_bsky/embed/images.rs +++ b/crates/jacquard-api/src/app_bsky/embed/images.rs @@ -19,6 +19,18 @@ pub struct Image<'a> { pub image: jacquard_common::types::blob::Blob<'a>, } +impl jacquard_common::IntoStatic for Image<'_> { + type Output = Image<'static>; + fn into_static(self) -> Self::Output { + Image { + alt: self.alt.into_static(), + aspect_ratio: self.aspect_ratio.into_static(), + image: self.image.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -27,6 +39,16 @@ pub struct Images<'a> { pub images: Vec>, } +impl jacquard_common::IntoStatic for Images<'_> { + type Output = Images<'static>; + fn into_static(self) -> Self::Output { + Images { + images: self.images.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -35,6 +57,16 @@ pub struct View<'a> { pub images: Vec>, } +impl jacquard_common::IntoStatic for View<'_> { + type Output = View<'static>; + fn into_static(self) -> Self::Output { + View { + images: self.images.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -51,4 +83,17 @@ pub struct ViewImage<'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>, +} + +impl jacquard_common::IntoStatic for ViewImage<'_> { + type Output = ViewImage<'static>; + fn into_static(self) -> Self::Output { + ViewImage { + alt: self.alt.into_static(), + aspect_ratio: self.aspect_ratio.into_static(), + fullsize: self.fullsize.into_static(), + thumb: self.thumb.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/embed/record.rs b/crates/jacquard-api/src/app_bsky/embed/record.rs index 0fe69ae6b..92249e852 100644 --- a/crates/jacquard-api/src/app_bsky/embed/record.rs +++ b/crates/jacquard-api/src/app_bsky/embed/record.rs @@ -13,6 +13,16 @@ pub struct Record<'a> { pub record: crate::com_atproto::repo::strong_ref::StrongRef<'a>, } +impl jacquard_common::IntoStatic for Record<'_> { + type Output = Record<'static>; + fn into_static(self) -> Self::Output { + Record { + record: self.record.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -36,6 +46,37 @@ pub enum ViewRecordRecord<'a> { DefsStarterPackViewBasic(Box>), } +impl jacquard_common::IntoStatic for ViewRecordRecord<'_> { + type Output = ViewRecordRecord<'static>; + fn into_static(self) -> Self::Output { + match self { + ViewRecordRecord::DefsGeneratorView(v) => { + ViewRecordRecord::DefsGeneratorView(v.into_static()) + } + ViewRecordRecord::DefsListView(v) => { + ViewRecordRecord::DefsListView(v.into_static()) + } + ViewRecordRecord::DefsLabelerView(v) => { + ViewRecordRecord::DefsLabelerView(v.into_static()) + } + ViewRecordRecord::DefsStarterPackViewBasic(v) => { + ViewRecordRecord::DefsStarterPackViewBasic(v.into_static()) + } + ViewRecordRecord::Unknown(v) => ViewRecordRecord::Unknown(v.into_static()), + } + } +} + +impl jacquard_common::IntoStatic for View<'_> { + type Output = View<'static>; + fn into_static(self) -> Self::Output { + View { + record: self.record.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -47,6 +88,18 @@ pub struct ViewBlocked<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for ViewBlocked<'_> { + type Output = ViewBlocked<'static>; + fn into_static(self) -> Self::Output { + ViewBlocked { + author: self.author.into_static(), + blocked: self.blocked.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -56,6 +109,17 @@ pub struct ViewDetached<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for ViewDetached<'_> { + type Output = ViewDetached<'static>; + fn into_static(self) -> Self::Output { + ViewDetached { + detached: self.detached.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -65,6 +129,17 @@ pub struct ViewNotFound<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for ViewNotFound<'_> { + type Output = ViewNotFound<'static>; + fn into_static(self) -> Self::Output { + ViewNotFound { + not_found: self.not_found.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -93,4 +168,24 @@ pub struct ViewRecord<'a> { ///The record data itself. #[serde(borrow)] pub value: jacquard_common::types::value::Data<'a>, +} + +impl jacquard_common::IntoStatic for ViewRecord<'_> { + type Output = ViewRecord<'static>; + fn into_static(self) -> Self::Output { + ViewRecord { + author: self.author.into_static(), + cid: self.cid.into_static(), + embeds: self.embeds.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + like_count: self.like_count.into_static(), + quote_count: self.quote_count.into_static(), + reply_count: self.reply_count.into_static(), + repost_count: self.repost_count.into_static(), + uri: self.uri.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/embed/record_with_media.rs b/crates/jacquard-api/src/app_bsky/embed/record_with_media.rs index cee725a1b..2609cf2e8 100644 --- a/crates/jacquard-api/src/app_bsky/embed/record_with_media.rs +++ b/crates/jacquard-api/src/app_bsky/embed/record_with_media.rs @@ -28,6 +28,37 @@ pub enum RecordWithMediaRecordMedia<'a> { External(Box>), } +impl jacquard_common::IntoStatic for RecordWithMediaRecordMedia<'_> { + type Output = RecordWithMediaRecordMedia<'static>; + fn into_static(self) -> Self::Output { + match self { + RecordWithMediaRecordMedia::Images(v) => { + RecordWithMediaRecordMedia::Images(v.into_static()) + } + RecordWithMediaRecordMedia::Video(v) => { + RecordWithMediaRecordMedia::Video(v.into_static()) + } + RecordWithMediaRecordMedia::External(v) => { + RecordWithMediaRecordMedia::External(v.into_static()) + } + RecordWithMediaRecordMedia::Unknown(v) => { + RecordWithMediaRecordMedia::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for RecordWithMedia<'_> { + type Output = RecordWithMedia<'static>; + fn into_static(self) -> Self::Output { + RecordWithMedia { + media: self.media.into_static(), + record: self.record.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -49,4 +80,31 @@ pub enum ViewRecordMedia<'a> { VideoView(Box>), #[serde(rename = "app.bsky.embed.external#view")] ExternalView(Box>), +} + +impl jacquard_common::IntoStatic for ViewRecordMedia<'_> { + type Output = ViewRecordMedia<'static>; + fn into_static(self) -> Self::Output { + match self { + ViewRecordMedia::ImagesView(v) => { + ViewRecordMedia::ImagesView(v.into_static()) + } + ViewRecordMedia::VideoView(v) => ViewRecordMedia::VideoView(v.into_static()), + ViewRecordMedia::ExternalView(v) => { + ViewRecordMedia::ExternalView(v.into_static()) + } + ViewRecordMedia::Unknown(v) => ViewRecordMedia::Unknown(v.into_static()), + } + } +} + +impl jacquard_common::IntoStatic for View<'_> { + type Output = View<'static>; + fn into_static(self) -> Self::Output { + View { + media: self.media.into_static(), + record: self.record.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/embed/video.rs b/crates/jacquard-api/src/app_bsky/embed/video.rs index 810efbd16..62eb7364a 100644 --- a/crates/jacquard-api/src/app_bsky/embed/video.rs +++ b/crates/jacquard-api/src/app_bsky/embed/video.rs @@ -14,6 +14,17 @@ pub struct Caption<'a> { pub lang: jacquard_common::types::string::Language, } +impl jacquard_common::IntoStatic for Caption<'_> { + type Output = Caption<'static>; + fn into_static(self) -> Self::Output { + Caption { + file: self.file.into_static(), + lang: self.lang.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -33,6 +44,19 @@ pub struct Video<'a> { pub video: jacquard_common::types::blob::Blob<'a>, } +impl jacquard_common::IntoStatic for Video<'_> { + type Output = Video<'static>; + fn into_static(self) -> Self::Output { + Video { + alt: self.alt.into_static(), + aspect_ratio: self.aspect_ratio.into_static(), + captions: self.captions.into_static(), + video: self.video.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -50,4 +74,18 @@ pub struct View<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub thumbnail: std::option::Option>, +} + +impl jacquard_common::IntoStatic for View<'_> { + type Output = View<'static>; + fn into_static(self) -> Self::Output { + View { + alt: self.alt.into_static(), + aspect_ratio: self.aspect_ratio.into_static(), + cid: self.cid.into_static(), + playlist: self.playlist.into_static(), + thumbnail: self.thumbnail.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed.rs b/crates/jacquard-api/src/app_bsky/feed.rs index e3a0f5687..acd136a5a 100644 --- a/crates/jacquard-api/src/app_bsky/feed.rs +++ b/crates/jacquard-api/src/app_bsky/feed.rs @@ -41,6 +41,17 @@ pub struct BlockedAuthor<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for BlockedAuthor<'_> { + type Output = BlockedAuthor<'static>; + fn into_static(self) -> Self::Output { + BlockedAuthor { + did: self.did.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -52,6 +63,18 @@ pub struct BlockedPost<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for BlockedPost<'_> { + type Output = BlockedPost<'static>; + fn into_static(self) -> Self::Output { + BlockedPost { + author: self.author.into_static(), + blocked: self.blocked.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -79,6 +102,31 @@ pub struct FeedViewPost<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum FeedViewPostRecordReason<'a> {} +impl jacquard_common::IntoStatic for FeedViewPostRecordReason<'_> { + type Output = FeedViewPostRecordReason<'static>; + fn into_static(self) -> Self::Output { + match self { + FeedViewPostRecordReason::Unknown(v) => { + FeedViewPostRecordReason::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for FeedViewPost<'_> { + type Output = FeedViewPost<'static>; + fn into_static(self) -> Self::Output { + FeedViewPost { + feed_context: self.feed_context.into_static(), + post: self.post.into_static(), + reason: self.reason.into_static(), + reply: self.reply.into_static(), + req_id: self.req_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -120,6 +168,29 @@ pub struct GeneratorView<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for GeneratorView<'_> { + type Output = GeneratorView<'static>; + fn into_static(self) -> Self::Output { + GeneratorView { + accepts_interactions: self.accepts_interactions.into_static(), + avatar: self.avatar.into_static(), + cid: self.cid.into_static(), + content_mode: self.content_mode.into_static(), + creator: self.creator.into_static(), + description: self.description.into_static(), + description_facets: self.description_facets.into_static(), + did: self.did.into_static(), + display_name: self.display_name.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + like_count: self.like_count.into_static(), + uri: self.uri.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -129,6 +200,16 @@ pub struct GeneratorViewerState<'a> { pub like: std::option::Option>, } +impl jacquard_common::IntoStatic for GeneratorViewerState<'_> { + type Output = GeneratorViewerState<'static>; + fn into_static(self) -> Self::Output { + GeneratorViewerState { + like: self.like.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -149,6 +230,19 @@ pub struct Interaction<'a> { pub req_id: std::option::Option>, } +impl jacquard_common::IntoStatic for Interaction<'_> { + type Output = Interaction<'static>; + fn into_static(self) -> Self::Output { + Interaction { + event: self.event.into_static(), + feed_context: self.feed_context.into_static(), + item: self.item.into_static(), + req_id: self.req_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -158,6 +252,17 @@ pub struct NotFoundPost<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for NotFoundPost<'_> { + type Output = NotFoundPost<'static>; + fn into_static(self) -> Self::Output { + NotFoundPost { + not_found: self.not_found.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -212,10 +317,68 @@ pub enum PostViewRecordEmbed<'a> { RecordWithMediaView(Box>), } +impl jacquard_common::IntoStatic for PostViewRecordEmbed<'_> { + type Output = PostViewRecordEmbed<'static>; + fn into_static(self) -> Self::Output { + match self { + PostViewRecordEmbed::ImagesView(v) => { + PostViewRecordEmbed::ImagesView(v.into_static()) + } + PostViewRecordEmbed::VideoView(v) => { + PostViewRecordEmbed::VideoView(v.into_static()) + } + PostViewRecordEmbed::ExternalView(v) => { + PostViewRecordEmbed::ExternalView(v.into_static()) + } + PostViewRecordEmbed::RecordView(v) => { + PostViewRecordEmbed::RecordView(v.into_static()) + } + PostViewRecordEmbed::RecordWithMediaView(v) => { + PostViewRecordEmbed::RecordWithMediaView(v.into_static()) + } + PostViewRecordEmbed::Unknown(v) => { + PostViewRecordEmbed::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for PostView<'_> { + type Output = PostView<'static>; + fn into_static(self) -> Self::Output { + PostView { + author: self.author.into_static(), + bookmark_count: self.bookmark_count.into_static(), + cid: self.cid.into_static(), + embed: self.embed.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + like_count: self.like_count.into_static(), + quote_count: self.quote_count.into_static(), + record: self.record.into_static(), + reply_count: self.reply_count.into_static(), + repost_count: self.repost_count.into_static(), + threadgate: self.threadgate.into_static(), + uri: self.uri.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ReasonPin<'a> {} +impl jacquard_common::IntoStatic for ReasonPin<'_> { + type Output = ReasonPin<'static>; + fn into_static(self) -> Self::Output { + ReasonPin { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -231,6 +394,19 @@ pub struct ReasonRepost<'a> { pub uri: std::option::Option>, } +impl jacquard_common::IntoStatic for ReasonRepost<'_> { + type Output = ReasonRepost<'static>; + fn into_static(self) -> Self::Output { + ReasonRepost { + by: self.by.into_static(), + cid: self.cid.into_static(), + indexed_at: self.indexed_at.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -252,11 +428,45 @@ pub struct ReplyRef<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ReplyRefRecordParent<'a> {} +impl jacquard_common::IntoStatic for ReplyRefRecordParent<'_> { + type Output = ReplyRefRecordParent<'static>; + fn into_static(self) -> Self::Output { + match self { + ReplyRefRecordParent::Unknown(v) => { + ReplyRefRecordParent::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ReplyRefRecordRoot<'a> {} +impl jacquard_common::IntoStatic for ReplyRefRecordRoot<'_> { + type Output = ReplyRefRecordRoot<'static>; + fn into_static(self) -> Self::Output { + match self { + ReplyRefRecordRoot::Unknown(v) => { + ReplyRefRecordRoot::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for ReplyRef<'_> { + type Output = ReplyRef<'static>; + fn into_static(self) -> Self::Output { + ReplyRef { + grandparent_author: self.grandparent_author.into_static(), + parent: self.parent.into_static(), + root: self.root.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -277,10 +487,42 @@ pub struct SkeletonFeedPost<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum SkeletonFeedPostRecordReason<'a> {} +impl jacquard_common::IntoStatic for SkeletonFeedPostRecordReason<'_> { + type Output = SkeletonFeedPostRecordReason<'static>; + fn into_static(self) -> Self::Output { + match self { + SkeletonFeedPostRecordReason::Unknown(v) => { + SkeletonFeedPostRecordReason::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for SkeletonFeedPost<'_> { + type Output = SkeletonFeedPost<'static>; + fn into_static(self) -> Self::Output { + SkeletonFeedPost { + feed_context: self.feed_context.into_static(), + post: self.post.into_static(), + reason: self.reason.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct SkeletonReasonPin<'a> {} +impl jacquard_common::IntoStatic for SkeletonReasonPin<'_> { + type Output = SkeletonReasonPin<'static>; + fn into_static(self) -> Self::Output { + SkeletonReasonPin { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -289,6 +531,16 @@ pub struct SkeletonReasonRepost<'a> { pub repost: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for SkeletonReasonRepost<'_> { + type Output = SkeletonReasonRepost<'static>; + fn into_static(self) -> Self::Output { + SkeletonReasonRepost { + repost: self.repost.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -299,6 +551,16 @@ pub struct ThreadContext<'a> { pub root_author_like: std::option::Option>, } +impl jacquard_common::IntoStatic for ThreadContext<'_> { + type Output = ThreadContext<'static>; + fn into_static(self) -> Self::Output { + ThreadContext { + root_author_like: self.root_author_like.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -321,6 +583,30 @@ pub struct ThreadViewPost<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ThreadViewPostRecordParent<'a> {} +impl jacquard_common::IntoStatic for ThreadViewPostRecordParent<'_> { + type Output = ThreadViewPostRecordParent<'static>; + fn into_static(self) -> Self::Output { + match self { + ThreadViewPostRecordParent::Unknown(v) => { + ThreadViewPostRecordParent::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for ThreadViewPost<'_> { + type Output = ThreadViewPost<'static>; + fn into_static(self) -> Self::Output { + ThreadViewPost { + parent: self.parent.into_static(), + post: self.post.into_static(), + replies: self.replies.into_static(), + thread_context: self.thread_context.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -339,6 +625,19 @@ pub struct ThreadgateView<'a> { pub uri: std::option::Option>, } +impl jacquard_common::IntoStatic for ThreadgateView<'_> { + type Output = ThreadgateView<'static>; + fn into_static(self) -> Self::Output { + ThreadgateView { + cid: self.cid.into_static(), + lists: self.lists.into_static(), + record: self.record.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -360,4 +659,20 @@ pub struct ViewerState<'a> { pub repost: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub thread_muted: std::option::Option, +} + +impl jacquard_common::IntoStatic for ViewerState<'_> { + type Output = ViewerState<'static>; + fn into_static(self) -> Self::Output { + ViewerState { + bookmarked: self.bookmarked.into_static(), + embedding_disabled: self.embedding_disabled.into_static(), + like: self.like.into_static(), + pinned: self.pinned.into_static(), + reply_disabled: self.reply_disabled.into_static(), + repost: self.repost.into_static(), + thread_muted: self.thread_muted.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/describe_feed_generator.rs b/crates/jacquard-api/src/app_bsky/feed/describe_feed_generator.rs index 2eb68e3ca..b61bb7f1c 100644 --- a/crates/jacquard-api/src/app_bsky/feed/describe_feed_generator.rs +++ b/crates/jacquard-api/src/app_bsky/feed/describe_feed_generator.rs @@ -13,6 +13,16 @@ pub struct Feed<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for Feed<'_> { + type Output = Feed<'static>; + fn into_static(self) -> Self::Output { + Feed { + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -25,6 +35,17 @@ pub struct Links<'a> { pub terms_of_service: std::option::Option>, } +impl jacquard_common::IntoStatic for Links<'_> { + type Output = Links<'static>; + fn into_static(self) -> Self::Output { + Links { + privacy_policy: self.privacy_policy.into_static(), + terms_of_service: self.terms_of_service.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -38,6 +59,18 @@ pub struct DescribeFeedGeneratorOutput<'a> { pub links: std::option::Option>, } +impl jacquard_common::IntoStatic for DescribeFeedGeneratorOutput<'_> { + type Output = DescribeFeedGeneratorOutput<'static>; + fn into_static(self) -> Self::Output { + DescribeFeedGeneratorOutput { + did: self.did.into_static(), + feeds: self.feeds.into_static(), + links: self.links.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct DescribeFeedGenerator; @@ -46,5 +79,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DescribeFeedGenerator { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = DescribeFeedGeneratorOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/generator.rs b/crates/jacquard-api/src/app_bsky/feed/generator.rs index f506a6e95..aa47b668e 100644 --- a/crates/jacquard-api/src/app_bsky/feed/generator.rs +++ b/crates/jacquard-api/src/app_bsky/feed/generator.rs @@ -47,6 +47,38 @@ pub enum GeneratorRecordLabels<'a> { DefsSelfLabels(Box>), } +impl jacquard_common::IntoStatic for GeneratorRecordLabels<'_> { + type Output = GeneratorRecordLabels<'static>; + fn into_static(self) -> Self::Output { + match self { + GeneratorRecordLabels::DefsSelfLabels(v) => { + GeneratorRecordLabels::DefsSelfLabels(v.into_static()) + } + GeneratorRecordLabels::Unknown(v) => { + GeneratorRecordLabels::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::collection::Collection for Generator<'_> { const NSID: &'static str = "app.bsky.feed.generator"; +} + +impl jacquard_common::IntoStatic for Generator<'_> { + type Output = Generator<'static>; + fn into_static(self) -> Self::Output { + Generator { + accepts_interactions: self.accepts_interactions.into_static(), + avatar: self.avatar.into_static(), + content_mode: self.content_mode.into_static(), + created_at: self.created_at.into_static(), + description: self.description.into_static(), + description_facets: self.description_facets.into_static(), + did: self.did.into_static(), + display_name: self.display_name.into_static(), + labels: self.labels.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/get_actor_feeds.rs b/crates/jacquard-api/src/app_bsky/feed/get_actor_feeds.rs index 437320e20..68e733e12 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_actor_feeds.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_actor_feeds.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetActorFeeds<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct GetActorFeeds<'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, } -impl Default for GetActorFeeds<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetActorFeeds<'_> { + type Output = GetActorFeeds<'static>; + fn into_static(self) -> Self::Output { + GetActorFeeds { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -38,10 +40,21 @@ pub struct GetActorFeedsOutput<'a> { pub feeds: Vec>, } +impl jacquard_common::IntoStatic for GetActorFeedsOutput<'_> { + type Output = GetActorFeedsOutput<'static>; + fn into_static(self) -> Self::Output { + GetActorFeedsOutput { + cursor: self.cursor.into_static(), + feeds: self.feeds.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetActorFeeds<'_> { const NSID: &'static str = "app.bsky.feed.getActorFeeds"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetActorFeedsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/get_actor_likes.rs b/crates/jacquard-api/src/app_bsky/feed/get_actor_likes.rs index e947ccdc0..1579b0b36 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_actor_likes.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_actor_likes.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetActorLikes<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct GetActorLikes<'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, } -impl Default for GetActorLikes<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetActorLikes<'_> { + type Output = GetActorLikes<'static>; + fn into_static(self) -> Self::Output { + GetActorLikes { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -38,6 +40,17 @@ pub struct GetActorLikesOutput<'a> { pub feed: Vec>, } +impl jacquard_common::IntoStatic for GetActorLikesOutput<'_> { + type Output = GetActorLikesOutput<'static>; + fn into_static(self) -> Self::Output { + GetActorLikesOutput { + cursor: self.cursor.into_static(), + feed: self.feed.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -80,6 +93,23 @@ impl std::fmt::Display for GetActorLikesError<'_> { } } +impl jacquard_common::IntoStatic for GetActorLikesError<'_> { + type Output = GetActorLikesError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetActorLikesError::BlockedActor(v) => { + GetActorLikesError::BlockedActor(v.into_static()) + } + GetActorLikesError::BlockedByActor(v) => { + GetActorLikesError::BlockedByActor(v.into_static()) + } + GetActorLikesError::Unknown(v) => { + GetActorLikesError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetActorLikes<'_> { const NSID: &'static str = "app.bsky.feed.getActorLikes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/feed/get_author_feed.rs b/crates/jacquard-api/src/app_bsky/feed/get_author_feed.rs index f406c0954..8f7cb5895 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_author_feed.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_author_feed.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetAuthorFeed<'a> { #[serde(borrow)] @@ -13,23 +13,27 @@ pub struct GetAuthorFeed<'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, } -impl Default for GetAuthorFeed<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - filter: Some(jacquard_common::CowStr::from("posts_with_replies")), - include_pins: Some(false), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetAuthorFeed<'_> { + type Output = GetAuthorFeed<'static>; + fn into_static(self) -> Self::Output { + GetAuthorFeed { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + filter: self.filter.into_static(), + include_pins: self.include_pins.into_static(), + limit: self.limit.into_static(), } } } @@ -45,6 +49,17 @@ pub struct GetAuthorFeedOutput<'a> { pub feed: Vec>, } +impl jacquard_common::IntoStatic for GetAuthorFeedOutput<'_> { + type Output = GetAuthorFeedOutput<'static>; + fn into_static(self) -> Self::Output { + GetAuthorFeedOutput { + cursor: self.cursor.into_static(), + feed: self.feed.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -87,6 +102,23 @@ impl std::fmt::Display for GetAuthorFeedError<'_> { } } +impl jacquard_common::IntoStatic for GetAuthorFeedError<'_> { + type Output = GetAuthorFeedError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetAuthorFeedError::BlockedActor(v) => { + GetAuthorFeedError::BlockedActor(v.into_static()) + } + GetAuthorFeedError::BlockedByActor(v) => { + GetAuthorFeedError::BlockedByActor(v.into_static()) + } + GetAuthorFeedError::Unknown(v) => { + GetAuthorFeedError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetAuthorFeed<'_> { const NSID: &'static str = "app.bsky.feed.getAuthorFeed"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/feed/get_feed.rs b/crates/jacquard-api/src/app_bsky/feed/get_feed.rs index b682a201a..2c84ca44e 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_feed.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_feed.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetFeed<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -13,16 +13,18 @@ pub struct GetFeed<'a> { 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, } -impl Default for GetFeed<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - feed: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetFeed<'_> { + type Output = GetFeed<'static>; + fn into_static(self) -> Self::Output { + GetFeed { + cursor: self.cursor.into_static(), + feed: self.feed.into_static(), + limit: self.limit.into_static(), } } } @@ -38,6 +40,17 @@ pub struct GetFeedOutput<'a> { pub feed: Vec>, } +impl jacquard_common::IntoStatic for GetFeedOutput<'_> { + type Output = GetFeedOutput<'static>; + fn into_static(self) -> Self::Output { + GetFeedOutput { + cursor: self.cursor.into_static(), + feed: self.feed.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -71,6 +84,16 @@ impl std::fmt::Display for GetFeedError<'_> { } } +impl jacquard_common::IntoStatic for GetFeedError<'_> { + type Output = GetFeedError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetFeedError::UnknownFeed(v) => GetFeedError::UnknownFeed(v.into_static()), + GetFeedError::Unknown(v) => GetFeedError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetFeed<'_> { const NSID: &'static str = "app.bsky.feed.getFeed"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/feed/get_feed_generator.rs b/crates/jacquard-api/src/app_bsky/feed/get_feed_generator.rs index 1791fc3de..f962d4efa 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_feed_generator.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_feed_generator.rs @@ -12,6 +12,15 @@ pub struct GetFeedGenerator<'a> { pub feed: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for GetFeedGenerator<'_> { + type Output = GetFeedGenerator<'static>; + fn into_static(self) -> Self::Output { + GetFeedGenerator { + feed: self.feed.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,10 +33,22 @@ pub struct GetFeedGeneratorOutput<'a> { pub view: crate::app_bsky::feed::GeneratorView<'a>, } +impl jacquard_common::IntoStatic for GetFeedGeneratorOutput<'_> { + type Output = GetFeedGeneratorOutput<'static>; + fn into_static(self) -> Self::Output { + GetFeedGeneratorOutput { + is_online: self.is_online.into_static(), + is_valid: self.is_valid.into_static(), + view: self.view.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetFeedGenerator<'_> { const NSID: &'static str = "app.bsky.feed.getFeedGenerator"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetFeedGeneratorOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/get_feed_generators.rs b/crates/jacquard-api/src/app_bsky/feed/get_feed_generators.rs index 5eb012474..c344f5e1e 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_feed_generators.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_feed_generators.rs @@ -12,6 +12,15 @@ pub struct GetFeedGenerators<'a> { pub feeds: Vec>, } +impl jacquard_common::IntoStatic for GetFeedGenerators<'_> { + type Output = GetFeedGenerators<'static>; + fn into_static(self) -> Self::Output { + GetFeedGenerators { + feeds: self.feeds.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetFeedGeneratorsOutput<'a> { pub feeds: Vec>, } +impl jacquard_common::IntoStatic for GetFeedGeneratorsOutput<'_> { + type Output = GetFeedGeneratorsOutput<'static>; + fn into_static(self) -> Self::Output { + GetFeedGeneratorsOutput { + feeds: self.feeds.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetFeedGenerators<'_> { const NSID: &'static str = "app.bsky.feed.getFeedGenerators"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetFeedGeneratorsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/get_feed_skeleton.rs b/crates/jacquard-api/src/app_bsky/feed/get_feed_skeleton.rs index 54d3d2956..593e6c09f 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_feed_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_feed_skeleton.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetFeedSkeleton<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -13,16 +13,18 @@ pub struct GetFeedSkeleton<'a> { 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, } -impl Default for GetFeedSkeleton<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - feed: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetFeedSkeleton<'_> { + type Output = GetFeedSkeleton<'static>; + fn into_static(self) -> Self::Output { + GetFeedSkeleton { + cursor: self.cursor.into_static(), + feed: self.feed.into_static(), + limit: self.limit.into_static(), } } } @@ -42,6 +44,18 @@ pub struct GetFeedSkeletonOutput<'a> { pub req_id: std::option::Option>, } +impl jacquard_common::IntoStatic for GetFeedSkeletonOutput<'_> { + type Output = GetFeedSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + GetFeedSkeletonOutput { + cursor: self.cursor.into_static(), + feed: self.feed.into_static(), + req_id: self.req_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -75,6 +89,20 @@ impl std::fmt::Display for GetFeedSkeletonError<'_> { } } +impl jacquard_common::IntoStatic for GetFeedSkeletonError<'_> { + type Output = GetFeedSkeletonError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetFeedSkeletonError::UnknownFeed(v) => { + GetFeedSkeletonError::UnknownFeed(v.into_static()) + } + GetFeedSkeletonError::Unknown(v) => { + GetFeedSkeletonError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetFeedSkeleton<'_> { const NSID: &'static str = "app.bsky.feed.getFeedSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/feed/get_likes.rs b/crates/jacquard-api/src/app_bsky/feed/get_likes.rs index d823f269a..64c0e0743 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_likes.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_likes.rs @@ -15,7 +15,19 @@ pub struct Like<'a> { pub indexed_at: jacquard_common::types::string::Datetime, } -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Default)] +impl jacquard_common::IntoStatic for Like<'_> { + type Output = Like<'static>; + fn into_static(self) -> Self::Output { + Like { + actor: self.actor.into_static(), + created_at: self.created_at.into_static(), + indexed_at: self.indexed_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetLikes<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -24,19 +36,21 @@ pub struct GetLikes<'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 uri: jacquard_common::types::string::AtUri<'a>, } -impl Default for GetLikes<'_> { - fn default() -> Self { - Self { - cid: Default::default(), - cursor: Default::default(), - limit: Some(50i64), - uri: Default::default(), +impl jacquard_common::IntoStatic for GetLikes<'_> { + type Output = GetLikes<'static>; + fn into_static(self) -> Self::Output { + GetLikes { + cid: self.cid.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + uri: self.uri.into_static(), } } } @@ -57,10 +71,23 @@ pub struct GetLikesOutput<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for GetLikesOutput<'_> { + type Output = GetLikesOutput<'static>; + fn into_static(self) -> Self::Output { + GetLikesOutput { + cid: self.cid.into_static(), + cursor: self.cursor.into_static(), + likes: self.likes.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetLikes<'_> { const NSID: &'static str = "app.bsky.feed.getLikes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetLikesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/get_list_feed.rs b/crates/jacquard-api/src/app_bsky/feed/get_list_feed.rs index 08d10daf1..f155b8cf4 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_list_feed.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_list_feed.rs @@ -5,24 +5,26 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for GetListFeed<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - list: Default::default(), +impl jacquard_common::IntoStatic for GetListFeed<'_> { + type Output = GetListFeed<'static>; + fn into_static(self) -> Self::Output { + GetListFeed { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + list: self.list.into_static(), } } } @@ -38,6 +40,17 @@ pub struct GetListFeedOutput<'a> { pub feed: Vec>, } +impl jacquard_common::IntoStatic for GetListFeedOutput<'_> { + type Output = GetListFeedOutput<'static>; + fn into_static(self) -> Self::Output { + GetListFeedOutput { + cursor: self.cursor.into_static(), + feed: self.feed.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -71,6 +84,18 @@ impl std::fmt::Display for GetListFeedError<'_> { } } +impl jacquard_common::IntoStatic for GetListFeedError<'_> { + type Output = GetListFeedError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetListFeedError::UnknownList(v) => { + GetListFeedError::UnknownList(v.into_static()) + } + GetListFeedError::Unknown(v) => GetListFeedError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetListFeed<'_> { const NSID: &'static str = "app.bsky.feed.getListFeed"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/feed/get_post_thread.rs b/crates/jacquard-api/src/app_bsky/feed/get_post_thread.rs index 32def8894..f29087841 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_post_thread.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_post_thread.rs @@ -5,23 +5,26 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for GetPostThread<'_> { - fn default() -> Self { - Self { - depth: Some(6i64), - parent_height: Some(80i64), - uri: Default::default(), +impl jacquard_common::IntoStatic for GetPostThread<'_> { + type Output = GetPostThread<'static>; + fn into_static(self) -> Self::Output { + GetPostThread { + depth: self.depth.into_static(), + parent_height: self.parent_height.into_static(), + uri: self.uri.into_static(), } } } @@ -50,6 +53,37 @@ pub enum GetPostThreadOutputRecordThread<'a> { DefsBlockedPost(Box>), } +impl jacquard_common::IntoStatic for GetPostThreadOutputRecordThread<'_> { + type Output = GetPostThreadOutputRecordThread<'static>; + fn into_static(self) -> Self::Output { + match self { + GetPostThreadOutputRecordThread::DefsThreadViewPost(v) => { + GetPostThreadOutputRecordThread::DefsThreadViewPost(v.into_static()) + } + GetPostThreadOutputRecordThread::DefsNotFoundPost(v) => { + GetPostThreadOutputRecordThread::DefsNotFoundPost(v.into_static()) + } + GetPostThreadOutputRecordThread::DefsBlockedPost(v) => { + GetPostThreadOutputRecordThread::DefsBlockedPost(v.into_static()) + } + GetPostThreadOutputRecordThread::Unknown(v) => { + GetPostThreadOutputRecordThread::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for GetPostThreadOutput<'_> { + type Output = GetPostThreadOutput<'static>; + fn into_static(self) -> Self::Output { + GetPostThreadOutput { + thread: self.thread.into_static(), + threadgate: self.threadgate.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -83,6 +117,20 @@ impl std::fmt::Display for GetPostThreadError<'_> { } } +impl jacquard_common::IntoStatic for GetPostThreadError<'_> { + type Output = GetPostThreadError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetPostThreadError::NotFound(v) => { + GetPostThreadError::NotFound(v.into_static()) + } + GetPostThreadError::Unknown(v) => { + GetPostThreadError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetPostThread<'_> { const NSID: &'static str = "app.bsky.feed.getPostThread"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/feed/get_posts.rs b/crates/jacquard-api/src/app_bsky/feed/get_posts.rs index bca27f344..0e1de0059 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_posts.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_posts.rs @@ -12,6 +12,15 @@ pub struct GetPosts<'a> { pub uris: Vec>, } +impl jacquard_common::IntoStatic for GetPosts<'_> { + type Output = GetPosts<'static>; + fn into_static(self) -> Self::Output { + GetPosts { + uris: self.uris.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetPostsOutput<'a> { pub posts: Vec>, } +impl jacquard_common::IntoStatic for GetPostsOutput<'_> { + type Output = GetPostsOutput<'static>; + fn into_static(self) -> Self::Output { + GetPostsOutput { + posts: self.posts.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetPosts<'_> { const NSID: &'static str = "app.bsky.feed.getPosts"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetPostsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/get_quotes.rs b/crates/jacquard-api/src/app_bsky/feed/get_quotes.rs index fdeb5a818..5b3a5592d 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_quotes.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_quotes.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetQuotes<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -14,19 +14,21 @@ pub struct GetQuotes<'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 uri: jacquard_common::types::string::AtUri<'a>, } -impl Default for GetQuotes<'_> { - fn default() -> Self { - Self { - cid: Default::default(), - cursor: Default::default(), - limit: Some(50i64), - uri: Default::default(), +impl jacquard_common::IntoStatic for GetQuotes<'_> { + type Output = GetQuotes<'static>; + fn into_static(self) -> Self::Output { + GetQuotes { + cid: self.cid.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + uri: self.uri.into_static(), } } } @@ -47,10 +49,23 @@ pub struct GetQuotesOutput<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for GetQuotesOutput<'_> { + type Output = GetQuotesOutput<'static>; + fn into_static(self) -> Self::Output { + GetQuotesOutput { + cid: self.cid.into_static(), + cursor: self.cursor.into_static(), + posts: self.posts.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetQuotes<'_> { const NSID: &'static str = "app.bsky.feed.getQuotes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetQuotesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/get_reposted_by.rs b/crates/jacquard-api/src/app_bsky/feed/get_reposted_by.rs index 99935211b..4f1da3c73 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_reposted_by.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_reposted_by.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetRepostedBy<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -14,19 +14,21 @@ pub struct GetRepostedBy<'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 uri: jacquard_common::types::string::AtUri<'a>, } -impl Default for GetRepostedBy<'_> { - fn default() -> Self { - Self { - cid: Default::default(), - cursor: Default::default(), - limit: Some(50i64), - uri: Default::default(), +impl jacquard_common::IntoStatic for GetRepostedBy<'_> { + type Output = GetRepostedBy<'static>; + fn into_static(self) -> Self::Output { + GetRepostedBy { + cid: self.cid.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + uri: self.uri.into_static(), } } } @@ -47,10 +49,23 @@ pub struct GetRepostedByOutput<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for GetRepostedByOutput<'_> { + type Output = GetRepostedByOutput<'static>; + fn into_static(self) -> Self::Output { + GetRepostedByOutput { + cid: self.cid.into_static(), + cursor: self.cursor.into_static(), + reposted_by: self.reposted_by.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRepostedBy<'_> { const NSID: &'static str = "app.bsky.feed.getRepostedBy"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetRepostedByOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/get_suggested_feeds.rs b/crates/jacquard-api/src/app_bsky/feed/get_suggested_feeds.rs index b0f4cdb2f..3035eef61 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_suggested_feeds.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_suggested_feeds.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetSuggestedFeeds<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetSuggestedFeeds<'_> { + type Output = GetSuggestedFeeds<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedFeeds { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,10 +37,22 @@ pub struct GetSuggestedFeedsOutput<'a> { pub feeds: Vec>, } +impl jacquard_common::IntoStatic for GetSuggestedFeedsOutput<'_> { + type Output = GetSuggestedFeedsOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedFeedsOutput { + cursor: self.cursor.into_static(), + feeds: self.feeds.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestedFeeds<'_> { const NSID: &'static str = "app.bsky.feed.getSuggestedFeeds"; - const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; + const METHOD: jacquard_common::types::xrpc::XrpcMethod = + jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestedFeedsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; -} \ No newline at end of file + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; +} diff --git a/crates/jacquard-api/src/app_bsky/feed/get_timeline.rs b/crates/jacquard-api/src/app_bsky/feed/get_timeline.rs index bb8daefe3..2526d6322 100644 --- a/crates/jacquard-api/src/app_bsky/feed/get_timeline.rs +++ b/crates/jacquard-api/src/app_bsky/feed/get_timeline.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetTimeline<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -14,16 +14,18 @@ pub struct GetTimeline<'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, } -impl Default for GetTimeline<'_> { - fn default() -> Self { - Self { - algorithm: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetTimeline<'_> { + type Output = GetTimeline<'static>; + fn into_static(self) -> Self::Output { + GetTimeline { + algorithm: self.algorithm.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -39,10 +41,21 @@ pub struct GetTimelineOutput<'a> { pub feed: Vec>, } +impl jacquard_common::IntoStatic for GetTimelineOutput<'_> { + type Output = GetTimelineOutput<'static>; + fn into_static(self) -> Self::Output { + GetTimelineOutput { + cursor: self.cursor.into_static(), + feed: self.feed.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetTimeline<'_> { const NSID: &'static str = "app.bsky.feed.getTimeline"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetTimelineOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/like.rs b/crates/jacquard-api/src/app_bsky/feed/like.rs index aeb9ea062..6abd2c9ad 100644 --- a/crates/jacquard-api/src/app_bsky/feed/like.rs +++ b/crates/jacquard-api/src/app_bsky/feed/like.rs @@ -20,4 +20,16 @@ pub struct Like<'a> { impl jacquard_common::types::collection::Collection for Like<'_> { const NSID: &'static str = "app.bsky.feed.like"; +} + +impl jacquard_common::IntoStatic for Like<'_> { + type Output = Like<'static>; + fn into_static(self) -> Self::Output { + Like { + created_at: self.created_at.into_static(), + subject: self.subject.into_static(), + via: self.via.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/post.rs b/crates/jacquard-api/src/app_bsky/feed/post.rs index 3da3319a3..6a688528c 100644 --- a/crates/jacquard-api/src/app_bsky/feed/post.rs +++ b/crates/jacquard-api/src/app_bsky/feed/post.rs @@ -19,6 +19,18 @@ pub struct Entity<'a> { pub value: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for Entity<'_> { + type Output = Entity<'static>; + fn into_static(self) -> Self::Output { + Entity { + index: self.index.into_static(), + r#type: self.r#type.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Record containing a Bluesky post. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -73,6 +85,22 @@ pub enum PostRecordEmbed<'a> { RecordWithMedia(Box>), } +impl jacquard_common::IntoStatic for PostRecordEmbed<'_> { + type Output = PostRecordEmbed<'static>; + fn into_static(self) -> Self::Output { + match self { + PostRecordEmbed::Images(v) => PostRecordEmbed::Images(v.into_static()), + PostRecordEmbed::Video(v) => PostRecordEmbed::Video(v.into_static()), + PostRecordEmbed::External(v) => PostRecordEmbed::External(v.into_static()), + PostRecordEmbed::Record(v) => PostRecordEmbed::Record(v.into_static()), + PostRecordEmbed::RecordWithMedia(v) => { + PostRecordEmbed::RecordWithMedia(v.into_static()) + } + PostRecordEmbed::Unknown(v) => PostRecordEmbed::Unknown(v.into_static()), + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] @@ -82,10 +110,40 @@ pub enum PostRecordLabels<'a> { DefsSelfLabels(Box>), } +impl jacquard_common::IntoStatic for PostRecordLabels<'_> { + type Output = PostRecordLabels<'static>; + fn into_static(self) -> Self::Output { + match self { + PostRecordLabels::DefsSelfLabels(v) => { + PostRecordLabels::DefsSelfLabels(v.into_static()) + } + PostRecordLabels::Unknown(v) => PostRecordLabels::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::collection::Collection for Post<'_> { const NSID: &'static str = "app.bsky.feed.post"; } +impl jacquard_common::IntoStatic for Post<'_> { + type Output = Post<'static>; + fn into_static(self) -> Self::Output { + Post { + created_at: self.created_at.into_static(), + embed: self.embed.into_static(), + entities: self.entities.into_static(), + facets: self.facets.into_static(), + labels: self.labels.into_static(), + langs: self.langs.into_static(), + reply: self.reply.into_static(), + tags: self.tags.into_static(), + text: self.text.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -96,6 +154,17 @@ pub struct ReplyRef<'a> { pub root: crate::com_atproto::repo::strong_ref::StrongRef<'a>, } +impl jacquard_common::IntoStatic for ReplyRef<'_> { + type Output = ReplyRef<'static>; + fn into_static(self) -> Self::Output { + ReplyRef { + parent: self.parent.into_static(), + root: self.root.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -103,4 +172,15 @@ pub struct ReplyRef<'a> { pub struct TextSlice<'a> { pub end: i64, pub start: i64, +} + +impl jacquard_common::IntoStatic for TextSlice<'_> { + type Output = TextSlice<'static>; + fn into_static(self) -> Self::Output { + TextSlice { + end: self.end.into_static(), + start: self.start.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/postgate.rs b/crates/jacquard-api/src/app_bsky/feed/postgate.rs index f8ce042ef..4ae59b631 100644 --- a/crates/jacquard-api/src/app_bsky/feed/postgate.rs +++ b/crates/jacquard-api/src/app_bsky/feed/postgate.rs @@ -10,6 +10,15 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct DisableRule<'a> {} +impl jacquard_common::IntoStatic for DisableRule<'_> { + type Output = DisableRule<'static>; + fn into_static(self) -> Self::Output { + DisableRule { + extra_data: self.extra_data.into_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. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -35,4 +44,17 @@ pub struct Postgate<'a> { impl jacquard_common::types::collection::Collection for Postgate<'_> { const NSID: &'static str = "app.bsky.feed.postgate"; +} + +impl jacquard_common::IntoStatic for Postgate<'_> { + type Output = Postgate<'static>; + fn into_static(self) -> Self::Output { + Postgate { + created_at: self.created_at.into_static(), + detached_embedding_uris: self.detached_embedding_uris.into_static(), + embedding_rules: self.embedding_rules.into_static(), + post: self.post.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/repost.rs b/crates/jacquard-api/src/app_bsky/feed/repost.rs index e6cb34e34..181325e14 100644 --- a/crates/jacquard-api/src/app_bsky/feed/repost.rs +++ b/crates/jacquard-api/src/app_bsky/feed/repost.rs @@ -20,4 +20,16 @@ pub struct Repost<'a> { impl jacquard_common::types::collection::Collection for Repost<'_> { const NSID: &'static str = "app.bsky.feed.repost"; +} + +impl jacquard_common::IntoStatic for Repost<'_> { + type Output = Repost<'static>; + fn into_static(self) -> Self::Output { + Repost { + created_at: self.created_at.into_static(), + subject: self.subject.into_static(), + via: self.via.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/search_posts.rs b/crates/jacquard-api/src/app_bsky/feed/search_posts.rs index 66aada845..b5ee905e1 100644 --- a/crates/jacquard-api/src/app_bsky/feed/search_posts.rs +++ b/crates/jacquard-api/src/app_bsky/feed/search_posts.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct SearchPosts<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -19,6 +19,7 @@ pub struct SearchPosts<'a> { 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")] @@ -29,6 +30,7 @@ pub struct SearchPosts<'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>, @@ -43,21 +45,22 @@ pub struct SearchPosts<'a> { pub url: std::option::Option>, } -impl Default for SearchPosts<'_> { - fn default() -> Self { - Self { - author: Default::default(), - cursor: Default::default(), - domain: Default::default(), - lang: Default::default(), - limit: Some(25i64), - mentions: Default::default(), - q: Default::default(), - since: Default::default(), - sort: Some(jacquard_common::CowStr::from("latest")), - tag: Default::default(), - until: Default::default(), - url: Default::default(), +impl jacquard_common::IntoStatic for SearchPosts<'_> { + type Output = SearchPosts<'static>; + fn into_static(self) -> Self::Output { + SearchPosts { + author: self.author.into_static(), + cursor: self.cursor.into_static(), + domain: self.domain.into_static(), + lang: self.lang.into_static(), + limit: self.limit.into_static(), + mentions: self.mentions.into_static(), + q: self.q.into_static(), + since: self.since.into_static(), + sort: self.sort.into_static(), + tag: self.tag.into_static(), + until: self.until.into_static(), + url: self.url.into_static(), } } } @@ -76,6 +79,18 @@ pub struct SearchPostsOutput<'a> { pub posts: Vec>, } +impl jacquard_common::IntoStatic for SearchPostsOutput<'_> { + type Output = SearchPostsOutput<'static>; + fn into_static(self) -> Self::Output { + SearchPostsOutput { + cursor: self.cursor.into_static(), + hits_total: self.hits_total.into_static(), + posts: self.posts.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -109,6 +124,18 @@ impl std::fmt::Display for SearchPostsError<'_> { } } +impl jacquard_common::IntoStatic for SearchPostsError<'_> { + type Output = SearchPostsError<'static>; + fn into_static(self) -> Self::Output { + match self { + SearchPostsError::BadQueryString(v) => { + SearchPostsError::BadQueryString(v.into_static()) + } + SearchPostsError::Unknown(v) => SearchPostsError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchPosts<'_> { const NSID: &'static str = "app.bsky.feed.searchPosts"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/feed/send_interactions.rs b/crates/jacquard-api/src/app_bsky/feed/send_interactions.rs index 14b0c7178..91c2f9720 100644 --- a/crates/jacquard-api/src/app_bsky/feed/send_interactions.rs +++ b/crates/jacquard-api/src/app_bsky/feed/send_interactions.rs @@ -13,10 +13,29 @@ pub struct SendInteractions<'a> { pub interactions: Vec>, } +impl jacquard_common::IntoStatic for SendInteractions<'_> { + type Output = SendInteractions<'static>; + fn into_static(self) -> Self::Output { + SendInteractions { + interactions: self.interactions.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct SendInteractionsOutput<'a> {} +impl jacquard_common::IntoStatic for SendInteractionsOutput<'_> { + type Output = SendInteractionsOutput<'static>; + fn into_static(self) -> Self::Output { + SendInteractionsOutput { + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SendInteractions<'_> { const NSID: &'static str = "app.bsky.feed.sendInteractions"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +43,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for SendInteractions<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SendInteractionsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/feed/threadgate.rs b/crates/jacquard-api/src/app_bsky/feed/threadgate.rs index f6acb2ff3..94480480c 100644 --- a/crates/jacquard-api/src/app_bsky/feed/threadgate.rs +++ b/crates/jacquard-api/src/app_bsky/feed/threadgate.rs @@ -10,11 +10,29 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct FollowerRule<'a> {} +impl jacquard_common::IntoStatic for FollowerRule<'_> { + type Output = FollowerRule<'static>; + fn into_static(self) -> Self::Output { + FollowerRule { + extra_data: self.extra_data.into_static(), + } + } +} + ///Allow replies from actors you follow. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct FollowingRule<'a> {} +impl jacquard_common::IntoStatic for FollowingRule<'_> { + type Output = FollowingRule<'static>; + fn into_static(self) -> Self::Output { + FollowingRule { + extra_data: self.extra_data.into_static(), + } + } +} + ///Allow replies from actors on a list. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -24,6 +42,16 @@ pub struct ListRule<'a> { pub list: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for ListRule<'_> { + type Output = ListRule<'static>; + fn into_static(self) -> Self::Output { + ListRule { + list: self.list.into_static(), + extra_data: self.extra_data.into_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. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -49,8 +77,29 @@ impl jacquard_common::types::collection::Collection for Threadgate<'_> { const NSID: &'static str = "app.bsky.feed.threadgate"; } +impl jacquard_common::IntoStatic for Threadgate<'_> { + type Output = Threadgate<'static>; + fn into_static(self) -> Self::Output { + Threadgate { + allow: self.allow.into_static(), + created_at: self.created_at.into_static(), + hidden_replies: self.hidden_replies.into_static(), + post: self.post.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Allow replies from actors mentioned in your post. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct MentionRule<'a> {} \ No newline at end of file +pub struct MentionRule<'a> {} +impl jacquard_common::IntoStatic for MentionRule<'_> { + type Output = MentionRule<'static>; + fn into_static(self) -> Self::Output { + MentionRule { + extra_data: self.extra_data.into_static(), + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph.rs b/crates/jacquard-api/src/app_bsky/graph.rs index e88213036..4f43d1a74 100644 --- a/crates/jacquard-api/src/app_bsky/graph.rs +++ b/crates/jacquard-api/src/app_bsky/graph.rs @@ -46,6 +46,17 @@ pub struct ListItemView<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for ListItemView<'_> { + type Output = ListItemView<'static>; + fn into_static(self) -> Self::Output { + ListItemView { + subject: self.subject.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ListPurpose<'a> { AppBskyGraphDefsModlist, @@ -115,6 +126,22 @@ where } } +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)] #[serde(rename_all = "camelCase")] @@ -151,6 +178,27 @@ pub struct ListView<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for ListView<'_> { + type Output = ListView<'static>; + fn into_static(self) -> Self::Output { + ListView { + avatar: self.avatar.into_static(), + cid: self.cid.into_static(), + creator: self.creator.into_static(), + description: self.description.into_static(), + description_facets: self.description_facets.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + list_item_count: self.list_item_count.into_static(), + name: self.name.into_static(), + purpose: self.purpose.into_static(), + uri: self.uri.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -178,6 +226,24 @@ pub struct ListViewBasic<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for ListViewBasic<'_> { + type Output = ListViewBasic<'static>; + fn into_static(self) -> Self::Output { + ListViewBasic { + avatar: self.avatar.into_static(), + cid: self.cid.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + list_item_count: self.list_item_count.into_static(), + name: self.name.into_static(), + purpose: self.purpose.into_static(), + uri: self.uri.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -189,6 +255,17 @@ pub struct ListViewerState<'a> { pub muted: std::option::Option, } +impl jacquard_common::IntoStatic for ListViewerState<'_> { + type Output = ListViewerState<'static>; + fn into_static(self) -> Self::Output { + ListViewerState { + blocked: self.blocked.into_static(), + muted: self.muted.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///indicates that a handle or DID could not be resolved #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -199,6 +276,17 @@ pub struct NotFoundActor<'a> { pub not_found: bool, } +impl jacquard_common::IntoStatic for NotFoundActor<'_> { + type Output = NotFoundActor<'static>; + fn into_static(self) -> Self::Output { + NotFoundActor { + actor: self.actor.into_static(), + not_found: self.not_found.into_static(), + extra_data: self.extra_data.into_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) #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -216,6 +304,18 @@ pub struct Relationship<'a> { pub following: std::option::Option>, } +impl jacquard_common::IntoStatic for Relationship<'_> { + type Output = Relationship<'static>; + fn into_static(self) -> Self::Output { + Relationship { + did: self.did.into_static(), + followed_by: self.followed_by.into_static(), + following: self.following.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -249,6 +349,26 @@ pub struct StarterPackView<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for StarterPackView<'_> { + type Output = StarterPackView<'static>; + fn into_static(self) -> Self::Output { + StarterPackView { + cid: self.cid.into_static(), + creator: self.creator.into_static(), + feeds: self.feeds.into_static(), + indexed_at: self.indexed_at.into_static(), + joined_all_time_count: self.joined_all_time_count.into_static(), + joined_week_count: self.joined_week_count.into_static(), + labels: self.labels.into_static(), + list: self.list.into_static(), + list_items_sample: self.list_items_sample.into_static(), + record: self.record.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -271,4 +391,22 @@ pub struct StarterPackViewBasic<'a> { pub record: jacquard_common::types::value::Data<'a>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, +} + +impl jacquard_common::IntoStatic for StarterPackViewBasic<'_> { + type Output = StarterPackViewBasic<'static>; + fn into_static(self) -> Self::Output { + StarterPackViewBasic { + cid: self.cid.into_static(), + creator: self.creator.into_static(), + indexed_at: self.indexed_at.into_static(), + joined_all_time_count: self.joined_all_time_count.into_static(), + joined_week_count: self.joined_week_count.into_static(), + labels: self.labels.into_static(), + list_item_count: self.list_item_count.into_static(), + record: self.record.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/block.rs b/crates/jacquard-api/src/app_bsky/graph/block.rs index de65c7402..179b67d66 100644 --- a/crates/jacquard-api/src/app_bsky/graph/block.rs +++ b/crates/jacquard-api/src/app_bsky/graph/block.rs @@ -18,4 +18,15 @@ pub struct Block<'a> { impl jacquard_common::types::collection::Collection for Block<'_> { const NSID: &'static str = "app.bsky.graph.block"; +} + +impl jacquard_common::IntoStatic for Block<'_> { + type Output = Block<'static>; + fn into_static(self) -> Self::Output { + Block { + created_at: self.created_at.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/follow.rs b/crates/jacquard-api/src/app_bsky/graph/follow.rs index 77ef1159d..ad35f2eb8 100644 --- a/crates/jacquard-api/src/app_bsky/graph/follow.rs +++ b/crates/jacquard-api/src/app_bsky/graph/follow.rs @@ -17,4 +17,15 @@ pub struct Follow<'a> { impl jacquard_common::types::collection::Collection for Follow<'_> { const NSID: &'static str = "app.bsky.graph.follow"; +} + +impl jacquard_common::IntoStatic for Follow<'_> { + type Output = Follow<'static>; + fn into_static(self) -> Self::Output { + Follow { + created_at: self.created_at.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_actor_starter_packs.rs b/crates/jacquard-api/src/app_bsky/graph/get_actor_starter_packs.rs index c5f731b7f..b92cb5eed 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_actor_starter_packs.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_actor_starter_packs.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetActorStarterPacks<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct GetActorStarterPacks<'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, } -impl Default for GetActorStarterPacks<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetActorStarterPacks<'_> { + type Output = GetActorStarterPacks<'static>; + fn into_static(self) -> Self::Output { + GetActorStarterPacks { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -38,10 +40,21 @@ pub struct GetActorStarterPacksOutput<'a> { pub starter_packs: Vec>, } +impl jacquard_common::IntoStatic for GetActorStarterPacksOutput<'_> { + type Output = GetActorStarterPacksOutput<'static>; + fn into_static(self) -> Self::Output { + GetActorStarterPacksOutput { + cursor: self.cursor.into_static(), + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetActorStarterPacks<'_> { const NSID: &'static str = "app.bsky.graph.getActorStarterPacks"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetActorStarterPacksOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_blocks.rs b/crates/jacquard-api/src/app_bsky/graph/get_blocks.rs index 6b74b71a5..a35e43ebd 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_blocks.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_blocks.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetBlocks<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetBlocks<'_> { + type Output = GetBlocks<'static>; + fn into_static(self) -> Self::Output { + GetBlocks { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,10 +37,21 @@ pub struct GetBlocksOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for GetBlocksOutput<'_> { + type Output = GetBlocksOutput<'static>; + fn into_static(self) -> Self::Output { + GetBlocksOutput { + blocks: self.blocks.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetBlocks<'_> { const NSID: &'static str = "app.bsky.graph.getBlocks"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetBlocksOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_followers.rs b/crates/jacquard-api/src/app_bsky/graph/get_followers.rs index 5eaa8ab46..7a86ffad9 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_followers.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_followers.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetFollowers<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct GetFollowers<'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, } -impl Default for GetFollowers<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetFollowers<'_> { + type Output = GetFollowers<'static>; + fn into_static(self) -> Self::Output { + GetFollowers { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -40,10 +42,22 @@ pub struct GetFollowersOutput<'a> { pub subject: crate::app_bsky::actor::ProfileView<'a>, } +impl jacquard_common::IntoStatic for GetFollowersOutput<'_> { + type Output = GetFollowersOutput<'static>; + fn into_static(self) -> Self::Output { + GetFollowersOutput { + cursor: self.cursor.into_static(), + followers: self.followers.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetFollowers<'_> { const NSID: &'static str = "app.bsky.graph.getFollowers"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetFollowersOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_follows.rs b/crates/jacquard-api/src/app_bsky/graph/get_follows.rs index c4b6cf796..fa9cf93fe 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_follows.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_follows.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetFollows<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct GetFollows<'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, } -impl Default for GetFollows<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetFollows<'_> { + type Output = GetFollows<'static>; + fn into_static(self) -> Self::Output { + GetFollows { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -40,10 +42,22 @@ pub struct GetFollowsOutput<'a> { pub subject: crate::app_bsky::actor::ProfileView<'a>, } +impl jacquard_common::IntoStatic for GetFollowsOutput<'_> { + type Output = GetFollowsOutput<'static>; + fn into_static(self) -> Self::Output { + GetFollowsOutput { + cursor: self.cursor.into_static(), + follows: self.follows.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetFollows<'_> { const NSID: &'static str = "app.bsky.graph.getFollows"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetFollowsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_known_followers.rs b/crates/jacquard-api/src/app_bsky/graph/get_known_followers.rs index 08a096fc8..4644a81b4 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_known_followers.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_known_followers.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetKnownFollowers<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct GetKnownFollowers<'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, } -impl Default for GetKnownFollowers<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetKnownFollowers<'_> { + type Output = GetKnownFollowers<'static>; + fn into_static(self) -> Self::Output { + GetKnownFollowers { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -40,10 +42,22 @@ pub struct GetKnownFollowersOutput<'a> { pub subject: crate::app_bsky::actor::ProfileView<'a>, } +impl jacquard_common::IntoStatic for GetKnownFollowersOutput<'_> { + type Output = GetKnownFollowersOutput<'static>; + fn into_static(self) -> Self::Output { + GetKnownFollowersOutput { + cursor: self.cursor.into_static(), + followers: self.followers.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetKnownFollowers<'_> { const NSID: &'static str = "app.bsky.graph.getKnownFollowers"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetKnownFollowersOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_list.rs b/crates/jacquard-api/src/app_bsky/graph/get_list.rs index 9a83125ce..9274464ee 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_list.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_list.rs @@ -5,24 +5,26 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for GetList<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - list: Default::default(), +impl jacquard_common::IntoStatic for GetList<'_> { + type Output = GetList<'static>; + fn into_static(self) -> Self::Output { + GetList { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + list: self.list.into_static(), } } } @@ -40,10 +42,22 @@ pub struct GetListOutput<'a> { pub list: crate::app_bsky::graph::ListView<'a>, } +impl jacquard_common::IntoStatic for GetListOutput<'_> { + type Output = GetListOutput<'static>; + fn into_static(self) -> Self::Output { + GetListOutput { + cursor: self.cursor.into_static(), + items: self.items.into_static(), + list: self.list.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetList<'_> { const NSID: &'static str = "app.bsky.graph.getList"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetListOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_list_blocks.rs b/crates/jacquard-api/src/app_bsky/graph/get_list_blocks.rs index 1ac333f6f..9be5d947c 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_list_blocks.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_list_blocks.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetListBlocks<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetListBlocks<'_> { + type Output = GetListBlocks<'static>; + fn into_static(self) -> Self::Output { + GetListBlocks { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,10 +37,21 @@ pub struct GetListBlocksOutput<'a> { pub lists: Vec>, } +impl jacquard_common::IntoStatic for GetListBlocksOutput<'_> { + type Output = GetListBlocksOutput<'static>; + fn into_static(self) -> Self::Output { + GetListBlocksOutput { + cursor: self.cursor.into_static(), + lists: self.lists.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetListBlocks<'_> { const NSID: &'static str = "app.bsky.graph.getListBlocks"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetListBlocksOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_list_mutes.rs b/crates/jacquard-api/src/app_bsky/graph/get_list_mutes.rs index f0afc81df..b9160813c 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_list_mutes.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_list_mutes.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetListMutes<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetListMutes<'_> { + type Output = GetListMutes<'static>; + fn into_static(self) -> Self::Output { + GetListMutes { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,10 +37,21 @@ pub struct GetListMutesOutput<'a> { pub lists: Vec>, } +impl jacquard_common::IntoStatic for GetListMutesOutput<'_> { + type Output = GetListMutesOutput<'static>; + fn into_static(self) -> Self::Output { + GetListMutesOutput { + cursor: self.cursor.into_static(), + lists: self.lists.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetListMutes<'_> { const NSID: &'static str = "app.bsky.graph.getListMutes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetListMutesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_lists.rs b/crates/jacquard-api/src/app_bsky/graph/get_lists.rs index 74dc27cb9..2e9798258 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_lists.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_lists.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetLists<'a> { #[serde(borrow)] @@ -13,6 +13,7 @@ pub struct GetLists<'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")] @@ -20,13 +21,14 @@ pub struct GetLists<'a> { pub purposes: std::option::Option>>, } -impl Default for GetLists<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), - purposes: Default::default(), +impl jacquard_common::IntoStatic for GetLists<'_> { + type Output = GetLists<'static>; + fn into_static(self) -> Self::Output { + GetLists { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + purposes: self.purposes.into_static(), } } } @@ -42,10 +44,21 @@ pub struct GetListsOutput<'a> { pub lists: Vec>, } +impl jacquard_common::IntoStatic for GetListsOutput<'_> { + type Output = GetListsOutput<'static>; + fn into_static(self) -> Self::Output { + GetListsOutput { + cursor: self.cursor.into_static(), + lists: self.lists.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetLists<'_> { const NSID: &'static str = "app.bsky.graph.getLists"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetListsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_lists_with_membership.rs b/crates/jacquard-api/src/app_bsky/graph/get_lists_with_membership.rs index 521e3db62..ba33ad223 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_lists_with_membership.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_lists_with_membership.rs @@ -17,7 +17,18 @@ pub struct ListWithMembership<'a> { pub list_item: std::option::Option>, } -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Default)] +impl jacquard_common::IntoStatic for ListWithMembership<'_> { + type Output = ListWithMembership<'static>; + fn into_static(self) -> Self::Output { + ListWithMembership { + list: self.list.into_static(), + list_item: self.list_item.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetListsWithMembership<'a> { #[serde(borrow)] @@ -25,6 +36,7 @@ pub struct GetListsWithMembership<'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")] @@ -32,13 +44,14 @@ pub struct GetListsWithMembership<'a> { pub purposes: std::option::Option>>, } -impl Default for GetListsWithMembership<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), - purposes: Default::default(), +impl jacquard_common::IntoStatic for GetListsWithMembership<'_> { + type Output = GetListsWithMembership<'static>; + fn into_static(self) -> Self::Output { + GetListsWithMembership { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + purposes: self.purposes.into_static(), } } } @@ -54,10 +67,21 @@ pub struct GetListsWithMembershipOutput<'a> { pub lists_with_membership: Vec>, } +impl jacquard_common::IntoStatic for GetListsWithMembershipOutput<'_> { + type Output = GetListsWithMembershipOutput<'static>; + fn into_static(self) -> Self::Output { + GetListsWithMembershipOutput { + cursor: self.cursor.into_static(), + lists_with_membership: self.lists_with_membership.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetListsWithMembership<'_> { const NSID: &'static str = "app.bsky.graph.getListsWithMembership"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetListsWithMembershipOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_mutes.rs b/crates/jacquard-api/src/app_bsky/graph/get_mutes.rs index 1ef450608..a80d23e95 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_mutes.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_mutes.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetMutes<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetMutes<'_> { + type Output = GetMutes<'static>; + fn into_static(self) -> Self::Output { + GetMutes { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,10 +37,21 @@ pub struct GetMutesOutput<'a> { pub mutes: Vec>, } +impl jacquard_common::IntoStatic for GetMutesOutput<'_> { + type Output = GetMutesOutput<'static>; + fn into_static(self) -> Self::Output { + GetMutesOutput { + cursor: self.cursor.into_static(), + mutes: self.mutes.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetMutes<'_> { const NSID: &'static str = "app.bsky.graph.getMutes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetMutesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_relationships.rs b/crates/jacquard-api/src/app_bsky/graph/get_relationships.rs index 8cbe53e99..da2eb8ce1 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_relationships.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_relationships.rs @@ -17,6 +17,16 @@ pub struct GetRelationships<'a> { >, } +impl jacquard_common::IntoStatic for GetRelationships<'_> { + type Output = GetRelationships<'static>; + fn into_static(self) -> Self::Output { + GetRelationships { + actor: self.actor.into_static(), + others: self.others.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -28,6 +38,17 @@ pub struct GetRelationshipsOutput<'a> { pub relationships: Vec>, } +impl jacquard_common::IntoStatic for GetRelationshipsOutput<'_> { + type Output = GetRelationshipsOutput<'static>; + fn into_static(self) -> Self::Output { + GetRelationshipsOutput { + actor: self.actor.into_static(), + relationships: self.relationships.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -62,6 +83,20 @@ impl std::fmt::Display for GetRelationshipsError<'_> { } } +impl jacquard_common::IntoStatic for GetRelationshipsError<'_> { + type Output = GetRelationshipsError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetRelationshipsError::ActorNotFound(v) => { + GetRelationshipsError::ActorNotFound(v.into_static()) + } + GetRelationshipsError::Unknown(v) => { + GetRelationshipsError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRelationships<'_> { const NSID: &'static str = "app.bsky.graph.getRelationships"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/graph/get_starter_pack.rs b/crates/jacquard-api/src/app_bsky/graph/get_starter_pack.rs index 7a393a98e..942b8d9ce 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_starter_pack.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_starter_pack.rs @@ -12,6 +12,15 @@ pub struct GetStarterPack<'a> { pub starter_pack: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for GetStarterPack<'_> { + type Output = GetStarterPack<'static>; + fn into_static(self) -> Self::Output { + GetStarterPack { + starter_pack: self.starter_pack.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetStarterPackOutput<'a> { pub starter_pack: crate::app_bsky::graph::StarterPackView<'a>, } +impl jacquard_common::IntoStatic for GetStarterPackOutput<'_> { + type Output = GetStarterPackOutput<'static>; + fn into_static(self) -> Self::Output { + GetStarterPackOutput { + starter_pack: self.starter_pack.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetStarterPack<'_> { const NSID: &'static str = "app.bsky.graph.getStarterPack"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetStarterPackOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_starter_packs.rs b/crates/jacquard-api/src/app_bsky/graph/get_starter_packs.rs index a1ec16650..747c8feb8 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_starter_packs.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_starter_packs.rs @@ -12,6 +12,15 @@ pub struct GetStarterPacks<'a> { pub uris: Vec>, } +impl jacquard_common::IntoStatic for GetStarterPacks<'_> { + type Output = GetStarterPacks<'static>; + fn into_static(self) -> Self::Output { + GetStarterPacks { + uris: self.uris.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetStarterPacksOutput<'a> { pub starter_packs: Vec>, } +impl jacquard_common::IntoStatic for GetStarterPacksOutput<'_> { + type Output = GetStarterPacksOutput<'static>; + fn into_static(self) -> Self::Output { + GetStarterPacksOutput { + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetStarterPacks<'_> { const NSID: &'static str = "app.bsky.graph.getStarterPacks"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetStarterPacksOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_starter_packs_with_membership.rs b/crates/jacquard-api/src/app_bsky/graph/get_starter_packs_with_membership.rs index 30d8bfc28..4f5d5b1cd 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_starter_packs_with_membership.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_starter_packs_with_membership.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetStarterPacksWithMembership<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct GetStarterPacksWithMembership<'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, } -impl Default for GetStarterPacksWithMembership<'_> { - fn default() -> Self { - Self { - actor: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetStarterPacksWithMembership<'_> { + type Output = GetStarterPacksWithMembership<'static>; + fn into_static(self) -> Self::Output { + GetStarterPacksWithMembership { + actor: self.actor.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -38,12 +40,25 @@ pub struct GetStarterPacksWithMembershipOutput<'a> { pub starter_packs_with_membership: Vec>, } +impl jacquard_common::IntoStatic for GetStarterPacksWithMembershipOutput<'_> { + type Output = GetStarterPacksWithMembershipOutput<'static>; + fn into_static(self) -> Self::Output { + GetStarterPacksWithMembershipOutput { + cursor: self.cursor.into_static(), + starter_packs_with_membership: self + .starter_packs_with_membership + .into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetStarterPacksWithMembership<'_> { const NSID: &'static str = "app.bsky.graph.getStarterPacksWithMembership"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetStarterPacksWithMembershipOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } ///A starter pack and an optional list item indicating membership of a target user to that starter pack. @@ -56,4 +71,15 @@ pub struct StarterPackWithMembership<'a> { pub list_item: std::option::Option>, #[serde(borrow)] pub starter_pack: crate::app_bsky::graph::StarterPackView<'a>, +} + +impl jacquard_common::IntoStatic for StarterPackWithMembership<'_> { + type Output = StarterPackWithMembership<'static>; + fn into_static(self) -> Self::Output { + StarterPackWithMembership { + list_item: self.list_item.into_static(), + starter_pack: self.starter_pack.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/get_suggested_follows_by_actor.rs b/crates/jacquard-api/src/app_bsky/graph/get_suggested_follows_by_actor.rs index 08a413246..9b9890898 100644 --- a/crates/jacquard-api/src/app_bsky/graph/get_suggested_follows_by_actor.rs +++ b/crates/jacquard-api/src/app_bsky/graph/get_suggested_follows_by_actor.rs @@ -12,6 +12,15 @@ pub struct GetSuggestedFollowsByActor<'a> { pub actor: jacquard_common::types::ident::AtIdentifier<'a>, } +impl jacquard_common::IntoStatic for GetSuggestedFollowsByActor<'_> { + type Output = GetSuggestedFollowsByActor<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedFollowsByActor { + actor: self.actor.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -26,10 +35,22 @@ pub struct GetSuggestedFollowsByActorOutput<'a> { pub suggestions: Vec>, } +impl jacquard_common::IntoStatic for GetSuggestedFollowsByActorOutput<'_> { + type Output = GetSuggestedFollowsByActorOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedFollowsByActorOutput { + is_fallback: self.is_fallback.into_static(), + rec_id: self.rec_id.into_static(), + suggestions: self.suggestions.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestedFollowsByActor<'_> { const NSID: &'static str = "app.bsky.graph.getSuggestedFollowsByActor"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestedFollowsByActorOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/list.rs b/crates/jacquard-api/src/app_bsky/graph/list.rs index b0efb24fb..e4bd622b5 100644 --- a/crates/jacquard-api/src/app_bsky/graph/list.rs +++ b/crates/jacquard-api/src/app_bsky/graph/list.rs @@ -42,6 +42,34 @@ pub enum ListRecordLabels<'a> { DefsSelfLabels(Box>), } +impl jacquard_common::IntoStatic for ListRecordLabels<'_> { + type Output = ListRecordLabels<'static>; + fn into_static(self) -> Self::Output { + match self { + ListRecordLabels::DefsSelfLabels(v) => { + ListRecordLabels::DefsSelfLabels(v.into_static()) + } + ListRecordLabels::Unknown(v) => ListRecordLabels::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::collection::Collection for List<'_> { const NSID: &'static str = "app.bsky.graph.list"; +} + +impl jacquard_common::IntoStatic for List<'_> { + type Output = List<'static>; + fn into_static(self) -> Self::Output { + List { + avatar: self.avatar.into_static(), + created_at: self.created_at.into_static(), + description: self.description.into_static(), + description_facets: self.description_facets.into_static(), + labels: self.labels.into_static(), + name: self.name.into_static(), + purpose: self.purpose.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/listblock.rs b/crates/jacquard-api/src/app_bsky/graph/listblock.rs index dbce0bf72..d9717eb46 100644 --- a/crates/jacquard-api/src/app_bsky/graph/listblock.rs +++ b/crates/jacquard-api/src/app_bsky/graph/listblock.rs @@ -18,4 +18,15 @@ pub struct Listblock<'a> { impl jacquard_common::types::collection::Collection for Listblock<'_> { const NSID: &'static str = "app.bsky.graph.listblock"; +} + +impl jacquard_common::IntoStatic for Listblock<'_> { + type Output = Listblock<'static>; + fn into_static(self) -> Self::Output { + Listblock { + created_at: self.created_at.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/listitem.rs b/crates/jacquard-api/src/app_bsky/graph/listitem.rs index 83dd5debd..e2a782ed7 100644 --- a/crates/jacquard-api/src/app_bsky/graph/listitem.rs +++ b/crates/jacquard-api/src/app_bsky/graph/listitem.rs @@ -21,4 +21,16 @@ pub struct Listitem<'a> { impl jacquard_common::types::collection::Collection for Listitem<'_> { const NSID: &'static str = "app.bsky.graph.listitem"; +} + +impl jacquard_common::IntoStatic for Listitem<'_> { + type Output = Listitem<'static>; + fn into_static(self) -> Self::Output { + Listitem { + created_at: self.created_at.into_static(), + list: self.list.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/mute_actor.rs b/crates/jacquard-api/src/app_bsky/graph/mute_actor.rs index f2cd25943..c409424e0 100644 --- a/crates/jacquard-api/src/app_bsky/graph/mute_actor.rs +++ b/crates/jacquard-api/src/app_bsky/graph/mute_actor.rs @@ -13,6 +13,16 @@ pub struct MuteActor<'a> { pub actor: jacquard_common::types::ident::AtIdentifier<'a>, } +impl jacquard_common::IntoStatic for MuteActor<'_> { + type Output = MuteActor<'static>; + fn into_static(self) -> Self::Output { + MuteActor { + actor: self.actor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for MuteActor<'_> { const NSID: &'static str = "app.bsky.graph.muteActor"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for MuteActor<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/mute_actor_list.rs b/crates/jacquard-api/src/app_bsky/graph/mute_actor_list.rs index 633b2dedd..bc4d9ec1a 100644 --- a/crates/jacquard-api/src/app_bsky/graph/mute_actor_list.rs +++ b/crates/jacquard-api/src/app_bsky/graph/mute_actor_list.rs @@ -13,6 +13,16 @@ pub struct MuteActorList<'a> { pub list: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for MuteActorList<'_> { + type Output = MuteActorList<'static>; + fn into_static(self) -> Self::Output { + MuteActorList { + list: self.list.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for MuteActorList<'_> { const NSID: &'static str = "app.bsky.graph.muteActorList"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for MuteActorList<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/mute_thread.rs b/crates/jacquard-api/src/app_bsky/graph/mute_thread.rs index 8e3c6d6bb..21515827b 100644 --- a/crates/jacquard-api/src/app_bsky/graph/mute_thread.rs +++ b/crates/jacquard-api/src/app_bsky/graph/mute_thread.rs @@ -13,6 +13,16 @@ pub struct MuteThread<'a> { pub root: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for MuteThread<'_> { + type Output = MuteThread<'static>; + fn into_static(self) -> Self::Output { + MuteThread { + root: self.root.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for MuteThread<'_> { const NSID: &'static str = "app.bsky.graph.muteThread"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for MuteThread<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/search_starter_packs.rs b/crates/jacquard-api/src/app_bsky/graph/search_starter_packs.rs index 5ff7d2dce..a65697162 100644 --- a/crates/jacquard-api/src/app_bsky/graph/search_starter_packs.rs +++ b/crates/jacquard-api/src/app_bsky/graph/search_starter_packs.rs @@ -5,24 +5,26 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for SearchStarterPacks<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(25i64), - q: Default::default(), +impl jacquard_common::IntoStatic for SearchStarterPacks<'_> { + type Output = SearchStarterPacks<'static>; + fn into_static(self) -> Self::Output { + SearchStarterPacks { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + q: self.q.into_static(), } } } @@ -38,10 +40,21 @@ pub struct SearchStarterPacksOutput<'a> { pub starter_packs: Vec>, } +impl jacquard_common::IntoStatic for SearchStarterPacksOutput<'_> { + type Output = SearchStarterPacksOutput<'static>; + fn into_static(self) -> Self::Output { + SearchStarterPacksOutput { + cursor: self.cursor.into_static(), + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchStarterPacks<'_> { const NSID: &'static str = "app.bsky.graph.searchStarterPacks"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SearchStarterPacksOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/starterpack.rs b/crates/jacquard-api/src/app_bsky/graph/starterpack.rs index 971dc0405..22f7835d3 100644 --- a/crates/jacquard-api/src/app_bsky/graph/starterpack.rs +++ b/crates/jacquard-api/src/app_bsky/graph/starterpack.rs @@ -13,6 +13,16 @@ pub struct FeedItem<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for FeedItem<'_> { + type Output = FeedItem<'static>; + fn into_static(self) -> Self::Output { + FeedItem { + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Record defining a starter pack of actors and feeds for new users. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -42,4 +52,19 @@ pub struct Starterpack<'a> { impl jacquard_common::types::collection::Collection for Starterpack<'_> { const NSID: &'static str = "app.bsky.graph.starterpack"; +} + +impl jacquard_common::IntoStatic for Starterpack<'_> { + type Output = Starterpack<'static>; + fn into_static(self) -> Self::Output { + Starterpack { + created_at: self.created_at.into_static(), + description: self.description.into_static(), + description_facets: self.description_facets.into_static(), + feeds: self.feeds.into_static(), + list: self.list.into_static(), + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/unmute_actor.rs b/crates/jacquard-api/src/app_bsky/graph/unmute_actor.rs index 2ebae4df3..7fa4a4625 100644 --- a/crates/jacquard-api/src/app_bsky/graph/unmute_actor.rs +++ b/crates/jacquard-api/src/app_bsky/graph/unmute_actor.rs @@ -13,6 +13,16 @@ pub struct UnmuteActor<'a> { pub actor: jacquard_common::types::ident::AtIdentifier<'a>, } +impl jacquard_common::IntoStatic for UnmuteActor<'_> { + type Output = UnmuteActor<'static>; + fn into_static(self) -> Self::Output { + UnmuteActor { + actor: self.actor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UnmuteActor<'_> { const NSID: &'static str = "app.bsky.graph.unmuteActor"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UnmuteActor<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/unmute_actor_list.rs b/crates/jacquard-api/src/app_bsky/graph/unmute_actor_list.rs index 51521725a..6c8114406 100644 --- a/crates/jacquard-api/src/app_bsky/graph/unmute_actor_list.rs +++ b/crates/jacquard-api/src/app_bsky/graph/unmute_actor_list.rs @@ -13,6 +13,16 @@ pub struct UnmuteActorList<'a> { pub list: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for UnmuteActorList<'_> { + type Output = UnmuteActorList<'static>; + fn into_static(self) -> Self::Output { + UnmuteActorList { + list: self.list.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UnmuteActorList<'_> { const NSID: &'static str = "app.bsky.graph.unmuteActorList"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UnmuteActorList<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/unmute_thread.rs b/crates/jacquard-api/src/app_bsky/graph/unmute_thread.rs index 3b8fdf179..9638ddf82 100644 --- a/crates/jacquard-api/src/app_bsky/graph/unmute_thread.rs +++ b/crates/jacquard-api/src/app_bsky/graph/unmute_thread.rs @@ -13,6 +13,16 @@ pub struct UnmuteThread<'a> { pub root: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for UnmuteThread<'_> { + type Output = UnmuteThread<'static>; + fn into_static(self) -> Self::Output { + UnmuteThread { + root: self.root.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UnmuteThread<'_> { const NSID: &'static str = "app.bsky.graph.unmuteThread"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UnmuteThread<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/graph/verification.rs b/crates/jacquard-api/src/app_bsky/graph/verification.rs index 0c925452a..96700a320 100644 --- a/crates/jacquard-api/src/app_bsky/graph/verification.rs +++ b/crates/jacquard-api/src/app_bsky/graph/verification.rs @@ -25,4 +25,17 @@ pub struct Verification<'a> { impl jacquard_common::types::collection::Collection for Verification<'_> { const NSID: &'static str = "app.bsky.graph.verification"; +} + +impl jacquard_common::IntoStatic for Verification<'_> { + type Output = Verification<'static>; + fn into_static(self) -> Self::Output { + Verification { + created_at: self.created_at.into_static(), + display_name: self.display_name.into_static(), + handle: self.handle.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/labeler.rs b/crates/jacquard-api/src/app_bsky/labeler.rs index 6432a8dc8..e28b0f6e5 100644 --- a/crates/jacquard-api/src/app_bsky/labeler.rs +++ b/crates/jacquard-api/src/app_bsky/labeler.rs @@ -23,6 +23,17 @@ pub struct LabelerPolicies<'a> { pub label_values: Vec>, } +impl jacquard_common::IntoStatic for LabelerPolicies<'_> { + type Output = LabelerPolicies<'static>; + fn into_static(self) -> Self::Output { + LabelerPolicies { + label_value_definitions: self.label_value_definitions.into_static(), + label_values: self.label_values.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -44,6 +55,22 @@ pub struct LabelerView<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for LabelerView<'_> { + type Output = LabelerView<'static>; + fn into_static(self) -> Self::Output { + LabelerView { + cid: self.cid.into_static(), + creator: self.creator.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + like_count: self.like_count.into_static(), + uri: self.uri.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -85,6 +112,26 @@ pub struct LabelerViewDetailed<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for LabelerViewDetailed<'_> { + type Output = LabelerViewDetailed<'static>; + fn into_static(self) -> Self::Output { + LabelerViewDetailed { + cid: self.cid.into_static(), + creator: self.creator.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + like_count: self.like_count.into_static(), + policies: self.policies.into_static(), + reason_types: self.reason_types.into_static(), + subject_collections: self.subject_collections.into_static(), + subject_types: self.subject_types.into_static(), + uri: self.uri.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -92,4 +139,14 @@ pub struct LabelerViewerState<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub like: std::option::Option>, +} + +impl jacquard_common::IntoStatic for LabelerViewerState<'_> { + type Output = LabelerViewerState<'static>; + fn into_static(self) -> Self::Output { + LabelerViewerState { + like: self.like.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/labeler/get_services.rs b/crates/jacquard-api/src/app_bsky/labeler/get_services.rs index d98dc9b84..5baa00d28 100644 --- a/crates/jacquard-api/src/app_bsky/labeler/get_services.rs +++ b/crates/jacquard-api/src/app_bsky/labeler/get_services.rs @@ -5,20 +5,22 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for GetServices<'_> { - fn default() -> Self { - Self { - detailed: Some(false), - dids: Default::default(), +impl jacquard_common::IntoStatic for GetServices<'_> { + type Output = GetServices<'static>; + fn into_static(self) -> Self::Output { + GetServices { + detailed: self.detailed.into_static(), + dids: self.dids.into_static(), } } } @@ -31,10 +33,20 @@ pub struct GetServicesOutput<'a> { pub views: Vec>, } +impl jacquard_common::IntoStatic for GetServicesOutput<'_> { + type Output = GetServicesOutput<'static>; + fn into_static(self) -> Self::Output { + GetServicesOutput { + views: self.views.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetServices<'_> { const NSID: &'static str = "app.bsky.labeler.getServices"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetServicesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/labeler/service.rs b/crates/jacquard-api/src/app_bsky/labeler/service.rs index c322c6718..ed3c3bddb 100644 --- a/crates/jacquard-api/src/app_bsky/labeler/service.rs +++ b/crates/jacquard-api/src/app_bsky/labeler/service.rs @@ -45,6 +45,35 @@ pub enum ServiceRecordLabels<'a> { DefsSelfLabels(Box>), } +impl jacquard_common::IntoStatic for ServiceRecordLabels<'_> { + type Output = ServiceRecordLabels<'static>; + fn into_static(self) -> Self::Output { + match self { + ServiceRecordLabels::DefsSelfLabels(v) => { + ServiceRecordLabels::DefsSelfLabels(v.into_static()) + } + ServiceRecordLabels::Unknown(v) => { + ServiceRecordLabels::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::collection::Collection for Service<'_> { const NSID: &'static str = "app.bsky.labeler.service"; +} + +impl jacquard_common::IntoStatic for Service<'_> { + type Output = Service<'static>; + fn into_static(self) -> Self::Output { + Service { + created_at: self.created_at.into_static(), + labels: self.labels.into_static(), + policies: self.policies.into_static(), + reason_types: self.reason_types.into_static(), + subject_collections: self.subject_collections.into_static(), + subject_types: self.subject_types.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification.rs b/crates/jacquard-api/src/app_bsky/notification.rs index 7dd29b1dc..48a0d7df1 100644 --- a/crates/jacquard-api/src/app_bsky/notification.rs +++ b/crates/jacquard-api/src/app_bsky/notification.rs @@ -25,6 +25,17 @@ pub struct ActivitySubscription<'a> { pub reply: bool, } +impl jacquard_common::IntoStatic for ActivitySubscription<'_> { + type Output = ActivitySubscription<'static>; + fn into_static(self) -> Self::Output { + ActivitySubscription { + post: self.post.into_static(), + reply: self.reply.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -34,6 +45,17 @@ pub struct ChatPreference<'a> { pub push: bool, } +impl jacquard_common::IntoStatic for ChatPreference<'_> { + type Output = ChatPreference<'static>; + fn into_static(self) -> Self::Output { + ChatPreference { + include: self.include.into_static(), + push: self.push.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -44,6 +66,18 @@ pub struct FilterablePreference<'a> { pub push: bool, } +impl jacquard_common::IntoStatic for FilterablePreference<'_> { + type Output = FilterablePreference<'static>; + fn into_static(self) -> Self::Output { + FilterablePreference { + include: self.include.into_static(), + list: self.list.into_static(), + push: self.push.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -52,6 +86,17 @@ pub struct Preference<'a> { pub push: bool, } +impl jacquard_common::IntoStatic for Preference<'_> { + type Output = Preference<'static>; + fn into_static(self) -> Self::Output { + Preference { + list: self.list.into_static(), + push: self.push.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -84,10 +129,41 @@ pub struct Preferences<'a> { pub verified: crate::app_bsky::notification::Preference<'a>, } +impl jacquard_common::IntoStatic for Preferences<'_> { + type Output = Preferences<'static>; + fn into_static(self) -> Self::Output { + Preferences { + chat: self.chat.into_static(), + follow: self.follow.into_static(), + like: self.like.into_static(), + like_via_repost: self.like_via_repost.into_static(), + mention: self.mention.into_static(), + quote: self.quote.into_static(), + reply: self.reply.into_static(), + repost: self.repost.into_static(), + repost_via_repost: self.repost_via_repost.into_static(), + starterpack_joined: self.starterpack_joined.into_static(), + subscribed_post: self.subscribed_post.into_static(), + unverified: self.unverified.into_static(), + verified: self.verified.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RecordDeleted<'a> {} +impl jacquard_common::IntoStatic for RecordDeleted<'_> { + type Output = RecordDeleted<'static>; + fn into_static(self) -> Self::Output { + RecordDeleted { + extra_data: self.extra_data.into_static(), + } + } +} + ///Object used to store activity subscription data in stash. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -97,4 +173,15 @@ pub struct SubjectActivitySubscription<'a> { pub activity_subscription: crate::app_bsky::notification::ActivitySubscription<'a>, #[serde(borrow)] pub subject: jacquard_common::types::string::Did<'a>, +} + +impl jacquard_common::IntoStatic for SubjectActivitySubscription<'_> { + type Output = SubjectActivitySubscription<'static>; + fn into_static(self) -> Self::Output { + SubjectActivitySubscription { + activity_subscription: self.activity_subscription.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/declaration.rs b/crates/jacquard-api/src/app_bsky/notification/declaration.rs index d8f86b426..9bb5b3e5e 100644 --- a/crates/jacquard-api/src/app_bsky/notification/declaration.rs +++ b/crates/jacquard-api/src/app_bsky/notification/declaration.rs @@ -17,4 +17,14 @@ pub struct Declaration<'a> { impl jacquard_common::types::collection::Collection for Declaration<'_> { const NSID: &'static str = "app.bsky.notification.declaration"; +} + +impl jacquard_common::IntoStatic for Declaration<'_> { + type Output = Declaration<'static>; + fn into_static(self) -> Self::Output { + Declaration { + allow_subscriptions: self.allow_subscriptions.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/get_preferences.rs b/crates/jacquard-api/src/app_bsky/notification/get_preferences.rs index 5a4a5f7a6..58eefa4b1 100644 --- a/crates/jacquard-api/src/app_bsky/notification/get_preferences.rs +++ b/crates/jacquard-api/src/app_bsky/notification/get_preferences.rs @@ -8,6 +8,13 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetPreferences {} +impl jacquard_common::IntoStatic for GetPreferences { + type Output = GetPreferences; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -16,10 +23,20 @@ pub struct GetPreferencesOutput<'a> { pub preferences: crate::app_bsky::notification::Preferences<'a>, } +impl jacquard_common::IntoStatic for GetPreferencesOutput<'_> { + type Output = GetPreferencesOutput<'static>; + fn into_static(self) -> Self::Output { + GetPreferencesOutput { + preferences: self.preferences.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetPreferences { const NSID: &'static str = "app.bsky.notification.getPreferences"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetPreferencesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/get_unread_count.rs b/crates/jacquard-api/src/app_bsky/notification/get_unread_count.rs index bc6c1117b..502cebca1 100644 --- a/crates/jacquard-api/src/app_bsky/notification/get_unread_count.rs +++ b/crates/jacquard-api/src/app_bsky/notification/get_unread_count.rs @@ -14,6 +14,13 @@ pub struct GetUnreadCount { pub seen_at: std::option::Option, } +impl jacquard_common::IntoStatic for GetUnreadCount { + type Output = GetUnreadCount; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,10 +28,20 @@ pub struct GetUnreadCountOutput<'a> { pub count: i64, } +impl jacquard_common::IntoStatic for GetUnreadCountOutput<'_> { + type Output = GetUnreadCountOutput<'static>; + fn into_static(self) -> Self::Output { + GetUnreadCountOutput { + count: self.count.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetUnreadCount { const NSID: &'static str = "app.bsky.notification.getUnreadCount"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetUnreadCountOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/list_activity_subscriptions.rs b/crates/jacquard-api/src/app_bsky/notification/list_activity_subscriptions.rs index b677a1388..343db099b 100644 --- a/crates/jacquard-api/src/app_bsky/notification/list_activity_subscriptions.rs +++ b/crates/jacquard-api/src/app_bsky/notification/list_activity_subscriptions.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for ListActivitySubscriptions<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for ListActivitySubscriptions<'_> { + type Output = ListActivitySubscriptions<'static>; + fn into_static(self) -> Self::Output { + ListActivitySubscriptions { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,10 +37,21 @@ pub struct ListActivitySubscriptionsOutput<'a> { pub subscriptions: Vec>, } +impl jacquard_common::IntoStatic for ListActivitySubscriptionsOutput<'_> { + type Output = ListActivitySubscriptionsOutput<'static>; + fn into_static(self) -> Self::Output { + ListActivitySubscriptionsOutput { + cursor: self.cursor.into_static(), + subscriptions: self.subscriptions.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListActivitySubscriptions<'_> { const NSID: &'static str = "app.bsky.notification.listActivitySubscriptions"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListActivitySubscriptionsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/list_notifications.rs b/crates/jacquard-api/src/app_bsky/notification/list_notifications.rs index 119a5166d..17cfe1f89 100644 --- a/crates/jacquard-api/src/app_bsky/notification/list_notifications.rs +++ b/crates/jacquard-api/src/app_bsky/notification/list_notifications.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -22,14 +23,15 @@ pub struct ListNotifications<'a> { pub seen_at: std::option::Option, } -impl Default for ListNotifications<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - priority: Default::default(), - reasons: Default::default(), - seen_at: Default::default(), +impl jacquard_common::IntoStatic for ListNotifications<'_> { + type Output = ListNotifications<'static>; + fn into_static(self) -> Self::Output { + ListNotifications { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + priority: self.priority.into_static(), + reasons: self.reasons.into_static(), + seen_at: self.seen_at.into_static(), } } } @@ -49,12 +51,25 @@ pub struct ListNotificationsOutput<'a> { pub seen_at: std::option::Option, } +impl jacquard_common::IntoStatic for ListNotificationsOutput<'_> { + type Output = ListNotificationsOutput<'static>; + fn into_static(self) -> Self::Output { + ListNotificationsOutput { + cursor: self.cursor.into_static(), + notifications: self.notifications.into_static(), + priority: self.priority.into_static(), + seen_at: self.seen_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListNotifications<'_> { const NSID: &'static str = "app.bsky.notification.listNotifications"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListNotificationsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -80,4 +95,22 @@ pub struct Notification<'a> { pub record: jacquard_common::types::value::Data<'a>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, +} + +impl jacquard_common::IntoStatic for Notification<'_> { + type Output = Notification<'static>; + fn into_static(self) -> Self::Output { + Notification { + author: self.author.into_static(), + cid: self.cid.into_static(), + indexed_at: self.indexed_at.into_static(), + is_read: self.is_read.into_static(), + labels: self.labels.into_static(), + reason: self.reason.into_static(), + reason_subject: self.reason_subject.into_static(), + record: self.record.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/put_activity_subscription.rs b/crates/jacquard-api/src/app_bsky/notification/put_activity_subscription.rs index e71ca58d9..1c7499a55 100644 --- a/crates/jacquard-api/src/app_bsky/notification/put_activity_subscription.rs +++ b/crates/jacquard-api/src/app_bsky/notification/put_activity_subscription.rs @@ -15,6 +15,17 @@ pub struct PutActivitySubscription<'a> { pub subject: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for PutActivitySubscription<'_> { + type Output = PutActivitySubscription<'static>; + fn into_static(self) -> Self::Output { + PutActivitySubscription { + activity_subscription: self.activity_subscription.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -28,6 +39,17 @@ pub struct PutActivitySubscriptionOutput<'a> { pub subject: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for PutActivitySubscriptionOutput<'_> { + type Output = PutActivitySubscriptionOutput<'static>; + fn into_static(self) -> Self::Output { + PutActivitySubscriptionOutput { + activity_subscription: self.activity_subscription.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for PutActivitySubscription<'_> { const NSID: &'static str = "app.bsky.notification.putActivitySubscription"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -35,5 +57,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for PutActivitySubscription<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = PutActivitySubscriptionOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/put_preferences.rs b/crates/jacquard-api/src/app_bsky/notification/put_preferences.rs index f090a4791..4360bdda0 100644 --- a/crates/jacquard-api/src/app_bsky/notification/put_preferences.rs +++ b/crates/jacquard-api/src/app_bsky/notification/put_preferences.rs @@ -12,6 +12,16 @@ pub struct PutPreferences<'a> { pub priority: bool, } +impl jacquard_common::IntoStatic for PutPreferences<'_> { + type Output = PutPreferences<'static>; + fn into_static(self) -> Self::Output { + PutPreferences { + priority: self.priority.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for PutPreferences<'_> { const NSID: &'static str = "app.bsky.notification.putPreferences"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -19,5 +29,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for PutPreferences<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/put_preferences_v2.rs b/crates/jacquard-api/src/app_bsky/notification/put_preferences_v2.rs index 2ee23d2a2..528f0c5c5 100644 --- a/crates/jacquard-api/src/app_bsky/notification/put_preferences_v2.rs +++ b/crates/jacquard-api/src/app_bsky/notification/put_preferences_v2.rs @@ -70,6 +70,28 @@ pub struct PutPreferencesV2<'a> { pub verified: std::option::Option>, } +impl jacquard_common::IntoStatic for PutPreferencesV2<'_> { + type Output = PutPreferencesV2<'static>; + fn into_static(self) -> Self::Output { + PutPreferencesV2 { + chat: self.chat.into_static(), + follow: self.follow.into_static(), + like: self.like.into_static(), + like_via_repost: self.like_via_repost.into_static(), + mention: self.mention.into_static(), + quote: self.quote.into_static(), + reply: self.reply.into_static(), + repost: self.repost.into_static(), + repost_via_repost: self.repost_via_repost.into_static(), + starterpack_joined: self.starterpack_joined.into_static(), + subscribed_post: self.subscribed_post.into_static(), + unverified: self.unverified.into_static(), + verified: self.verified.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -78,6 +100,16 @@ pub struct PutPreferencesV2Output<'a> { pub preferences: crate::app_bsky::notification::Preferences<'a>, } +impl jacquard_common::IntoStatic for PutPreferencesV2Output<'_> { + type Output = PutPreferencesV2Output<'static>; + fn into_static(self) -> Self::Output { + PutPreferencesV2Output { + preferences: self.preferences.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for PutPreferencesV2<'_> { const NSID: &'static str = "app.bsky.notification.putPreferencesV2"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -85,5 +117,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for PutPreferencesV2<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = PutPreferencesV2Output<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/register_push.rs b/crates/jacquard-api/src/app_bsky/notification/register_push.rs index 109475cb6..b93a22fcb 100644 --- a/crates/jacquard-api/src/app_bsky/notification/register_push.rs +++ b/crates/jacquard-api/src/app_bsky/notification/register_push.rs @@ -22,6 +22,20 @@ pub struct RegisterPush<'a> { pub token: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RegisterPush<'_> { + type Output = RegisterPush<'static>; + fn into_static(self) -> Self::Output { + RegisterPush { + age_restricted: self.age_restricted.into_static(), + app_id: self.app_id.into_static(), + platform: self.platform.into_static(), + service_did: self.service_did.into_static(), + token: self.token.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RegisterPush<'_> { const NSID: &'static str = "app.bsky.notification.registerPush"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -29,5 +43,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RegisterPush<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/unregister_push.rs b/crates/jacquard-api/src/app_bsky/notification/unregister_push.rs index 10a91875b..37a15094c 100644 --- a/crates/jacquard-api/src/app_bsky/notification/unregister_push.rs +++ b/crates/jacquard-api/src/app_bsky/notification/unregister_push.rs @@ -19,6 +19,19 @@ pub struct UnregisterPush<'a> { pub token: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for UnregisterPush<'_> { + type Output = UnregisterPush<'static>; + fn into_static(self) -> Self::Output { + UnregisterPush { + app_id: self.app_id.into_static(), + platform: self.platform.into_static(), + service_did: self.service_did.into_static(), + token: self.token.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UnregisterPush<'_> { const NSID: &'static str = "app.bsky.notification.unregisterPush"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -26,5 +39,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UnregisterPush<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/notification/update_seen.rs b/crates/jacquard-api/src/app_bsky/notification/update_seen.rs index 74b936390..b167ab5af 100644 --- a/crates/jacquard-api/src/app_bsky/notification/update_seen.rs +++ b/crates/jacquard-api/src/app_bsky/notification/update_seen.rs @@ -12,6 +12,16 @@ pub struct UpdateSeen<'a> { pub seen_at: jacquard_common::types::string::Datetime, } +impl jacquard_common::IntoStatic for UpdateSeen<'_> { + type Output = UpdateSeen<'static>; + fn into_static(self) -> Self::Output { + UpdateSeen { + seen_at: self.seen_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateSeen<'_> { const NSID: &'static str = "app.bsky.notification.updateSeen"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -19,5 +29,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateSeen<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/richtext/facet.rs b/crates/jacquard-api/src/app_bsky/richtext/facet.rs index 57be475e1..1c742c660 100644 --- a/crates/jacquard-api/src/app_bsky/richtext/facet.rs +++ b/crates/jacquard-api/src/app_bsky/richtext/facet.rs @@ -14,6 +14,17 @@ pub struct ByteSlice<'a> { pub byte_start: i64, } +impl jacquard_common::IntoStatic for ByteSlice<'_> { + type Output = ByteSlice<'static>; + fn into_static(self) -> Self::Output { + ByteSlice { + byte_end: self.byte_end.into_static(), + byte_start: self.byte_start.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -23,6 +34,16 @@ pub struct Link<'a> { pub uri: jacquard_common::types::string::Uri<'a>, } +impl jacquard_common::IntoStatic for Link<'_> { + type Output = Link<'static>; + fn into_static(self) -> Self::Output { + Link { + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Annotation of a sub-string within rich text. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -34,6 +55,17 @@ pub struct Facet<'a> { pub index: crate::app_bsky::richtext::facet::ByteSlice<'a>, } +impl jacquard_common::IntoStatic for Facet<'_> { + type Output = Facet<'static>; + fn into_static(self) -> Self::Output { + Facet { + features: self.features.into_static(), + index: self.index.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -43,6 +75,16 @@ pub struct Mention<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for Mention<'_> { + type Output = Mention<'static>; + fn into_static(self) -> Self::Output { + Mention { + did: self.did.into_static(), + extra_data: self.extra_data.into_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'). #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -50,4 +92,14 @@ pub struct Mention<'a> { pub struct Tag<'a> { #[serde(borrow)] pub tag: jacquard_common::CowStr<'a>, +} + +impl jacquard_common::IntoStatic for Tag<'_> { + type Output = Tag<'static>; + fn into_static(self) -> Self::Output { + Tag { + tag: self.tag.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced.rs b/crates/jacquard-api/src/app_bsky/unspecced.rs index 6848c7107..102c0c7ed 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced.rs @@ -63,6 +63,23 @@ pub struct AgeAssuranceEvent<'a> { pub status: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AgeAssuranceEvent<'_> { + type Output = AgeAssuranceEvent<'static>; + fn into_static(self) -> Self::Output { + AgeAssuranceEvent { + attempt_id: self.attempt_id.into_static(), + complete_ip: self.complete_ip.into_static(), + complete_ua: self.complete_ua.into_static(), + created_at: self.created_at.into_static(), + email: self.email.into_static(), + init_ip: self.init_ip.into_static(), + init_ua: self.init_ua.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -76,6 +93,17 @@ pub struct AgeAssuranceState<'a> { pub status: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AgeAssuranceState<'_> { + type Output = AgeAssuranceState<'static>; + fn into_static(self) -> Self::Output { + AgeAssuranceState { + last_initiated_at: self.last_initiated_at.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -84,6 +112,16 @@ pub struct SkeletonSearchActor<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for SkeletonSearchActor<'_> { + type Output = SkeletonSearchActor<'static>; + fn into_static(self) -> Self::Output { + SkeletonSearchActor { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -92,6 +130,16 @@ pub struct SkeletonSearchPost<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for SkeletonSearchPost<'_> { + type Output = SkeletonSearchPost<'static>; + fn into_static(self) -> Self::Output { + SkeletonSearchPost { + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -100,6 +148,16 @@ pub struct SkeletonSearchStarterPack<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for SkeletonSearchStarterPack<'_> { + type Output = SkeletonSearchStarterPack<'static>; + fn into_static(self) -> Self::Output { + SkeletonSearchStarterPack { + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -122,6 +180,23 @@ pub struct SkeletonTrend<'a> { pub topic: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for SkeletonTrend<'_> { + type Output = SkeletonTrend<'static>; + fn into_static(self) -> Self::Output { + SkeletonTrend { + category: self.category.into_static(), + dids: self.dids.into_static(), + display_name: self.display_name.into_static(), + link: self.link.into_static(), + post_count: self.post_count.into_static(), + started_at: self.started_at.into_static(), + status: self.status.into_static(), + topic: self.topic.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -130,14 +205,42 @@ pub struct ThreadItemBlocked<'a> { pub author: crate::app_bsky::feed::BlockedAuthor<'a>, } +impl jacquard_common::IntoStatic for ThreadItemBlocked<'_> { + type Output = ThreadItemBlocked<'static>; + fn into_static(self) -> Self::Output { + ThreadItemBlocked { + author: self.author.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ThreadItemNoUnauthenticated<'a> {} +impl jacquard_common::IntoStatic for ThreadItemNoUnauthenticated<'_> { + type Output = ThreadItemNoUnauthenticated<'static>; + fn into_static(self) -> Self::Output { + ThreadItemNoUnauthenticated { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ThreadItemNotFound<'a> {} +impl jacquard_common::IntoStatic for ThreadItemNotFound<'_> { + type Output = ThreadItemNotFound<'static>; + fn into_static(self) -> Self::Output { + ThreadItemNotFound { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -156,6 +259,21 @@ pub struct ThreadItemPost<'a> { pub post: crate::app_bsky::feed::PostView<'a>, } +impl jacquard_common::IntoStatic for ThreadItemPost<'_> { + type Output = ThreadItemPost<'static>; + fn into_static(self) -> Self::Output { + ThreadItemPost { + hidden_by_threadgate: self.hidden_by_threadgate.into_static(), + more_parents: self.more_parents.into_static(), + more_replies: self.more_replies.into_static(), + muted_by_viewer: self.muted_by_viewer.into_static(), + op_thread: self.op_thread.into_static(), + post: self.post.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -178,6 +296,23 @@ pub struct TrendView<'a> { pub topic: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for TrendView<'_> { + type Output = TrendView<'static>; + fn into_static(self) -> Self::Output { + TrendView { + actors: self.actors.into_static(), + category: self.category.into_static(), + display_name: self.display_name.into_static(), + link: self.link.into_static(), + post_count: self.post_count.into_static(), + started_at: self.started_at.into_static(), + status: self.status.into_static(), + topic: self.topic.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -192,4 +327,17 @@ pub struct TrendingTopic<'a> { pub link: jacquard_common::CowStr<'a>, #[serde(borrow)] pub topic: jacquard_common::CowStr<'a>, +} + +impl jacquard_common::IntoStatic for TrendingTopic<'_> { + type Output = TrendingTopic<'static>; + fn into_static(self) -> Self::Output { + TrendingTopic { + description: self.description.into_static(), + display_name: self.display_name.into_static(), + link: self.link.into_static(), + topic: self.topic.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_age_assurance_state.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_age_assurance_state.rs index 8413af7a5..b49bc3773 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_age_assurance_state.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_age_assurance_state.rs @@ -14,6 +14,16 @@ pub struct GetAgeAssuranceStateOutput<'a> { pub value: crate::app_bsky::unspecced::AgeAssuranceState<'a>, } +impl jacquard_common::IntoStatic for GetAgeAssuranceStateOutput<'_> { + type Output = GetAgeAssuranceStateOutput<'static>; + fn into_static(self) -> Self::Output { + GetAgeAssuranceStateOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct GetAgeAssuranceState; @@ -22,5 +32,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for GetAgeAssuranceState { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetAgeAssuranceStateOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_config.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_config.rs index e9ec82f38..7cb970195 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_config.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_config.rs @@ -15,6 +15,17 @@ pub struct LiveNowConfig<'a> { pub domains: Vec>, } +impl jacquard_common::IntoStatic for LiveNowConfig<'_> { + type Output = LiveNowConfig<'static>; + fn into_static(self) -> Self::Output { + LiveNowConfig { + did: self.did.into_static(), + domains: self.domains.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -26,6 +37,17 @@ pub struct GetConfigOutput<'a> { pub live_now: std::option::Option>>, } +impl jacquard_common::IntoStatic for GetConfigOutput<'_> { + type Output = GetConfigOutput<'static>; + fn into_static(self) -> Self::Output { + GetConfigOutput { + check_email_confirmed: self.check_email_confirmed.into_static(), + live_now: self.live_now.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct GetConfig; @@ -34,5 +56,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for GetConfig { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetConfigOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs.rs index 97eeb4329..d81b331e6 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs.rs @@ -5,13 +5,21 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } +impl jacquard_common::IntoStatic for GetOnboardingSuggestedStarterPacks { + type Output = GetOnboardingSuggestedStarterPacks; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +28,21 @@ pub struct GetOnboardingSuggestedStarterPacksOutput<'a> { pub starter_packs: Vec>, } +impl jacquard_common::IntoStatic for GetOnboardingSuggestedStarterPacksOutput<'_> { + type Output = GetOnboardingSuggestedStarterPacksOutput<'static>; + fn into_static(self) -> Self::Output { + GetOnboardingSuggestedStarterPacksOutput { + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetOnboardingSuggestedStarterPacks { const NSID: &'static str = "app.bsky.unspecced.getOnboardingSuggestedStarterPacks"; - const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; + const METHOD: jacquard_common::types::xrpc::XrpcMethod = + jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetOnboardingSuggestedStarterPacksOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; -} \ No newline at end of file + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; +} diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs_skeleton.rs index 8e9043994..ec2dcbdfe 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_onboarding_suggested_starter_packs_skeleton.rs @@ -5,9 +5,10 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -15,11 +16,12 @@ pub struct GetOnboardingSuggestedStarterPacksSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for GetOnboardingSuggestedStarterPacksSkeleton<'_> { - fn default() -> Self { - Self { - limit: Some(10i64), - viewer: Default::default(), +impl jacquard_common::IntoStatic for GetOnboardingSuggestedStarterPacksSkeleton<'_> { + type Output = GetOnboardingSuggestedStarterPacksSkeleton<'static>; + fn into_static(self) -> Self::Output { + GetOnboardingSuggestedStarterPacksSkeleton { + limit: self.limit.into_static(), + viewer: self.viewer.into_static(), } } } @@ -32,11 +34,22 @@ pub struct GetOnboardingSuggestedStarterPacksSkeletonOutput<'a> { pub starter_packs: Vec>, } +impl jacquard_common::IntoStatic +for GetOnboardingSuggestedStarterPacksSkeletonOutput<'_> { + type Output = GetOnboardingSuggestedStarterPacksSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + GetOnboardingSuggestedStarterPacksSkeletonOutput { + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetOnboardingSuggestedStarterPacksSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetOnboardingSuggestedStarterPacksSkeletonOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_popular_feed_generators.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_popular_feed_generators.rs index 8a5794f2d..462d99eea 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_popular_feed_generators.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_popular_feed_generators.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -18,12 +19,13 @@ pub struct GetPopularFeedGenerators<'a> { pub query: std::option::Option>, } -impl Default for GetPopularFeedGenerators<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - query: Default::default(), +impl jacquard_common::IntoStatic for GetPopularFeedGenerators<'_> { + type Output = GetPopularFeedGenerators<'static>; + fn into_static(self) -> Self::Output { + GetPopularFeedGenerators { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + query: self.query.into_static(), } } } @@ -39,10 +41,21 @@ pub struct GetPopularFeedGeneratorsOutput<'a> { pub feeds: Vec>, } +impl jacquard_common::IntoStatic for GetPopularFeedGeneratorsOutput<'_> { + type Output = GetPopularFeedGeneratorsOutput<'static>; + fn into_static(self) -> Self::Output { + GetPopularFeedGeneratorsOutput { + cursor: self.cursor.into_static(), + feeds: self.feeds.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetPopularFeedGenerators<'_> { const NSID: &'static str = "app.bsky.unspecced.getPopularFeedGenerators"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetPopularFeedGeneratorsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs index 1cc5f0c5c..8eedbeddf 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs @@ -5,20 +5,22 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetPostThreadOtherV2<'_> { - fn default() -> Self { - Self { - anchor: Default::default(), - prioritize_followed_users: Some(false), +impl jacquard_common::IntoStatic for GetPostThreadOtherV2<'_> { + type Output = GetPostThreadOtherV2<'static>; + fn into_static(self) -> Self::Output { + GetPostThreadOtherV2 { + anchor: self.anchor.into_static(), + prioritize_followed_users: self.prioritize_followed_users.into_static(), } } } @@ -32,12 +34,22 @@ pub struct GetPostThreadOtherV2Output<'a> { pub thread: Vec>, } +impl jacquard_common::IntoStatic for GetPostThreadOtherV2Output<'_> { + type Output = GetPostThreadOtherV2Output<'static>; + fn into_static(self) -> Self::Output { + GetPostThreadOtherV2Output { + thread: self.thread.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetPostThreadOtherV2<'_> { const NSID: &'static str = "app.bsky.unspecced.getPostThreadOtherV2"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetPostThreadOtherV2Output<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -59,4 +71,30 @@ pub struct ThreadItem<'a> { pub enum ThreadItemRecordValue<'a> { #[serde(rename = "app.bsky.unspecced.defs#threadItemPost")] DefsThreadItemPost(Box>), +} + +impl jacquard_common::IntoStatic for ThreadItemRecordValue<'_> { + type Output = ThreadItemRecordValue<'static>; + fn into_static(self) -> Self::Output { + match self { + ThreadItemRecordValue::DefsThreadItemPost(v) => { + ThreadItemRecordValue::DefsThreadItemPost(v.into_static()) + } + ThreadItemRecordValue::Unknown(v) => { + ThreadItemRecordValue::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for ThreadItem<'_> { + type Output = ThreadItem<'static>; + fn into_static(self) -> Self::Output { + ThreadItem { + depth: self.depth.into_static(), + uri: self.uri.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_post_thread_v2.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_post_thread_v2.rs index 78ea05e82..f143c60dd 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_post_thread_v2.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_post_thread_v2.rs @@ -5,33 +5,39 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for GetPostThreadV2<'_> { - fn default() -> Self { - Self { - above: Some(true), - anchor: Default::default(), - below: Some(6i64), - branching_factor: Some(10i64), - prioritize_followed_users: Some(false), - sort: Some(jacquard_common::CowStr::from("oldest")), +impl jacquard_common::IntoStatic for GetPostThreadV2<'_> { + type Output = GetPostThreadV2<'static>; + fn into_static(self) -> Self::Output { + GetPostThreadV2 { + above: self.above.into_static(), + anchor: self.anchor.into_static(), + below: self.below.into_static(), + branching_factor: self.branching_factor.into_static(), + prioritize_followed_users: self.prioritize_followed_users.into_static(), + sort: self.sort.into_static(), } } } @@ -50,12 +56,24 @@ pub struct GetPostThreadV2Output<'a> { pub threadgate: std::option::Option>, } +impl jacquard_common::IntoStatic for GetPostThreadV2Output<'_> { + type Output = GetPostThreadV2Output<'static>; + fn into_static(self) -> Self::Output { + GetPostThreadV2Output { + has_other_replies: self.has_other_replies.into_static(), + thread: self.thread.into_static(), + threadgate: self.threadgate.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetPostThreadV2<'_> { const NSID: &'static str = "app.bsky.unspecced.getPostThreadV2"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetPostThreadV2Output<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -85,4 +103,39 @@ pub enum ThreadItemRecordValue<'a> { DefsThreadItemNotFound(Box>), #[serde(rename = "app.bsky.unspecced.defs#threadItemBlocked")] DefsThreadItemBlocked(Box>), +} + +impl jacquard_common::IntoStatic for ThreadItemRecordValue<'_> { + type Output = ThreadItemRecordValue<'static>; + fn into_static(self) -> Self::Output { + match self { + ThreadItemRecordValue::DefsThreadItemPost(v) => { + ThreadItemRecordValue::DefsThreadItemPost(v.into_static()) + } + ThreadItemRecordValue::DefsThreadItemNoUnauthenticated(v) => { + ThreadItemRecordValue::DefsThreadItemNoUnauthenticated(v.into_static()) + } + ThreadItemRecordValue::DefsThreadItemNotFound(v) => { + ThreadItemRecordValue::DefsThreadItemNotFound(v.into_static()) + } + ThreadItemRecordValue::DefsThreadItemBlocked(v) => { + ThreadItemRecordValue::DefsThreadItemBlocked(v.into_static()) + } + ThreadItemRecordValue::Unknown(v) => { + ThreadItemRecordValue::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for ThreadItem<'_> { + type Output = ThreadItem<'static>; + fn into_static(self) -> Self::Output { + ThreadItem { + depth: self.depth.into_static(), + uri: self.uri.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_feeds.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_feeds.rs index c578172e9..359e35d94 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_feeds.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_feeds.rs @@ -5,13 +5,21 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } +impl jacquard_common::IntoStatic for GetSuggestedFeeds { + type Output = GetSuggestedFeeds; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +28,20 @@ pub struct GetSuggestedFeedsOutput<'a> { pub feeds: Vec>, } +impl jacquard_common::IntoStatic for GetSuggestedFeedsOutput<'_> { + type Output = GetSuggestedFeedsOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedFeedsOutput { + feeds: self.feeds.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestedFeeds { const NSID: &'static str = "app.bsky.unspecced.getSuggestedFeeds"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestedFeedsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_feeds_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_feeds_skeleton.rs index bdec73add..61170effd 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_feeds_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_feeds_skeleton.rs @@ -5,9 +5,10 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -15,11 +16,12 @@ pub struct GetSuggestedFeedsSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for GetSuggestedFeedsSkeleton<'_> { - fn default() -> Self { - Self { - limit: Some(10i64), - viewer: Default::default(), +impl jacquard_common::IntoStatic for GetSuggestedFeedsSkeleton<'_> { + type Output = GetSuggestedFeedsSkeleton<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedFeedsSkeleton { + limit: self.limit.into_static(), + viewer: self.viewer.into_static(), } } } @@ -32,10 +34,20 @@ pub struct GetSuggestedFeedsSkeletonOutput<'a> { pub feeds: Vec>, } +impl jacquard_common::IntoStatic for GetSuggestedFeedsSkeletonOutput<'_> { + type Output = GetSuggestedFeedsSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedFeedsSkeletonOutput { + feeds: self.feeds.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestedFeedsSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.getSuggestedFeedsSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestedFeedsSkeletonOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_starter_packs.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_starter_packs.rs index 1311b51c3..6dc04605b 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_starter_packs.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_starter_packs.rs @@ -5,13 +5,21 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } +impl jacquard_common::IntoStatic for GetSuggestedStarterPacks { + type Output = GetSuggestedStarterPacks; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +28,20 @@ pub struct GetSuggestedStarterPacksOutput<'a> { pub starter_packs: Vec>, } +impl jacquard_common::IntoStatic for GetSuggestedStarterPacksOutput<'_> { + type Output = GetSuggestedStarterPacksOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedStarterPacksOutput { + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestedStarterPacks { const NSID: &'static str = "app.bsky.unspecced.getSuggestedStarterPacks"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestedStarterPacksOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_starter_packs_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_starter_packs_skeleton.rs index e3432da86..de85597ce 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_starter_packs_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_starter_packs_skeleton.rs @@ -5,9 +5,10 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -15,11 +16,12 @@ pub struct GetSuggestedStarterPacksSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for GetSuggestedStarterPacksSkeleton<'_> { - fn default() -> Self { - Self { - limit: Some(10i64), - viewer: Default::default(), +impl jacquard_common::IntoStatic for GetSuggestedStarterPacksSkeleton<'_> { + type Output = GetSuggestedStarterPacksSkeleton<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedStarterPacksSkeleton { + limit: self.limit.into_static(), + viewer: self.viewer.into_static(), } } } @@ -32,10 +34,20 @@ pub struct GetSuggestedStarterPacksSkeletonOutput<'a> { pub starter_packs: Vec>, } +impl jacquard_common::IntoStatic for GetSuggestedStarterPacksSkeletonOutput<'_> { + type Output = GetSuggestedStarterPacksSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedStarterPacksSkeletonOutput { + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestedStarterPacksSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.getSuggestedStarterPacksSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestedStarterPacksSkeletonOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_users.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_users.rs index 1379cb15e..f26ab80d6 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_users.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_users.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for GetSuggestedUsers<'_> { - fn default() -> Self { - Self { - category: Default::default(), - limit: Some(25i64), +impl jacquard_common::IntoStatic for GetSuggestedUsers<'_> { + type Output = GetSuggestedUsers<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedUsers { + category: self.category.into_static(), + limit: self.limit.into_static(), } } } @@ -32,10 +34,20 @@ pub struct GetSuggestedUsersOutput<'a> { pub actors: Vec>, } +impl jacquard_common::IntoStatic for GetSuggestedUsersOutput<'_> { + type Output = GetSuggestedUsersOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedUsersOutput { + actors: self.actors.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestedUsers<'_> { const NSID: &'static str = "app.bsky.unspecced.getSuggestedUsers"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestedUsersOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_users_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_users_skeleton.rs index 9a8eb07d9..01f24c2da 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_users_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_suggested_users_skeleton.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -18,12 +19,13 @@ pub struct GetSuggestedUsersSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for GetSuggestedUsersSkeleton<'_> { - fn default() -> Self { - Self { - category: Default::default(), - limit: Some(25i64), - viewer: Default::default(), +impl jacquard_common::IntoStatic for GetSuggestedUsersSkeleton<'_> { + type Output = GetSuggestedUsersSkeleton<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedUsersSkeleton { + category: self.category.into_static(), + limit: self.limit.into_static(), + viewer: self.viewer.into_static(), } } } @@ -36,10 +38,20 @@ pub struct GetSuggestedUsersSkeletonOutput<'a> { pub dids: Vec>, } +impl jacquard_common::IntoStatic for GetSuggestedUsersSkeletonOutput<'_> { + type Output = GetSuggestedUsersSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestedUsersSkeletonOutput { + dids: self.dids.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestedUsersSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.getSuggestedUsersSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestedUsersSkeletonOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_suggestions_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_suggestions_skeleton.rs index f44ccb2d8..ef82d6836 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_suggestions_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_suggestions_skeleton.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -21,13 +22,14 @@ pub struct GetSuggestionsSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for GetSuggestionsSkeleton<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - relative_to_did: Default::default(), - viewer: Default::default(), +impl jacquard_common::IntoStatic for GetSuggestionsSkeleton<'_> { + type Output = GetSuggestionsSkeleton<'static>; + fn into_static(self) -> Self::Output { + GetSuggestionsSkeleton { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + relative_to_did: self.relative_to_did.into_static(), + viewer: self.viewer.into_static(), } } } @@ -50,10 +52,23 @@ pub struct GetSuggestionsSkeletonOutput<'a> { pub relative_to_did: std::option::Option>, } +impl jacquard_common::IntoStatic for GetSuggestionsSkeletonOutput<'_> { + type Output = GetSuggestionsSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + GetSuggestionsSkeletonOutput { + actors: self.actors.into_static(), + cursor: self.cursor.into_static(), + rec_id: self.rec_id.into_static(), + relative_to_did: self.relative_to_did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSuggestionsSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.getSuggestionsSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSuggestionsSkeletonOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_tagged_suggestions.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_tagged_suggestions.rs index f5da5332f..ba2325c9f 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_tagged_suggestions.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_tagged_suggestions.rs @@ -8,6 +8,13 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetTaggedSuggestions {} +impl jacquard_common::IntoStatic for GetTaggedSuggestions { + type Output = GetTaggedSuggestions; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -16,12 +23,22 @@ pub struct GetTaggedSuggestionsOutput<'a> { pub suggestions: Vec>, } +impl jacquard_common::IntoStatic for GetTaggedSuggestionsOutput<'_> { + type Output = GetTaggedSuggestionsOutput<'static>; + fn into_static(self) -> Self::Output { + GetTaggedSuggestionsOutput { + suggestions: self.suggestions.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetTaggedSuggestions { const NSID: &'static str = "app.bsky.unspecced.getTaggedSuggestions"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetTaggedSuggestionsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -34,4 +51,16 @@ pub struct Suggestion<'a> { pub subject_type: jacquard_common::CowStr<'a>, #[serde(borrow)] pub tag: jacquard_common::CowStr<'a>, +} + +impl jacquard_common::IntoStatic for Suggestion<'_> { + type Output = Suggestion<'static>; + fn into_static(self) -> Self::Output { + Suggestion { + subject: self.subject.into_static(), + subject_type: self.subject_type.into_static(), + tag: self.tag.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_trending_topics.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_trending_topics.rs index 843b638a7..4978956ad 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_trending_topics.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_trending_topics.rs @@ -5,9 +5,10 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -15,11 +16,12 @@ pub struct GetTrendingTopics<'a> { pub viewer: std::option::Option>, } -impl Default for GetTrendingTopics<'_> { - fn default() -> Self { - Self { - limit: Some(10i64), - viewer: Default::default(), +impl jacquard_common::IntoStatic for GetTrendingTopics<'_> { + type Output = GetTrendingTopics<'static>; + fn into_static(self) -> Self::Output { + GetTrendingTopics { + limit: self.limit.into_static(), + viewer: self.viewer.into_static(), } } } @@ -34,10 +36,21 @@ pub struct GetTrendingTopicsOutput<'a> { pub topics: Vec>, } +impl jacquard_common::IntoStatic for GetTrendingTopicsOutput<'_> { + type Output = GetTrendingTopicsOutput<'static>; + fn into_static(self) -> Self::Output { + GetTrendingTopicsOutput { + suggested: self.suggested.into_static(), + topics: self.topics.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetTrendingTopics<'_> { const NSID: &'static str = "app.bsky.unspecced.getTrendingTopics"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetTrendingTopicsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_trends.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_trends.rs index f3ddbed79..efd924b1e 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_trends.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_trends.rs @@ -5,13 +5,21 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } +impl jacquard_common::IntoStatic for GetTrends { + type Output = GetTrends; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +28,20 @@ pub struct GetTrendsOutput<'a> { pub trends: Vec>, } +impl jacquard_common::IntoStatic for GetTrendsOutput<'_> { + type Output = GetTrendsOutput<'static>; + fn into_static(self) -> Self::Output { + GetTrendsOutput { + trends: self.trends.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetTrends { const NSID: &'static str = "app.bsky.unspecced.getTrends"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetTrendsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/get_trends_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/get_trends_skeleton.rs index 6ab527118..ffb81928c 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/get_trends_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/get_trends_skeleton.rs @@ -5,9 +5,10 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -15,11 +16,12 @@ pub struct GetTrendsSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for GetTrendsSkeleton<'_> { - fn default() -> Self { - Self { - limit: Some(10i64), - viewer: Default::default(), +impl jacquard_common::IntoStatic for GetTrendsSkeleton<'_> { + type Output = GetTrendsSkeleton<'static>; + fn into_static(self) -> Self::Output { + GetTrendsSkeleton { + limit: self.limit.into_static(), + viewer: self.viewer.into_static(), } } } @@ -32,10 +34,20 @@ pub struct GetTrendsSkeletonOutput<'a> { pub trends: Vec>, } +impl jacquard_common::IntoStatic for GetTrendsSkeletonOutput<'_> { + type Output = GetTrendsSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + GetTrendsSkeletonOutput { + trends: self.trends.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetTrendsSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.getTrendsSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetTrendsSkeletonOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/unspecced/init_age_assurance.rs b/crates/jacquard-api/src/app_bsky/unspecced/init_age_assurance.rs index b2dd02d95..4a5b4c0ad 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/init_age_assurance.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/init_age_assurance.rs @@ -20,6 +20,18 @@ pub struct InitAgeAssurance<'a> { pub language: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for InitAgeAssurance<'_> { + type Output = InitAgeAssurance<'static>; + fn into_static(self) -> Self::Output { + InitAgeAssurance { + country_code: self.country_code.into_static(), + email: self.email.into_static(), + language: self.language.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -29,6 +41,16 @@ pub struct InitAgeAssuranceOutput<'a> { pub value: crate::app_bsky::unspecced::AgeAssuranceState<'a>, } +impl jacquard_common::IntoStatic for InitAgeAssuranceOutput<'_> { + type Output = InitAgeAssuranceOutput<'static>; + fn into_static(self) -> Self::Output { + InitAgeAssuranceOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -80,6 +102,26 @@ impl std::fmt::Display for InitAgeAssuranceError<'_> { } } +impl jacquard_common::IntoStatic for InitAgeAssuranceError<'_> { + type Output = InitAgeAssuranceError<'static>; + fn into_static(self) -> Self::Output { + match self { + InitAgeAssuranceError::InvalidEmail(v) => { + InitAgeAssuranceError::InvalidEmail(v.into_static()) + } + InitAgeAssuranceError::DidTooLong(v) => { + InitAgeAssuranceError::DidTooLong(v.into_static()) + } + InitAgeAssuranceError::InvalidInitiation(v) => { + InitAgeAssuranceError::InvalidInitiation(v.into_static()) + } + InitAgeAssuranceError::Unknown(v) => { + InitAgeAssuranceError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for InitAgeAssurance<'_> { const NSID: &'static str = "app.bsky.unspecced.initAgeAssurance"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/app_bsky/unspecced/search_actors_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/search_actors_skeleton.rs index 02731077f..a0fe4c25f 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/search_actors_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/search_actors_skeleton.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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)] @@ -22,14 +23,15 @@ pub struct SearchActorsSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for SearchActorsSkeleton<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(25i64), - q: Default::default(), - typeahead: Default::default(), - viewer: Default::default(), +impl jacquard_common::IntoStatic for SearchActorsSkeleton<'_> { + type Output = SearchActorsSkeleton<'static>; + fn into_static(self) -> Self::Output { + SearchActorsSkeleton { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + q: self.q.into_static(), + typeahead: self.typeahead.into_static(), + viewer: self.viewer.into_static(), } } } @@ -48,6 +50,18 @@ pub struct SearchActorsSkeletonOutput<'a> { pub hits_total: std::option::Option, } +impl jacquard_common::IntoStatic for SearchActorsSkeletonOutput<'_> { + type Output = SearchActorsSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + SearchActorsSkeletonOutput { + actors: self.actors.into_static(), + cursor: self.cursor.into_static(), + hits_total: self.hits_total.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -81,6 +95,20 @@ impl std::fmt::Display for SearchActorsSkeletonError<'_> { } } +impl jacquard_common::IntoStatic for SearchActorsSkeletonError<'_> { + type Output = SearchActorsSkeletonError<'static>; + fn into_static(self) -> Self::Output { + match self { + SearchActorsSkeletonError::BadQueryString(v) => { + SearchActorsSkeletonError::BadQueryString(v.into_static()) + } + SearchActorsSkeletonError::Unknown(v) => { + SearchActorsSkeletonError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchActorsSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.searchActorsSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/unspecced/search_posts_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/search_posts_skeleton.rs index 763f874d6..31637ca29 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/search_posts_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/search_posts_skeleton.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct SearchPostsSkeleton<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -19,6 +19,7 @@ pub struct SearchPostsSkeleton<'a> { 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")] @@ -29,6 +30,7 @@ pub struct SearchPostsSkeleton<'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>, @@ -46,22 +48,23 @@ pub struct SearchPostsSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for SearchPostsSkeleton<'_> { - fn default() -> Self { - Self { - author: Default::default(), - cursor: Default::default(), - domain: Default::default(), - lang: Default::default(), - limit: Some(25i64), - mentions: Default::default(), - q: Default::default(), - since: Default::default(), - sort: Some(jacquard_common::CowStr::from("latest")), - tag: Default::default(), - until: Default::default(), - url: Default::default(), - viewer: Default::default(), +impl jacquard_common::IntoStatic for SearchPostsSkeleton<'_> { + type Output = SearchPostsSkeleton<'static>; + fn into_static(self) -> Self::Output { + SearchPostsSkeleton { + author: self.author.into_static(), + cursor: self.cursor.into_static(), + domain: self.domain.into_static(), + lang: self.lang.into_static(), + limit: self.limit.into_static(), + mentions: self.mentions.into_static(), + q: self.q.into_static(), + since: self.since.into_static(), + sort: self.sort.into_static(), + tag: self.tag.into_static(), + until: self.until.into_static(), + url: self.url.into_static(), + viewer: self.viewer.into_static(), } } } @@ -80,6 +83,18 @@ pub struct SearchPostsSkeletonOutput<'a> { pub posts: Vec>, } +impl jacquard_common::IntoStatic for SearchPostsSkeletonOutput<'_> { + type Output = SearchPostsSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + SearchPostsSkeletonOutput { + cursor: self.cursor.into_static(), + hits_total: self.hits_total.into_static(), + posts: self.posts.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -113,6 +128,20 @@ impl std::fmt::Display for SearchPostsSkeletonError<'_> { } } +impl jacquard_common::IntoStatic for SearchPostsSkeletonError<'_> { + type Output = SearchPostsSkeletonError<'static>; + fn into_static(self) -> Self::Output { + match self { + SearchPostsSkeletonError::BadQueryString(v) => { + SearchPostsSkeletonError::BadQueryString(v.into_static()) + } + SearchPostsSkeletonError::Unknown(v) => { + SearchPostsSkeletonError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchPostsSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.searchPostsSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/unspecced/search_starter_packs_skeleton.rs b/crates/jacquard-api/src/app_bsky/unspecced/search_starter_packs_skeleton.rs index f1cde22a4..a09ac9fef 100644 --- a/crates/jacquard-api/src/app_bsky/unspecced/search_starter_packs_skeleton.rs +++ b/crates/jacquard-api/src/app_bsky/unspecced/search_starter_packs_skeleton.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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)] @@ -20,13 +21,14 @@ pub struct SearchStarterPacksSkeleton<'a> { pub viewer: std::option::Option>, } -impl Default for SearchStarterPacksSkeleton<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(25i64), - q: Default::default(), - viewer: Default::default(), +impl jacquard_common::IntoStatic for SearchStarterPacksSkeleton<'_> { + type Output = SearchStarterPacksSkeleton<'static>; + fn into_static(self) -> Self::Output { + SearchStarterPacksSkeleton { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + q: self.q.into_static(), + viewer: self.viewer.into_static(), } } } @@ -45,6 +47,18 @@ pub struct SearchStarterPacksSkeletonOutput<'a> { pub starter_packs: Vec>, } +impl jacquard_common::IntoStatic for SearchStarterPacksSkeletonOutput<'_> { + type Output = SearchStarterPacksSkeletonOutput<'static>; + fn into_static(self) -> Self::Output { + SearchStarterPacksSkeletonOutput { + cursor: self.cursor.into_static(), + hits_total: self.hits_total.into_static(), + starter_packs: self.starter_packs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -78,6 +92,20 @@ impl std::fmt::Display for SearchStarterPacksSkeletonError<'_> { } } +impl jacquard_common::IntoStatic for SearchStarterPacksSkeletonError<'_> { + type Output = SearchStarterPacksSkeletonError<'static>; + fn into_static(self) -> Self::Output { + match self { + SearchStarterPacksSkeletonError::BadQueryString(v) => { + SearchStarterPacksSkeletonError::BadQueryString(v.into_static()) + } + SearchStarterPacksSkeletonError::Unknown(v) => { + SearchStarterPacksSkeletonError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchStarterPacksSkeleton<'_> { const NSID: &'static str = "app.bsky.unspecced.searchStarterPacksSkeleton"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/app_bsky/video.rs b/crates/jacquard-api/src/app_bsky/video.rs index 4d9f51d9b..36ff12197 100644 --- a/crates/jacquard-api/src/app_bsky/video.rs +++ b/crates/jacquard-api/src/app_bsky/video.rs @@ -32,4 +32,20 @@ pub struct JobStatus<'a> { ///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>, +} + +impl jacquard_common::IntoStatic for JobStatus<'_> { + type Output = JobStatus<'static>; + fn into_static(self) -> Self::Output { + JobStatus { + blob: self.blob.into_static(), + did: self.did.into_static(), + error: self.error.into_static(), + job_id: self.job_id.into_static(), + message: self.message.into_static(), + progress: self.progress.into_static(), + state: self.state.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/video/get_job_status.rs b/crates/jacquard-api/src/app_bsky/video/get_job_status.rs index f54f46557..8c48ce7e7 100644 --- a/crates/jacquard-api/src/app_bsky/video/get_job_status.rs +++ b/crates/jacquard-api/src/app_bsky/video/get_job_status.rs @@ -12,6 +12,15 @@ pub struct GetJobStatus<'a> { pub job_id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for GetJobStatus<'_> { + type Output = GetJobStatus<'static>; + fn into_static(self) -> Self::Output { + GetJobStatus { + job_id: self.job_id.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetJobStatusOutput<'a> { pub job_status: crate::app_bsky::video::JobStatus<'a>, } +impl jacquard_common::IntoStatic for GetJobStatusOutput<'_> { + type Output = GetJobStatusOutput<'static>; + fn into_static(self) -> Self::Output { + GetJobStatusOutput { + job_status: self.job_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetJobStatus<'_> { const NSID: &'static str = "app.bsky.video.getJobStatus"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetJobStatusOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/video/get_upload_limits.rs b/crates/jacquard-api/src/app_bsky/video/get_upload_limits.rs index 0ee022da6..d763b9b9b 100644 --- a/crates/jacquard-api/src/app_bsky/video/get_upload_limits.rs +++ b/crates/jacquard-api/src/app_bsky/video/get_upload_limits.rs @@ -22,6 +22,20 @@ pub struct GetUploadLimitsOutput<'a> { pub remaining_daily_videos: std::option::Option, } +impl jacquard_common::IntoStatic for GetUploadLimitsOutput<'_> { + type Output = GetUploadLimitsOutput<'static>; + fn into_static(self) -> Self::Output { + GetUploadLimitsOutput { + can_upload: self.can_upload.into_static(), + error: self.error.into_static(), + message: self.message.into_static(), + remaining_daily_bytes: self.remaining_daily_bytes.into_static(), + remaining_daily_videos: self.remaining_daily_videos.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct GetUploadLimits; @@ -30,5 +44,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for GetUploadLimits { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetUploadLimitsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/app_bsky/video/upload_video.rs b/crates/jacquard-api/src/app_bsky/video/upload_video.rs index 9c0ad28a6..a7f783024 100644 --- a/crates/jacquard-api/src/app_bsky/video/upload_video.rs +++ b/crates/jacquard-api/src/app_bsky/video/upload_video.rs @@ -9,6 +9,15 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UploadVideo<'a> {} +impl jacquard_common::IntoStatic for UploadVideo<'_> { + type Output = UploadVideo<'static>; + fn into_static(self) -> Self::Output { + UploadVideo { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -17,6 +26,16 @@ pub struct UploadVideoOutput<'a> { pub job_status: crate::app_bsky::video::JobStatus<'a>, } +impl jacquard_common::IntoStatic for UploadVideoOutput<'_> { + type Output = UploadVideoOutput<'static>; + fn into_static(self) -> Self::Output { + UploadVideoOutput { + job_status: self.job_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UploadVideo<'_> { const NSID: &'static str = "app.bsky.video.uploadVideo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +43,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UploadVideo<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = UploadVideoOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/actor.rs b/crates/jacquard-api/src/chat_bsky/actor.rs index 590499d2b..986d0ff66 100644 --- a/crates/jacquard-api/src/chat_bsky/actor.rs +++ b/crates/jacquard-api/src/chat_bsky/actor.rs @@ -38,4 +38,22 @@ pub struct ProfileViewBasic<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer: std::option::Option>, +} + +impl jacquard_common::IntoStatic for ProfileViewBasic<'_> { + type Output = ProfileViewBasic<'static>; + fn into_static(self) -> Self::Output { + ProfileViewBasic { + associated: self.associated.into_static(), + avatar: self.avatar.into_static(), + chat_disabled: self.chat_disabled.into_static(), + did: self.did.into_static(), + display_name: self.display_name.into_static(), + handle: self.handle.into_static(), + labels: self.labels.into_static(), + verification: self.verification.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/actor/declaration.rs b/crates/jacquard-api/src/chat_bsky/actor/declaration.rs index b64ed1ef2..b5cfd2a1b 100644 --- a/crates/jacquard-api/src/chat_bsky/actor/declaration.rs +++ b/crates/jacquard-api/src/chat_bsky/actor/declaration.rs @@ -16,4 +16,14 @@ pub struct Declaration<'a> { impl jacquard_common::types::collection::Collection for Declaration<'_> { const NSID: &'static str = "chat.bsky.actor.declaration"; +} + +impl jacquard_common::IntoStatic for Declaration<'_> { + type Output = Declaration<'static>; + fn into_static(self) -> Self::Output { + Declaration { + allow_incoming: self.allow_incoming.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/actor/delete_account.rs b/crates/jacquard-api/src/chat_bsky/actor/delete_account.rs index 177dd520e..41dd69289 100644 --- a/crates/jacquard-api/src/chat_bsky/actor/delete_account.rs +++ b/crates/jacquard-api/src/chat_bsky/actor/delete_account.rs @@ -9,6 +9,15 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct DeleteAccountOutput<'a> {} +impl jacquard_common::IntoStatic for DeleteAccountOutput<'_> { + type Output = DeleteAccountOutput<'static>; + fn into_static(self) -> Self::Output { + DeleteAccountOutput { + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct DeleteAccount; @@ -19,5 +28,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DeleteAccount { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = DeleteAccountOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/actor/export_account_data.rs b/crates/jacquard-api/src/chat_bsky/actor/export_account_data.rs index 1a480592c..d05754c55 100644 --- a/crates/jacquard-api/src/chat_bsky/actor/export_account_data.rs +++ b/crates/jacquard-api/src/chat_bsky/actor/export_account_data.rs @@ -9,6 +9,15 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ExportAccountDataOutput<'a> {} +impl jacquard_common::IntoStatic for ExportAccountDataOutput<'_> { + type Output = ExportAccountDataOutput<'static>; + fn into_static(self) -> Self::Output { + ExportAccountDataOutput { + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct ExportAccountData; @@ -17,5 +26,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for ExportAccountData { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/jsonl"; type Output<'de> = ExportAccountDataOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo.rs b/crates/jacquard-api/src/chat_bsky/convo.rs index 9e85b572f..14b89863d 100644 --- a/crates/jacquard-api/src/chat_bsky/convo.rs +++ b/crates/jacquard-api/src/chat_bsky/convo.rs @@ -51,11 +51,50 @@ pub struct ConvoView<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ConvoViewRecordLastMessage<'a> {} +impl jacquard_common::IntoStatic for ConvoViewRecordLastMessage<'_> { + type Output = ConvoViewRecordLastMessage<'static>; + fn into_static(self) -> Self::Output { + match self { + ConvoViewRecordLastMessage::Unknown(v) => { + ConvoViewRecordLastMessage::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ConvoViewRecordLastReaction<'a> {} +impl jacquard_common::IntoStatic for ConvoViewRecordLastReaction<'_> { + type Output = ConvoViewRecordLastReaction<'static>; + fn into_static(self) -> Self::Output { + match self { + ConvoViewRecordLastReaction::Unknown(v) => { + ConvoViewRecordLastReaction::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for ConvoView<'_> { + type Output = ConvoView<'static>; + fn into_static(self) -> Self::Output { + ConvoView { + id: self.id.into_static(), + last_message: self.last_message.into_static(), + last_reaction: self.last_reaction.into_static(), + members: self.members.into_static(), + muted: self.muted.into_static(), + rev: self.rev.into_static(), + status: self.status.into_static(), + unread_count: self.unread_count.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -69,6 +108,19 @@ pub struct DeletedMessageView<'a> { pub sent_at: jacquard_common::types::string::Datetime, } +impl jacquard_common::IntoStatic for DeletedMessageView<'_> { + type Output = DeletedMessageView<'static>; + fn into_static(self) -> Self::Output { + DeletedMessageView { + id: self.id.into_static(), + rev: self.rev.into_static(), + sender: self.sender.into_static(), + sent_at: self.sent_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -79,6 +131,17 @@ pub struct LogAcceptConvo<'a> { pub rev: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LogAcceptConvo<'_> { + type Output = LogAcceptConvo<'static>; + fn into_static(self) -> Self::Output { + LogAcceptConvo { + convo_id: self.convo_id.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -98,6 +161,30 @@ pub struct LogAddReaction<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum LogAddReactionRecordMessage<'a> {} +impl jacquard_common::IntoStatic for LogAddReactionRecordMessage<'_> { + type Output = LogAddReactionRecordMessage<'static>; + fn into_static(self) -> Self::Output { + match self { + LogAddReactionRecordMessage::Unknown(v) => { + LogAddReactionRecordMessage::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for LogAddReaction<'_> { + type Output = LogAddReaction<'static>; + fn into_static(self) -> Self::Output { + LogAddReaction { + convo_id: self.convo_id.into_static(), + message: self.message.into_static(), + reaction: self.reaction.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -108,6 +195,17 @@ pub struct LogBeginConvo<'a> { pub rev: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LogBeginConvo<'_> { + type Output = LogBeginConvo<'static>; + fn into_static(self) -> Self::Output { + LogBeginConvo { + convo_id: self.convo_id.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -125,6 +223,29 @@ pub struct LogCreateMessage<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum LogCreateMessageRecordMessage<'a> {} +impl jacquard_common::IntoStatic for LogCreateMessageRecordMessage<'_> { + type Output = LogCreateMessageRecordMessage<'static>; + fn into_static(self) -> Self::Output { + match self { + LogCreateMessageRecordMessage::Unknown(v) => { + LogCreateMessageRecordMessage::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for LogCreateMessage<'_> { + type Output = LogCreateMessage<'static>; + fn into_static(self) -> Self::Output { + LogCreateMessage { + convo_id: self.convo_id.into_static(), + message: self.message.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -142,6 +263,29 @@ pub struct LogDeleteMessage<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum LogDeleteMessageRecordMessage<'a> {} +impl jacquard_common::IntoStatic for LogDeleteMessageRecordMessage<'_> { + type Output = LogDeleteMessageRecordMessage<'static>; + fn into_static(self) -> Self::Output { + match self { + LogDeleteMessageRecordMessage::Unknown(v) => { + LogDeleteMessageRecordMessage::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for LogDeleteMessage<'_> { + type Output = LogDeleteMessage<'static>; + fn into_static(self) -> Self::Output { + LogDeleteMessage { + convo_id: self.convo_id.into_static(), + message: self.message.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -152,6 +296,17 @@ pub struct LogLeaveConvo<'a> { pub rev: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LogLeaveConvo<'_> { + type Output = LogLeaveConvo<'static>; + fn into_static(self) -> Self::Output { + LogLeaveConvo { + convo_id: self.convo_id.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -162,6 +317,17 @@ pub struct LogMuteConvo<'a> { pub rev: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LogMuteConvo<'_> { + type Output = LogMuteConvo<'static>; + fn into_static(self) -> Self::Output { + LogMuteConvo { + convo_id: self.convo_id.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -179,6 +345,29 @@ pub struct LogReadMessage<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum LogReadMessageRecordMessage<'a> {} +impl jacquard_common::IntoStatic for LogReadMessageRecordMessage<'_> { + type Output = LogReadMessageRecordMessage<'static>; + fn into_static(self) -> Self::Output { + match self { + LogReadMessageRecordMessage::Unknown(v) => { + LogReadMessageRecordMessage::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for LogReadMessage<'_> { + type Output = LogReadMessage<'static>; + fn into_static(self) -> Self::Output { + LogReadMessage { + convo_id: self.convo_id.into_static(), + message: self.message.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -198,6 +387,30 @@ pub struct LogRemoveReaction<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum LogRemoveReactionRecordMessage<'a> {} +impl jacquard_common::IntoStatic for LogRemoveReactionRecordMessage<'_> { + type Output = LogRemoveReactionRecordMessage<'static>; + fn into_static(self) -> Self::Output { + match self { + LogRemoveReactionRecordMessage::Unknown(v) => { + LogRemoveReactionRecordMessage::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for LogRemoveReaction<'_> { + type Output = LogRemoveReaction<'static>; + fn into_static(self) -> Self::Output { + LogRemoveReaction { + convo_id: self.convo_id.into_static(), + message: self.message.into_static(), + reaction: self.reaction.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -208,6 +421,17 @@ pub struct LogUnmuteConvo<'a> { pub rev: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LogUnmuteConvo<'_> { + type Output = LogUnmuteConvo<'static>; + fn into_static(self) -> Self::Output { + LogUnmuteConvo { + convo_id: self.convo_id.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -218,6 +442,17 @@ pub struct MessageAndReactionView<'a> { pub reaction: crate::chat_bsky::convo::ReactionView<'a>, } +impl jacquard_common::IntoStatic for MessageAndReactionView<'_> { + type Output = MessageAndReactionView<'static>; + fn into_static(self) -> Self::Output { + MessageAndReactionView { + message: self.message.into_static(), + reaction: self.reaction.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -242,6 +477,32 @@ pub enum MessageInputRecordEmbed<'a> { Record(Box>), } +impl jacquard_common::IntoStatic for MessageInputRecordEmbed<'_> { + type Output = MessageInputRecordEmbed<'static>; + fn into_static(self) -> Self::Output { + match self { + MessageInputRecordEmbed::Record(v) => { + MessageInputRecordEmbed::Record(v.into_static()) + } + MessageInputRecordEmbed::Unknown(v) => { + MessageInputRecordEmbed::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for MessageInput<'_> { + type Output = MessageInput<'static>; + fn into_static(self) -> Self::Output { + MessageInput { + embed: self.embed.into_static(), + facets: self.facets.into_static(), + text: self.text.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -254,6 +515,18 @@ pub struct MessageRef<'a> { pub message_id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for MessageRef<'_> { + type Output = MessageRef<'static>; + fn into_static(self) -> Self::Output { + MessageRef { + convo_id: self.convo_id.into_static(), + did: self.did.into_static(), + message_id: self.message_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -289,6 +562,37 @@ pub enum MessageViewRecordEmbed<'a> { RecordView(Box>), } +impl jacquard_common::IntoStatic for MessageViewRecordEmbed<'_> { + type Output = MessageViewRecordEmbed<'static>; + fn into_static(self) -> Self::Output { + match self { + MessageViewRecordEmbed::RecordView(v) => { + MessageViewRecordEmbed::RecordView(v.into_static()) + } + MessageViewRecordEmbed::Unknown(v) => { + MessageViewRecordEmbed::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for MessageView<'_> { + type Output = MessageView<'static>; + fn into_static(self) -> Self::Output { + MessageView { + embed: self.embed.into_static(), + facets: self.facets.into_static(), + id: self.id.into_static(), + reactions: self.reactions.into_static(), + rev: self.rev.into_static(), + sender: self.sender.into_static(), + sent_at: self.sent_at.into_static(), + text: self.text.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -297,6 +601,16 @@ pub struct MessageViewSender<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for MessageViewSender<'_> { + type Output = MessageViewSender<'static>; + fn into_static(self) -> Self::Output { + MessageViewSender { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -308,10 +622,32 @@ pub struct ReactionView<'a> { pub value: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ReactionView<'_> { + type Output = ReactionView<'static>; + fn into_static(self) -> Self::Output { + ReactionView { + created_at: self.created_at.into_static(), + sender: self.sender.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ReactionViewSender<'a> { #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, +} + +impl jacquard_common::IntoStatic for ReactionViewSender<'_> { + type Output = ReactionViewSender<'static>; + fn into_static(self) -> Self::Output { + ReactionViewSender { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/accept_convo.rs b/crates/jacquard-api/src/chat_bsky/convo/accept_convo.rs index 8f83aa013..f6993ac0e 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/accept_convo.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/accept_convo.rs @@ -13,6 +13,16 @@ pub struct AcceptConvo<'a> { pub convo_id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AcceptConvo<'_> { + type Output = AcceptConvo<'static>; + fn into_static(self) -> Self::Output { + AcceptConvo { + convo_id: self.convo_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -23,6 +33,16 @@ pub struct AcceptConvoOutput<'a> { pub rev: std::option::Option>, } +impl jacquard_common::IntoStatic for AcceptConvoOutput<'_> { + type Output = AcceptConvoOutput<'static>; + fn into_static(self) -> Self::Output { + AcceptConvoOutput { + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for AcceptConvo<'_> { const NSID: &'static str = "chat.bsky.convo.acceptConvo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -30,5 +50,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for AcceptConvo<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = AcceptConvoOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/add_reaction.rs b/crates/jacquard-api/src/chat_bsky/convo/add_reaction.rs index 6d8d35d6f..ea8e4103c 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/add_reaction.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/add_reaction.rs @@ -17,6 +17,18 @@ pub struct AddReaction<'a> { pub value: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AddReaction<'_> { + type Output = AddReaction<'static>; + fn into_static(self) -> Self::Output { + AddReaction { + convo_id: self.convo_id.into_static(), + message_id: self.message_id.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -25,6 +37,16 @@ pub struct AddReactionOutput<'a> { pub message: crate::chat_bsky::convo::MessageView<'a>, } +impl jacquard_common::IntoStatic for AddReactionOutput<'_> { + type Output = AddReactionOutput<'static>; + fn into_static(self) -> Self::Output { + AddReactionOutput { + message: self.message.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -79,6 +101,24 @@ impl std::fmt::Display for AddReactionError<'_> { } } +impl jacquard_common::IntoStatic for AddReactionError<'_> { + type Output = AddReactionError<'static>; + fn into_static(self) -> Self::Output { + match self { + AddReactionError::ReactionMessageDeleted(v) => { + AddReactionError::ReactionMessageDeleted(v.into_static()) + } + AddReactionError::ReactionLimitReached(v) => { + AddReactionError::ReactionLimitReached(v.into_static()) + } + AddReactionError::ReactionInvalidValue(v) => { + AddReactionError::ReactionInvalidValue(v.into_static()) + } + AddReactionError::Unknown(v) => AddReactionError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for AddReaction<'_> { const NSID: &'static str = "chat.bsky.convo.addReaction"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/chat_bsky/convo/delete_message_for_self.rs b/crates/jacquard-api/src/chat_bsky/convo/delete_message_for_self.rs index b137e6bf8..8655cdac8 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/delete_message_for_self.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/delete_message_for_self.rs @@ -15,6 +15,17 @@ pub struct DeleteMessageForSelf<'a> { pub message_id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for DeleteMessageForSelf<'_> { + type Output = DeleteMessageForSelf<'static>; + fn into_static(self) -> Self::Output { + DeleteMessageForSelf { + convo_id: self.convo_id.into_static(), + message_id: self.message_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,6 +35,16 @@ pub struct DeleteMessageForSelfOutput<'a> { pub value: crate::chat_bsky::convo::DeletedMessageView<'a>, } +impl jacquard_common::IntoStatic for DeleteMessageForSelfOutput<'_> { + type Output = DeleteMessageForSelfOutput<'static>; + fn into_static(self) -> Self::Output { + DeleteMessageForSelfOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteMessageForSelf<'_> { const NSID: &'static str = "chat.bsky.convo.deleteMessageForSelf"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -31,5 +52,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DeleteMessageForSelf<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = DeleteMessageForSelfOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/get_convo.rs b/crates/jacquard-api/src/chat_bsky/convo/get_convo.rs index c5e9b7d32..9ce56ed1e 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/get_convo.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/get_convo.rs @@ -12,6 +12,15 @@ pub struct GetConvo<'a> { pub convo_id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for GetConvo<'_> { + type Output = GetConvo<'static>; + fn into_static(self) -> Self::Output { + GetConvo { + convo_id: self.convo_id.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetConvoOutput<'a> { pub convo: crate::chat_bsky::convo::ConvoView<'a>, } +impl jacquard_common::IntoStatic for GetConvoOutput<'_> { + type Output = GetConvoOutput<'static>; + fn into_static(self) -> Self::Output { + GetConvoOutput { + convo: self.convo.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetConvo<'_> { const NSID: &'static str = "chat.bsky.convo.getConvo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetConvoOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/get_convo_availability.rs b/crates/jacquard-api/src/chat_bsky/convo/get_convo_availability.rs index 11d9f0ced..96efc1002 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/get_convo_availability.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/get_convo_availability.rs @@ -12,6 +12,15 @@ pub struct GetConvoAvailability<'a> { pub members: Vec>, } +impl jacquard_common::IntoStatic for GetConvoAvailability<'_> { + type Output = GetConvoAvailability<'static>; + fn into_static(self) -> Self::Output { + GetConvoAvailability { + members: self.members.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -22,10 +31,21 @@ pub struct GetConvoAvailabilityOutput<'a> { pub convo: std::option::Option>, } +impl jacquard_common::IntoStatic for GetConvoAvailabilityOutput<'_> { + type Output = GetConvoAvailabilityOutput<'static>; + fn into_static(self) -> Self::Output { + GetConvoAvailabilityOutput { + can_chat: self.can_chat.into_static(), + convo: self.convo.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetConvoAvailability<'_> { const NSID: &'static str = "chat.bsky.convo.getConvoAvailability"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetConvoAvailabilityOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/get_convo_for_members.rs b/crates/jacquard-api/src/chat_bsky/convo/get_convo_for_members.rs index f6d306671..cbfade777 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/get_convo_for_members.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/get_convo_for_members.rs @@ -12,6 +12,15 @@ pub struct GetConvoForMembers<'a> { pub members: Vec>, } +impl jacquard_common::IntoStatic for GetConvoForMembers<'_> { + type Output = GetConvoForMembers<'static>; + fn into_static(self) -> Self::Output { + GetConvoForMembers { + members: self.members.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetConvoForMembersOutput<'a> { pub convo: crate::chat_bsky::convo::ConvoView<'a>, } +impl jacquard_common::IntoStatic for GetConvoForMembersOutput<'_> { + type Output = GetConvoForMembersOutput<'static>; + fn into_static(self) -> Self::Output { + GetConvoForMembersOutput { + convo: self.convo.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetConvoForMembers<'_> { const NSID: &'static str = "chat.bsky.convo.getConvoForMembers"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetConvoForMembersOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/get_log.rs b/crates/jacquard-api/src/chat_bsky/convo/get_log.rs index b1664289a..e2b355be5 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/get_log.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/get_log.rs @@ -13,6 +13,15 @@ pub struct GetLog<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for GetLog<'_> { + type Output = GetLog<'static>; + fn into_static(self) -> Self::Output { + GetLog { + cursor: self.cursor.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,10 +33,21 @@ pub struct GetLogOutput<'a> { pub logs: Vec>, } +impl jacquard_common::IntoStatic for GetLogOutput<'_> { + type Output = GetLogOutput<'static>; + fn into_static(self) -> Self::Output { + GetLogOutput { + cursor: self.cursor.into_static(), + logs: self.logs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetLog<'_> { const NSID: &'static str = "chat.bsky.convo.getLog"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetLogOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/get_messages.rs b/crates/jacquard-api/src/chat_bsky/convo/get_messages.rs index 43615aff6..7451b253e 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/get_messages.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/get_messages.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetMessages<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct GetMessages<'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, } -impl Default for GetMessages<'_> { - fn default() -> Self { - Self { - convo_id: Default::default(), - cursor: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetMessages<'_> { + type Output = GetMessages<'static>; + fn into_static(self) -> Self::Output { + GetMessages { + convo_id: self.convo_id.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -38,10 +40,21 @@ pub struct GetMessagesOutput<'a> { pub messages: Vec>, } +impl jacquard_common::IntoStatic for GetMessagesOutput<'_> { + type Output = GetMessagesOutput<'static>; + fn into_static(self) -> Self::Output { + GetMessagesOutput { + cursor: self.cursor.into_static(), + messages: self.messages.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetMessages<'_> { const NSID: &'static str = "chat.bsky.convo.getMessages"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetMessagesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/leave_convo.rs b/crates/jacquard-api/src/chat_bsky/convo/leave_convo.rs index 1f750d799..deda5f4bb 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/leave_convo.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/leave_convo.rs @@ -13,6 +13,16 @@ pub struct LeaveConvo<'a> { pub convo_id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LeaveConvo<'_> { + type Output = LeaveConvo<'static>; + fn into_static(self) -> Self::Output { + LeaveConvo { + convo_id: self.convo_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -23,6 +33,17 @@ pub struct LeaveConvoOutput<'a> { pub rev: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LeaveConvoOutput<'_> { + type Output = LeaveConvoOutput<'static>; + fn into_static(self) -> Self::Output { + LeaveConvoOutput { + convo_id: self.convo_id.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for LeaveConvo<'_> { const NSID: &'static str = "chat.bsky.convo.leaveConvo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -30,5 +51,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for LeaveConvo<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = LeaveConvoOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/list_convos.rs b/crates/jacquard-api/src/chat_bsky/convo/list_convos.rs index f31385f10..b3566e965 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/list_convos.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/list_convos.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -21,13 +22,14 @@ pub struct ListConvos<'a> { pub status: std::option::Option>, } -impl Default for ListConvos<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - read_state: Default::default(), - status: Default::default(), +impl jacquard_common::IntoStatic for ListConvos<'_> { + type Output = ListConvos<'static>; + fn into_static(self) -> Self::Output { + ListConvos { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + read_state: self.read_state.into_static(), + status: self.status.into_static(), } } } @@ -43,10 +45,21 @@ pub struct ListConvosOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for ListConvosOutput<'_> { + type Output = ListConvosOutput<'static>; + fn into_static(self) -> Self::Output { + ListConvosOutput { + convos: self.convos.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListConvos<'_> { const NSID: &'static str = "chat.bsky.convo.listConvos"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListConvosOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/mute_convo.rs b/crates/jacquard-api/src/chat_bsky/convo/mute_convo.rs index 26d387f04..805d2560e 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/mute_convo.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/mute_convo.rs @@ -13,6 +13,16 @@ pub struct MuteConvo<'a> { pub convo_id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for MuteConvo<'_> { + type Output = MuteConvo<'static>; + fn into_static(self) -> Self::Output { + MuteConvo { + convo_id: self.convo_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,6 +31,16 @@ pub struct MuteConvoOutput<'a> { pub convo: crate::chat_bsky::convo::ConvoView<'a>, } +impl jacquard_common::IntoStatic for MuteConvoOutput<'_> { + type Output = MuteConvoOutput<'static>; + fn into_static(self) -> Self::Output { + MuteConvoOutput { + convo: self.convo.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for MuteConvo<'_> { const NSID: &'static str = "chat.bsky.convo.muteConvo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -28,5 +48,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for MuteConvo<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = MuteConvoOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/remove_reaction.rs b/crates/jacquard-api/src/chat_bsky/convo/remove_reaction.rs index 6ceb29c3b..569889825 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/remove_reaction.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/remove_reaction.rs @@ -17,6 +17,18 @@ pub struct RemoveReaction<'a> { pub value: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RemoveReaction<'_> { + type Output = RemoveReaction<'static>; + fn into_static(self) -> Self::Output { + RemoveReaction { + convo_id: self.convo_id.into_static(), + message_id: self.message_id.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -25,6 +37,16 @@ pub struct RemoveReactionOutput<'a> { pub message: crate::chat_bsky::convo::MessageView<'a>, } +impl jacquard_common::IntoStatic for RemoveReactionOutput<'_> { + type Output = RemoveReactionOutput<'static>; + fn into_static(self) -> Self::Output { + RemoveReactionOutput { + message: self.message.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -69,6 +91,23 @@ impl std::fmt::Display for RemoveReactionError<'_> { } } +impl jacquard_common::IntoStatic for RemoveReactionError<'_> { + type Output = RemoveReactionError<'static>; + fn into_static(self) -> Self::Output { + match self { + RemoveReactionError::ReactionMessageDeleted(v) => { + RemoveReactionError::ReactionMessageDeleted(v.into_static()) + } + RemoveReactionError::ReactionInvalidValue(v) => { + RemoveReactionError::ReactionInvalidValue(v.into_static()) + } + RemoveReactionError::Unknown(v) => { + RemoveReactionError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RemoveReaction<'_> { const NSID: &'static str = "chat.bsky.convo.removeReaction"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/chat_bsky/convo/send_message.rs b/crates/jacquard-api/src/chat_bsky/convo/send_message.rs index c13596e22..c020a9101 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/send_message.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/send_message.rs @@ -15,6 +15,17 @@ pub struct SendMessage<'a> { pub message: crate::chat_bsky::convo::MessageInput<'a>, } +impl jacquard_common::IntoStatic for SendMessage<'_> { + type Output = SendMessage<'static>; + fn into_static(self) -> Self::Output { + SendMessage { + convo_id: self.convo_id.into_static(), + message: self.message.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,6 +35,16 @@ pub struct SendMessageOutput<'a> { pub value: crate::chat_bsky::convo::MessageView<'a>, } +impl jacquard_common::IntoStatic for SendMessageOutput<'_> { + type Output = SendMessageOutput<'static>; + fn into_static(self) -> Self::Output { + SendMessageOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SendMessage<'_> { const NSID: &'static str = "chat.bsky.convo.sendMessage"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -31,5 +52,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for SendMessage<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SendMessageOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/send_message_batch.rs b/crates/jacquard-api/src/chat_bsky/convo/send_message_batch.rs index d2c7e66da..6da72f0bd 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/send_message_batch.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/send_message_batch.rs @@ -15,6 +15,17 @@ pub struct BatchItem<'a> { pub message: crate::chat_bsky::convo::MessageInput<'a>, } +impl jacquard_common::IntoStatic for BatchItem<'_> { + type Output = BatchItem<'static>; + fn into_static(self) -> Self::Output { + BatchItem { + convo_id: self.convo_id.into_static(), + message: self.message.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -23,6 +34,16 @@ pub struct SendMessageBatch<'a> { pub items: Vec>, } +impl jacquard_common::IntoStatic for SendMessageBatch<'_> { + type Output = SendMessageBatch<'static>; + fn into_static(self) -> Self::Output { + SendMessageBatch { + items: self.items.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -31,6 +52,16 @@ pub struct SendMessageBatchOutput<'a> { pub items: Vec>, } +impl jacquard_common::IntoStatic for SendMessageBatchOutput<'_> { + type Output = SendMessageBatchOutput<'static>; + fn into_static(self) -> Self::Output { + SendMessageBatchOutput { + items: self.items.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SendMessageBatch<'_> { const NSID: &'static str = "chat.bsky.convo.sendMessageBatch"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -38,5 +69,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for SendMessageBatch<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SendMessageBatchOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/unmute_convo.rs b/crates/jacquard-api/src/chat_bsky/convo/unmute_convo.rs index ed8187f92..c3b6b8990 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/unmute_convo.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/unmute_convo.rs @@ -13,6 +13,16 @@ pub struct UnmuteConvo<'a> { pub convo_id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for UnmuteConvo<'_> { + type Output = UnmuteConvo<'static>; + fn into_static(self) -> Self::Output { + UnmuteConvo { + convo_id: self.convo_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,6 +31,16 @@ pub struct UnmuteConvoOutput<'a> { pub convo: crate::chat_bsky::convo::ConvoView<'a>, } +impl jacquard_common::IntoStatic for UnmuteConvoOutput<'_> { + type Output = UnmuteConvoOutput<'static>; + fn into_static(self) -> Self::Output { + UnmuteConvoOutput { + convo: self.convo.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UnmuteConvo<'_> { const NSID: &'static str = "chat.bsky.convo.unmuteConvo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -28,5 +48,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UnmuteConvo<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = UnmuteConvoOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/update_all_read.rs b/crates/jacquard-api/src/chat_bsky/convo/update_all_read.rs index 5074bf432..24a1faa9d 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/update_all_read.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/update_all_read.rs @@ -14,6 +14,16 @@ pub struct UpdateAllRead<'a> { pub status: std::option::Option>, } +impl jacquard_common::IntoStatic for UpdateAllRead<'_> { + type Output = UpdateAllRead<'static>; + fn into_static(self) -> Self::Output { + UpdateAllRead { + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -22,6 +32,16 @@ pub struct UpdateAllReadOutput<'a> { pub updated_count: i64, } +impl jacquard_common::IntoStatic for UpdateAllReadOutput<'_> { + type Output = UpdateAllReadOutput<'static>; + fn into_static(self) -> Self::Output { + UpdateAllReadOutput { + updated_count: self.updated_count.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateAllRead<'_> { const NSID: &'static str = "chat.bsky.convo.updateAllRead"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -29,5 +49,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateAllRead<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = UpdateAllReadOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/convo/update_read.rs b/crates/jacquard-api/src/chat_bsky/convo/update_read.rs index ae682558f..591d2cfb0 100644 --- a/crates/jacquard-api/src/chat_bsky/convo/update_read.rs +++ b/crates/jacquard-api/src/chat_bsky/convo/update_read.rs @@ -16,6 +16,17 @@ pub struct UpdateRead<'a> { pub message_id: std::option::Option>, } +impl jacquard_common::IntoStatic for UpdateRead<'_> { + type Output = UpdateRead<'static>; + fn into_static(self) -> Self::Output { + UpdateRead { + convo_id: self.convo_id.into_static(), + message_id: self.message_id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,6 +35,16 @@ pub struct UpdateReadOutput<'a> { pub convo: crate::chat_bsky::convo::ConvoView<'a>, } +impl jacquard_common::IntoStatic for UpdateReadOutput<'_> { + type Output = UpdateReadOutput<'static>; + fn into_static(self) -> Self::Output { + UpdateReadOutput { + convo: self.convo.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateRead<'_> { const NSID: &'static str = "chat.bsky.convo.updateRead"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -31,5 +52,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateRead<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = UpdateReadOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/moderation/get_actor_metadata.rs b/crates/jacquard-api/src/chat_bsky/moderation/get_actor_metadata.rs index 114c7a89e..4f1caa573 100644 --- a/crates/jacquard-api/src/chat_bsky/moderation/get_actor_metadata.rs +++ b/crates/jacquard-api/src/chat_bsky/moderation/get_actor_metadata.rs @@ -12,6 +12,15 @@ pub struct GetActorMetadata<'a> { pub actor: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetActorMetadata<'_> { + type Output = GetActorMetadata<'static>; + fn into_static(self) -> Self::Output { + GetActorMetadata { + actor: self.actor.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,12 +33,24 @@ pub struct GetActorMetadataOutput<'a> { pub month: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for GetActorMetadataOutput<'_> { + type Output = GetActorMetadataOutput<'static>; + fn into_static(self) -> Self::Output { + GetActorMetadataOutput { + all: self.all.into_static(), + day: self.day.into_static(), + month: self.month.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetActorMetadata<'_> { const NSID: &'static str = "chat.bsky.moderation.getActorMetadata"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetActorMetadataOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -40,4 +61,17 @@ pub struct Metadata<'a> { pub convos_started: i64, pub messages_received: i64, pub messages_sent: i64, +} + +impl jacquard_common::IntoStatic for Metadata<'_> { + type Output = Metadata<'static>; + fn into_static(self) -> Self::Output { + Metadata { + convos: self.convos.into_static(), + convos_started: self.convos_started.into_static(), + messages_received: self.messages_received.into_static(), + messages_sent: self.messages_sent.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/moderation/get_message_context.rs b/crates/jacquard-api/src/chat_bsky/moderation/get_message_context.rs index 4a54af8b8..9c4072827 100644 --- a/crates/jacquard-api/src/chat_bsky/moderation/get_message_context.rs +++ b/crates/jacquard-api/src/chat_bsky/moderation/get_message_context.rs @@ -5,11 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -19,13 +21,14 @@ pub struct GetMessageContext<'a> { pub message_id: jacquard_common::CowStr<'a>, } -impl Default for GetMessageContext<'_> { - fn default() -> Self { - Self { - after: Some(5i64), - before: Some(5i64), - convo_id: Default::default(), - message_id: Default::default(), +impl jacquard_common::IntoStatic for GetMessageContext<'_> { + type Output = GetMessageContext<'static>; + fn into_static(self) -> Self::Output { + GetMessageContext { + after: self.after.into_static(), + before: self.before.into_static(), + convo_id: self.convo_id.into_static(), + message_id: self.message_id.into_static(), } } } @@ -38,10 +41,20 @@ pub struct GetMessageContextOutput<'a> { pub messages: Vec>, } +impl jacquard_common::IntoStatic for GetMessageContextOutput<'_> { + type Output = GetMessageContextOutput<'static>; + fn into_static(self) -> Self::Output { + GetMessageContextOutput { + messages: self.messages.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetMessageContext<'_> { const NSID: &'static str = "chat.bsky.moderation.getMessageContext"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetMessageContextOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/chat_bsky/moderation/update_actor_access.rs b/crates/jacquard-api/src/chat_bsky/moderation/update_actor_access.rs index f3b1c5ea6..5b9276111 100644 --- a/crates/jacquard-api/src/chat_bsky/moderation/update_actor_access.rs +++ b/crates/jacquard-api/src/chat_bsky/moderation/update_actor_access.rs @@ -17,6 +17,18 @@ pub struct UpdateActorAccess<'a> { pub r#ref: std::option::Option>, } +impl jacquard_common::IntoStatic for UpdateActorAccess<'_> { + type Output = UpdateActorAccess<'static>; + fn into_static(self) -> Self::Output { + UpdateActorAccess { + actor: self.actor.into_static(), + allow_access: self.allow_access.into_static(), + r#ref: self.r#ref.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateActorAccess<'_> { const NSID: &'static str = "chat.bsky.moderation.updateActorAccess"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +36,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateActorAccess<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin.rs b/crates/jacquard-api/src/com_atproto/admin.rs index c7f188f82..3f479d274 100644 --- a/crates/jacquard-api/src/com_atproto/admin.rs +++ b/crates/jacquard-api/src/com_atproto/admin.rs @@ -62,6 +62,27 @@ pub struct AccountView<'a> { >, } +impl jacquard_common::IntoStatic for AccountView<'_> { + type Output = AccountView<'static>; + fn into_static(self) -> Self::Output { + AccountView { + deactivated_at: self.deactivated_at.into_static(), + did: self.did.into_static(), + email: self.email.into_static(), + email_confirmed_at: self.email_confirmed_at.into_static(), + handle: self.handle.into_static(), + indexed_at: self.indexed_at.into_static(), + invite_note: self.invite_note.into_static(), + invited_by: self.invited_by.into_static(), + invites: self.invites.into_static(), + invites_disabled: self.invites_disabled.into_static(), + related_records: self.related_records.into_static(), + threat_signatures: self.threat_signatures.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -75,6 +96,18 @@ pub struct RepoBlobRef<'a> { pub record_uri: std::option::Option>, } +impl jacquard_common::IntoStatic for RepoBlobRef<'_> { + type Output = RepoBlobRef<'static>; + fn into_static(self) -> Self::Output { + RepoBlobRef { + cid: self.cid.into_static(), + did: self.did.into_static(), + record_uri: self.record_uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -83,6 +116,16 @@ pub struct RepoRef<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for RepoRef<'_> { + type Output = RepoRef<'static>; + fn into_static(self) -> Self::Output { + RepoRef { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -93,6 +136,17 @@ pub struct StatusAttr<'a> { pub r#ref: std::option::Option>, } +impl jacquard_common::IntoStatic for StatusAttr<'_> { + type Output = StatusAttr<'static>; + fn into_static(self) -> Self::Output { + StatusAttr { + applied: self.applied.into_static(), + r#ref: self.r#ref.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -101,4 +155,15 @@ pub struct ThreatSignature<'a> { pub property: jacquard_common::CowStr<'a>, #[serde(borrow)] pub value: jacquard_common::CowStr<'a>, +} + +impl jacquard_common::IntoStatic for ThreatSignature<'_> { + type Output = ThreatSignature<'static>; + fn into_static(self) -> Self::Output { + ThreatSignature { + property: self.property.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/delete_account.rs b/crates/jacquard-api/src/com_atproto/admin/delete_account.rs index ca0edef15..e315b10a4 100644 --- a/crates/jacquard-api/src/com_atproto/admin/delete_account.rs +++ b/crates/jacquard-api/src/com_atproto/admin/delete_account.rs @@ -13,6 +13,16 @@ pub struct DeleteAccount<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for DeleteAccount<'_> { + type Output = DeleteAccount<'static>; + fn into_static(self) -> Self::Output { + DeleteAccount { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteAccount<'_> { const NSID: &'static str = "com.atproto.admin.deleteAccount"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DeleteAccount<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/disable_account_invites.rs b/crates/jacquard-api/src/com_atproto/admin/disable_account_invites.rs index f028f8bfa..4376675a2 100644 --- a/crates/jacquard-api/src/com_atproto/admin/disable_account_invites.rs +++ b/crates/jacquard-api/src/com_atproto/admin/disable_account_invites.rs @@ -17,6 +17,17 @@ pub struct DisableAccountInvites<'a> { pub note: std::option::Option>, } +impl jacquard_common::IntoStatic for DisableAccountInvites<'_> { + type Output = DisableAccountInvites<'static>; + fn into_static(self) -> Self::Output { + DisableAccountInvites { + account: self.account.into_static(), + note: self.note.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DisableAccountInvites<'_> { const NSID: &'static str = "com.atproto.admin.disableAccountInvites"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +35,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DisableAccountInvites<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/disable_invite_codes.rs b/crates/jacquard-api/src/com_atproto/admin/disable_invite_codes.rs index 044aa4266..b10116972 100644 --- a/crates/jacquard-api/src/com_atproto/admin/disable_invite_codes.rs +++ b/crates/jacquard-api/src/com_atproto/admin/disable_invite_codes.rs @@ -17,6 +17,17 @@ pub struct DisableInviteCodes<'a> { pub codes: std::option::Option>>, } +impl jacquard_common::IntoStatic for DisableInviteCodes<'_> { + type Output = DisableInviteCodes<'static>; + fn into_static(self) -> Self::Output { + DisableInviteCodes { + accounts: self.accounts.into_static(), + codes: self.codes.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DisableInviteCodes<'_> { const NSID: &'static str = "com.atproto.admin.disableInviteCodes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +35,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DisableInviteCodes<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/enable_account_invites.rs b/crates/jacquard-api/src/com_atproto/admin/enable_account_invites.rs index 6146399ad..476209f3d 100644 --- a/crates/jacquard-api/src/com_atproto/admin/enable_account_invites.rs +++ b/crates/jacquard-api/src/com_atproto/admin/enable_account_invites.rs @@ -17,6 +17,17 @@ pub struct EnableAccountInvites<'a> { pub note: std::option::Option>, } +impl jacquard_common::IntoStatic for EnableAccountInvites<'_> { + type Output = EnableAccountInvites<'static>; + fn into_static(self) -> Self::Output { + EnableAccountInvites { + account: self.account.into_static(), + note: self.note.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for EnableAccountInvites<'_> { const NSID: &'static str = "com.atproto.admin.enableAccountInvites"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +35,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for EnableAccountInvites<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/get_account_info.rs b/crates/jacquard-api/src/com_atproto/admin/get_account_info.rs index 1069146b8..76f016b12 100644 --- a/crates/jacquard-api/src/com_atproto/admin/get_account_info.rs +++ b/crates/jacquard-api/src/com_atproto/admin/get_account_info.rs @@ -12,6 +12,15 @@ pub struct GetAccountInfo<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetAccountInfo<'_> { + type Output = GetAccountInfo<'static>; + fn into_static(self) -> Self::Output { + GetAccountInfo { + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,10 +30,20 @@ pub struct GetAccountInfoOutput<'a> { pub value: crate::com_atproto::admin::AccountView<'a>, } +impl jacquard_common::IntoStatic for GetAccountInfoOutput<'_> { + type Output = GetAccountInfoOutput<'static>; + fn into_static(self) -> Self::Output { + GetAccountInfoOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetAccountInfo<'_> { const NSID: &'static str = "com.atproto.admin.getAccountInfo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetAccountInfoOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/get_account_infos.rs b/crates/jacquard-api/src/com_atproto/admin/get_account_infos.rs index 49390dcf7..d8e2e1702 100644 --- a/crates/jacquard-api/src/com_atproto/admin/get_account_infos.rs +++ b/crates/jacquard-api/src/com_atproto/admin/get_account_infos.rs @@ -12,6 +12,15 @@ pub struct GetAccountInfos<'a> { pub dids: Vec>, } +impl jacquard_common::IntoStatic for GetAccountInfos<'_> { + type Output = GetAccountInfos<'static>; + fn into_static(self) -> Self::Output { + GetAccountInfos { + dids: self.dids.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetAccountInfosOutput<'a> { pub infos: Vec>, } +impl jacquard_common::IntoStatic for GetAccountInfosOutput<'_> { + type Output = GetAccountInfosOutput<'static>; + fn into_static(self) -> Self::Output { + GetAccountInfosOutput { + infos: self.infos.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetAccountInfos<'_> { const NSID: &'static str = "com.atproto.admin.getAccountInfos"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetAccountInfosOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/get_invite_codes.rs b/crates/jacquard-api/src/com_atproto/admin/get_invite_codes.rs index a85cb05f1..aa1f54369 100644 --- a/crates/jacquard-api/src/com_atproto/admin/get_invite_codes.rs +++ b/crates/jacquard-api/src/com_atproto/admin/get_invite_codes.rs @@ -5,25 +5,28 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for GetInviteCodes<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(100i64), - sort: Some(jacquard_common::CowStr::from("recent")), +impl jacquard_common::IntoStatic for GetInviteCodes<'_> { + type Output = GetInviteCodes<'static>; + fn into_static(self) -> Self::Output { + GetInviteCodes { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + sort: self.sort.into_static(), } } } @@ -39,10 +42,21 @@ pub struct GetInviteCodesOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for GetInviteCodesOutput<'_> { + type Output = GetInviteCodesOutput<'static>; + fn into_static(self) -> Self::Output { + GetInviteCodesOutput { + codes: self.codes.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetInviteCodes<'_> { const NSID: &'static str = "com.atproto.admin.getInviteCodes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetInviteCodesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/get_subject_status.rs b/crates/jacquard-api/src/com_atproto/admin/get_subject_status.rs index 31198608e..01592a56d 100644 --- a/crates/jacquard-api/src/com_atproto/admin/get_subject_status.rs +++ b/crates/jacquard-api/src/com_atproto/admin/get_subject_status.rs @@ -19,6 +19,17 @@ pub struct GetSubjectStatus<'a> { pub uri: std::option::Option>, } +impl jacquard_common::IntoStatic for GetSubjectStatus<'_> { + type Output = GetSubjectStatus<'static>; + fn into_static(self) -> Self::Output { + GetSubjectStatus { + blob: self.blob.into_static(), + did: self.did.into_static(), + uri: self.uri.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -46,10 +57,42 @@ pub enum GetSubjectStatusOutputRecordSubject<'a> { DefsRepoBlobRef(Box>), } +impl jacquard_common::IntoStatic for GetSubjectStatusOutputRecordSubject<'_> { + type Output = GetSubjectStatusOutputRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + GetSubjectStatusOutputRecordSubject::DefsRepoRef(v) => { + GetSubjectStatusOutputRecordSubject::DefsRepoRef(v.into_static()) + } + GetSubjectStatusOutputRecordSubject::StrongRef(v) => { + GetSubjectStatusOutputRecordSubject::StrongRef(v.into_static()) + } + GetSubjectStatusOutputRecordSubject::DefsRepoBlobRef(v) => { + GetSubjectStatusOutputRecordSubject::DefsRepoBlobRef(v.into_static()) + } + GetSubjectStatusOutputRecordSubject::Unknown(v) => { + GetSubjectStatusOutputRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for GetSubjectStatusOutput<'_> { + type Output = GetSubjectStatusOutput<'static>; + fn into_static(self) -> Self::Output { + GetSubjectStatusOutput { + deactivated: self.deactivated.into_static(), + subject: self.subject.into_static(), + takedown: self.takedown.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSubjectStatus<'_> { const NSID: &'static str = "com.atproto.admin.getSubjectStatus"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSubjectStatusOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/search_accounts.rs b/crates/jacquard-api/src/com_atproto/admin/search_accounts.rs index c365abd9f..a40e40b51 100644 --- a/crates/jacquard-api/src/com_atproto/admin/search_accounts.rs +++ b/crates/jacquard-api/src/com_atproto/admin/search_accounts.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct SearchAccounts<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -14,16 +14,18 @@ pub struct SearchAccounts<'a> { #[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, } -impl Default for SearchAccounts<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - email: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for SearchAccounts<'_> { + type Output = SearchAccounts<'static>; + fn into_static(self) -> Self::Output { + SearchAccounts { + cursor: self.cursor.into_static(), + email: self.email.into_static(), + limit: self.limit.into_static(), } } } @@ -39,10 +41,21 @@ pub struct SearchAccountsOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for SearchAccountsOutput<'_> { + type Output = SearchAccountsOutput<'static>; + fn into_static(self) -> Self::Output { + SearchAccountsOutput { + accounts: self.accounts.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchAccounts<'_> { const NSID: &'static str = "com.atproto.admin.searchAccounts"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SearchAccountsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/send_email.rs b/crates/jacquard-api/src/com_atproto/admin/send_email.rs index c745a87dd..514460c80 100644 --- a/crates/jacquard-api/src/com_atproto/admin/send_email.rs +++ b/crates/jacquard-api/src/com_atproto/admin/send_email.rs @@ -24,6 +24,20 @@ pub struct SendEmail<'a> { pub subject: std::option::Option>, } +impl jacquard_common::IntoStatic for SendEmail<'_> { + type Output = SendEmail<'static>; + fn into_static(self) -> Self::Output { + SendEmail { + comment: self.comment.into_static(), + content: self.content.into_static(), + recipient_did: self.recipient_did.into_static(), + sender_did: self.sender_did.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -31,6 +45,16 @@ pub struct SendEmailOutput<'a> { pub sent: bool, } +impl jacquard_common::IntoStatic for SendEmailOutput<'_> { + type Output = SendEmailOutput<'static>; + fn into_static(self) -> Self::Output { + SendEmailOutput { + sent: self.sent.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SendEmail<'_> { const NSID: &'static str = "com.atproto.admin.sendEmail"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -38,5 +62,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for SendEmail<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SendEmailOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/update_account_email.rs b/crates/jacquard-api/src/com_atproto/admin/update_account_email.rs index ba1bd97c4..6a5242477 100644 --- a/crates/jacquard-api/src/com_atproto/admin/update_account_email.rs +++ b/crates/jacquard-api/src/com_atproto/admin/update_account_email.rs @@ -16,6 +16,17 @@ pub struct UpdateAccountEmail<'a> { pub email: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for UpdateAccountEmail<'_> { + type Output = UpdateAccountEmail<'static>; + fn into_static(self) -> Self::Output { + UpdateAccountEmail { + account: self.account.into_static(), + email: self.email.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateAccountEmail<'_> { const NSID: &'static str = "com.atproto.admin.updateAccountEmail"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -23,5 +34,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateAccountEmail<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/update_account_handle.rs b/crates/jacquard-api/src/com_atproto/admin/update_account_handle.rs index 666e2fd75..b52a1cb2d 100644 --- a/crates/jacquard-api/src/com_atproto/admin/update_account_handle.rs +++ b/crates/jacquard-api/src/com_atproto/admin/update_account_handle.rs @@ -15,6 +15,17 @@ pub struct UpdateAccountHandle<'a> { pub handle: jacquard_common::types::string::Handle<'a>, } +impl jacquard_common::IntoStatic for UpdateAccountHandle<'_> { + type Output = UpdateAccountHandle<'static>; + fn into_static(self) -> Self::Output { + UpdateAccountHandle { + did: self.did.into_static(), + handle: self.handle.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateAccountHandle<'_> { const NSID: &'static str = "com.atproto.admin.updateAccountHandle"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -22,5 +33,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateAccountHandle<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/update_account_password.rs b/crates/jacquard-api/src/com_atproto/admin/update_account_password.rs index d88807037..518132f7a 100644 --- a/crates/jacquard-api/src/com_atproto/admin/update_account_password.rs +++ b/crates/jacquard-api/src/com_atproto/admin/update_account_password.rs @@ -15,6 +15,17 @@ pub struct UpdateAccountPassword<'a> { pub password: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for UpdateAccountPassword<'_> { + type Output = UpdateAccountPassword<'static>; + fn into_static(self) -> Self::Output { + UpdateAccountPassword { + did: self.did.into_static(), + password: self.password.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateAccountPassword<'_> { const NSID: &'static str = "com.atproto.admin.updateAccountPassword"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -22,5 +33,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateAccountPassword<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/update_account_signing_key.rs b/crates/jacquard-api/src/com_atproto/admin/update_account_signing_key.rs index d257a8d6f..72ecfdd25 100644 --- a/crates/jacquard-api/src/com_atproto/admin/update_account_signing_key.rs +++ b/crates/jacquard-api/src/com_atproto/admin/update_account_signing_key.rs @@ -16,6 +16,17 @@ pub struct UpdateAccountSigningKey<'a> { pub signing_key: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for UpdateAccountSigningKey<'_> { + type Output = UpdateAccountSigningKey<'static>; + fn into_static(self) -> Self::Output { + UpdateAccountSigningKey { + did: self.did.into_static(), + signing_key: self.signing_key.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateAccountSigningKey<'_> { const NSID: &'static str = "com.atproto.admin.updateAccountSigningKey"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -23,5 +34,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateAccountSigningKey<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/admin/update_subject_status.rs b/crates/jacquard-api/src/com_atproto/admin/update_subject_status.rs index 1caec0c34..d000380b1 100644 --- a/crates/jacquard-api/src/com_atproto/admin/update_subject_status.rs +++ b/crates/jacquard-api/src/com_atproto/admin/update_subject_status.rs @@ -32,6 +32,38 @@ pub enum UpdateSubjectStatusRecordSubject<'a> { DefsRepoBlobRef(Box>), } +impl jacquard_common::IntoStatic for UpdateSubjectStatusRecordSubject<'_> { + type Output = UpdateSubjectStatusRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + UpdateSubjectStatusRecordSubject::DefsRepoRef(v) => { + UpdateSubjectStatusRecordSubject::DefsRepoRef(v.into_static()) + } + UpdateSubjectStatusRecordSubject::StrongRef(v) => { + UpdateSubjectStatusRecordSubject::StrongRef(v.into_static()) + } + UpdateSubjectStatusRecordSubject::DefsRepoBlobRef(v) => { + UpdateSubjectStatusRecordSubject::DefsRepoBlobRef(v.into_static()) + } + UpdateSubjectStatusRecordSubject::Unknown(v) => { + UpdateSubjectStatusRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for UpdateSubjectStatus<'_> { + type Output = UpdateSubjectStatus<'static>; + fn into_static(self) -> Self::Output { + UpdateSubjectStatus { + deactivated: self.deactivated.into_static(), + subject: self.subject.into_static(), + takedown: self.takedown.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -56,6 +88,37 @@ pub enum UpdateSubjectStatusOutputRecordSubject<'a> { DefsRepoBlobRef(Box>), } +impl jacquard_common::IntoStatic for UpdateSubjectStatusOutputRecordSubject<'_> { + type Output = UpdateSubjectStatusOutputRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + UpdateSubjectStatusOutputRecordSubject::DefsRepoRef(v) => { + UpdateSubjectStatusOutputRecordSubject::DefsRepoRef(v.into_static()) + } + UpdateSubjectStatusOutputRecordSubject::StrongRef(v) => { + UpdateSubjectStatusOutputRecordSubject::StrongRef(v.into_static()) + } + UpdateSubjectStatusOutputRecordSubject::DefsRepoBlobRef(v) => { + UpdateSubjectStatusOutputRecordSubject::DefsRepoBlobRef(v.into_static()) + } + UpdateSubjectStatusOutputRecordSubject::Unknown(v) => { + UpdateSubjectStatusOutputRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for UpdateSubjectStatusOutput<'_> { + type Output = UpdateSubjectStatusOutput<'static>; + fn into_static(self) -> Self::Output { + UpdateSubjectStatusOutput { + subject: self.subject.into_static(), + takedown: self.takedown.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateSubjectStatus<'_> { const NSID: &'static str = "com.atproto.admin.updateSubjectStatus"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -63,5 +126,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateSubjectStatus<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = UpdateSubjectStatusOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/identity.rs b/crates/jacquard-api/src/com_atproto/identity.rs index b95867b84..2de1d3b26 100644 --- a/crates/jacquard-api/src/com_atproto/identity.rs +++ b/crates/jacquard-api/src/com_atproto/identity.rs @@ -27,4 +27,16 @@ pub struct IdentityInfo<'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>, +} + +impl jacquard_common::IntoStatic for IdentityInfo<'_> { + type Output = IdentityInfo<'static>; + fn into_static(self) -> Self::Output { + IdentityInfo { + did: self.did.into_static(), + did_doc: self.did_doc.into_static(), + handle: self.handle.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/identity/get_recommended_did_credentials.rs b/crates/jacquard-api/src/com_atproto/identity/get_recommended_did_credentials.rs index 6a8a24c38..e5cb1f2fe 100644 --- a/crates/jacquard-api/src/com_atproto/identity/get_recommended_did_credentials.rs +++ b/crates/jacquard-api/src/com_atproto/identity/get_recommended_did_credentials.rs @@ -26,6 +26,19 @@ pub struct GetRecommendedDidCredentialsOutput<'a> { >, } +impl jacquard_common::IntoStatic for GetRecommendedDidCredentialsOutput<'_> { + type Output = GetRecommendedDidCredentialsOutput<'static>; + fn into_static(self) -> Self::Output { + GetRecommendedDidCredentialsOutput { + also_known_as: self.also_known_as.into_static(), + rotation_keys: self.rotation_keys.into_static(), + services: self.services.into_static(), + verification_methods: self.verification_methods.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct GetRecommendedDidCredentials; @@ -34,5 +47,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for GetRecommendedDidCredentials const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetRecommendedDidCredentialsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/identity/refresh_identity.rs b/crates/jacquard-api/src/com_atproto/identity/refresh_identity.rs index f8e9a7171..751116112 100644 --- a/crates/jacquard-api/src/com_atproto/identity/refresh_identity.rs +++ b/crates/jacquard-api/src/com_atproto/identity/refresh_identity.rs @@ -13,6 +13,16 @@ pub struct RefreshIdentity<'a> { pub identifier: jacquard_common::types::ident::AtIdentifier<'a>, } +impl jacquard_common::IntoStatic for RefreshIdentity<'_> { + type Output = RefreshIdentity<'static>; + fn into_static(self) -> Self::Output { + RefreshIdentity { + identifier: self.identifier.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -22,6 +32,16 @@ pub struct RefreshIdentityOutput<'a> { pub value: crate::com_atproto::identity::IdentityInfo<'a>, } +impl jacquard_common::IntoStatic for RefreshIdentityOutput<'_> { + type Output = RefreshIdentityOutput<'static>; + fn into_static(self) -> Self::Output { + RefreshIdentityOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -76,6 +96,26 @@ impl std::fmt::Display for RefreshIdentityError<'_> { } } +impl jacquard_common::IntoStatic for RefreshIdentityError<'_> { + type Output = RefreshIdentityError<'static>; + fn into_static(self) -> Self::Output { + match self { + RefreshIdentityError::HandleNotFound(v) => { + RefreshIdentityError::HandleNotFound(v.into_static()) + } + RefreshIdentityError::DidNotFound(v) => { + RefreshIdentityError::DidNotFound(v.into_static()) + } + RefreshIdentityError::DidDeactivated(v) => { + RefreshIdentityError::DidDeactivated(v.into_static()) + } + RefreshIdentityError::Unknown(v) => { + RefreshIdentityError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RefreshIdentity<'_> { const NSID: &'static str = "com.atproto.identity.refreshIdentity"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/identity/request_plc_operation_signature.rs b/crates/jacquard-api/src/com_atproto/identity/request_plc_operation_signature.rs index 1a8a5db6e..9e2c86890 100644 --- a/crates/jacquard-api/src/com_atproto/identity/request_plc_operation_signature.rs +++ b/crates/jacquard-api/src/com_atproto/identity/request_plc_operation_signature.rs @@ -15,5 +15,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RequestPlcOperationSignature ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/identity/resolve_did.rs b/crates/jacquard-api/src/com_atproto/identity/resolve_did.rs index 997a7ca23..be3998d02 100644 --- a/crates/jacquard-api/src/com_atproto/identity/resolve_did.rs +++ b/crates/jacquard-api/src/com_atproto/identity/resolve_did.rs @@ -12,6 +12,15 @@ pub struct ResolveDid<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for ResolveDid<'_> { + type Output = ResolveDid<'static>; + fn into_static(self) -> Self::Output { + ResolveDid { + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,6 +30,16 @@ pub struct ResolveDidOutput<'a> { pub did_doc: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for ResolveDidOutput<'_> { + type Output = ResolveDidOutput<'static>; + fn into_static(self) -> Self::Output { + ResolveDidOutput { + did_doc: self.did_doc.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -65,6 +84,21 @@ impl std::fmt::Display for ResolveDidError<'_> { } } +impl jacquard_common::IntoStatic for ResolveDidError<'_> { + type Output = ResolveDidError<'static>; + fn into_static(self) -> Self::Output { + match self { + ResolveDidError::DidNotFound(v) => { + ResolveDidError::DidNotFound(v.into_static()) + } + ResolveDidError::DidDeactivated(v) => { + ResolveDidError::DidDeactivated(v.into_static()) + } + ResolveDidError::Unknown(v) => ResolveDidError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ResolveDid<'_> { const NSID: &'static str = "com.atproto.identity.resolveDid"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/identity/resolve_handle.rs b/crates/jacquard-api/src/com_atproto/identity/resolve_handle.rs index 363c5943b..7c52d9243 100644 --- a/crates/jacquard-api/src/com_atproto/identity/resolve_handle.rs +++ b/crates/jacquard-api/src/com_atproto/identity/resolve_handle.rs @@ -12,6 +12,15 @@ pub struct ResolveHandle<'a> { pub handle: jacquard_common::types::string::Handle<'a>, } +impl jacquard_common::IntoStatic for ResolveHandle<'_> { + type Output = ResolveHandle<'static>; + fn into_static(self) -> Self::Output { + ResolveHandle { + handle: self.handle.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,6 +29,16 @@ pub struct ResolveHandleOutput<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for ResolveHandleOutput<'_> { + type Output = ResolveHandleOutput<'static>; + fn into_static(self) -> Self::Output { + ResolveHandleOutput { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -54,6 +73,20 @@ impl std::fmt::Display for ResolveHandleError<'_> { } } +impl jacquard_common::IntoStatic for ResolveHandleError<'_> { + type Output = ResolveHandleError<'static>; + fn into_static(self) -> Self::Output { + match self { + ResolveHandleError::HandleNotFound(v) => { + ResolveHandleError::HandleNotFound(v.into_static()) + } + ResolveHandleError::Unknown(v) => { + ResolveHandleError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ResolveHandle<'_> { const NSID: &'static str = "com.atproto.identity.resolveHandle"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/identity/resolve_identity.rs b/crates/jacquard-api/src/com_atproto/identity/resolve_identity.rs index 6f342f1bd..76f88d5eb 100644 --- a/crates/jacquard-api/src/com_atproto/identity/resolve_identity.rs +++ b/crates/jacquard-api/src/com_atproto/identity/resolve_identity.rs @@ -12,6 +12,15 @@ pub struct ResolveIdentity<'a> { pub identifier: jacquard_common::types::ident::AtIdentifier<'a>, } +impl jacquard_common::IntoStatic for ResolveIdentity<'_> { + type Output = ResolveIdentity<'static>; + fn into_static(self) -> Self::Output { + ResolveIdentity { + identifier: self.identifier.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,6 +30,16 @@ pub struct ResolveIdentityOutput<'a> { pub value: crate::com_atproto::identity::IdentityInfo<'a>, } +impl jacquard_common::IntoStatic for ResolveIdentityOutput<'_> { + type Output = ResolveIdentityOutput<'static>; + fn into_static(self) -> Self::Output { + ResolveIdentityOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -75,6 +94,26 @@ impl std::fmt::Display for ResolveIdentityError<'_> { } } +impl jacquard_common::IntoStatic for ResolveIdentityError<'_> { + type Output = ResolveIdentityError<'static>; + fn into_static(self) -> Self::Output { + match self { + ResolveIdentityError::HandleNotFound(v) => { + ResolveIdentityError::HandleNotFound(v.into_static()) + } + ResolveIdentityError::DidNotFound(v) => { + ResolveIdentityError::DidNotFound(v.into_static()) + } + ResolveIdentityError::DidDeactivated(v) => { + ResolveIdentityError::DidDeactivated(v.into_static()) + } + ResolveIdentityError::Unknown(v) => { + ResolveIdentityError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ResolveIdentity<'_> { const NSID: &'static str = "com.atproto.identity.resolveIdentity"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/identity/sign_plc_operation.rs b/crates/jacquard-api/src/com_atproto/identity/sign_plc_operation.rs index 4463eda11..379d43c2a 100644 --- a/crates/jacquard-api/src/com_atproto/identity/sign_plc_operation.rs +++ b/crates/jacquard-api/src/com_atproto/identity/sign_plc_operation.rs @@ -29,6 +29,20 @@ pub struct SignPlcOperation<'a> { >, } +impl jacquard_common::IntoStatic for SignPlcOperation<'_> { + type Output = SignPlcOperation<'static>; + fn into_static(self) -> Self::Output { + SignPlcOperation { + also_known_as: self.also_known_as.into_static(), + rotation_keys: self.rotation_keys.into_static(), + services: self.services.into_static(), + token: self.token.into_static(), + verification_methods: self.verification_methods.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -38,6 +52,16 @@ pub struct SignPlcOperationOutput<'a> { pub operation: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for SignPlcOperationOutput<'_> { + type Output = SignPlcOperationOutput<'static>; + fn into_static(self) -> Self::Output { + SignPlcOperationOutput { + operation: self.operation.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SignPlcOperation<'_> { const NSID: &'static str = "com.atproto.identity.signPlcOperation"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -45,5 +69,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for SignPlcOperation<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SignPlcOperationOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/identity/submit_plc_operation.rs b/crates/jacquard-api/src/com_atproto/identity/submit_plc_operation.rs index 4ae0299e8..9478427ee 100644 --- a/crates/jacquard-api/src/com_atproto/identity/submit_plc_operation.rs +++ b/crates/jacquard-api/src/com_atproto/identity/submit_plc_operation.rs @@ -13,6 +13,16 @@ pub struct SubmitPlcOperation<'a> { pub operation: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for SubmitPlcOperation<'_> { + type Output = SubmitPlcOperation<'static>; + fn into_static(self) -> Self::Output { + SubmitPlcOperation { + operation: self.operation.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SubmitPlcOperation<'_> { const NSID: &'static str = "com.atproto.identity.submitPlcOperation"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for SubmitPlcOperation<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/identity/update_handle.rs b/crates/jacquard-api/src/com_atproto/identity/update_handle.rs index f24d0f8e8..71e9d2c48 100644 --- a/crates/jacquard-api/src/com_atproto/identity/update_handle.rs +++ b/crates/jacquard-api/src/com_atproto/identity/update_handle.rs @@ -14,6 +14,16 @@ pub struct UpdateHandle<'a> { pub handle: jacquard_common::types::string::Handle<'a>, } +impl jacquard_common::IntoStatic for UpdateHandle<'_> { + type Output = UpdateHandle<'static>; + fn into_static(self) -> Self::Output { + UpdateHandle { + handle: self.handle.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateHandle<'_> { const NSID: &'static str = "com.atproto.identity.updateHandle"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -21,5 +31,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpdateHandle<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/label.rs b/crates/jacquard-api/src/com_atproto/label.rs index 4a5def935..9565e367b 100644 --- a/crates/jacquard-api/src/com_atproto/label.rs +++ b/crates/jacquard-api/src/com_atproto/label.rs @@ -42,6 +42,24 @@ pub struct Label<'a> { pub ver: std::option::Option, } +impl jacquard_common::IntoStatic for Label<'_> { + type Output = Label<'static>; + fn into_static(self) -> Self::Output { + Label { + cid: self.cid.into_static(), + cts: self.cts.into_static(), + exp: self.exp.into_static(), + neg: self.neg.into_static(), + sig: self.sig.into_static(), + src: self.src.into_static(), + uri: self.uri.into_static(), + val: self.val.into_static(), + ver: self.ver.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum LabelValue<'a> { Hide, @@ -143,6 +161,26 @@ where } } +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)] @@ -168,6 +206,21 @@ pub struct LabelValueDefinition<'a> { pub severity: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LabelValueDefinition<'_> { + type Output = LabelValueDefinition<'static>; + fn into_static(self) -> Self::Output { + LabelValueDefinition { + adult_only: self.adult_only.into_static(), + blurs: self.blurs.into_static(), + default_setting: self.default_setting.into_static(), + identifier: self.identifier.into_static(), + locales: self.locales.into_static(), + severity: self.severity.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -183,6 +236,18 @@ pub struct LabelValueDefinitionStrings<'a> { pub name: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for LabelValueDefinitionStrings<'_> { + type Output = LabelValueDefinitionStrings<'static>; + fn into_static(self) -> Self::Output { + LabelValueDefinitionStrings { + description: self.description.into_static(), + lang: self.lang.into_static(), + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -193,6 +258,16 @@ pub struct SelfLabel<'a> { pub val: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for SelfLabel<'_> { + type Output = SelfLabel<'static>; + fn into_static(self) -> Self::Output { + SelfLabel { + val: self.val.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -200,4 +275,14 @@ pub struct SelfLabel<'a> { pub struct SelfLabels<'a> { #[serde(borrow)] pub values: Vec>, +} + +impl jacquard_common::IntoStatic for SelfLabels<'_> { + type Output = SelfLabels<'static>; + fn into_static(self) -> Self::Output { + SelfLabels { + values: self.values.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/label/query_labels.rs b/crates/jacquard-api/src/com_atproto/label/query_labels.rs index 18fdedc85..5c3026c3c 100644 --- a/crates/jacquard-api/src/com_atproto/label/query_labels.rs +++ b/crates/jacquard-api/src/com_atproto/label/query_labels.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -20,13 +21,14 @@ pub struct QueryLabels<'a> { pub uri_patterns: Vec>, } -impl Default for QueryLabels<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - sources: Default::default(), - uri_patterns: Default::default(), +impl jacquard_common::IntoStatic for QueryLabels<'_> { + type Output = QueryLabels<'static>; + fn into_static(self) -> Self::Output { + QueryLabels { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + sources: self.sources.into_static(), + uri_patterns: self.uri_patterns.into_static(), } } } @@ -42,10 +44,21 @@ pub struct QueryLabelsOutput<'a> { pub labels: Vec>, } +impl jacquard_common::IntoStatic for QueryLabelsOutput<'_> { + type Output = QueryLabelsOutput<'static>; + fn into_static(self) -> Self::Output { + QueryLabelsOutput { + cursor: self.cursor.into_static(), + labels: self.labels.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for QueryLabels<'_> { const NSID: &'static str = "com.atproto.label.queryLabels"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = QueryLabelsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/label/subscribe_labels.rs b/crates/jacquard-api/src/com_atproto/label/subscribe_labels.rs index 407337715..f2db0f972 100644 --- a/crates/jacquard-api/src/com_atproto/label/subscribe_labels.rs +++ b/crates/jacquard-api/src/com_atproto/label/subscribe_labels.rs @@ -16,6 +16,17 @@ pub struct Info<'a> { pub name: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for Info<'_> { + type Output = Info<'static>; + fn into_static(self) -> Self::Output { + Info { + message: self.message.into_static(), + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -25,6 +36,17 @@ pub struct Labels<'a> { pub seq: i64, } +impl jacquard_common::IntoStatic for Labels<'_> { + type Output = Labels<'static>; + fn into_static(self) -> Self::Output { + Labels { + labels: self.labels.into_static(), + seq: self.seq.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct SubscribeLabels { @@ -32,6 +54,13 @@ pub struct SubscribeLabels { pub cursor: std::option::Option, } +impl jacquard_common::IntoStatic for SubscribeLabels { + type Output = SubscribeLabels; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] @@ -43,6 +72,23 @@ pub enum SubscribeLabelsMessage<'a> { Info(Box>), } +impl jacquard_common::IntoStatic for SubscribeLabelsMessage<'_> { + type Output = SubscribeLabelsMessage<'static>; + fn into_static(self) -> Self::Output { + match self { + SubscribeLabelsMessage::Labels(v) => { + SubscribeLabelsMessage::Labels(v.into_static()) + } + SubscribeLabelsMessage::Info(v) => { + SubscribeLabelsMessage::Info(v.into_static()) + } + SubscribeLabelsMessage::Unknown(v) => { + SubscribeLabelsMessage::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -74,4 +120,18 @@ impl std::fmt::Display for SubscribeLabelsError<'_> { Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } +} + +impl jacquard_common::IntoStatic for SubscribeLabelsError<'_> { + type Output = SubscribeLabelsError<'static>; + fn into_static(self) -> Self::Output { + match self { + SubscribeLabelsError::FutureCursor(v) => { + SubscribeLabelsError::FutureCursor(v.into_static()) + } + SubscribeLabelsError::Unknown(v) => { + SubscribeLabelsError::Unknown(v.into_static()) + } + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/lexicon/schema.rs b/crates/jacquard-api/src/com_atproto/lexicon/schema.rs index d819b8115..03ec741f4 100644 --- a/crates/jacquard-api/src/com_atproto/lexicon/schema.rs +++ b/crates/jacquard-api/src/com_atproto/lexicon/schema.rs @@ -16,4 +16,14 @@ pub struct Schema<'a> { impl jacquard_common::types::collection::Collection for Schema<'_> { const NSID: &'static str = "com.atproto.lexicon.schema"; +} + +impl jacquard_common::IntoStatic for Schema<'_> { + type Output = Schema<'static>; + fn into_static(self) -> Self::Output { + Schema { + lexicon: self.lexicon.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/moderation.rs b/crates/jacquard-api/src/com_atproto/moderation.rs index ca388bb8a..ee20b1c7a 100644 --- a/crates/jacquard-api/src/com_atproto/moderation.rs +++ b/crates/jacquard-api/src/com_atproto/moderation.rs @@ -584,6 +584,171 @@ where } } +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::ToolsOzoneReportDefsReasonViolenceAnimalWelfare => { + ReasonType::ToolsOzoneReportDefsReasonViolenceAnimalWelfare + } + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats => { + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats + } + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent => { + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + ReasonType::ToolsOzoneReportDefsReasonViolenceSelfHarm => { + ReasonType::ToolsOzoneReportDefsReasonViolenceSelfHarm + } + 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::ToolsOzoneReportDefsReasonSexualSextortion => { + ReasonType::ToolsOzoneReportDefsReasonSexualSextortion + } + 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::ToolsOzoneReportDefsReasonChildSafetyMinorPrivacy => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyMinorPrivacy + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyEndangerment => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyEndangerment + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPromotion => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPromotion + } + 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::ToolsOzoneReportDefsReasonMisleadingSyntheticContent => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingSyntheticContent + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingMisinformation => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingMisinformation + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther + } + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity => { + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + ReasonType::ToolsOzoneReportDefsReasonRuleStolenContent => { + ReasonType::ToolsOzoneReportDefsReasonRuleStolenContent + } + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales => { + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion => { + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion + } + ReasonType::ToolsOzoneReportDefsReasonRuleOther => { + ReasonType::ToolsOzoneReportDefsReasonRuleOther + } + ReasonType::ToolsOzoneReportDefsReasonCivicElectoralProcess => { + ReasonType::ToolsOzoneReportDefsReasonCivicElectoralProcess + } + ReasonType::ToolsOzoneReportDefsReasonCivicDisclosure => { + ReasonType::ToolsOzoneReportDefsReasonCivicDisclosure + } + ReasonType::ToolsOzoneReportDefsReasonCivicInterference => { + ReasonType::ToolsOzoneReportDefsReasonCivicInterference + } + ReasonType::ToolsOzoneReportDefsReasonCivicMisinformation => { + ReasonType::ToolsOzoneReportDefsReasonCivicMisinformation + } + ReasonType::ToolsOzoneReportDefsReasonCivicImpersonation => { + ReasonType::ToolsOzoneReportDefsReasonCivicImpersonation + } + ReasonType::Other(v) => ReasonType::Other(v.into_static()), + } + } +} + ///Tag describing a type of subject that might be reported. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum SubjectType<'a> { @@ -652,4 +817,16 @@ where 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/jacquard-api/src/com_atproto/moderation/create_report.rs b/crates/jacquard-api/src/com_atproto/moderation/create_report.rs index c7aeb8121..f2298172b 100644 --- a/crates/jacquard-api/src/com_atproto/moderation/create_report.rs +++ b/crates/jacquard-api/src/com_atproto/moderation/create_report.rs @@ -34,6 +34,36 @@ pub enum CreateReportRecordSubject<'a> { StrongRef(Box>), } +impl jacquard_common::IntoStatic for CreateReportRecordSubject<'_> { + type Output = CreateReportRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + CreateReportRecordSubject::DefsRepoRef(v) => { + CreateReportRecordSubject::DefsRepoRef(v.into_static()) + } + CreateReportRecordSubject::StrongRef(v) => { + CreateReportRecordSubject::StrongRef(v.into_static()) + } + CreateReportRecordSubject::Unknown(v) => { + CreateReportRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for CreateReport<'_> { + type Output = CreateReport<'static>; + fn into_static(self) -> Self::Output { + CreateReport { + mod_tool: self.mod_tool.into_static(), + reason: self.reason.into_static(), + reason_type: self.reason_type.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -62,6 +92,38 @@ pub enum CreateReportOutputRecordSubject<'a> { StrongRef(Box>), } +impl jacquard_common::IntoStatic for CreateReportOutputRecordSubject<'_> { + type Output = CreateReportOutputRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + CreateReportOutputRecordSubject::DefsRepoRef(v) => { + CreateReportOutputRecordSubject::DefsRepoRef(v.into_static()) + } + CreateReportOutputRecordSubject::StrongRef(v) => { + CreateReportOutputRecordSubject::StrongRef(v.into_static()) + } + CreateReportOutputRecordSubject::Unknown(v) => { + CreateReportOutputRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for CreateReportOutput<'_> { + type Output = CreateReportOutput<'static>; + fn into_static(self) -> Self::Output { + CreateReportOutput { + created_at: self.created_at.into_static(), + id: self.id.into_static(), + reason: self.reason.into_static(), + reason_type: self.reason_type.into_static(), + reported_by: self.reported_by.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateReport<'_> { const NSID: &'static str = "com.atproto.moderation.createReport"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -69,7 +131,7 @@ impl jacquard_common::types::xrpc::XrpcRequest for CreateReport<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = CreateReportOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } ///Moderation tool information for tracing the source of the action @@ -84,4 +146,15 @@ pub struct ModTool<'a> { ///Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome') #[serde(borrow)] pub name: jacquard_common::CowStr<'a>, +} + +impl jacquard_common::IntoStatic for ModTool<'_> { + type Output = ModTool<'static>; + fn into_static(self) -> Self::Output { + ModTool { + meta: self.meta.into_static(), + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/repo.rs b/crates/jacquard-api/src/com_atproto/repo.rs index f59bde466..6847e773a 100644 --- a/crates/jacquard-api/src/com_atproto/repo.rs +++ b/crates/jacquard-api/src/com_atproto/repo.rs @@ -24,4 +24,15 @@ pub struct CommitMeta<'a> { #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, pub rev: jacquard_common::types::string::Tid, +} + +impl jacquard_common::IntoStatic for CommitMeta<'_> { + type Output = CommitMeta<'static>; + fn into_static(self) -> Self::Output { + CommitMeta { + cid: self.cid.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/repo/apply_writes.rs b/crates/jacquard-api/src/com_atproto/repo/apply_writes.rs index 19b43b36d..d76cebc73 100644 --- a/crates/jacquard-api/src/com_atproto/repo/apply_writes.rs +++ b/crates/jacquard-api/src/com_atproto/repo/apply_writes.rs @@ -24,6 +24,18 @@ pub struct Create<'a> { pub value: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for Create<'_> { + type Output = Create<'static>; + fn into_static(self) -> Self::Output { + Create { + collection: self.collection.into_static(), + rkey: self.rkey.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -37,6 +49,18 @@ pub struct CreateResult<'a> { pub validation_status: std::option::Option>, } +impl jacquard_common::IntoStatic for CreateResult<'_> { + type Output = CreateResult<'static>; + fn into_static(self) -> Self::Output { + CreateResult { + cid: self.cid.into_static(), + uri: self.uri.into_static(), + validation_status: self.validation_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Operation which deletes an existing record. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -50,10 +74,30 @@ pub struct Delete<'a> { >, } +impl jacquard_common::IntoStatic for Delete<'_> { + type Output = Delete<'static>; + fn into_static(self) -> Self::Output { + Delete { + collection: self.collection.into_static(), + rkey: self.rkey.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct DeleteResult<'a> {} +impl jacquard_common::IntoStatic for DeleteResult<'_> { + type Output = DeleteResult<'static>; + fn into_static(self) -> Self::Output { + DeleteResult { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -72,6 +116,19 @@ pub struct ApplyWrites<'a> { pub writes: Vec>, } +impl jacquard_common::IntoStatic for ApplyWrites<'_> { + type Output = ApplyWrites<'static>; + fn into_static(self) -> Self::Output { + ApplyWrites { + repo: self.repo.into_static(), + swap_commit: self.swap_commit.into_static(), + validate: self.validate.into_static(), + writes: self.writes.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -84,6 +141,17 @@ pub struct ApplyWritesOutput<'a> { pub results: std::option::Option>>, } +impl jacquard_common::IntoStatic for ApplyWritesOutput<'_> { + type Output = ApplyWritesOutput<'static>; + fn into_static(self) -> Self::Output { + ApplyWritesOutput { + commit: self.commit.into_static(), + results: self.results.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -118,6 +186,18 @@ impl std::fmt::Display for ApplyWritesError<'_> { } } +impl jacquard_common::IntoStatic for ApplyWritesError<'_> { + type Output = ApplyWritesError<'static>; + fn into_static(self) -> Self::Output { + match self { + ApplyWritesError::InvalidSwap(v) => { + ApplyWritesError::InvalidSwap(v.into_static()) + } + ApplyWritesError::Unknown(v) => ApplyWritesError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ApplyWrites<'_> { const NSID: &'static str = "com.atproto.repo.applyWrites"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -143,6 +223,18 @@ pub struct Update<'a> { pub value: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for Update<'_> { + type Output = Update<'static>; + fn into_static(self) -> Self::Output { + Update { + collection: self.collection.into_static(), + rkey: self.rkey.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -154,4 +246,16 @@ pub struct UpdateResult<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub validation_status: std::option::Option>, +} + +impl jacquard_common::IntoStatic for UpdateResult<'_> { + type Output = UpdateResult<'static>; + fn into_static(self) -> Self::Output { + UpdateResult { + cid: self.cid.into_static(), + uri: self.uri.into_static(), + validation_status: self.validation_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/repo/create_record.rs b/crates/jacquard-api/src/com_atproto/repo/create_record.rs index 4639b7eaf..c0437af22 100644 --- a/crates/jacquard-api/src/com_atproto/repo/create_record.rs +++ b/crates/jacquard-api/src/com_atproto/repo/create_record.rs @@ -35,6 +35,21 @@ pub struct CreateRecord<'a> { pub validate: std::option::Option, } +impl jacquard_common::IntoStatic for CreateRecord<'_> { + type Output = CreateRecord<'static>; + fn into_static(self) -> Self::Output { + CreateRecord { + collection: self.collection.into_static(), + record: self.record.into_static(), + repo: self.repo.into_static(), + rkey: self.rkey.into_static(), + swap_commit: self.swap_commit.into_static(), + validate: self.validate.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -51,6 +66,19 @@ pub struct CreateRecordOutput<'a> { pub validation_status: std::option::Option>, } +impl jacquard_common::IntoStatic for CreateRecordOutput<'_> { + type Output = CreateRecordOutput<'static>; + fn into_static(self) -> Self::Output { + CreateRecordOutput { + cid: self.cid.into_static(), + commit: self.commit.into_static(), + uri: self.uri.into_static(), + validation_status: self.validation_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -85,6 +113,18 @@ impl std::fmt::Display for CreateRecordError<'_> { } } +impl jacquard_common::IntoStatic for CreateRecordError<'_> { + type Output = CreateRecordError<'static>; + fn into_static(self) -> Self::Output { + match self { + CreateRecordError::InvalidSwap(v) => { + CreateRecordError::InvalidSwap(v.into_static()) + } + CreateRecordError::Unknown(v) => CreateRecordError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateRecord<'_> { const NSID: &'static str = "com.atproto.repo.createRecord"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/repo/delete_record.rs b/crates/jacquard-api/src/com_atproto/repo/delete_record.rs index 1172c823c..d4cee769a 100644 --- a/crates/jacquard-api/src/com_atproto/repo/delete_record.rs +++ b/crates/jacquard-api/src/com_atproto/repo/delete_record.rs @@ -30,6 +30,20 @@ pub struct DeleteRecord<'a> { pub swap_record: std::option::Option>, } +impl jacquard_common::IntoStatic for DeleteRecord<'_> { + type Output = DeleteRecord<'static>; + fn into_static(self) -> Self::Output { + DeleteRecord { + collection: self.collection.into_static(), + repo: self.repo.into_static(), + rkey: self.rkey.into_static(), + swap_commit: self.swap_commit.into_static(), + swap_record: self.swap_record.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -39,6 +53,16 @@ pub struct DeleteRecordOutput<'a> { pub commit: std::option::Option>, } +impl jacquard_common::IntoStatic for DeleteRecordOutput<'_> { + type Output = DeleteRecordOutput<'static>; + fn into_static(self) -> Self::Output { + DeleteRecordOutput { + commit: self.commit.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -72,6 +96,18 @@ impl std::fmt::Display for DeleteRecordError<'_> { } } +impl jacquard_common::IntoStatic for DeleteRecordError<'_> { + type Output = DeleteRecordError<'static>; + fn into_static(self) -> Self::Output { + match self { + DeleteRecordError::InvalidSwap(v) => { + DeleteRecordError::InvalidSwap(v.into_static()) + } + DeleteRecordError::Unknown(v) => DeleteRecordError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteRecord<'_> { const NSID: &'static str = "com.atproto.repo.deleteRecord"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/repo/describe_repo.rs b/crates/jacquard-api/src/com_atproto/repo/describe_repo.rs index de851f941..b2f02b09c 100644 --- a/crates/jacquard-api/src/com_atproto/repo/describe_repo.rs +++ b/crates/jacquard-api/src/com_atproto/repo/describe_repo.rs @@ -12,6 +12,15 @@ pub struct DescribeRepo<'a> { pub repo: jacquard_common::types::ident::AtIdentifier<'a>, } +impl jacquard_common::IntoStatic for DescribeRepo<'_> { + type Output = DescribeRepo<'static>; + fn into_static(self) -> Self::Output { + DescribeRepo { + repo: self.repo.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -30,10 +39,24 @@ pub struct DescribeRepoOutput<'a> { pub handle_is_correct: bool, } +impl jacquard_common::IntoStatic for DescribeRepoOutput<'_> { + type Output = DescribeRepoOutput<'static>; + fn into_static(self) -> Self::Output { + DescribeRepoOutput { + collections: self.collections.into_static(), + did: self.did.into_static(), + did_doc: self.did_doc.into_static(), + handle: self.handle.into_static(), + handle_is_correct: self.handle_is_correct.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DescribeRepo<'_> { const NSID: &'static str = "com.atproto.repo.describeRepo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = DescribeRepoOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/repo/get_record.rs b/crates/jacquard-api/src/com_atproto/repo/get_record.rs index da0dfa519..c3e574a30 100644 --- a/crates/jacquard-api/src/com_atproto/repo/get_record.rs +++ b/crates/jacquard-api/src/com_atproto/repo/get_record.rs @@ -21,6 +21,18 @@ pub struct GetRecord<'a> { >, } +impl jacquard_common::IntoStatic for GetRecord<'_> { + type Output = GetRecord<'static>; + fn into_static(self) -> Self::Output { + GetRecord { + cid: self.cid.into_static(), + collection: self.collection.into_static(), + repo: self.repo.into_static(), + rkey: self.rkey.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -34,6 +46,18 @@ pub struct GetRecordOutput<'a> { pub value: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for GetRecordOutput<'_> { + type Output = GetRecordOutput<'static>; + fn into_static(self) -> Self::Output { + GetRecordOutput { + cid: self.cid.into_static(), + uri: self.uri.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -67,6 +91,18 @@ impl std::fmt::Display for GetRecordError<'_> { } } +impl jacquard_common::IntoStatic for GetRecordError<'_> { + type Output = GetRecordError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetRecordError::RecordNotFound(v) => { + GetRecordError::RecordNotFound(v.into_static()) + } + GetRecordError::Unknown(v) => GetRecordError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRecord<'_> { const NSID: &'static str = "com.atproto.repo.getRecord"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/repo/import_repo.rs b/crates/jacquard-api/src/com_atproto/repo/import_repo.rs index 7258b3ee0..5c010eeb8 100644 --- a/crates/jacquard-api/src/com_atproto/repo/import_repo.rs +++ b/crates/jacquard-api/src/com_atproto/repo/import_repo.rs @@ -9,6 +9,15 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ImportRepo<'a> {} +impl jacquard_common::IntoStatic for ImportRepo<'_> { + type Output = ImportRepo<'static>; + fn into_static(self) -> Self::Output { + ImportRepo { + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ImportRepo<'_> { const NSID: &'static str = "com.atproto.repo.importRepo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -16,5 +25,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for ImportRepo<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/repo/list_missing_blobs.rs b/crates/jacquard-api/src/com_atproto/repo/list_missing_blobs.rs index a8b462281..a46bb5e95 100644 --- a/crates/jacquard-api/src/com_atproto/repo/list_missing_blobs.rs +++ b/crates/jacquard-api/src/com_atproto/repo/list_missing_blobs.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for ListMissingBlobs<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(500i64), +impl jacquard_common::IntoStatic for ListMissingBlobs<'_> { + type Output = ListMissingBlobs<'static>; + fn into_static(self) -> Self::Output { + ListMissingBlobs { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,12 +37,23 @@ pub struct ListMissingBlobsOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for ListMissingBlobsOutput<'_> { + type Output = ListMissingBlobsOutput<'static>; + fn into_static(self) -> Self::Output { + ListMissingBlobsOutput { + blobs: self.blobs.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListMissingBlobs<'_> { const NSID: &'static str = "com.atproto.repo.listMissingBlobs"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListMissingBlobsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -51,4 +64,15 @@ pub struct RecordBlob<'a> { pub cid: jacquard_common::types::string::Cid<'a>, #[serde(borrow)] pub record_uri: jacquard_common::types::string::AtUri<'a>, +} + +impl jacquard_common::IntoStatic for RecordBlob<'_> { + type Output = RecordBlob<'static>; + fn into_static(self) -> Self::Output { + RecordBlob { + cid: self.cid.into_static(), + record_uri: self.record_uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/repo/list_records.rs b/crates/jacquard-api/src/com_atproto/repo/list_records.rs index ff1666884..bbeb3ed87 100644 --- a/crates/jacquard-api/src/com_atproto/repo/list_records.rs +++ b/crates/jacquard-api/src/com_atproto/repo/list_records.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ListRecords<'a> { #[serde(borrow)] @@ -13,6 +13,7 @@ pub struct ListRecords<'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)] @@ -21,14 +22,15 @@ pub struct ListRecords<'a> { pub reverse: std::option::Option, } -impl Default for ListRecords<'_> { - fn default() -> Self { - Self { - collection: Default::default(), - cursor: Default::default(), - limit: Some(50i64), - repo: Default::default(), - reverse: Default::default(), +impl jacquard_common::IntoStatic for ListRecords<'_> { + type Output = ListRecords<'static>; + fn into_static(self) -> Self::Output { + ListRecords { + collection: self.collection.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + repo: self.repo.into_static(), + reverse: self.reverse.into_static(), } } } @@ -44,12 +46,23 @@ pub struct ListRecordsOutput<'a> { pub records: Vec>, } +impl jacquard_common::IntoStatic for ListRecordsOutput<'_> { + type Output = ListRecordsOutput<'static>; + fn into_static(self) -> Self::Output { + ListRecordsOutput { + cursor: self.cursor.into_static(), + records: self.records.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListRecords<'_> { const NSID: &'static str = "com.atproto.repo.listRecords"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListRecordsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -62,4 +75,16 @@ pub struct Record<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(borrow)] pub value: jacquard_common::types::value::Data<'a>, +} + +impl jacquard_common::IntoStatic for Record<'_> { + type Output = Record<'static>; + fn into_static(self) -> Self::Output { + Record { + cid: self.cid.into_static(), + uri: self.uri.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/repo/put_record.rs b/crates/jacquard-api/src/com_atproto/repo/put_record.rs index d9d372be8..45afee6ec 100644 --- a/crates/jacquard-api/src/com_atproto/repo/put_record.rs +++ b/crates/jacquard-api/src/com_atproto/repo/put_record.rs @@ -36,6 +36,22 @@ pub struct PutRecord<'a> { pub validate: std::option::Option, } +impl jacquard_common::IntoStatic for PutRecord<'_> { + type Output = PutRecord<'static>; + fn into_static(self) -> Self::Output { + PutRecord { + collection: self.collection.into_static(), + record: self.record.into_static(), + repo: self.repo.into_static(), + rkey: self.rkey.into_static(), + swap_commit: self.swap_commit.into_static(), + swap_record: self.swap_record.into_static(), + validate: self.validate.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -52,6 +68,19 @@ pub struct PutRecordOutput<'a> { pub validation_status: std::option::Option>, } +impl jacquard_common::IntoStatic for PutRecordOutput<'_> { + type Output = PutRecordOutput<'static>; + fn into_static(self) -> Self::Output { + PutRecordOutput { + cid: self.cid.into_static(), + commit: self.commit.into_static(), + uri: self.uri.into_static(), + validation_status: self.validation_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -85,6 +114,18 @@ impl std::fmt::Display for PutRecordError<'_> { } } +impl jacquard_common::IntoStatic for PutRecordError<'_> { + type Output = PutRecordError<'static>; + fn into_static(self) -> Self::Output { + match self { + PutRecordError::InvalidSwap(v) => { + PutRecordError::InvalidSwap(v.into_static()) + } + PutRecordError::Unknown(v) => PutRecordError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for PutRecord<'_> { const NSID: &'static str = "com.atproto.repo.putRecord"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/repo/strong_ref.rs b/crates/jacquard-api/src/com_atproto/repo/strong_ref.rs index b4f909050..4108c3aa9 100644 --- a/crates/jacquard-api/src/com_atproto/repo/strong_ref.rs +++ b/crates/jacquard-api/src/com_atproto/repo/strong_ref.rs @@ -13,4 +13,15 @@ pub struct StrongRef<'a> { pub cid: jacquard_common::types::string::Cid<'a>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, +} + +impl jacquard_common::IntoStatic for StrongRef<'_> { + type Output = StrongRef<'static>; + fn into_static(self) -> Self::Output { + StrongRef { + cid: self.cid.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/repo/upload_blob.rs b/crates/jacquard-api/src/com_atproto/repo/upload_blob.rs index 7f3e010d3..443fd1e6c 100644 --- a/crates/jacquard-api/src/com_atproto/repo/upload_blob.rs +++ b/crates/jacquard-api/src/com_atproto/repo/upload_blob.rs @@ -9,6 +9,15 @@ #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct UploadBlob<'a> {} +impl jacquard_common::IntoStatic for UploadBlob<'_> { + type Output = UploadBlob<'static>; + fn into_static(self) -> Self::Output { + UploadBlob { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -17,6 +26,16 @@ pub struct UploadBlobOutput<'a> { pub blob: jacquard_common::types::blob::Blob<'a>, } +impl jacquard_common::IntoStatic for UploadBlobOutput<'_> { + type Output = UploadBlobOutput<'static>; + fn into_static(self) -> Self::Output { + UploadBlobOutput { + blob: self.blob.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UploadBlob<'_> { const NSID: &'static str = "com.atproto.repo.uploadBlob"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +43,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UploadBlob<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = UploadBlobOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server.rs b/crates/jacquard-api/src/com_atproto/server.rs index 418501da5..f6e16d952 100644 --- a/crates/jacquard-api/src/com_atproto/server.rs +++ b/crates/jacquard-api/src/com_atproto/server.rs @@ -48,6 +48,22 @@ pub struct InviteCode<'a> { pub uses: Vec>, } +impl jacquard_common::IntoStatic for InviteCode<'_> { + type Output = InviteCode<'static>; + fn into_static(self) -> Self::Output { + InviteCode { + available: self.available.into_static(), + code: self.code.into_static(), + created_at: self.created_at.into_static(), + created_by: self.created_by.into_static(), + disabled: self.disabled.into_static(), + for_account: self.for_account.into_static(), + uses: self.uses.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -55,4 +71,15 @@ pub struct InviteCodeUse<'a> { pub used_at: jacquard_common::types::string::Datetime, #[serde(borrow)] pub used_by: jacquard_common::types::string::Did<'a>, +} + +impl jacquard_common::IntoStatic for InviteCodeUse<'_> { + type Output = InviteCodeUse<'static>; + fn into_static(self) -> Self::Output { + InviteCodeUse { + used_at: self.used_at.into_static(), + used_by: self.used_by.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/activate_account.rs b/crates/jacquard-api/src/com_atproto/server/activate_account.rs index 0dbe4dfd4..8fafef37e 100644 --- a/crates/jacquard-api/src/com_atproto/server/activate_account.rs +++ b/crates/jacquard-api/src/com_atproto/server/activate_account.rs @@ -15,5 +15,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for ActivateAccount { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/check_account_status.rs b/crates/jacquard-api/src/com_atproto/server/check_account_status.rs index 7e2c56ff2..7d73c2ea5 100644 --- a/crates/jacquard-api/src/com_atproto/server/check_account_status.rs +++ b/crates/jacquard-api/src/com_atproto/server/check_account_status.rs @@ -22,6 +22,24 @@ pub struct CheckAccountStatusOutput<'a> { pub valid_did: bool, } +impl jacquard_common::IntoStatic for CheckAccountStatusOutput<'_> { + type Output = CheckAccountStatusOutput<'static>; + fn into_static(self) -> Self::Output { + CheckAccountStatusOutput { + activated: self.activated.into_static(), + expected_blobs: self.expected_blobs.into_static(), + imported_blobs: self.imported_blobs.into_static(), + indexed_records: self.indexed_records.into_static(), + private_state_values: self.private_state_values.into_static(), + repo_blocks: self.repo_blocks.into_static(), + repo_commit: self.repo_commit.into_static(), + repo_rev: self.repo_rev.into_static(), + valid_did: self.valid_did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct CheckAccountStatus; @@ -30,5 +48,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for CheckAccountStatus { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = CheckAccountStatusOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/confirm_email.rs b/crates/jacquard-api/src/com_atproto/server/confirm_email.rs index 9eb88c96b..e264c8f20 100644 --- a/crates/jacquard-api/src/com_atproto/server/confirm_email.rs +++ b/crates/jacquard-api/src/com_atproto/server/confirm_email.rs @@ -15,6 +15,17 @@ pub struct ConfirmEmail<'a> { pub token: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ConfirmEmail<'_> { + type Output = ConfirmEmail<'static>; + fn into_static(self) -> Self::Output { + ConfirmEmail { + email: self.email.into_static(), + token: self.token.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -75,6 +86,27 @@ impl std::fmt::Display for ConfirmEmailError<'_> { } } +impl jacquard_common::IntoStatic for ConfirmEmailError<'_> { + type Output = ConfirmEmailError<'static>; + fn into_static(self) -> Self::Output { + match self { + ConfirmEmailError::AccountNotFound(v) => { + ConfirmEmailError::AccountNotFound(v.into_static()) + } + ConfirmEmailError::ExpiredToken(v) => { + ConfirmEmailError::ExpiredToken(v.into_static()) + } + ConfirmEmailError::InvalidToken(v) => { + ConfirmEmailError::InvalidToken(v.into_static()) + } + ConfirmEmailError::InvalidEmail(v) => { + ConfirmEmailError::InvalidEmail(v.into_static()) + } + ConfirmEmailError::Unknown(v) => ConfirmEmailError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ConfirmEmail<'_> { const NSID: &'static str = "com.atproto.server.confirmEmail"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/server/create_account.rs b/crates/jacquard-api/src/com_atproto/server/create_account.rs index 878332c8c..8afa2ae07 100644 --- a/crates/jacquard-api/src/com_atproto/server/create_account.rs +++ b/crates/jacquard-api/src/com_atproto/server/create_account.rs @@ -42,6 +42,24 @@ pub struct CreateAccount<'a> { pub verification_phone: std::option::Option>, } +impl jacquard_common::IntoStatic for CreateAccount<'_> { + type Output = CreateAccount<'static>; + fn into_static(self) -> Self::Output { + CreateAccount { + did: self.did.into_static(), + email: self.email.into_static(), + handle: self.handle.into_static(), + invite_code: self.invite_code.into_static(), + password: self.password.into_static(), + plc_op: self.plc_op.into_static(), + recovery_key: self.recovery_key.into_static(), + verification_code: self.verification_code.into_static(), + verification_phone: self.verification_phone.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -61,6 +79,20 @@ pub struct CreateAccountOutput<'a> { pub refresh_jwt: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for CreateAccountOutput<'_> { + type Output = CreateAccountOutput<'static>; + fn into_static(self) -> Self::Output { + CreateAccountOutput { + access_jwt: self.access_jwt.into_static(), + did: self.did.into_static(), + did_doc: self.did_doc.into_static(), + handle: self.handle.into_static(), + refresh_jwt: self.refresh_jwt.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -148,6 +180,38 @@ impl std::fmt::Display for CreateAccountError<'_> { } } +impl jacquard_common::IntoStatic for CreateAccountError<'_> { + type Output = CreateAccountError<'static>; + fn into_static(self) -> Self::Output { + match self { + CreateAccountError::InvalidHandle(v) => { + CreateAccountError::InvalidHandle(v.into_static()) + } + CreateAccountError::InvalidPassword(v) => { + CreateAccountError::InvalidPassword(v.into_static()) + } + CreateAccountError::InvalidInviteCode(v) => { + CreateAccountError::InvalidInviteCode(v.into_static()) + } + CreateAccountError::HandleNotAvailable(v) => { + CreateAccountError::HandleNotAvailable(v.into_static()) + } + CreateAccountError::UnsupportedDomain(v) => { + CreateAccountError::UnsupportedDomain(v.into_static()) + } + CreateAccountError::UnresolvableDid(v) => { + CreateAccountError::UnresolvableDid(v.into_static()) + } + CreateAccountError::IncompatibleDidDoc(v) => { + CreateAccountError::IncompatibleDidDoc(v.into_static()) + } + CreateAccountError::Unknown(v) => { + CreateAccountError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateAccount<'_> { const NSID: &'static str = "com.atproto.server.createAccount"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/server/create_app_password.rs b/crates/jacquard-api/src/com_atproto/server/create_app_password.rs index be6cf8010..97647f666 100644 --- a/crates/jacquard-api/src/com_atproto/server/create_app_password.rs +++ b/crates/jacquard-api/src/com_atproto/server/create_app_password.rs @@ -18,6 +18,19 @@ pub struct AppPassword<'a> { pub privileged: std::option::Option, } +impl jacquard_common::IntoStatic for AppPassword<'_> { + type Output = AppPassword<'static>; + fn into_static(self) -> Self::Output { + AppPassword { + created_at: self.created_at.into_static(), + name: self.name.into_static(), + password: self.password.into_static(), + privileged: self.privileged.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -30,6 +43,17 @@ pub struct CreateAppPassword<'a> { pub privileged: std::option::Option, } +impl jacquard_common::IntoStatic for CreateAppPassword<'_> { + type Output = CreateAppPassword<'static>; + fn into_static(self) -> Self::Output { + CreateAppPassword { + name: self.name.into_static(), + privileged: self.privileged.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -39,6 +63,16 @@ pub struct CreateAppPasswordOutput<'a> { pub value: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for CreateAppPasswordOutput<'_> { + type Output = CreateAppPasswordOutput<'static>; + fn into_static(self) -> Self::Output { + CreateAppPasswordOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -72,6 +106,20 @@ impl std::fmt::Display for CreateAppPasswordError<'_> { } } +impl jacquard_common::IntoStatic for CreateAppPasswordError<'_> { + type Output = CreateAppPasswordError<'static>; + fn into_static(self) -> Self::Output { + match self { + CreateAppPasswordError::AccountTakedown(v) => { + CreateAppPasswordError::AccountTakedown(v.into_static()) + } + CreateAppPasswordError::Unknown(v) => { + CreateAppPasswordError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateAppPassword<'_> { const NSID: &'static str = "com.atproto.server.createAppPassword"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/server/create_invite_code.rs b/crates/jacquard-api/src/com_atproto/server/create_invite_code.rs index dab1cf8e3..8737f3f15 100644 --- a/crates/jacquard-api/src/com_atproto/server/create_invite_code.rs +++ b/crates/jacquard-api/src/com_atproto/server/create_invite_code.rs @@ -15,6 +15,17 @@ pub struct CreateInviteCode<'a> { pub use_count: i64, } +impl jacquard_common::IntoStatic for CreateInviteCode<'_> { + type Output = CreateInviteCode<'static>; + fn into_static(self) -> Self::Output { + CreateInviteCode { + for_account: self.for_account.into_static(), + use_count: self.use_count.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -23,6 +34,16 @@ pub struct CreateInviteCodeOutput<'a> { pub code: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for CreateInviteCodeOutput<'_> { + type Output = CreateInviteCodeOutput<'static>; + fn into_static(self) -> Self::Output { + CreateInviteCodeOutput { + code: self.code.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateInviteCode<'_> { const NSID: &'static str = "com.atproto.server.createInviteCode"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -30,5 +51,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for CreateInviteCode<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = CreateInviteCodeOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/create_invite_codes.rs b/crates/jacquard-api/src/com_atproto/server/create_invite_codes.rs index c547fb3ec..80af10408 100644 --- a/crates/jacquard-api/src/com_atproto/server/create_invite_codes.rs +++ b/crates/jacquard-api/src/com_atproto/server/create_invite_codes.rs @@ -15,6 +15,17 @@ pub struct AccountCodes<'a> { pub codes: Vec>, } +impl jacquard_common::IntoStatic for AccountCodes<'_> { + type Output = AccountCodes<'static>; + fn into_static(self) -> Self::Output { + AccountCodes { + account: self.account.into_static(), + codes: self.codes.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -26,6 +37,18 @@ pub struct CreateInviteCodes<'a> { pub use_count: i64, } +impl jacquard_common::IntoStatic for CreateInviteCodes<'_> { + type Output = CreateInviteCodes<'static>; + fn into_static(self) -> Self::Output { + CreateInviteCodes { + code_count: self.code_count.into_static(), + for_accounts: self.for_accounts.into_static(), + use_count: self.use_count.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -34,6 +57,16 @@ pub struct CreateInviteCodesOutput<'a> { pub codes: Vec>, } +impl jacquard_common::IntoStatic for CreateInviteCodesOutput<'_> { + type Output = CreateInviteCodesOutput<'static>; + fn into_static(self) -> Self::Output { + CreateInviteCodesOutput { + codes: self.codes.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateInviteCodes<'_> { const NSID: &'static str = "com.atproto.server.createInviteCodes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -41,5 +74,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for CreateInviteCodes<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = CreateInviteCodesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/create_session.rs b/crates/jacquard-api/src/com_atproto/server/create_session.rs index 2efd23bff..5d75829c5 100644 --- a/crates/jacquard-api/src/com_atproto/server/create_session.rs +++ b/crates/jacquard-api/src/com_atproto/server/create_session.rs @@ -22,6 +22,19 @@ pub struct CreateSession<'a> { pub password: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for CreateSession<'_> { + type Output = CreateSession<'static>; + fn into_static(self) -> Self::Output { + CreateSession { + allow_takendown: self.allow_takendown.into_static(), + auth_factor_token: self.auth_factor_token.into_static(), + identifier: self.identifier.into_static(), + password: self.password.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -52,6 +65,25 @@ pub struct CreateSessionOutput<'a> { pub status: std::option::Option>, } +impl jacquard_common::IntoStatic for CreateSessionOutput<'_> { + type Output = CreateSessionOutput<'static>; + fn into_static(self) -> Self::Output { + CreateSessionOutput { + access_jwt: self.access_jwt.into_static(), + active: self.active.into_static(), + did: self.did.into_static(), + did_doc: self.did_doc.into_static(), + email: self.email.into_static(), + email_auth_factor: self.email_auth_factor.into_static(), + email_confirmed: self.email_confirmed.into_static(), + handle: self.handle.into_static(), + refresh_jwt: self.refresh_jwt.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -94,6 +126,23 @@ impl std::fmt::Display for CreateSessionError<'_> { } } +impl jacquard_common::IntoStatic for CreateSessionError<'_> { + type Output = CreateSessionError<'static>; + fn into_static(self) -> Self::Output { + match self { + CreateSessionError::AccountTakedown(v) => { + CreateSessionError::AccountTakedown(v.into_static()) + } + CreateSessionError::AuthFactorTokenRequired(v) => { + CreateSessionError::AuthFactorTokenRequired(v.into_static()) + } + CreateSessionError::Unknown(v) => { + CreateSessionError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateSession<'_> { const NSID: &'static str = "com.atproto.server.createSession"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/server/deactivate_account.rs b/crates/jacquard-api/src/com_atproto/server/deactivate_account.rs index 297f07817..f6e10bcca 100644 --- a/crates/jacquard-api/src/com_atproto/server/deactivate_account.rs +++ b/crates/jacquard-api/src/com_atproto/server/deactivate_account.rs @@ -14,6 +14,16 @@ pub struct DeactivateAccount<'a> { pub delete_after: std::option::Option, } +impl jacquard_common::IntoStatic for DeactivateAccount<'_> { + type Output = DeactivateAccount<'static>; + fn into_static(self) -> Self::Output { + DeactivateAccount { + delete_after: self.delete_after.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeactivateAccount<'_> { const NSID: &'static str = "com.atproto.server.deactivateAccount"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -21,5 +31,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DeactivateAccount<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/delete_account.rs b/crates/jacquard-api/src/com_atproto/server/delete_account.rs index d93066492..fe6048c96 100644 --- a/crates/jacquard-api/src/com_atproto/server/delete_account.rs +++ b/crates/jacquard-api/src/com_atproto/server/delete_account.rs @@ -17,6 +17,18 @@ pub struct DeleteAccount<'a> { pub token: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for DeleteAccount<'_> { + type Output = DeleteAccount<'static>; + fn into_static(self) -> Self::Output { + DeleteAccount { + did: self.did.into_static(), + password: self.password.into_static(), + token: self.token.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -59,6 +71,23 @@ impl std::fmt::Display for DeleteAccountError<'_> { } } +impl jacquard_common::IntoStatic for DeleteAccountError<'_> { + type Output = DeleteAccountError<'static>; + fn into_static(self) -> Self::Output { + match self { + DeleteAccountError::ExpiredToken(v) => { + DeleteAccountError::ExpiredToken(v.into_static()) + } + DeleteAccountError::InvalidToken(v) => { + DeleteAccountError::InvalidToken(v.into_static()) + } + DeleteAccountError::Unknown(v) => { + DeleteAccountError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteAccount<'_> { const NSID: &'static str = "com.atproto.server.deleteAccount"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/server/delete_session.rs b/crates/jacquard-api/src/com_atproto/server/delete_session.rs index 429314880..cd8142831 100644 --- a/crates/jacquard-api/src/com_atproto/server/delete_session.rs +++ b/crates/jacquard-api/src/com_atproto/server/delete_session.rs @@ -15,5 +15,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DeleteSession { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/describe_server.rs b/crates/jacquard-api/src/com_atproto/server/describe_server.rs index cc893c08a..82d152aba 100644 --- a/crates/jacquard-api/src/com_atproto/server/describe_server.rs +++ b/crates/jacquard-api/src/com_atproto/server/describe_server.rs @@ -14,6 +14,16 @@ pub struct Contact<'a> { pub email: std::option::Option>, } +impl jacquard_common::IntoStatic for Contact<'_> { + type Output = Contact<'static>; + fn into_static(self) -> Self::Output { + Contact { + email: self.email.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -26,6 +36,17 @@ pub struct Links<'a> { pub terms_of_service: std::option::Option>, } +impl jacquard_common::IntoStatic for Links<'_> { + type Output = Links<'static>; + fn into_static(self) -> Self::Output { + Links { + privacy_policy: self.privacy_policy.into_static(), + terms_of_service: self.terms_of_service.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -51,6 +72,21 @@ pub struct DescribeServerOutput<'a> { pub phone_verification_required: std::option::Option, } +impl jacquard_common::IntoStatic for DescribeServerOutput<'_> { + type Output = DescribeServerOutput<'static>; + fn into_static(self) -> Self::Output { + DescribeServerOutput { + available_user_domains: self.available_user_domains.into_static(), + contact: self.contact.into_static(), + did: self.did.into_static(), + invite_code_required: self.invite_code_required.into_static(), + links: self.links.into_static(), + phone_verification_required: self.phone_verification_required.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct DescribeServer; @@ -59,5 +95,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DescribeServer { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = DescribeServerOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/get_account_invite_codes.rs b/crates/jacquard-api/src/com_atproto/server/get_account_invite_codes.rs index 7e25d32a8..c0f889f6f 100644 --- a/crates/jacquard-api/src/com_atproto/server/get_account_invite_codes.rs +++ b/crates/jacquard-api/src/com_atproto/server/get_account_invite_codes.rs @@ -5,15 +5,24 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } +impl jacquard_common::IntoStatic for GetAccountInviteCodes { + type Output = GetAccountInviteCodes; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -22,6 +31,16 @@ pub struct GetAccountInviteCodesOutput<'a> { pub codes: Vec>, } +impl jacquard_common::IntoStatic for GetAccountInviteCodesOutput<'_> { + type Output = GetAccountInviteCodesOutput<'static>; + fn into_static(self) -> Self::Output { + GetAccountInviteCodesOutput { + codes: self.codes.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -55,6 +74,20 @@ impl std::fmt::Display for GetAccountInviteCodesError<'_> { } } +impl jacquard_common::IntoStatic for GetAccountInviteCodesError<'_> { + type Output = GetAccountInviteCodesError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetAccountInviteCodesError::DuplicateCreate(v) => { + GetAccountInviteCodesError::DuplicateCreate(v.into_static()) + } + GetAccountInviteCodesError::Unknown(v) => { + GetAccountInviteCodesError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetAccountInviteCodes { const NSID: &'static str = "com.atproto.server.getAccountInviteCodes"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/server/get_service_auth.rs b/crates/jacquard-api/src/com_atproto/server/get_service_auth.rs index 7a0d411d9..42a7f48f0 100644 --- a/crates/jacquard-api/src/com_atproto/server/get_service_auth.rs +++ b/crates/jacquard-api/src/com_atproto/server/get_service_auth.rs @@ -17,6 +17,17 @@ pub struct GetServiceAuth<'a> { pub lxm: std::option::Option>, } +impl jacquard_common::IntoStatic for GetServiceAuth<'_> { + type Output = GetServiceAuth<'static>; + fn into_static(self) -> Self::Output { + GetServiceAuth { + aud: self.aud.into_static(), + exp: self.exp.into_static(), + lxm: self.lxm.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -25,6 +36,16 @@ pub struct GetServiceAuthOutput<'a> { pub token: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for GetServiceAuthOutput<'_> { + type Output = GetServiceAuthOutput<'static>; + fn into_static(self) -> Self::Output { + GetServiceAuthOutput { + token: self.token.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -59,6 +80,20 @@ impl std::fmt::Display for GetServiceAuthError<'_> { } } +impl jacquard_common::IntoStatic for GetServiceAuthError<'_> { + type Output = GetServiceAuthError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetServiceAuthError::BadExpiration(v) => { + GetServiceAuthError::BadExpiration(v.into_static()) + } + GetServiceAuthError::Unknown(v) => { + GetServiceAuthError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetServiceAuth<'_> { const NSID: &'static str = "com.atproto.server.getServiceAuth"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/server/get_session.rs b/crates/jacquard-api/src/com_atproto/server/get_session.rs index 588800c92..e9b1a8d46 100644 --- a/crates/jacquard-api/src/com_atproto/server/get_session.rs +++ b/crates/jacquard-api/src/com_atproto/server/get_session.rs @@ -31,6 +31,23 @@ pub struct GetSessionOutput<'a> { pub status: std::option::Option>, } +impl jacquard_common::IntoStatic for GetSessionOutput<'_> { + type Output = GetSessionOutput<'static>; + fn into_static(self) -> Self::Output { + GetSessionOutput { + active: self.active.into_static(), + did: self.did.into_static(), + did_doc: self.did_doc.into_static(), + email: self.email.into_static(), + email_auth_factor: self.email_auth_factor.into_static(), + email_confirmed: self.email_confirmed.into_static(), + handle: self.handle.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct GetSession; @@ -39,5 +56,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for GetSession { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSessionOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/list_app_passwords.rs b/crates/jacquard-api/src/com_atproto/server/list_app_passwords.rs index bbc3eaff2..3151192c2 100644 --- a/crates/jacquard-api/src/com_atproto/server/list_app_passwords.rs +++ b/crates/jacquard-api/src/com_atproto/server/list_app_passwords.rs @@ -16,6 +16,18 @@ pub struct AppPassword<'a> { pub privileged: std::option::Option, } +impl jacquard_common::IntoStatic for AppPassword<'_> { + type Output = AppPassword<'static>; + fn into_static(self) -> Self::Output { + AppPassword { + created_at: self.created_at.into_static(), + name: self.name.into_static(), + privileged: self.privileged.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,6 +36,16 @@ pub struct ListAppPasswordsOutput<'a> { pub passwords: Vec>, } +impl jacquard_common::IntoStatic for ListAppPasswordsOutput<'_> { + type Output = ListAppPasswordsOutput<'static>; + fn into_static(self) -> Self::Output { + ListAppPasswordsOutput { + passwords: self.passwords.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -57,6 +79,20 @@ impl std::fmt::Display for ListAppPasswordsError<'_> { } } +impl jacquard_common::IntoStatic for ListAppPasswordsError<'_> { + type Output = ListAppPasswordsError<'static>; + fn into_static(self) -> Self::Output { + match self { + ListAppPasswordsError::AccountTakedown(v) => { + ListAppPasswordsError::AccountTakedown(v.into_static()) + } + ListAppPasswordsError::Unknown(v) => { + ListAppPasswordsError::Unknown(v.into_static()) + } + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct ListAppPasswords; diff --git a/crates/jacquard-api/src/com_atproto/server/refresh_session.rs b/crates/jacquard-api/src/com_atproto/server/refresh_session.rs index 97d5e65d7..96a134a4f 100644 --- a/crates/jacquard-api/src/com_atproto/server/refresh_session.rs +++ b/crates/jacquard-api/src/com_atproto/server/refresh_session.rs @@ -28,6 +28,22 @@ pub struct RefreshSessionOutput<'a> { pub status: std::option::Option>, } +impl jacquard_common::IntoStatic for RefreshSessionOutput<'_> { + type Output = RefreshSessionOutput<'static>; + fn into_static(self) -> Self::Output { + RefreshSessionOutput { + access_jwt: self.access_jwt.into_static(), + active: self.active.into_static(), + did: self.did.into_static(), + did_doc: self.did_doc.into_static(), + handle: self.handle.into_static(), + refresh_jwt: self.refresh_jwt.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -61,6 +77,20 @@ impl std::fmt::Display for RefreshSessionError<'_> { } } +impl jacquard_common::IntoStatic for RefreshSessionError<'_> { + type Output = RefreshSessionError<'static>; + fn into_static(self) -> Self::Output { + match self { + RefreshSessionError::AccountTakedown(v) => { + RefreshSessionError::AccountTakedown(v.into_static()) + } + RefreshSessionError::Unknown(v) => { + RefreshSessionError::Unknown(v.into_static()) + } + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct RefreshSession; diff --git a/crates/jacquard-api/src/com_atproto/server/request_account_delete.rs b/crates/jacquard-api/src/com_atproto/server/request_account_delete.rs index e79aeeb77..3c22579e6 100644 --- a/crates/jacquard-api/src/com_atproto/server/request_account_delete.rs +++ b/crates/jacquard-api/src/com_atproto/server/request_account_delete.rs @@ -15,5 +15,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RequestAccountDelete { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/request_email_confirmation.rs b/crates/jacquard-api/src/com_atproto/server/request_email_confirmation.rs index c5fb0f693..77b095842 100644 --- a/crates/jacquard-api/src/com_atproto/server/request_email_confirmation.rs +++ b/crates/jacquard-api/src/com_atproto/server/request_email_confirmation.rs @@ -15,5 +15,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RequestEmailConfirmation { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/request_email_update.rs b/crates/jacquard-api/src/com_atproto/server/request_email_update.rs index a7bc81af4..995a35998 100644 --- a/crates/jacquard-api/src/com_atproto/server/request_email_update.rs +++ b/crates/jacquard-api/src/com_atproto/server/request_email_update.rs @@ -12,6 +12,16 @@ pub struct RequestEmailUpdateOutput<'a> { pub token_required: bool, } +impl jacquard_common::IntoStatic for RequestEmailUpdateOutput<'_> { + type Output = RequestEmailUpdateOutput<'static>; + fn into_static(self) -> Self::Output { + RequestEmailUpdateOutput { + token_required: self.token_required.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct RequestEmailUpdate; @@ -22,5 +32,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RequestEmailUpdate { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = RequestEmailUpdateOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/request_password_reset.rs b/crates/jacquard-api/src/com_atproto/server/request_password_reset.rs index b3c3544be..74701d26a 100644 --- a/crates/jacquard-api/src/com_atproto/server/request_password_reset.rs +++ b/crates/jacquard-api/src/com_atproto/server/request_password_reset.rs @@ -13,6 +13,16 @@ pub struct RequestPasswordReset<'a> { pub email: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RequestPasswordReset<'_> { + type Output = RequestPasswordReset<'static>; + fn into_static(self) -> Self::Output { + RequestPasswordReset { + email: self.email.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RequestPasswordReset<'_> { const NSID: &'static str = "com.atproto.server.requestPasswordReset"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RequestPasswordReset<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/reserve_signing_key.rs b/crates/jacquard-api/src/com_atproto/server/reserve_signing_key.rs index 04ae39f20..64e7509f6 100644 --- a/crates/jacquard-api/src/com_atproto/server/reserve_signing_key.rs +++ b/crates/jacquard-api/src/com_atproto/server/reserve_signing_key.rs @@ -15,6 +15,16 @@ pub struct ReserveSigningKey<'a> { pub did: std::option::Option>, } +impl jacquard_common::IntoStatic for ReserveSigningKey<'_> { + type Output = ReserveSigningKey<'static>; + fn into_static(self) -> Self::Output { + ReserveSigningKey { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,6 +34,16 @@ pub struct ReserveSigningKeyOutput<'a> { pub signing_key: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ReserveSigningKeyOutput<'_> { + type Output = ReserveSigningKeyOutput<'static>; + fn into_static(self) -> Self::Output { + ReserveSigningKeyOutput { + signing_key: self.signing_key.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ReserveSigningKey<'_> { const NSID: &'static str = "com.atproto.server.reserveSigningKey"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -31,5 +51,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for ReserveSigningKey<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ReserveSigningKeyOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/reset_password.rs b/crates/jacquard-api/src/com_atproto/server/reset_password.rs index 0a02e3617..c510fdda1 100644 --- a/crates/jacquard-api/src/com_atproto/server/reset_password.rs +++ b/crates/jacquard-api/src/com_atproto/server/reset_password.rs @@ -15,6 +15,17 @@ pub struct ResetPassword<'a> { pub token: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ResetPassword<'_> { + type Output = ResetPassword<'static>; + fn into_static(self) -> Self::Output { + ResetPassword { + password: self.password.into_static(), + token: self.token.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -57,6 +68,23 @@ impl std::fmt::Display for ResetPasswordError<'_> { } } +impl jacquard_common::IntoStatic for ResetPasswordError<'_> { + type Output = ResetPasswordError<'static>; + fn into_static(self) -> Self::Output { + match self { + ResetPasswordError::ExpiredToken(v) => { + ResetPasswordError::ExpiredToken(v.into_static()) + } + ResetPasswordError::InvalidToken(v) => { + ResetPasswordError::InvalidToken(v.into_static()) + } + ResetPasswordError::Unknown(v) => { + ResetPasswordError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ResetPassword<'_> { const NSID: &'static str = "com.atproto.server.resetPassword"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/server/revoke_app_password.rs b/crates/jacquard-api/src/com_atproto/server/revoke_app_password.rs index 6b4393889..51debbfc2 100644 --- a/crates/jacquard-api/src/com_atproto/server/revoke_app_password.rs +++ b/crates/jacquard-api/src/com_atproto/server/revoke_app_password.rs @@ -13,6 +13,16 @@ pub struct RevokeAppPassword<'a> { pub name: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RevokeAppPassword<'_> { + type Output = RevokeAppPassword<'static>; + fn into_static(self) -> Self::Output { + RevokeAppPassword { + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RevokeAppPassword<'_> { const NSID: &'static str = "com.atproto.server.revokeAppPassword"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RevokeAppPassword<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/server/update_email.rs b/crates/jacquard-api/src/com_atproto/server/update_email.rs index a3f4f5ebe..552d1cbad 100644 --- a/crates/jacquard-api/src/com_atproto/server/update_email.rs +++ b/crates/jacquard-api/src/com_atproto/server/update_email.rs @@ -19,6 +19,18 @@ pub struct UpdateEmail<'a> { pub token: std::option::Option>, } +impl jacquard_common::IntoStatic for UpdateEmail<'_> { + type Output = UpdateEmail<'static>; + fn into_static(self) -> Self::Output { + UpdateEmail { + email: self.email.into_static(), + email_auth_factor: self.email_auth_factor.into_static(), + token: self.token.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -70,6 +82,24 @@ impl std::fmt::Display for UpdateEmailError<'_> { } } +impl jacquard_common::IntoStatic for UpdateEmailError<'_> { + type Output = UpdateEmailError<'static>; + fn into_static(self) -> Self::Output { + match self { + UpdateEmailError::ExpiredToken(v) => { + UpdateEmailError::ExpiredToken(v.into_static()) + } + UpdateEmailError::InvalidToken(v) => { + UpdateEmailError::InvalidToken(v.into_static()) + } + UpdateEmailError::TokenRequired(v) => { + UpdateEmailError::TokenRequired(v.into_static()) + } + UpdateEmailError::Unknown(v) => UpdateEmailError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateEmail<'_> { const NSID: &'static str = "com.atproto.server.updateEmail"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/sync.rs b/crates/jacquard-api/src/com_atproto/sync.rs index 2623650b2..309a4f7f0 100644 --- a/crates/jacquard-api/src/com_atproto/sync.rs +++ b/crates/jacquard-api/src/com_atproto/sync.rs @@ -97,4 +97,18 @@ where 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/jacquard-api/src/com_atproto/sync/get_blob.rs b/crates/jacquard-api/src/com_atproto/sync/get_blob.rs index fce0a53ec..f5b3525b6 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_blob.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_blob.rs @@ -14,10 +14,29 @@ pub struct GetBlob<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetBlob<'_> { + type Output = GetBlob<'static>; + fn into_static(self) -> Self::Output { + GetBlob { + cid: self.cid.into_static(), + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetBlobOutput<'a> {} +impl jacquard_common::IntoStatic for GetBlobOutput<'_> { + type Output = GetBlobOutput<'static>; + fn into_static(self) -> Self::Output { + GetBlobOutput { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -87,6 +106,26 @@ impl std::fmt::Display for GetBlobError<'_> { } } +impl jacquard_common::IntoStatic for GetBlobError<'_> { + type Output = GetBlobError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetBlobError::BlobNotFound(v) => GetBlobError::BlobNotFound(v.into_static()), + GetBlobError::RepoNotFound(v) => GetBlobError::RepoNotFound(v.into_static()), + GetBlobError::RepoTakendown(v) => { + GetBlobError::RepoTakendown(v.into_static()) + } + GetBlobError::RepoSuspended(v) => { + GetBlobError::RepoSuspended(v.into_static()) + } + GetBlobError::RepoDeactivated(v) => { + GetBlobError::RepoDeactivated(v.into_static()) + } + GetBlobError::Unknown(v) => GetBlobError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetBlob<'_> { const NSID: &'static str = "com.atproto.sync.getBlob"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/get_blocks.rs b/crates/jacquard-api/src/com_atproto/sync/get_blocks.rs index 0ea69c49f..b3ca89a82 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_blocks.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_blocks.rs @@ -14,10 +14,29 @@ pub struct GetBlocks<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetBlocks<'_> { + type Output = GetBlocks<'static>; + fn into_static(self) -> Self::Output { + GetBlocks { + cids: self.cids.into_static(), + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetBlocksOutput<'a> {} +impl jacquard_common::IntoStatic for GetBlocksOutput<'_> { + type Output = GetBlocksOutput<'static>; + fn into_static(self) -> Self::Output { + GetBlocksOutput { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -87,6 +106,30 @@ impl std::fmt::Display for GetBlocksError<'_> { } } +impl jacquard_common::IntoStatic for GetBlocksError<'_> { + type Output = GetBlocksError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetBlocksError::BlockNotFound(v) => { + GetBlocksError::BlockNotFound(v.into_static()) + } + GetBlocksError::RepoNotFound(v) => { + GetBlocksError::RepoNotFound(v.into_static()) + } + GetBlocksError::RepoTakendown(v) => { + GetBlocksError::RepoTakendown(v.into_static()) + } + GetBlocksError::RepoSuspended(v) => { + GetBlocksError::RepoSuspended(v.into_static()) + } + GetBlocksError::RepoDeactivated(v) => { + GetBlocksError::RepoDeactivated(v.into_static()) + } + GetBlocksError::Unknown(v) => GetBlocksError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetBlocks<'_> { const NSID: &'static str = "com.atproto.sync.getBlocks"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/get_checkout.rs b/crates/jacquard-api/src/com_atproto/sync/get_checkout.rs index db0e73903..eb22b7561 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_checkout.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_checkout.rs @@ -12,14 +12,32 @@ pub struct GetCheckout<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetCheckout<'_> { + type Output = GetCheckout<'static>; + fn into_static(self) -> Self::Output { + GetCheckout { + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetCheckoutOutput<'a> {} +impl jacquard_common::IntoStatic for GetCheckoutOutput<'_> { + type Output = GetCheckoutOutput<'static>; + fn into_static(self) -> Self::Output { + GetCheckoutOutput { + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetCheckout<'_> { const NSID: &'static str = "com.atproto.sync.getCheckout"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/vnd.ipld.car"; type Output<'de> = GetCheckoutOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/sync/get_head.rs b/crates/jacquard-api/src/com_atproto/sync/get_head.rs index b1a027020..e1e626459 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_head.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_head.rs @@ -12,6 +12,15 @@ pub struct GetHead<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetHead<'_> { + type Output = GetHead<'static>; + fn into_static(self) -> Self::Output { + GetHead { + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,6 +29,16 @@ pub struct GetHeadOutput<'a> { pub root: jacquard_common::types::string::Cid<'a>, } +impl jacquard_common::IntoStatic for GetHeadOutput<'_> { + type Output = GetHeadOutput<'static>; + fn into_static(self) -> Self::Output { + GetHeadOutput { + root: self.root.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -53,6 +72,16 @@ impl std::fmt::Display for GetHeadError<'_> { } } +impl jacquard_common::IntoStatic for GetHeadError<'_> { + type Output = GetHeadError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetHeadError::HeadNotFound(v) => GetHeadError::HeadNotFound(v.into_static()), + GetHeadError::Unknown(v) => GetHeadError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetHead<'_> { const NSID: &'static str = "com.atproto.sync.getHead"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/get_host_status.rs b/crates/jacquard-api/src/com_atproto/sync/get_host_status.rs index 06c83d685..dea00a82f 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_host_status.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_host_status.rs @@ -12,6 +12,15 @@ pub struct GetHostStatus<'a> { pub hostname: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for GetHostStatus<'_> { + type Output = GetHostStatus<'static>; + fn into_static(self) -> Self::Output { + GetHostStatus { + hostname: self.hostname.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -29,6 +38,19 @@ pub struct GetHostStatusOutput<'a> { pub status: std::option::Option>, } +impl jacquard_common::IntoStatic for GetHostStatusOutput<'_> { + type Output = GetHostStatusOutput<'static>; + fn into_static(self) -> Self::Output { + GetHostStatusOutput { + account_count: self.account_count.into_static(), + hostname: self.hostname.into_static(), + seq: self.seq.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -62,6 +84,20 @@ impl std::fmt::Display for GetHostStatusError<'_> { } } +impl jacquard_common::IntoStatic for GetHostStatusError<'_> { + type Output = GetHostStatusError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetHostStatusError::HostNotFound(v) => { + GetHostStatusError::HostNotFound(v.into_static()) + } + GetHostStatusError::Unknown(v) => { + GetHostStatusError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetHostStatus<'_> { const NSID: &'static str = "com.atproto.sync.getHostStatus"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/get_latest_commit.rs b/crates/jacquard-api/src/com_atproto/sync/get_latest_commit.rs index a9719a6b8..850ecfbe7 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_latest_commit.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_latest_commit.rs @@ -12,6 +12,15 @@ pub struct GetLatestCommit<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetLatestCommit<'_> { + type Output = GetLatestCommit<'static>; + fn into_static(self) -> Self::Output { + GetLatestCommit { + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,6 +30,17 @@ pub struct GetLatestCommitOutput<'a> { pub rev: jacquard_common::types::string::Tid, } +impl jacquard_common::IntoStatic for GetLatestCommitOutput<'_> { + type Output = GetLatestCommitOutput<'static>; + fn into_static(self) -> Self::Output { + GetLatestCommitOutput { + cid: self.cid.into_static(), + rev: self.rev.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -81,6 +101,29 @@ impl std::fmt::Display for GetLatestCommitError<'_> { } } +impl jacquard_common::IntoStatic for GetLatestCommitError<'_> { + type Output = GetLatestCommitError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetLatestCommitError::RepoNotFound(v) => { + GetLatestCommitError::RepoNotFound(v.into_static()) + } + GetLatestCommitError::RepoTakendown(v) => { + GetLatestCommitError::RepoTakendown(v.into_static()) + } + GetLatestCommitError::RepoSuspended(v) => { + GetLatestCommitError::RepoSuspended(v.into_static()) + } + GetLatestCommitError::RepoDeactivated(v) => { + GetLatestCommitError::RepoDeactivated(v.into_static()) + } + GetLatestCommitError::Unknown(v) => { + GetLatestCommitError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetLatestCommit<'_> { const NSID: &'static str = "com.atproto.sync.getLatestCommit"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/get_record.rs b/crates/jacquard-api/src/com_atproto/sync/get_record.rs index b56d1c147..b2e0017a7 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_record.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_record.rs @@ -18,10 +18,30 @@ pub struct GetRecord<'a> { >, } +impl jacquard_common::IntoStatic for GetRecord<'_> { + type Output = GetRecord<'static>; + fn into_static(self) -> Self::Output { + GetRecord { + collection: self.collection.into_static(), + did: self.did.into_static(), + rkey: self.rkey.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetRecordOutput<'a> {} +impl jacquard_common::IntoStatic for GetRecordOutput<'_> { + type Output = GetRecordOutput<'static>; + fn into_static(self) -> Self::Output { + GetRecordOutput { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -91,6 +111,30 @@ impl std::fmt::Display for GetRecordError<'_> { } } +impl jacquard_common::IntoStatic for GetRecordError<'_> { + type Output = GetRecordError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetRecordError::RecordNotFound(v) => { + GetRecordError::RecordNotFound(v.into_static()) + } + GetRecordError::RepoNotFound(v) => { + GetRecordError::RepoNotFound(v.into_static()) + } + GetRecordError::RepoTakendown(v) => { + GetRecordError::RepoTakendown(v.into_static()) + } + GetRecordError::RepoSuspended(v) => { + GetRecordError::RepoSuspended(v.into_static()) + } + GetRecordError::RepoDeactivated(v) => { + GetRecordError::RepoDeactivated(v.into_static()) + } + GetRecordError::Unknown(v) => GetRecordError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRecord<'_> { const NSID: &'static str = "com.atproto.sync.getRecord"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/get_repo.rs b/crates/jacquard-api/src/com_atproto/sync/get_repo.rs index a74fe23be..3d02a790f 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_repo.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_repo.rs @@ -14,10 +14,29 @@ pub struct GetRepo<'a> { pub since: std::option::Option, } +impl jacquard_common::IntoStatic for GetRepo<'_> { + type Output = GetRepo<'static>; + fn into_static(self) -> Self::Output { + GetRepo { + did: self.did.into_static(), + since: self.since.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetRepoOutput<'a> {} +impl jacquard_common::IntoStatic for GetRepoOutput<'_> { + type Output = GetRepoOutput<'static>; + fn into_static(self) -> Self::Output { + GetRepoOutput { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -78,6 +97,25 @@ impl std::fmt::Display for GetRepoError<'_> { } } +impl jacquard_common::IntoStatic for GetRepoError<'_> { + type Output = GetRepoError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetRepoError::RepoNotFound(v) => GetRepoError::RepoNotFound(v.into_static()), + GetRepoError::RepoTakendown(v) => { + GetRepoError::RepoTakendown(v.into_static()) + } + GetRepoError::RepoSuspended(v) => { + GetRepoError::RepoSuspended(v.into_static()) + } + GetRepoError::RepoDeactivated(v) => { + GetRepoError::RepoDeactivated(v.into_static()) + } + GetRepoError::Unknown(v) => GetRepoError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRepo<'_> { const NSID: &'static str = "com.atproto.sync.getRepo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/get_repo_status.rs b/crates/jacquard-api/src/com_atproto/sync/get_repo_status.rs index 9a3bbb05a..5a3a27f51 100644 --- a/crates/jacquard-api/src/com_atproto/sync/get_repo_status.rs +++ b/crates/jacquard-api/src/com_atproto/sync/get_repo_status.rs @@ -12,6 +12,15 @@ pub struct GetRepoStatus<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetRepoStatus<'_> { + type Output = GetRepoStatus<'static>; + fn into_static(self) -> Self::Output { + GetRepoStatus { + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -28,6 +37,19 @@ pub struct GetRepoStatusOutput<'a> { pub status: std::option::Option>, } +impl jacquard_common::IntoStatic for GetRepoStatusOutput<'_> { + type Output = GetRepoStatusOutput<'static>; + fn into_static(self) -> Self::Output { + GetRepoStatusOutput { + active: self.active.into_static(), + did: self.did.into_static(), + rev: self.rev.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -61,6 +83,20 @@ impl std::fmt::Display for GetRepoStatusError<'_> { } } +impl jacquard_common::IntoStatic for GetRepoStatusError<'_> { + type Output = GetRepoStatusError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetRepoStatusError::RepoNotFound(v) => { + GetRepoStatusError::RepoNotFound(v.into_static()) + } + GetRepoStatusError::Unknown(v) => { + GetRepoStatusError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRepoStatus<'_> { const NSID: &'static str = "com.atproto.sync.getRepoStatus"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/list_blobs.rs b/crates/jacquard-api/src/com_atproto/sync/list_blobs.rs index 74178c98f..6d8e4db23 100644 --- a/crates/jacquard-api/src/com_atproto/sync/list_blobs.rs +++ b/crates/jacquard-api/src/com_atproto/sync/list_blobs.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ListBlobs<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -13,19 +13,21 @@ pub struct ListBlobs<'a> { 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, } -impl Default for ListBlobs<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - did: Default::default(), - limit: Some(500i64), - since: Default::default(), +impl jacquard_common::IntoStatic for ListBlobs<'_> { + type Output = ListBlobs<'static>; + fn into_static(self) -> Self::Output { + ListBlobs { + cursor: self.cursor.into_static(), + did: self.did.into_static(), + limit: self.limit.into_static(), + since: self.since.into_static(), } } } @@ -41,6 +43,17 @@ pub struct ListBlobsOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for ListBlobsOutput<'_> { + type Output = ListBlobsOutput<'static>; + fn into_static(self) -> Self::Output { + ListBlobsOutput { + cids: self.cids.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -101,6 +114,27 @@ impl std::fmt::Display for ListBlobsError<'_> { } } +impl jacquard_common::IntoStatic for ListBlobsError<'_> { + type Output = ListBlobsError<'static>; + fn into_static(self) -> Self::Output { + match self { + ListBlobsError::RepoNotFound(v) => { + ListBlobsError::RepoNotFound(v.into_static()) + } + ListBlobsError::RepoTakendown(v) => { + ListBlobsError::RepoTakendown(v.into_static()) + } + ListBlobsError::RepoSuspended(v) => { + ListBlobsError::RepoSuspended(v.into_static()) + } + ListBlobsError::RepoDeactivated(v) => { + ListBlobsError::RepoDeactivated(v.into_static()) + } + ListBlobsError::Unknown(v) => ListBlobsError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListBlobs<'_> { const NSID: &'static str = "com.atproto.sync.listBlobs"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/sync/list_hosts.rs b/crates/jacquard-api/src/com_atproto/sync/list_hosts.rs index 57cd98523..06cd79f1e 100644 --- a/crates/jacquard-api/src/com_atproto/sync/list_hosts.rs +++ b/crates/jacquard-api/src/com_atproto/sync/list_hosts.rs @@ -22,21 +22,36 @@ pub struct Host<'a> { pub status: std::option::Option>, } -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Default)] +impl jacquard_common::IntoStatic for Host<'_> { + type Output = Host<'static>; + fn into_static(self) -> Self::Output { + Host { + account_count: self.account_count.into_static(), + hostname: self.hostname.into_static(), + seq: self.seq.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for ListHosts<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(200i64), +impl jacquard_common::IntoStatic for ListHosts<'_> { + type Output = ListHosts<'static>; + fn into_static(self) -> Self::Output { + ListHosts { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -53,10 +68,21 @@ pub struct ListHostsOutput<'a> { pub hosts: Vec>, } +impl jacquard_common::IntoStatic for ListHostsOutput<'_> { + type Output = ListHostsOutput<'static>; + fn into_static(self) -> Self::Output { + ListHostsOutput { + cursor: self.cursor.into_static(), + hosts: self.hosts.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListHosts<'_> { const NSID: &'static str = "com.atproto.sync.listHosts"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListHostsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/sync/list_repos.rs b/crates/jacquard-api/src/com_atproto/sync/list_repos.rs index 0c745c793..48683fb18 100644 --- a/crates/jacquard-api/src/com_atproto/sync/list_repos.rs +++ b/crates/jacquard-api/src/com_atproto/sync/list_repos.rs @@ -5,21 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } -impl Default for ListRepos<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(500i64), +impl jacquard_common::IntoStatic for ListRepos<'_> { + type Output = ListRepos<'static>; + fn into_static(self) -> Self::Output { + ListRepos { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -35,12 +37,23 @@ pub struct ListReposOutput<'a> { pub repos: Vec>, } +impl jacquard_common::IntoStatic for ListReposOutput<'_> { + type Output = ListReposOutput<'static>; + fn into_static(self) -> Self::Output { + ListReposOutput { + cursor: self.cursor.into_static(), + repos: self.repos.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListRepos<'_> { const NSID: &'static str = "com.atproto.sync.listRepos"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListReposOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -59,4 +72,18 @@ pub struct Repo<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub status: std::option::Option>, +} + +impl jacquard_common::IntoStatic for Repo<'_> { + type Output = Repo<'static>; + fn into_static(self) -> Self::Output { + Repo { + active: self.active.into_static(), + did: self.did.into_static(), + head: self.head.into_static(), + rev: self.rev.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/sync/list_repos_by_collection.rs b/crates/jacquard-api/src/com_atproto/sync/list_repos_by_collection.rs index 2dc2fe7b9..39d566cb4 100644 --- a/crates/jacquard-api/src/com_atproto/sync/list_repos_by_collection.rs +++ b/crates/jacquard-api/src/com_atproto/sync/list_repos_by_collection.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ListReposByCollection<'a> { #[serde(borrow)] @@ -13,16 +13,18 @@ pub struct ListReposByCollection<'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, } -impl Default for ListReposByCollection<'_> { - fn default() -> Self { - Self { - collection: Default::default(), - cursor: Default::default(), - limit: Some(500i64), +impl jacquard_common::IntoStatic for ListReposByCollection<'_> { + type Output = ListReposByCollection<'static>; + fn into_static(self) -> Self::Output { + ListReposByCollection { + collection: self.collection.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), } } } @@ -38,12 +40,23 @@ pub struct ListReposByCollectionOutput<'a> { pub repos: Vec>, } +impl jacquard_common::IntoStatic for ListReposByCollectionOutput<'_> { + type Output = ListReposByCollectionOutput<'static>; + fn into_static(self) -> Self::Output { + ListReposByCollectionOutput { + cursor: self.cursor.into_static(), + repos: self.repos.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListReposByCollection<'_> { const NSID: &'static str = "com.atproto.sync.listReposByCollection"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListReposByCollectionOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -52,4 +65,14 @@ impl jacquard_common::types::xrpc::XrpcRequest for ListReposByCollection<'_> { pub struct Repo<'a> { #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, +} + +impl jacquard_common::IntoStatic for Repo<'_> { + type Output = Repo<'static>; + fn into_static(self) -> Self::Output { + Repo { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/sync/notify_of_update.rs b/crates/jacquard-api/src/com_atproto/sync/notify_of_update.rs index e54293f34..aee329c3b 100644 --- a/crates/jacquard-api/src/com_atproto/sync/notify_of_update.rs +++ b/crates/jacquard-api/src/com_atproto/sync/notify_of_update.rs @@ -14,6 +14,16 @@ pub struct NotifyOfUpdate<'a> { pub hostname: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for NotifyOfUpdate<'_> { + type Output = NotifyOfUpdate<'static>; + fn into_static(self) -> Self::Output { + NotifyOfUpdate { + hostname: self.hostname.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for NotifyOfUpdate<'_> { const NSID: &'static str = "com.atproto.sync.notifyOfUpdate"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -21,5 +31,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for NotifyOfUpdate<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/sync/request_crawl.rs b/crates/jacquard-api/src/com_atproto/sync/request_crawl.rs index 44d20effd..24fff6ebd 100644 --- a/crates/jacquard-api/src/com_atproto/sync/request_crawl.rs +++ b/crates/jacquard-api/src/com_atproto/sync/request_crawl.rs @@ -14,6 +14,16 @@ pub struct RequestCrawl<'a> { pub hostname: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RequestCrawl<'_> { + type Output = RequestCrawl<'static>; + fn into_static(self) -> Self::Output { + RequestCrawl { + hostname: self.hostname.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -47,6 +57,18 @@ impl std::fmt::Display for RequestCrawlError<'_> { } } +impl jacquard_common::IntoStatic for RequestCrawlError<'_> { + type Output = RequestCrawlError<'static>; + fn into_static(self) -> Self::Output { + match self { + RequestCrawlError::HostBanned(v) => { + RequestCrawlError::HostBanned(v.into_static()) + } + RequestCrawlError::Unknown(v) => RequestCrawlError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RequestCrawl<'_> { const NSID: &'static str = "com.atproto.sync.requestCrawl"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/com_atproto/sync/subscribe_repos.rs b/crates/jacquard-api/src/com_atproto/sync/subscribe_repos.rs index 6f0729b34..993439ea9 100644 --- a/crates/jacquard-api/src/com_atproto/sync/subscribe_repos.rs +++ b/crates/jacquard-api/src/com_atproto/sync/subscribe_repos.rs @@ -22,6 +22,20 @@ pub struct Account<'a> { pub time: jacquard_common::types::string::Datetime, } +impl jacquard_common::IntoStatic for Account<'_> { + type Output = Account<'static>; + fn into_static(self) -> Self::Output { + Account { + active: self.active.into_static(), + did: self.did.into_static(), + seq: self.seq.into_static(), + status: self.status.into_static(), + time: self.time.into_static(), + extra_data: self.extra_data.into_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. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -57,6 +71,27 @@ pub struct Commit<'a> { pub too_big: bool, } +impl jacquard_common::IntoStatic for Commit<'_> { + type Output = Commit<'static>; + fn into_static(self) -> Self::Output { + Commit { + blobs: self.blobs.into_static(), + blocks: self.blocks.into_static(), + commit: self.commit.into_static(), + ops: self.ops.into_static(), + prev_data: self.prev_data.into_static(), + rebase: self.rebase.into_static(), + repo: self.repo.into_static(), + rev: self.rev.into_static(), + seq: self.seq.into_static(), + since: self.since.into_static(), + time: self.time.into_static(), + too_big: self.too_big.into_static(), + extra_data: self.extra_data.into_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. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -72,6 +107,19 @@ pub struct Identity<'a> { pub time: jacquard_common::types::string::Datetime, } +impl jacquard_common::IntoStatic for Identity<'_> { + type Output = Identity<'static>; + fn into_static(self) -> Self::Output { + Identity { + did: self.did.into_static(), + handle: self.handle.into_static(), + seq: self.seq.into_static(), + time: self.time.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -83,6 +131,17 @@ pub struct Info<'a> { pub name: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for Info<'_> { + type Output = Info<'static>; + fn into_static(self) -> Self::Output { + Info { + message: self.message.into_static(), + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct SubscribeRepos { @@ -90,6 +149,13 @@ pub struct SubscribeRepos { pub cursor: std::option::Option, } +impl jacquard_common::IntoStatic for SubscribeRepos { + type Output = SubscribeRepos; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] @@ -107,6 +173,32 @@ pub enum SubscribeReposMessage<'a> { Info(Box>), } +impl jacquard_common::IntoStatic for SubscribeReposMessage<'_> { + type Output = SubscribeReposMessage<'static>; + fn into_static(self) -> Self::Output { + match self { + SubscribeReposMessage::Commit(v) => { + SubscribeReposMessage::Commit(v.into_static()) + } + SubscribeReposMessage::Sync(v) => { + SubscribeReposMessage::Sync(v.into_static()) + } + SubscribeReposMessage::Identity(v) => { + SubscribeReposMessage::Identity(v.into_static()) + } + SubscribeReposMessage::Account(v) => { + SubscribeReposMessage::Account(v.into_static()) + } + SubscribeReposMessage::Info(v) => { + SubscribeReposMessage::Info(v.into_static()) + } + SubscribeReposMessage::Unknown(v) => { + SubscribeReposMessage::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -150,6 +242,23 @@ impl std::fmt::Display for SubscribeReposError<'_> { } } +impl jacquard_common::IntoStatic for SubscribeReposError<'_> { + type Output = SubscribeReposError<'static>; + fn into_static(self) -> Self::Output { + match self { + SubscribeReposError::FutureCursor(v) => { + SubscribeReposError::FutureCursor(v.into_static()) + } + SubscribeReposError::ConsumerTooSlow(v) => { + SubscribeReposError::ConsumerTooSlow(v.into_static()) + } + SubscribeReposError::Unknown(v) => { + SubscribeReposError::Unknown(v.into_static()) + } + } + } +} + ///A repo operation, ie a mutation of a single record. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -168,6 +277,19 @@ pub struct RepoOp<'a> { pub prev: std::option::Option>, } +impl jacquard_common::IntoStatic for RepoOp<'_> { + type Output = RepoOp<'static>; + fn into_static(self) -> Self::Output { + RepoOp { + action: self.action.into_static(), + cid: self.cid.into_static(), + path: self.path.into_static(), + prev: self.prev.into_static(), + extra_data: self.extra_data.into_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. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -185,4 +307,18 @@ pub struct Sync<'a> { pub seq: i64, ///Timestamp of when this message was originally broadcast. pub time: jacquard_common::types::string::Datetime, +} + +impl jacquard_common::IntoStatic for Sync<'_> { + type Output = Sync<'static>; + fn into_static(self) -> Self::Output { + Sync { + blocks: self.blocks.into_static(), + did: self.did.into_static(), + rev: self.rev.into_static(), + seq: self.seq.into_static(), + time: self.time.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/temp/add_reserved_handle.rs b/crates/jacquard-api/src/com_atproto/temp/add_reserved_handle.rs index 05a9f24ac..2ae68c186 100644 --- a/crates/jacquard-api/src/com_atproto/temp/add_reserved_handle.rs +++ b/crates/jacquard-api/src/com_atproto/temp/add_reserved_handle.rs @@ -13,10 +13,29 @@ pub struct AddReservedHandle<'a> { pub handle: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AddReservedHandle<'_> { + type Output = AddReservedHandle<'static>; + fn into_static(self) -> Self::Output { + AddReservedHandle { + handle: self.handle.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AddReservedHandleOutput<'a> {} +impl jacquard_common::IntoStatic for AddReservedHandleOutput<'_> { + type Output = AddReservedHandleOutput<'static>; + fn into_static(self) -> Self::Output { + AddReservedHandleOutput { + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for AddReservedHandle<'_> { const NSID: &'static str = "com.atproto.temp.addReservedHandle"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +43,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for AddReservedHandle<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = AddReservedHandleOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/temp/check_handle_availability.rs b/crates/jacquard-api/src/com_atproto/temp/check_handle_availability.rs index 5f962df77..254eecf1f 100644 --- a/crates/jacquard-api/src/com_atproto/temp/check_handle_availability.rs +++ b/crates/jacquard-api/src/com_atproto/temp/check_handle_availability.rs @@ -17,6 +17,17 @@ pub struct CheckHandleAvailability<'a> { pub handle: jacquard_common::types::string::Handle<'a>, } +impl jacquard_common::IntoStatic for CheckHandleAvailability<'_> { + type Output = CheckHandleAvailability<'static>; + fn into_static(self) -> Self::Output { + CheckHandleAvailability { + birth_date: self.birth_date.into_static(), + email: self.email.into_static(), + handle: self.handle.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -33,6 +44,28 @@ pub struct CheckHandleAvailabilityOutput<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum CheckHandleAvailabilityOutputRecordResult<'a> {} +impl jacquard_common::IntoStatic for CheckHandleAvailabilityOutputRecordResult<'_> { + type Output = CheckHandleAvailabilityOutputRecordResult<'static>; + fn into_static(self) -> Self::Output { + match self { + CheckHandleAvailabilityOutputRecordResult::Unknown(v) => { + CheckHandleAvailabilityOutputRecordResult::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for CheckHandleAvailabilityOutput<'_> { + type Output = CheckHandleAvailabilityOutput<'static>; + fn into_static(self) -> Self::Output { + CheckHandleAvailabilityOutput { + handle: self.handle.into_static(), + result: self.result.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -67,6 +100,20 @@ impl std::fmt::Display for CheckHandleAvailabilityError<'_> { } } +impl jacquard_common::IntoStatic for CheckHandleAvailabilityError<'_> { + type Output = CheckHandleAvailabilityError<'static>; + fn into_static(self) -> Self::Output { + match self { + CheckHandleAvailabilityError::InvalidEmail(v) => { + CheckHandleAvailabilityError::InvalidEmail(v.into_static()) + } + CheckHandleAvailabilityError::Unknown(v) => { + CheckHandleAvailabilityError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CheckHandleAvailability<'_> { const NSID: &'static str = "com.atproto.temp.checkHandleAvailability"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; @@ -80,6 +127,15 @@ impl jacquard_common::types::xrpc::XrpcRequest for CheckHandleAvailability<'_> { #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ResultAvailable<'a> {} +impl jacquard_common::IntoStatic for ResultAvailable<'_> { + type Output = ResultAvailable<'static>; + fn into_static(self) -> Self::Output { + ResultAvailable { + extra_data: self.extra_data.into_static(), + } + } +} + ///Indicates the provided handle is unavailable and gives suggestions of available handles. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -92,6 +148,16 @@ pub struct ResultUnavailable<'a> { >, } +impl jacquard_common::IntoStatic for ResultUnavailable<'_> { + type Output = ResultUnavailable<'static>; + fn into_static(self) -> Self::Output { + ResultUnavailable { + suggestions: self.suggestions.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -101,4 +167,15 @@ pub struct Suggestion<'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>, +} + +impl jacquard_common::IntoStatic for Suggestion<'_> { + type Output = Suggestion<'static>; + fn into_static(self) -> Self::Output { + Suggestion { + handle: self.handle.into_static(), + method: self.method.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/temp/check_signup_queue.rs b/crates/jacquard-api/src/com_atproto/temp/check_signup_queue.rs index 8efe56a26..47798e451 100644 --- a/crates/jacquard-api/src/com_atproto/temp/check_signup_queue.rs +++ b/crates/jacquard-api/src/com_atproto/temp/check_signup_queue.rs @@ -16,6 +16,18 @@ pub struct CheckSignupQueueOutput<'a> { pub place_in_queue: std::option::Option, } +impl jacquard_common::IntoStatic for CheckSignupQueueOutput<'_> { + type Output = CheckSignupQueueOutput<'static>; + fn into_static(self) -> Self::Output { + CheckSignupQueueOutput { + activated: self.activated.into_static(), + estimated_time_ms: self.estimated_time_ms.into_static(), + place_in_queue: self.place_in_queue.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct CheckSignupQueue; @@ -24,5 +36,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for CheckSignupQueue { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = CheckSignupQueueOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/temp/dereference_scope.rs b/crates/jacquard-api/src/com_atproto/temp/dereference_scope.rs index 78e3015da..96f42a2c3 100644 --- a/crates/jacquard-api/src/com_atproto/temp/dereference_scope.rs +++ b/crates/jacquard-api/src/com_atproto/temp/dereference_scope.rs @@ -12,6 +12,15 @@ pub struct DereferenceScope<'a> { pub scope: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for DereferenceScope<'_> { + type Output = DereferenceScope<'static>; + fn into_static(self) -> Self::Output { + DereferenceScope { + scope: self.scope.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,6 +30,16 @@ pub struct DereferenceScopeOutput<'a> { pub scope: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for DereferenceScopeOutput<'_> { + type Output = DereferenceScopeOutput<'static>; + fn into_static(self) -> Self::Output { + DereferenceScopeOutput { + scope: self.scope.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -55,6 +74,20 @@ impl std::fmt::Display for DereferenceScopeError<'_> { } } +impl jacquard_common::IntoStatic for DereferenceScopeError<'_> { + type Output = DereferenceScopeError<'static>; + fn into_static(self) -> Self::Output { + match self { + DereferenceScopeError::InvalidScopeReference(v) => { + DereferenceScopeError::InvalidScopeReference(v.into_static()) + } + DereferenceScopeError::Unknown(v) => { + DereferenceScopeError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DereferenceScope<'_> { const NSID: &'static str = "com.atproto.temp.dereferenceScope"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/com_atproto/temp/fetch_labels.rs b/crates/jacquard-api/src/com_atproto/temp/fetch_labels.rs index 2e85b39a9..0e2e52a5a 100644 --- a/crates/jacquard-api/src/com_atproto/temp/fetch_labels.rs +++ b/crates/jacquard-api/src/com_atproto/temp/fetch_labels.rs @@ -5,15 +5,23 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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, } +impl jacquard_common::IntoStatic for FetchLabels { + type Output = FetchLabels; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -22,10 +30,20 @@ pub struct FetchLabelsOutput<'a> { pub labels: Vec>, } +impl jacquard_common::IntoStatic for FetchLabelsOutput<'_> { + type Output = FetchLabelsOutput<'static>; + fn into_static(self) -> Self::Output { + FetchLabelsOutput { + labels: self.labels.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for FetchLabels { const NSID: &'static str = "com.atproto.temp.fetchLabels"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = FetchLabelsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/temp/request_phone_verification.rs b/crates/jacquard-api/src/com_atproto/temp/request_phone_verification.rs index 4c9322667..18301db8f 100644 --- a/crates/jacquard-api/src/com_atproto/temp/request_phone_verification.rs +++ b/crates/jacquard-api/src/com_atproto/temp/request_phone_verification.rs @@ -13,6 +13,16 @@ pub struct RequestPhoneVerification<'a> { pub phone_number: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RequestPhoneVerification<'_> { + type Output = RequestPhoneVerification<'static>; + fn into_static(self) -> Self::Output { + RequestPhoneVerification { + phone_number: self.phone_number.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RequestPhoneVerification<'_> { const NSID: &'static str = "com.atproto.temp.requestPhoneVerification"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RequestPhoneVerification<'_> ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/com_atproto/temp/revoke_account_credentials.rs b/crates/jacquard-api/src/com_atproto/temp/revoke_account_credentials.rs index 0e1df500d..7b22da813 100644 --- a/crates/jacquard-api/src/com_atproto/temp/revoke_account_credentials.rs +++ b/crates/jacquard-api/src/com_atproto/temp/revoke_account_credentials.rs @@ -13,6 +13,16 @@ pub struct RevokeAccountCredentials<'a> { pub account: jacquard_common::types::ident::AtIdentifier<'a>, } +impl jacquard_common::IntoStatic for RevokeAccountCredentials<'_> { + type Output = RevokeAccountCredentials<'static>; + fn into_static(self) -> Self::Output { + RevokeAccountCredentials { + account: self.account.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RevokeAccountCredentials<'_> { const NSID: &'static str = "com.atproto.temp.revokeAccountCredentials"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RevokeAccountCredentials<'_> ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/communication.rs b/crates/jacquard-api/src/tools_ozone/communication.rs index 5848e9963..19f6c22d3 100644 --- a/crates/jacquard-api/src/tools_ozone/communication.rs +++ b/crates/jacquard-api/src/tools_ozone/communication.rs @@ -35,4 +35,22 @@ pub struct TemplateView<'a> { #[serde(borrow)] pub subject: std::option::Option>, pub updated_at: jacquard_common::types::string::Datetime, +} + +impl jacquard_common::IntoStatic for TemplateView<'_> { + type Output = TemplateView<'static>; + fn into_static(self) -> Self::Output { + TemplateView { + content_markdown: self.content_markdown.into_static(), + created_at: self.created_at.into_static(), + disabled: self.disabled.into_static(), + id: self.id.into_static(), + lang: self.lang.into_static(), + last_updated_by: self.last_updated_by.into_static(), + name: self.name.into_static(), + subject: self.subject.into_static(), + updated_at: self.updated_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/communication/create_template.rs b/crates/jacquard-api/src/tools_ozone/communication/create_template.rs index d7ad649af..abdd4a8c2 100644 --- a/crates/jacquard-api/src/tools_ozone/communication/create_template.rs +++ b/crates/jacquard-api/src/tools_ozone/communication/create_template.rs @@ -27,6 +27,20 @@ pub struct CreateTemplate<'a> { pub subject: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for CreateTemplate<'_> { + type Output = CreateTemplate<'static>; + fn into_static(self) -> Self::Output { + CreateTemplate { + content_markdown: self.content_markdown.into_static(), + created_by: self.created_by.into_static(), + lang: self.lang.into_static(), + name: self.name.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -36,6 +50,16 @@ pub struct CreateTemplateOutput<'a> { pub value: crate::tools_ozone::communication::TemplateView<'a>, } +impl jacquard_common::IntoStatic for CreateTemplateOutput<'_> { + type Output = CreateTemplateOutput<'static>; + fn into_static(self) -> Self::Output { + CreateTemplateOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -69,6 +93,20 @@ impl std::fmt::Display for CreateTemplateError<'_> { } } +impl jacquard_common::IntoStatic for CreateTemplateError<'_> { + type Output = CreateTemplateError<'static>; + fn into_static(self) -> Self::Output { + match self { + CreateTemplateError::DuplicateTemplateName(v) => { + CreateTemplateError::DuplicateTemplateName(v.into_static()) + } + CreateTemplateError::Unknown(v) => { + CreateTemplateError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for CreateTemplate<'_> { const NSID: &'static str = "tools.ozone.communication.createTemplate"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/communication/delete_template.rs b/crates/jacquard-api/src/tools_ozone/communication/delete_template.rs index f2e1a032a..35a7d61c1 100644 --- a/crates/jacquard-api/src/tools_ozone/communication/delete_template.rs +++ b/crates/jacquard-api/src/tools_ozone/communication/delete_template.rs @@ -13,6 +13,16 @@ pub struct DeleteTemplate<'a> { pub id: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for DeleteTemplate<'_> { + type Output = DeleteTemplate<'static>; + fn into_static(self) -> Self::Output { + DeleteTemplate { + id: self.id.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteTemplate<'_> { const NSID: &'static str = "tools.ozone.communication.deleteTemplate"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -20,5 +30,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for DeleteTemplate<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/communication/list_templates.rs b/crates/jacquard-api/src/tools_ozone/communication/list_templates.rs index e6a1c0d11..7db8b247a 100644 --- a/crates/jacquard-api/src/tools_ozone/communication/list_templates.rs +++ b/crates/jacquard-api/src/tools_ozone/communication/list_templates.rs @@ -15,6 +15,16 @@ pub struct ListTemplatesOutput<'a> { >, } +impl jacquard_common::IntoStatic for ListTemplatesOutput<'_> { + type Output = ListTemplatesOutput<'static>; + fn into_static(self) -> Self::Output { + ListTemplatesOutput { + communication_templates: self.communication_templates.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct ListTemplates; @@ -23,5 +33,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for ListTemplates { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListTemplatesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/communication/update_template.rs b/crates/jacquard-api/src/tools_ozone/communication/update_template.rs index 0df97eb7c..29f748ac6 100644 --- a/crates/jacquard-api/src/tools_ozone/communication/update_template.rs +++ b/crates/jacquard-api/src/tools_ozone/communication/update_template.rs @@ -35,6 +35,22 @@ pub struct UpdateTemplate<'a> { pub updated_by: std::option::Option>, } +impl jacquard_common::IntoStatic for UpdateTemplate<'_> { + type Output = UpdateTemplate<'static>; + fn into_static(self) -> Self::Output { + UpdateTemplate { + content_markdown: self.content_markdown.into_static(), + disabled: self.disabled.into_static(), + id: self.id.into_static(), + lang: self.lang.into_static(), + name: self.name.into_static(), + subject: self.subject.into_static(), + updated_by: self.updated_by.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -44,6 +60,16 @@ pub struct UpdateTemplateOutput<'a> { pub value: crate::tools_ozone::communication::TemplateView<'a>, } +impl jacquard_common::IntoStatic for UpdateTemplateOutput<'_> { + type Output = UpdateTemplateOutput<'static>; + fn into_static(self) -> Self::Output { + UpdateTemplateOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -77,6 +103,20 @@ impl std::fmt::Display for UpdateTemplateError<'_> { } } +impl jacquard_common::IntoStatic for UpdateTemplateError<'_> { + type Output = UpdateTemplateError<'static>; + fn into_static(self) -> Self::Output { + match self { + UpdateTemplateError::DuplicateTemplateName(v) => { + UpdateTemplateError::DuplicateTemplateName(v.into_static()) + } + UpdateTemplateError::Unknown(v) => { + UpdateTemplateError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateTemplate<'_> { const NSID: &'static str = "tools.ozone.communication.updateTemplate"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/hosting/get_account_history.rs b/crates/jacquard-api/src/tools_ozone/hosting/get_account_history.rs index 6157661c1..955fd5163 100644 --- a/crates/jacquard-api/src/tools_ozone/hosting/get_account_history.rs +++ b/crates/jacquard-api/src/tools_ozone/hosting/get_account_history.rs @@ -17,6 +17,17 @@ pub struct AccountCreated<'a> { pub handle: std::option::Option>, } +impl jacquard_common::IntoStatic for AccountCreated<'_> { + type Output = AccountCreated<'static>; + fn into_static(self) -> Self::Output { + AccountCreated { + email: self.email.into_static(), + handle: self.handle.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -25,6 +36,16 @@ pub struct EmailConfirmed<'a> { pub email: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for EmailConfirmed<'_> { + type Output = EmailConfirmed<'static>; + fn into_static(self) -> Self::Output { + EmailConfirmed { + email: self.email.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -33,6 +54,16 @@ pub struct EmailUpdated<'a> { pub email: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for EmailUpdated<'_> { + type Output = EmailUpdated<'static>; + fn into_static(self) -> Self::Output { + EmailUpdated { + email: self.email.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -49,6 +80,29 @@ pub struct Event<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum EventRecordDetails<'a> {} +impl jacquard_common::IntoStatic for EventRecordDetails<'_> { + type Output = EventRecordDetails<'static>; + fn into_static(self) -> Self::Output { + match self { + EventRecordDetails::Unknown(v) => { + EventRecordDetails::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for Event<'_> { + type Output = Event<'static>; + fn into_static(self) -> Self::Output { + Event { + created_at: self.created_at.into_static(), + created_by: self.created_by.into_static(), + details: self.details.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -57,7 +111,17 @@ pub struct HandleUpdated<'a> { pub handle: jacquard_common::types::string::Handle<'a>, } -#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Default)] +impl jacquard_common::IntoStatic for HandleUpdated<'_> { + type Output = HandleUpdated<'static>; + fn into_static(self) -> Self::Output { + HandleUpdated { + handle: self.handle.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct GetAccountHistory<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -68,17 +132,19 @@ pub struct GetAccountHistory<'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, } -impl Default for GetAccountHistory<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - did: Default::default(), - events: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for GetAccountHistory<'_> { + type Output = GetAccountHistory<'static>; + fn into_static(self) -> Self::Output { + GetAccountHistory { + cursor: self.cursor.into_static(), + did: self.did.into_static(), + events: self.events.into_static(), + limit: self.limit.into_static(), } } } @@ -94,15 +160,34 @@ pub struct GetAccountHistoryOutput<'a> { pub events: Vec>, } +impl jacquard_common::IntoStatic for GetAccountHistoryOutput<'_> { + type Output = GetAccountHistoryOutput<'static>; + fn into_static(self) -> Self::Output { + GetAccountHistoryOutput { + cursor: self.cursor.into_static(), + events: self.events.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetAccountHistory<'_> { const NSID: &'static str = "tools.ozone.hosting.getAccountHistory"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetAccountHistoryOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct PasswordUpdated<'a> {} \ No newline at end of file +pub struct PasswordUpdated<'a> {} +impl jacquard_common::IntoStatic for PasswordUpdated<'_> { + type Output = PasswordUpdated<'static>; + fn into_static(self) -> Self::Output { + PasswordUpdated { + extra_data: self.extra_data.into_static(), + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation.rs b/crates/jacquard-api/src/tools_ozone/moderation.rs index 245b3efb6..276fb42b3 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation.rs @@ -34,6 +34,19 @@ pub struct AccountEvent<'a> { pub timestamp: jacquard_common::types::string::Datetime, } +impl jacquard_common::IntoStatic for AccountEvent<'_> { + type Output = AccountEvent<'static>; + fn into_static(self) -> Self::Output { + AccountEvent { + active: self.active.into_static(), + comment: self.comment.into_static(), + status: self.status.into_static(), + timestamp: self.timestamp.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -52,6 +65,21 @@ pub struct AccountHosting<'a> { pub updated_at: std::option::Option, } +impl jacquard_common::IntoStatic for AccountHosting<'_> { + type Output = AccountHosting<'static>; + fn into_static(self) -> Self::Output { + AccountHosting { + created_at: self.created_at.into_static(), + deactivated_at: self.deactivated_at.into_static(), + deleted_at: self.deleted_at.into_static(), + reactivated_at: self.reactivated_at.into_static(), + status: self.status.into_static(), + updated_at: self.updated_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Statistics about a particular account subject #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -74,6 +102,20 @@ pub struct AccountStats<'a> { pub takedown_count: std::option::Option, } +impl jacquard_common::IntoStatic for AccountStats<'_> { + type Output = AccountStats<'static>; + fn into_static(self) -> Self::Output { + AccountStats { + appeal_count: self.appeal_count.into_static(), + escalate_count: self.escalate_count.into_static(), + report_count: self.report_count.into_static(), + suspend_count: self.suspend_count.into_static(), + takedown_count: self.takedown_count.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Age assurance info coming directly from users. Only works on DID subjects. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -105,6 +147,22 @@ pub struct AgeAssuranceEvent<'a> { pub status: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AgeAssuranceEvent<'_> { + type Output = AgeAssuranceEvent<'static>; + fn into_static(self) -> Self::Output { + AgeAssuranceEvent { + attempt_id: self.attempt_id.into_static(), + complete_ip: self.complete_ip.into_static(), + complete_ua: self.complete_ua.into_static(), + created_at: self.created_at.into_static(), + init_ip: self.init_ip.into_static(), + init_ua: self.init_ua.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Age assurance status override by moderators. Only works on DID subjects. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -118,6 +176,17 @@ pub struct AgeAssuranceOverrideEvent<'a> { pub status: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AgeAssuranceOverrideEvent<'_> { + type Output = AgeAssuranceOverrideEvent<'static>; + fn into_static(self) -> Self::Output { + AgeAssuranceOverrideEvent { + comment: self.comment.into_static(), + status: self.status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -141,6 +210,32 @@ pub struct BlobView<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum BlobViewRecordDetails<'a> {} +impl jacquard_common::IntoStatic for BlobViewRecordDetails<'_> { + type Output = BlobViewRecordDetails<'static>; + fn into_static(self) -> Self::Output { + match self { + BlobViewRecordDetails::Unknown(v) => { + BlobViewRecordDetails::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for BlobView<'_> { + type Output = BlobView<'static>; + fn into_static(self) -> Self::Output { + BlobView { + cid: self.cid.into_static(), + created_at: self.created_at.into_static(), + details: self.details.into_static(), + mime_type: self.mime_type.into_static(), + moderation: self.moderation.into_static(), + size: self.size.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -160,6 +255,20 @@ pub struct IdentityEvent<'a> { pub tombstone: std::option::Option, } +impl jacquard_common::IntoStatic for IdentityEvent<'_> { + type Output = IdentityEvent<'static>; + fn into_static(self) -> Self::Output { + IdentityEvent { + comment: self.comment.into_static(), + handle: self.handle.into_static(), + pds_host: self.pds_host.into_static(), + timestamp: self.timestamp.into_static(), + tombstone: self.tombstone.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -168,6 +277,17 @@ pub struct ImageDetails<'a> { pub width: i64, } +impl jacquard_common::IntoStatic for ImageDetails<'_> { + type Output = ImageDetails<'static>; + fn into_static(self) -> Self::Output { + ImageDetails { + height: self.height.into_static(), + width: self.width.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -180,6 +300,19 @@ pub struct ModEventAcknowledge<'a> { pub comment: std::option::Option>, } +impl jacquard_common::IntoStatic for ModEventAcknowledge<'_> { + type Output = ModEventAcknowledge<'static>; + fn into_static(self) -> Self::Output { + ModEventAcknowledge { + acknowledge_account_subjects: self + .acknowledge_account_subjects + .into_static(), + comment: self.comment.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -193,6 +326,17 @@ pub struct ModEventComment<'a> { pub sticky: std::option::Option, } +impl jacquard_common::IntoStatic for ModEventComment<'_> { + type Output = ModEventComment<'static>; + fn into_static(self) -> Self::Output { + ModEventComment { + comment: self.comment.into_static(), + sticky: self.sticky.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -203,6 +347,16 @@ pub struct ModEventDivert<'a> { pub comment: std::option::Option>, } +impl jacquard_common::IntoStatic for ModEventDivert<'_> { + type Output = ModEventDivert<'static>; + fn into_static(self) -> Self::Output { + ModEventDivert { + comment: self.comment.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Keep a log of outgoing email to a user #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -221,6 +375,18 @@ pub struct ModEventEmail<'a> { pub subject_line: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ModEventEmail<'_> { + type Output = ModEventEmail<'static>; + fn into_static(self) -> Self::Output { + ModEventEmail { + comment: self.comment.into_static(), + content: self.content.into_static(), + subject_line: self.subject_line.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -230,6 +396,16 @@ pub struct ModEventEscalate<'a> { pub comment: std::option::Option>, } +impl jacquard_common::IntoStatic for ModEventEscalate<'_> { + type Output = ModEventEscalate<'static>; + fn into_static(self) -> Self::Output { + ModEventEscalate { + comment: self.comment.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Apply/Negate labels on a subject #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -247,6 +423,19 @@ pub struct ModEventLabel<'a> { pub negate_label_vals: Vec>, } +impl jacquard_common::IntoStatic for ModEventLabel<'_> { + type Output = ModEventLabel<'static>; + fn into_static(self) -> Self::Output { + ModEventLabel { + comment: self.comment.into_static(), + create_label_vals: self.create_label_vals.into_static(), + duration_in_hours: self.duration_in_hours.into_static(), + negate_label_vals: self.negate_label_vals.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Mute incoming reports on a subject #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -259,6 +448,17 @@ pub struct ModEventMute<'a> { pub duration_in_hours: i64, } +impl jacquard_common::IntoStatic for ModEventMute<'_> { + type Output = ModEventMute<'static>; + fn into_static(self) -> Self::Output { + ModEventMute { + comment: self.comment.into_static(), + duration_in_hours: self.duration_in_hours.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Mute incoming reports from an account #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -272,6 +472,17 @@ pub struct ModEventMuteReporter<'a> { pub duration_in_hours: std::option::Option, } +impl jacquard_common::IntoStatic for ModEventMuteReporter<'_> { + type Output = ModEventMuteReporter<'static>; + fn into_static(self) -> Self::Output { + ModEventMuteReporter { + comment: self.comment.into_static(), + duration_in_hours: self.duration_in_hours.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Set priority score of the subject. Higher score means higher priority. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -283,6 +494,17 @@ pub struct ModEventPriorityScore<'a> { pub score: i64, } +impl jacquard_common::IntoStatic for ModEventPriorityScore<'_> { + type Output = ModEventPriorityScore<'static>; + fn into_static(self) -> Self::Output { + ModEventPriorityScore { + comment: self.comment.into_static(), + score: self.score.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Report a subject #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -298,6 +520,18 @@ pub struct ModEventReport<'a> { pub report_type: crate::com_atproto::moderation::ReasonType<'a>, } +impl jacquard_common::IntoStatic for ModEventReport<'_> { + type Output = ModEventReport<'static>; + fn into_static(self) -> Self::Output { + ModEventReport { + comment: self.comment.into_static(), + is_reporter_muted: self.is_reporter_muted.into_static(), + report_type: self.report_type.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Resolve appeal on a subject #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -309,6 +543,16 @@ pub struct ModEventResolveAppeal<'a> { pub comment: std::option::Option>, } +impl jacquard_common::IntoStatic for ModEventResolveAppeal<'_> { + type Output = ModEventResolveAppeal<'static>; + fn into_static(self) -> Self::Output { + ModEventResolveAppeal { + comment: self.comment.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Revert take down action on a subject #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -320,6 +564,16 @@ pub struct ModEventReverseTakedown<'a> { pub comment: std::option::Option>, } +impl jacquard_common::IntoStatic for ModEventReverseTakedown<'_> { + type Output = ModEventReverseTakedown<'static>; + fn into_static(self) -> Self::Output { + ModEventReverseTakedown { + comment: self.comment.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Add/Remove a tag on a subject #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -337,6 +591,18 @@ pub struct ModEventTag<'a> { pub remove: Vec>, } +impl jacquard_common::IntoStatic for ModEventTag<'_> { + type Output = ModEventTag<'static>; + fn into_static(self) -> Self::Output { + ModEventTag { + add: self.add.into_static(), + comment: self.comment.into_static(), + remove: self.remove.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Take down a subject permanently or temporarily #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -357,6 +623,21 @@ pub struct ModEventTakedown<'a> { pub policies: std::option::Option>>, } +impl jacquard_common::IntoStatic for ModEventTakedown<'_> { + type Output = ModEventTakedown<'static>; + fn into_static(self) -> Self::Output { + ModEventTakedown { + acknowledge_account_subjects: self + .acknowledge_account_subjects + .into_static(), + comment: self.comment.into_static(), + duration_in_hours: self.duration_in_hours.into_static(), + policies: self.policies.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Unmute action on a subject #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -368,6 +649,16 @@ pub struct ModEventUnmute<'a> { pub comment: std::option::Option>, } +impl jacquard_common::IntoStatic for ModEventUnmute<'_> { + type Output = ModEventUnmute<'static>; + fn into_static(self) -> Self::Output { + ModEventUnmute { + comment: self.comment.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Unmute incoming reports from an account #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -379,6 +670,16 @@ pub struct ModEventUnmuteReporter<'a> { pub comment: std::option::Option>, } +impl jacquard_common::IntoStatic for ModEventUnmuteReporter<'_> { + type Output = ModEventUnmuteReporter<'static>; + fn into_static(self) -> Self::Output { + ModEventUnmuteReporter { + comment: self.comment.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -409,6 +710,17 @@ pub struct ModEventView<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ModEventViewRecordEvent<'a> {} +impl jacquard_common::IntoStatic for ModEventViewRecordEvent<'_> { + type Output = ModEventViewRecordEvent<'static>; + fn into_static(self) -> Self::Output { + match self { + ModEventViewRecordEvent::Unknown(v) => { + ModEventViewRecordEvent::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] @@ -422,6 +734,44 @@ pub enum ModEventViewRecordSubject<'a> { DefsMessageRef(Box>), } +impl jacquard_common::IntoStatic for ModEventViewRecordSubject<'_> { + type Output = ModEventViewRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + ModEventViewRecordSubject::DefsRepoRef(v) => { + ModEventViewRecordSubject::DefsRepoRef(v.into_static()) + } + ModEventViewRecordSubject::StrongRef(v) => { + ModEventViewRecordSubject::StrongRef(v.into_static()) + } + ModEventViewRecordSubject::DefsMessageRef(v) => { + ModEventViewRecordSubject::DefsMessageRef(v.into_static()) + } + ModEventViewRecordSubject::Unknown(v) => { + ModEventViewRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for ModEventView<'_> { + type Output = ModEventView<'static>; + fn into_static(self) -> Self::Output { + ModEventView { + created_at: self.created_at.into_static(), + created_by: self.created_by.into_static(), + creator_handle: self.creator_handle.into_static(), + event: self.event.into_static(), + id: self.id.into_static(), + mod_tool: self.mod_tool.into_static(), + subject: self.subject.into_static(), + subject_blob_cids: self.subject_blob_cids.into_static(), + subject_handle: self.subject_handle.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -446,11 +796,49 @@ pub struct ModEventViewDetail<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ModEventViewDetailRecordEvent<'a> {} +impl jacquard_common::IntoStatic for ModEventViewDetailRecordEvent<'_> { + type Output = ModEventViewDetailRecordEvent<'static>; + fn into_static(self) -> Self::Output { + match self { + ModEventViewDetailRecordEvent::Unknown(v) => { + ModEventViewDetailRecordEvent::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ModEventViewDetailRecordSubject<'a> {} +impl jacquard_common::IntoStatic for ModEventViewDetailRecordSubject<'_> { + type Output = ModEventViewDetailRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + ModEventViewDetailRecordSubject::Unknown(v) => { + ModEventViewDetailRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for ModEventViewDetail<'_> { + type Output = ModEventViewDetail<'static>; + fn into_static(self) -> Self::Output { + ModEventViewDetail { + created_at: self.created_at.into_static(), + created_by: self.created_by.into_static(), + event: self.event.into_static(), + id: self.id.into_static(), + mod_tool: self.mod_tool.into_static(), + subject: self.subject.into_static(), + subject_blobs: self.subject_blobs.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Moderation tool information for tracing the source of the action #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -465,6 +853,17 @@ pub struct ModTool<'a> { pub name: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for ModTool<'_> { + type Output = ModTool<'static>; + fn into_static(self) -> Self::Output { + ModTool { + meta: self.meta.into_static(), + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -476,6 +875,16 @@ pub struct Moderation<'a> { >, } +impl jacquard_common::IntoStatic for Moderation<'_> { + type Output = Moderation<'static>; + fn into_static(self) -> Self::Output { + Moderation { + subject_status: self.subject_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -487,6 +896,16 @@ pub struct ModerationDetail<'a> { >, } +impl jacquard_common::IntoStatic for ModerationDetail<'_> { + type Output = ModerationDetail<'static>; + fn into_static(self) -> Self::Output { + ModerationDetail { + subject_status: self.subject_status.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -503,6 +922,19 @@ pub struct RecordEvent<'a> { pub timestamp: jacquard_common::types::string::Datetime, } +impl jacquard_common::IntoStatic for RecordEvent<'_> { + type Output = RecordEvent<'static>; + fn into_static(self) -> Self::Output { + RecordEvent { + cid: self.cid.into_static(), + comment: self.comment.into_static(), + op: self.op.into_static(), + timestamp: self.timestamp.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -517,6 +949,19 @@ pub struct RecordHosting<'a> { pub updated_at: std::option::Option, } +impl jacquard_common::IntoStatic for RecordHosting<'_> { + type Output = RecordHosting<'static>; + fn into_static(self) -> Self::Output { + RecordHosting { + created_at: self.created_at.into_static(), + deleted_at: self.deleted_at.into_static(), + status: self.status.into_static(), + updated_at: self.updated_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -536,6 +981,22 @@ pub struct RecordView<'a> { pub value: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for RecordView<'_> { + type Output = RecordView<'static>; + fn into_static(self) -> Self::Output { + RecordView { + blob_cids: self.blob_cids.into_static(), + cid: self.cid.into_static(), + indexed_at: self.indexed_at.into_static(), + moderation: self.moderation.into_static(), + repo: self.repo.into_static(), + uri: self.uri.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -558,6 +1019,23 @@ pub struct RecordViewDetail<'a> { pub value: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for RecordViewDetail<'_> { + type Output = RecordViewDetail<'static>; + fn into_static(self) -> Self::Output { + RecordViewDetail { + blobs: self.blobs.into_static(), + cid: self.cid.into_static(), + indexed_at: self.indexed_at.into_static(), + labels: self.labels.into_static(), + moderation: self.moderation.into_static(), + repo: self.repo.into_static(), + uri: self.uri.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -566,6 +1044,16 @@ pub struct RecordViewNotFound<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for RecordViewNotFound<'_> { + type Output = RecordViewNotFound<'static>; + fn into_static(self) -> Self::Output { + RecordViewNotFound { + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Statistics about a set of record subject items #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -597,6 +1085,23 @@ pub struct RecordsStats<'a> { pub total_reports: std::option::Option, } +impl jacquard_common::IntoStatic for RecordsStats<'_> { + type Output = RecordsStats<'static>; + fn into_static(self) -> Self::Output { + RecordsStats { + appealed_count: self.appealed_count.into_static(), + escalated_count: self.escalated_count.into_static(), + pending_count: self.pending_count.into_static(), + processed_count: self.processed_count.into_static(), + reported_count: self.reported_count.into_static(), + subject_count: self.subject_count.into_static(), + takendown_count: self.takendown_count.into_static(), + total_reports: self.total_reports.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -630,6 +1135,26 @@ pub struct RepoView<'a> { >, } +impl jacquard_common::IntoStatic for RepoView<'_> { + type Output = RepoView<'static>; + fn into_static(self) -> Self::Output { + RepoView { + deactivated_at: self.deactivated_at.into_static(), + did: self.did.into_static(), + email: self.email.into_static(), + handle: self.handle.into_static(), + indexed_at: self.indexed_at.into_static(), + invite_note: self.invite_note.into_static(), + invited_by: self.invited_by.into_static(), + invites_disabled: self.invites_disabled.into_static(), + moderation: self.moderation.into_static(), + related_records: self.related_records.into_static(), + threat_signatures: self.threat_signatures.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -673,6 +1198,29 @@ pub struct RepoViewDetail<'a> { >, } +impl jacquard_common::IntoStatic for RepoViewDetail<'_> { + type Output = RepoViewDetail<'static>; + fn into_static(self) -> Self::Output { + RepoViewDetail { + deactivated_at: self.deactivated_at.into_static(), + did: self.did.into_static(), + email: self.email.into_static(), + email_confirmed_at: self.email_confirmed_at.into_static(), + handle: self.handle.into_static(), + indexed_at: self.indexed_at.into_static(), + invite_note: self.invite_note.into_static(), + invited_by: self.invited_by.into_static(), + invites: self.invites.into_static(), + invites_disabled: self.invites_disabled.into_static(), + labels: self.labels.into_static(), + moderation: self.moderation.into_static(), + related_records: self.related_records.into_static(), + threat_signatures: self.threat_signatures.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -681,6 +1229,16 @@ pub struct RepoViewNotFound<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for RepoViewNotFound<'_> { + type Output = RepoViewNotFound<'static>; + fn into_static(self) -> Self::Output { + RepoViewNotFound { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -705,6 +1263,24 @@ pub struct ReporterStats<'a> { pub takendown_record_count: i64, } +impl jacquard_common::IntoStatic for ReporterStats<'_> { + type Output = ReporterStats<'static>; + fn into_static(self) -> Self::Output { + ReporterStats { + account_report_count: self.account_report_count.into_static(), + did: self.did.into_static(), + labeled_account_count: self.labeled_account_count.into_static(), + labeled_record_count: self.labeled_record_count.into_static(), + record_report_count: self.record_report_count.into_static(), + reported_account_count: self.reported_account_count.into_static(), + reported_record_count: self.reported_record_count.into_static(), + takendown_account_count: self.takendown_account_count.into_static(), + takendown_record_count: self.takendown_record_count.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///Account credentials revocation by moderators. Only works on DID subjects. #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] @@ -715,6 +1291,16 @@ pub struct RevokeAccountCredentialsEvent<'a> { pub comment: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RevokeAccountCredentialsEvent<'_> { + type Output = RevokeAccountCredentialsEvent<'static>; + fn into_static(self) -> Self::Output { + RevokeAccountCredentialsEvent { + comment: self.comment.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum SubjectReviewState<'a> { ReviewOpen, @@ -788,6 +1374,19 @@ where } } +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)] #[serde(rename_all = "camelCase")] @@ -872,6 +1471,17 @@ pub struct SubjectStatusView<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum SubjectStatusViewRecordHosting<'a> {} +impl jacquard_common::IntoStatic for SubjectStatusViewRecordHosting<'_> { + type Output = SubjectStatusViewRecordHosting<'static>; + fn into_static(self) -> Self::Output { + match self { + SubjectStatusViewRecordHosting::Unknown(v) => { + SubjectStatusViewRecordHosting::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] @@ -885,6 +1495,59 @@ pub enum SubjectStatusViewRecordSubject<'a> { DefsMessageRef(Box>), } +impl jacquard_common::IntoStatic for SubjectStatusViewRecordSubject<'_> { + type Output = SubjectStatusViewRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + SubjectStatusViewRecordSubject::DefsRepoRef(v) => { + SubjectStatusViewRecordSubject::DefsRepoRef(v.into_static()) + } + SubjectStatusViewRecordSubject::StrongRef(v) => { + SubjectStatusViewRecordSubject::StrongRef(v.into_static()) + } + SubjectStatusViewRecordSubject::DefsMessageRef(v) => { + SubjectStatusViewRecordSubject::DefsMessageRef(v.into_static()) + } + SubjectStatusViewRecordSubject::Unknown(v) => { + SubjectStatusViewRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for SubjectStatusView<'_> { + type Output = SubjectStatusView<'static>; + fn into_static(self) -> Self::Output { + SubjectStatusView { + account_stats: self.account_stats.into_static(), + age_assurance_state: self.age_assurance_state.into_static(), + age_assurance_updated_by: self.age_assurance_updated_by.into_static(), + appealed: self.appealed.into_static(), + comment: self.comment.into_static(), + created_at: self.created_at.into_static(), + hosting: self.hosting.into_static(), + id: self.id.into_static(), + last_appealed_at: self.last_appealed_at.into_static(), + last_reported_at: self.last_reported_at.into_static(), + last_reviewed_at: self.last_reviewed_at.into_static(), + last_reviewed_by: self.last_reviewed_by.into_static(), + mute_reporting_until: self.mute_reporting_until.into_static(), + mute_until: self.mute_until.into_static(), + priority_score: self.priority_score.into_static(), + records_stats: self.records_stats.into_static(), + review_state: self.review_state.into_static(), + subject: self.subject.into_static(), + subject_blob_cids: self.subject_blob_cids.into_static(), + subject_repo_handle: self.subject_repo_handle.into_static(), + suspend_until: self.suspend_until.into_static(), + tags: self.tags.into_static(), + takendown: self.takendown.into_static(), + updated_at: self.updated_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + ///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)] @@ -917,6 +1580,32 @@ pub struct SubjectView<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum SubjectViewRecordProfile<'a> {} +impl jacquard_common::IntoStatic for SubjectViewRecordProfile<'_> { + type Output = SubjectViewRecordProfile<'static>; + fn into_static(self) -> Self::Output { + match self { + SubjectViewRecordProfile::Unknown(v) => { + SubjectViewRecordProfile::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for SubjectView<'_> { + type Output = SubjectView<'static>; + fn into_static(self) -> Self::Output { + SubjectView { + profile: self.profile.into_static(), + record: self.record.into_static(), + repo: self.repo.into_static(), + status: self.status.into_static(), + subject: self.subject.into_static(), + r#type: self.r#type.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -924,4 +1613,16 @@ pub struct VideoDetails<'a> { pub height: i64, pub length: i64, pub width: i64, +} + +impl jacquard_common::IntoStatic for VideoDetails<'_> { + type Output = VideoDetails<'static>; + fn into_static(self) -> Self::Output { + VideoDetails { + height: self.height.into_static(), + length: self.length.into_static(), + width: self.width.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/emit_event.rs b/crates/jacquard-api/src/tools_ozone/moderation/emit_event.rs index 1c978332c..9f8c26276 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/emit_event.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/emit_event.rs @@ -96,6 +96,83 @@ pub enum EmitEventRecordEvent<'a> { ), } +impl jacquard_common::IntoStatic for EmitEventRecordEvent<'_> { + type Output = EmitEventRecordEvent<'static>; + fn into_static(self) -> Self::Output { + match self { + EmitEventRecordEvent::DefsModEventTakedown(v) => { + EmitEventRecordEvent::DefsModEventTakedown(v.into_static()) + } + EmitEventRecordEvent::DefsModEventAcknowledge(v) => { + EmitEventRecordEvent::DefsModEventAcknowledge(v.into_static()) + } + EmitEventRecordEvent::DefsModEventEscalate(v) => { + EmitEventRecordEvent::DefsModEventEscalate(v.into_static()) + } + EmitEventRecordEvent::DefsModEventComment(v) => { + EmitEventRecordEvent::DefsModEventComment(v.into_static()) + } + EmitEventRecordEvent::DefsModEventLabel(v) => { + EmitEventRecordEvent::DefsModEventLabel(v.into_static()) + } + EmitEventRecordEvent::DefsModEventReport(v) => { + EmitEventRecordEvent::DefsModEventReport(v.into_static()) + } + EmitEventRecordEvent::DefsModEventMute(v) => { + EmitEventRecordEvent::DefsModEventMute(v.into_static()) + } + EmitEventRecordEvent::DefsModEventUnmute(v) => { + EmitEventRecordEvent::DefsModEventUnmute(v.into_static()) + } + EmitEventRecordEvent::DefsModEventMuteReporter(v) => { + EmitEventRecordEvent::DefsModEventMuteReporter(v.into_static()) + } + EmitEventRecordEvent::DefsModEventUnmuteReporter(v) => { + EmitEventRecordEvent::DefsModEventUnmuteReporter(v.into_static()) + } + EmitEventRecordEvent::DefsModEventReverseTakedown(v) => { + EmitEventRecordEvent::DefsModEventReverseTakedown(v.into_static()) + } + EmitEventRecordEvent::DefsModEventResolveAppeal(v) => { + EmitEventRecordEvent::DefsModEventResolveAppeal(v.into_static()) + } + EmitEventRecordEvent::DefsModEventEmail(v) => { + EmitEventRecordEvent::DefsModEventEmail(v.into_static()) + } + EmitEventRecordEvent::DefsModEventDivert(v) => { + EmitEventRecordEvent::DefsModEventDivert(v.into_static()) + } + EmitEventRecordEvent::DefsModEventTag(v) => { + EmitEventRecordEvent::DefsModEventTag(v.into_static()) + } + EmitEventRecordEvent::DefsAccountEvent(v) => { + EmitEventRecordEvent::DefsAccountEvent(v.into_static()) + } + EmitEventRecordEvent::DefsIdentityEvent(v) => { + EmitEventRecordEvent::DefsIdentityEvent(v.into_static()) + } + EmitEventRecordEvent::DefsRecordEvent(v) => { + EmitEventRecordEvent::DefsRecordEvent(v.into_static()) + } + EmitEventRecordEvent::DefsModEventPriorityScore(v) => { + EmitEventRecordEvent::DefsModEventPriorityScore(v.into_static()) + } + EmitEventRecordEvent::DefsAgeAssuranceEvent(v) => { + EmitEventRecordEvent::DefsAgeAssuranceEvent(v.into_static()) + } + EmitEventRecordEvent::DefsAgeAssuranceOverrideEvent(v) => { + EmitEventRecordEvent::DefsAgeAssuranceOverrideEvent(v.into_static()) + } + EmitEventRecordEvent::DefsRevokeAccountCredentialsEvent(v) => { + EmitEventRecordEvent::DefsRevokeAccountCredentialsEvent(v.into_static()) + } + EmitEventRecordEvent::Unknown(v) => { + EmitEventRecordEvent::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] @@ -107,6 +184,38 @@ pub enum EmitEventRecordSubject<'a> { StrongRef(Box>), } +impl jacquard_common::IntoStatic for EmitEventRecordSubject<'_> { + type Output = EmitEventRecordSubject<'static>; + fn into_static(self) -> Self::Output { + match self { + EmitEventRecordSubject::DefsRepoRef(v) => { + EmitEventRecordSubject::DefsRepoRef(v.into_static()) + } + EmitEventRecordSubject::StrongRef(v) => { + EmitEventRecordSubject::StrongRef(v.into_static()) + } + EmitEventRecordSubject::Unknown(v) => { + EmitEventRecordSubject::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for EmitEvent<'_> { + type Output = EmitEvent<'static>; + fn into_static(self) -> Self::Output { + EmitEvent { + created_by: self.created_by.into_static(), + event: self.event.into_static(), + external_id: self.external_id.into_static(), + mod_tool: self.mod_tool.into_static(), + subject: self.subject.into_static(), + subject_blob_cids: self.subject_blob_cids.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -116,6 +225,16 @@ pub struct EmitEventOutput<'a> { pub value: crate::tools_ozone::moderation::ModEventView<'a>, } +impl jacquard_common::IntoStatic for EmitEventOutput<'_> { + type Output = EmitEventOutput<'static>; + fn into_static(self) -> Self::Output { + EmitEventOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -159,6 +278,21 @@ impl std::fmt::Display for EmitEventError<'_> { } } +impl jacquard_common::IntoStatic for EmitEventError<'_> { + type Output = EmitEventError<'static>; + fn into_static(self) -> Self::Output { + match self { + EmitEventError::SubjectHasAction(v) => { + EmitEventError::SubjectHasAction(v.into_static()) + } + EmitEventError::DuplicateExternalId(v) => { + EmitEventError::DuplicateExternalId(v.into_static()) + } + EmitEventError::Unknown(v) => EmitEventError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for EmitEvent<'_> { const NSID: &'static str = "tools.ozone.moderation.emitEvent"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/moderation/get_account_timeline.rs b/crates/jacquard-api/src/tools_ozone/moderation/get_account_timeline.rs index 8a91910af..54def7870 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/get_account_timeline.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/get_account_timeline.rs @@ -12,6 +12,15 @@ pub struct GetAccountTimeline<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetAccountTimeline<'_> { + type Output = GetAccountTimeline<'static>; + fn into_static(self) -> Self::Output { + GetAccountTimeline { + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,6 +29,16 @@ pub struct GetAccountTimelineOutput<'a> { pub timeline: Vec>, } +impl jacquard_common::IntoStatic for GetAccountTimelineOutput<'_> { + type Output = GetAccountTimelineOutput<'static>; + fn into_static(self) -> Self::Output { + GetAccountTimelineOutput { + timeline: self.timeline.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -53,6 +72,20 @@ impl std::fmt::Display for GetAccountTimelineError<'_> { } } +impl jacquard_common::IntoStatic for GetAccountTimelineError<'_> { + type Output = GetAccountTimelineError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetAccountTimelineError::RepoNotFound(v) => { + GetAccountTimelineError::RepoNotFound(v.into_static()) + } + GetAccountTimelineError::Unknown(v) => { + GetAccountTimelineError::Unknown(v.into_static()) + } + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetAccountTimeline<'_> { const NSID: &'static str = "tools.ozone.moderation.getAccountTimeline"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; @@ -73,6 +106,17 @@ pub struct TimelineItem<'a> { >, } +impl jacquard_common::IntoStatic for TimelineItem<'_> { + type Output = TimelineItem<'static>; + fn into_static(self) -> Self::Output { + TimelineItem { + day: self.day.into_static(), + summary: self.summary.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -82,4 +126,16 @@ pub struct TimelineItemSummary<'a> { pub event_subject_type: jacquard_common::CowStr<'a>, #[serde(borrow)] pub event_type: jacquard_common::CowStr<'a>, +} + +impl jacquard_common::IntoStatic for TimelineItemSummary<'_> { + type Output = TimelineItemSummary<'static>; + fn into_static(self) -> Self::Output { + TimelineItemSummary { + count: self.count.into_static(), + event_subject_type: self.event_subject_type.into_static(), + event_type: self.event_type.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/get_event.rs b/crates/jacquard-api/src/tools_ozone/moderation/get_event.rs index 7a2a14f74..bc6ff857d 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/get_event.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/get_event.rs @@ -11,6 +11,13 @@ pub struct GetEvent { pub id: i64, } +impl jacquard_common::IntoStatic for GetEvent { + type Output = GetEvent; + fn into_static(self) -> Self::Output { + self + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +27,20 @@ pub struct GetEventOutput<'a> { pub value: crate::tools_ozone::moderation::ModEventViewDetail<'a>, } +impl jacquard_common::IntoStatic for GetEventOutput<'_> { + type Output = GetEventOutput<'static>; + fn into_static(self) -> Self::Output { + GetEventOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetEvent { const NSID: &'static str = "tools.ozone.moderation.getEvent"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetEventOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/get_record.rs b/crates/jacquard-api/src/tools_ozone/moderation/get_record.rs index e619adc2e..8681896fd 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/get_record.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/get_record.rs @@ -15,6 +15,16 @@ pub struct GetRecord<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } +impl jacquard_common::IntoStatic for GetRecord<'_> { + type Output = GetRecord<'static>; + fn into_static(self) -> Self::Output { + GetRecord { + cid: self.cid.into_static(), + uri: self.uri.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,6 +34,16 @@ pub struct GetRecordOutput<'a> { pub value: crate::tools_ozone::moderation::RecordViewDetail<'a>, } +impl jacquard_common::IntoStatic for GetRecordOutput<'_> { + type Output = GetRecordOutput<'static>; + fn into_static(self) -> Self::Output { + GetRecordOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -57,6 +77,18 @@ impl std::fmt::Display for GetRecordError<'_> { } } +impl jacquard_common::IntoStatic for GetRecordError<'_> { + type Output = GetRecordError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetRecordError::RecordNotFound(v) => { + GetRecordError::RecordNotFound(v.into_static()) + } + GetRecordError::Unknown(v) => GetRecordError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRecord<'_> { const NSID: &'static str = "tools.ozone.moderation.getRecord"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/tools_ozone/moderation/get_records.rs b/crates/jacquard-api/src/tools_ozone/moderation/get_records.rs index 6cd5d972b..b49e4ca4c 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/get_records.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/get_records.rs @@ -12,6 +12,15 @@ pub struct GetRecords<'a> { pub uris: Vec>, } +impl jacquard_common::IntoStatic for GetRecords<'_> { + type Output = GetRecords<'static>; + fn into_static(self) -> Self::Output { + GetRecords { + uris: self.uris.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetRecordsOutput<'a> { pub records: Vec>, } +impl jacquard_common::IntoStatic for GetRecordsOutput<'_> { + type Output = GetRecordsOutput<'static>; + fn into_static(self) -> Self::Output { + GetRecordsOutput { + records: self.records.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRecords<'_> { const NSID: &'static str = "tools.ozone.moderation.getRecords"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetRecordsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/get_repo.rs b/crates/jacquard-api/src/tools_ozone/moderation/get_repo.rs index 06f5c462a..d8c9738f1 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/get_repo.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/get_repo.rs @@ -12,6 +12,15 @@ pub struct GetRepo<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GetRepo<'_> { + type Output = GetRepo<'static>; + fn into_static(self) -> Self::Output { + GetRepo { + did: self.did.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -21,6 +30,16 @@ pub struct GetRepoOutput<'a> { pub value: crate::tools_ozone::moderation::RepoViewDetail<'a>, } +impl jacquard_common::IntoStatic for GetRepoOutput<'_> { + type Output = GetRepoOutput<'static>; + fn into_static(self) -> Self::Output { + GetRepoOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -54,6 +73,16 @@ impl std::fmt::Display for GetRepoError<'_> { } } +impl jacquard_common::IntoStatic for GetRepoError<'_> { + type Output = GetRepoError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetRepoError::RepoNotFound(v) => GetRepoError::RepoNotFound(v.into_static()), + GetRepoError::Unknown(v) => GetRepoError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRepo<'_> { const NSID: &'static str = "tools.ozone.moderation.getRepo"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/tools_ozone/moderation/get_reporter_stats.rs b/crates/jacquard-api/src/tools_ozone/moderation/get_reporter_stats.rs index 3d93d305d..ad578860b 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/get_reporter_stats.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/get_reporter_stats.rs @@ -12,6 +12,15 @@ pub struct GetReporterStats<'a> { pub dids: Vec>, } +impl jacquard_common::IntoStatic for GetReporterStats<'_> { + type Output = GetReporterStats<'static>; + fn into_static(self) -> Self::Output { + GetReporterStats { + dids: self.dids.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetReporterStatsOutput<'a> { pub stats: Vec>, } +impl jacquard_common::IntoStatic for GetReporterStatsOutput<'_> { + type Output = GetReporterStatsOutput<'static>; + fn into_static(self) -> Self::Output { + GetReporterStatsOutput { + stats: self.stats.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetReporterStats<'_> { const NSID: &'static str = "tools.ozone.moderation.getReporterStats"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetReporterStatsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/get_repos.rs b/crates/jacquard-api/src/tools_ozone/moderation/get_repos.rs index 0dfe22473..34d95f0a6 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/get_repos.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/get_repos.rs @@ -12,6 +12,15 @@ pub struct GetRepos<'a> { pub dids: Vec>, } +impl jacquard_common::IntoStatic for GetRepos<'_> { + type Output = GetRepos<'static>; + fn into_static(self) -> Self::Output { + GetRepos { + dids: self.dids.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetReposOutput<'a> { pub repos: Vec>, } +impl jacquard_common::IntoStatic for GetReposOutput<'_> { + type Output = GetReposOutput<'static>; + fn into_static(self) -> Self::Output { + GetReposOutput { + repos: self.repos.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetRepos<'_> { const NSID: &'static str = "tools.ozone.moderation.getRepos"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetReposOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/get_subjects.rs b/crates/jacquard-api/src/tools_ozone/moderation/get_subjects.rs index d40833a4a..853a4b0d8 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/get_subjects.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/get_subjects.rs @@ -12,6 +12,15 @@ pub struct GetSubjects<'a> { pub subjects: Vec>, } +impl jacquard_common::IntoStatic for GetSubjects<'_> { + type Output = GetSubjects<'static>; + fn into_static(self) -> Self::Output { + GetSubjects { + subjects: self.subjects.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct GetSubjectsOutput<'a> { pub subjects: Vec>, } +impl jacquard_common::IntoStatic for GetSubjectsOutput<'_> { + type Output = GetSubjectsOutput<'static>; + fn into_static(self) -> Self::Output { + GetSubjectsOutput { + subjects: self.subjects.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetSubjects<'_> { const NSID: &'static str = "tools.ozone.moderation.getSubjects"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetSubjectsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/query_events.rs b/crates/jacquard-api/src/tools_ozone/moderation/query_events.rs index 66cfba07e..1c8fb6af6 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/query_events.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/query_events.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct QueryEvents<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -38,8 +38,10 @@ pub struct QueryEvents<'a> { 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")] @@ -57,6 +59,7 @@ pub struct QueryEvents<'a> { #[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>, @@ -71,31 +74,32 @@ pub struct QueryEvents<'a> { pub types: std::option::Option>>, } -impl Default for QueryEvents<'_> { - fn default() -> Self { - Self { - added_labels: Default::default(), - added_tags: Default::default(), - age_assurance_state: Default::default(), - batch_id: Default::default(), - collections: Default::default(), - comment: Default::default(), - created_after: Default::default(), - created_before: Default::default(), - created_by: Default::default(), - cursor: Default::default(), - has_comment: Default::default(), - include_all_user_records: Some(false), - limit: Some(50i64), - mod_tool: Default::default(), - policies: Default::default(), - removed_labels: Default::default(), - removed_tags: Default::default(), - report_types: Default::default(), - sort_direction: Some(jacquard_common::CowStr::from("desc")), - subject: Default::default(), - subject_type: Default::default(), - types: Default::default(), +impl jacquard_common::IntoStatic for QueryEvents<'_> { + type Output = QueryEvents<'static>; + fn into_static(self) -> Self::Output { + QueryEvents { + added_labels: self.added_labels.into_static(), + added_tags: self.added_tags.into_static(), + age_assurance_state: self.age_assurance_state.into_static(), + batch_id: self.batch_id.into_static(), + collections: self.collections.into_static(), + comment: self.comment.into_static(), + created_after: self.created_after.into_static(), + created_before: self.created_before.into_static(), + created_by: self.created_by.into_static(), + cursor: self.cursor.into_static(), + has_comment: self.has_comment.into_static(), + include_all_user_records: self.include_all_user_records.into_static(), + limit: self.limit.into_static(), + mod_tool: self.mod_tool.into_static(), + policies: self.policies.into_static(), + removed_labels: self.removed_labels.into_static(), + removed_tags: self.removed_tags.into_static(), + report_types: self.report_types.into_static(), + sort_direction: self.sort_direction.into_static(), + subject: self.subject.into_static(), + subject_type: self.subject_type.into_static(), + types: self.types.into_static(), } } } @@ -111,10 +115,21 @@ pub struct QueryEventsOutput<'a> { pub events: Vec>, } +impl jacquard_common::IntoStatic for QueryEventsOutput<'_> { + type Output = QueryEventsOutput<'static>; + fn into_static(self) -> Self::Output { + QueryEventsOutput { + cursor: self.cursor.into_static(), + events: self.events.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for QueryEvents<'_> { const NSID: &'static str = "tools.ozone.moderation.queryEvents"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = QueryEventsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/query_statuses.rs b/crates/jacquard-api/src/tools_ozone/moderation/query_statuses.rs index a686233da..7fe7262ac 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/query_statuses.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/query_statuses.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct QueryStatuses<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -56,10 +56,12 @@ pub struct QueryStatuses<'a> { #[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")] @@ -86,9 +88,11 @@ pub struct QueryStatuses<'a> { 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>, @@ -105,44 +109,45 @@ pub struct QueryStatuses<'a> { pub takendown: std::option::Option, } -impl Default for QueryStatuses<'_> { - fn default() -> Self { - Self { - age_assurance_state: Default::default(), - appealed: Default::default(), - collections: Default::default(), - comment: Default::default(), - cursor: Default::default(), - exclude_tags: Default::default(), - hosting_deleted_after: Default::default(), - hosting_deleted_before: Default::default(), - hosting_statuses: Default::default(), - hosting_updated_after: Default::default(), - hosting_updated_before: Default::default(), - ignore_subjects: Default::default(), - include_all_user_records: Default::default(), - include_muted: Default::default(), - last_reviewed_by: Default::default(), - limit: Some(50i64), - min_account_suspend_count: Default::default(), - min_priority_score: Default::default(), - min_reported_records_count: Default::default(), - min_takendown_records_count: Default::default(), - only_muted: Default::default(), - queue_count: Default::default(), - queue_index: Default::default(), - queue_seed: Default::default(), - reported_after: Default::default(), - reported_before: Default::default(), - review_state: Default::default(), - reviewed_after: Default::default(), - reviewed_before: Default::default(), - sort_direction: Some(jacquard_common::CowStr::from("desc")), - sort_field: Some(jacquard_common::CowStr::from("lastReportedAt")), - subject: Default::default(), - subject_type: Default::default(), - tags: Default::default(), - takendown: Default::default(), +impl jacquard_common::IntoStatic for QueryStatuses<'_> { + type Output = QueryStatuses<'static>; + fn into_static(self) -> Self::Output { + QueryStatuses { + age_assurance_state: self.age_assurance_state.into_static(), + appealed: self.appealed.into_static(), + collections: self.collections.into_static(), + comment: self.comment.into_static(), + cursor: self.cursor.into_static(), + exclude_tags: self.exclude_tags.into_static(), + hosting_deleted_after: self.hosting_deleted_after.into_static(), + hosting_deleted_before: self.hosting_deleted_before.into_static(), + hosting_statuses: self.hosting_statuses.into_static(), + hosting_updated_after: self.hosting_updated_after.into_static(), + hosting_updated_before: self.hosting_updated_before.into_static(), + ignore_subjects: self.ignore_subjects.into_static(), + include_all_user_records: self.include_all_user_records.into_static(), + include_muted: self.include_muted.into_static(), + last_reviewed_by: self.last_reviewed_by.into_static(), + limit: self.limit.into_static(), + min_account_suspend_count: self.min_account_suspend_count.into_static(), + min_priority_score: self.min_priority_score.into_static(), + min_reported_records_count: self.min_reported_records_count.into_static(), + min_takendown_records_count: self.min_takendown_records_count.into_static(), + only_muted: self.only_muted.into_static(), + queue_count: self.queue_count.into_static(), + queue_index: self.queue_index.into_static(), + queue_seed: self.queue_seed.into_static(), + reported_after: self.reported_after.into_static(), + reported_before: self.reported_before.into_static(), + review_state: self.review_state.into_static(), + reviewed_after: self.reviewed_after.into_static(), + reviewed_before: self.reviewed_before.into_static(), + sort_direction: self.sort_direction.into_static(), + sort_field: self.sort_field.into_static(), + subject: self.subject.into_static(), + subject_type: self.subject_type.into_static(), + tags: self.tags.into_static(), + takendown: self.takendown.into_static(), } } } @@ -158,10 +163,21 @@ pub struct QueryStatusesOutput<'a> { pub subject_statuses: Vec>, } +impl jacquard_common::IntoStatic for QueryStatusesOutput<'_> { + type Output = QueryStatusesOutput<'static>; + fn into_static(self) -> Self::Output { + QueryStatusesOutput { + cursor: self.cursor.into_static(), + subject_statuses: self.subject_statuses.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for QueryStatuses<'_> { const NSID: &'static str = "tools.ozone.moderation.queryStatuses"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = QueryStatusesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/moderation/search_repos.rs b/crates/jacquard-api/src/tools_ozone/moderation/search_repos.rs index 93fbb5166..f0f08fb1f 100644 --- a/crates/jacquard-api/src/tools_ozone/moderation/search_repos.rs +++ b/crates/jacquard-api/src/tools_ozone/moderation/search_repos.rs @@ -5,12 +5,13 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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")] @@ -21,13 +22,14 @@ pub struct SearchRepos<'a> { pub term: std::option::Option>, } -impl Default for SearchRepos<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - q: Default::default(), - term: Default::default(), +impl jacquard_common::IntoStatic for SearchRepos<'_> { + type Output = SearchRepos<'static>; + fn into_static(self) -> Self::Output { + SearchRepos { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + q: self.q.into_static(), + term: self.term.into_static(), } } } @@ -43,10 +45,21 @@ pub struct SearchReposOutput<'a> { pub repos: Vec>, } +impl jacquard_common::IntoStatic for SearchReposOutput<'_> { + type Output = SearchReposOutput<'static>; + fn into_static(self) -> Self::Output { + SearchReposOutput { + cursor: self.cursor.into_static(), + repos: self.repos.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchRepos<'_> { const NSID: &'static str = "tools.ozone.moderation.searchRepos"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SearchReposOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/report.rs b/crates/jacquard-api/src/tools_ozone/report.rs index dca49d6c0..aecbea952 100644 --- a/crates/jacquard-api/src/tools_ozone/report.rs +++ b/crates/jacquard-api/src/tools_ozone/report.rs @@ -510,4 +510,148 @@ where 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::ToolsOzoneReportDefsReasonViolenceAnimalWelfare => { + ReasonType::ToolsOzoneReportDefsReasonViolenceAnimalWelfare + } + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats => { + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats + } + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent => { + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + ReasonType::ToolsOzoneReportDefsReasonViolenceSelfHarm => { + ReasonType::ToolsOzoneReportDefsReasonViolenceSelfHarm + } + 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::ToolsOzoneReportDefsReasonSexualSextortion => { + ReasonType::ToolsOzoneReportDefsReasonSexualSextortion + } + 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::ToolsOzoneReportDefsReasonChildSafetyMinorPrivacy => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyMinorPrivacy + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyEndangerment => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyEndangerment + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPromotion => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPromotion + } + 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::ToolsOzoneReportDefsReasonMisleadingSyntheticContent => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingSyntheticContent + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingMisinformation => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingMisinformation + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther + } + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity => { + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + ReasonType::ToolsOzoneReportDefsReasonRuleStolenContent => { + ReasonType::ToolsOzoneReportDefsReasonRuleStolenContent + } + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales => { + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion => { + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion + } + ReasonType::ToolsOzoneReportDefsReasonRuleOther => { + ReasonType::ToolsOzoneReportDefsReasonRuleOther + } + ReasonType::ToolsOzoneReportDefsReasonCivicElectoralProcess => { + ReasonType::ToolsOzoneReportDefsReasonCivicElectoralProcess + } + ReasonType::ToolsOzoneReportDefsReasonCivicDisclosure => { + ReasonType::ToolsOzoneReportDefsReasonCivicDisclosure + } + ReasonType::ToolsOzoneReportDefsReasonCivicInterference => { + ReasonType::ToolsOzoneReportDefsReasonCivicInterference + } + ReasonType::ToolsOzoneReportDefsReasonCivicMisinformation => { + ReasonType::ToolsOzoneReportDefsReasonCivicMisinformation + } + ReasonType::ToolsOzoneReportDefsReasonCivicImpersonation => { + ReasonType::ToolsOzoneReportDefsReasonCivicImpersonation + } + ReasonType::Other(v) => ReasonType::Other(v.into_static()), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/safelink.rs b/crates/jacquard-api/src/tools_ozone/safelink.rs index a7648f741..4e5cb0af6 100644 --- a/crates/jacquard-api/src/tools_ozone/safelink.rs +++ b/crates/jacquard-api/src/tools_ozone/safelink.rs @@ -80,6 +80,18 @@ where } } +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)] @@ -108,6 +120,24 @@ pub struct Event<'a> { pub url: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for Event<'_> { + type Output = Event<'static>; + fn into_static(self) -> Self::Output { + Event { + action: self.action.into_static(), + comment: self.comment.into_static(), + created_at: self.created_at.into_static(), + created_by: self.created_by.into_static(), + event_type: self.event_type.into_static(), + id: self.id.into_static(), + pattern: self.pattern.into_static(), + reason: self.reason.into_static(), + url: self.url.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum EventType<'a> { AddRule, @@ -177,6 +207,18 @@ where } } +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, @@ -242,6 +284,17 @@ where } } +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, @@ -315,6 +368,19 @@ where } } +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)] @@ -340,4 +406,21 @@ pub struct UrlRule<'a> { ///The URL or domain to apply the rule to #[serde(borrow)] pub url: jacquard_common::CowStr<'a>, +} + +impl jacquard_common::IntoStatic for UrlRule<'_> { + type Output = UrlRule<'static>; + fn into_static(self) -> Self::Output { + UrlRule { + action: self.action.into_static(), + comment: self.comment.into_static(), + created_at: self.created_at.into_static(), + created_by: self.created_by.into_static(), + pattern: self.pattern.into_static(), + reason: self.reason.into_static(), + updated_at: self.updated_at.into_static(), + url: self.url.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/safelink/add_rule.rs b/crates/jacquard-api/src/tools_ozone/safelink/add_rule.rs index 838959cdd..3c71a7dd0 100644 --- a/crates/jacquard-api/src/tools_ozone/safelink/add_rule.rs +++ b/crates/jacquard-api/src/tools_ozone/safelink/add_rule.rs @@ -28,6 +28,21 @@ pub struct AddRule<'a> { pub url: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AddRule<'_> { + type Output = AddRule<'static>; + fn into_static(self) -> Self::Output { + AddRule { + action: self.action.into_static(), + comment: self.comment.into_static(), + created_by: self.created_by.into_static(), + pattern: self.pattern.into_static(), + reason: self.reason.into_static(), + url: self.url.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -37,6 +52,16 @@ pub struct AddRuleOutput<'a> { pub value: crate::tools_ozone::safelink::Event<'a>, } +impl jacquard_common::IntoStatic for AddRuleOutput<'_> { + type Output = AddRuleOutput<'static>; + fn into_static(self) -> Self::Output { + AddRuleOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -81,6 +106,19 @@ impl std::fmt::Display for AddRuleError<'_> { } } +impl jacquard_common::IntoStatic for AddRuleError<'_> { + type Output = AddRuleError<'static>; + fn into_static(self) -> Self::Output { + match self { + AddRuleError::InvalidUrl(v) => AddRuleError::InvalidUrl(v.into_static()), + AddRuleError::RuleAlreadyExists(v) => { + AddRuleError::RuleAlreadyExists(v.into_static()) + } + AddRuleError::Unknown(v) => AddRuleError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for AddRule<'_> { const NSID: &'static str = "tools.ozone.safelink.addRule"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/safelink/query_events.rs b/crates/jacquard-api/src/tools_ozone/safelink/query_events.rs index 3c64d8f0c..91bbe3e99 100644 --- a/crates/jacquard-api/src/tools_ozone/safelink/query_events.rs +++ b/crates/jacquard-api/src/tools_ozone/safelink/query_events.rs @@ -30,6 +30,20 @@ pub struct QueryEvents<'a> { pub urls: std::option::Option>>, } +impl jacquard_common::IntoStatic for QueryEvents<'_> { + type Output = QueryEvents<'static>; + fn into_static(self) -> Self::Output { + QueryEvents { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + pattern_type: self.pattern_type.into_static(), + sort_direction: self.sort_direction.into_static(), + urls: self.urls.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -42,6 +56,17 @@ pub struct QueryEventsOutput<'a> { pub events: Vec>, } +impl jacquard_common::IntoStatic for QueryEventsOutput<'_> { + type Output = QueryEventsOutput<'static>; + fn into_static(self) -> Self::Output { + QueryEventsOutput { + cursor: self.cursor.into_static(), + events: self.events.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for QueryEvents<'_> { const NSID: &'static str = "tools.ozone.safelink.queryEvents"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -49,5 +74,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for QueryEvents<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = QueryEventsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/safelink/query_rules.rs b/crates/jacquard-api/src/tools_ozone/safelink/query_rules.rs index 1ba59a70f..16467abcc 100644 --- a/crates/jacquard-api/src/tools_ozone/safelink/query_rules.rs +++ b/crates/jacquard-api/src/tools_ozone/safelink/query_rules.rs @@ -42,6 +42,23 @@ pub struct QueryRules<'a> { pub urls: std::option::Option>>, } +impl jacquard_common::IntoStatic for QueryRules<'_> { + type Output = QueryRules<'static>; + fn into_static(self) -> Self::Output { + QueryRules { + actions: self.actions.into_static(), + created_by: self.created_by.into_static(), + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + pattern_type: self.pattern_type.into_static(), + reason: self.reason.into_static(), + sort_direction: self.sort_direction.into_static(), + urls: self.urls.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -54,6 +71,17 @@ pub struct QueryRulesOutput<'a> { pub rules: Vec>, } +impl jacquard_common::IntoStatic for QueryRulesOutput<'_> { + type Output = QueryRulesOutput<'static>; + fn into_static(self) -> Self::Output { + QueryRulesOutput { + cursor: self.cursor.into_static(), + rules: self.rules.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for QueryRules<'_> { const NSID: &'static str = "tools.ozone.safelink.queryRules"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -61,5 +89,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for QueryRules<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = QueryRulesOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/safelink/remove_rule.rs b/crates/jacquard-api/src/tools_ozone/safelink/remove_rule.rs index 3660d3fcf..f153ea0be 100644 --- a/crates/jacquard-api/src/tools_ozone/safelink/remove_rule.rs +++ b/crates/jacquard-api/src/tools_ozone/safelink/remove_rule.rs @@ -24,6 +24,19 @@ pub struct RemoveRule<'a> { pub url: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RemoveRule<'_> { + type Output = RemoveRule<'static>; + fn into_static(self) -> Self::Output { + RemoveRule { + comment: self.comment.into_static(), + created_by: self.created_by.into_static(), + pattern: self.pattern.into_static(), + url: self.url.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -33,6 +46,16 @@ pub struct RemoveRuleOutput<'a> { pub value: crate::tools_ozone::safelink::Event<'a>, } +impl jacquard_common::IntoStatic for RemoveRuleOutput<'_> { + type Output = RemoveRuleOutput<'static>; + fn into_static(self) -> Self::Output { + RemoveRuleOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -67,6 +90,18 @@ impl std::fmt::Display for RemoveRuleError<'_> { } } +impl jacquard_common::IntoStatic for RemoveRuleError<'_> { + type Output = RemoveRuleError<'static>; + fn into_static(self) -> Self::Output { + match self { + RemoveRuleError::RuleNotFound(v) => { + RemoveRuleError::RuleNotFound(v.into_static()) + } + RemoveRuleError::Unknown(v) => RemoveRuleError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RemoveRule<'_> { const NSID: &'static str = "tools.ozone.safelink.removeRule"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/safelink/update_rule.rs b/crates/jacquard-api/src/tools_ozone/safelink/update_rule.rs index 7d04ef803..4acc0a363 100644 --- a/crates/jacquard-api/src/tools_ozone/safelink/update_rule.rs +++ b/crates/jacquard-api/src/tools_ozone/safelink/update_rule.rs @@ -28,6 +28,21 @@ pub struct UpdateRule<'a> { pub url: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for UpdateRule<'_> { + type Output = UpdateRule<'static>; + fn into_static(self) -> Self::Output { + UpdateRule { + action: self.action.into_static(), + comment: self.comment.into_static(), + created_by: self.created_by.into_static(), + pattern: self.pattern.into_static(), + reason: self.reason.into_static(), + url: self.url.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -37,6 +52,16 @@ pub struct UpdateRuleOutput<'a> { pub value: crate::tools_ozone::safelink::Event<'a>, } +impl jacquard_common::IntoStatic for UpdateRuleOutput<'_> { + type Output = UpdateRuleOutput<'static>; + fn into_static(self) -> Self::Output { + UpdateRuleOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -71,6 +96,18 @@ impl std::fmt::Display for UpdateRuleError<'_> { } } +impl jacquard_common::IntoStatic for UpdateRuleError<'_> { + type Output = UpdateRuleError<'static>; + fn into_static(self) -> Self::Output { + match self { + UpdateRuleError::RuleNotFound(v) => { + UpdateRuleError::RuleNotFound(v.into_static()) + } + UpdateRuleError::Unknown(v) => UpdateRuleError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateRule<'_> { const NSID: &'static str = "tools.ozone.safelink.updateRule"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/server/get_config.rs b/crates/jacquard-api/src/tools_ozone/server/get_config.rs index 92813142e..993697015 100644 --- a/crates/jacquard-api/src/tools_ozone/server/get_config.rs +++ b/crates/jacquard-api/src/tools_ozone/server/get_config.rs @@ -30,6 +30,21 @@ pub struct GetConfigOutput<'a> { pub viewer: std::option::Option>, } +impl jacquard_common::IntoStatic for GetConfigOutput<'_> { + type Output = GetConfigOutput<'static>; + fn into_static(self) -> Self::Output { + GetConfigOutput { + appview: self.appview.into_static(), + blob_divert: self.blob_divert.into_static(), + chat: self.chat.into_static(), + pds: self.pds.into_static(), + verifier_did: self.verifier_did.into_static(), + viewer: self.viewer.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + /// XRPC request marker type #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)] pub struct GetConfig; @@ -38,7 +53,7 @@ impl jacquard_common::types::xrpc::XrpcRequest for GetConfig { const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GetConfigOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -50,6 +65,16 @@ pub struct ServiceConfig<'a> { pub url: std::option::Option>, } +impl jacquard_common::IntoStatic for ServiceConfig<'_> { + type Output = ServiceConfig<'static>; + fn into_static(self) -> Self::Output { + ServiceConfig { + url: self.url.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -57,4 +82,14 @@ pub struct ViewerConfig<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub role: std::option::Option>, +} + +impl jacquard_common::IntoStatic for ViewerConfig<'_> { + type Output = ViewerConfig<'static>; + fn into_static(self) -> Self::Output { + ViewerConfig { + role: self.role.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/set.rs b/crates/jacquard-api/src/tools_ozone/set.rs index 7d2ef372d..6cb0c6124 100644 --- a/crates/jacquard-api/src/tools_ozone/set.rs +++ b/crates/jacquard-api/src/tools_ozone/set.rs @@ -23,6 +23,17 @@ pub struct Set<'a> { pub name: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for Set<'_> { + type Output = Set<'static>; + fn into_static(self) -> Self::Output { + Set { + description: self.description.into_static(), + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -35,4 +46,18 @@ pub struct SetView<'a> { pub name: jacquard_common::CowStr<'a>, pub set_size: i64, pub updated_at: jacquard_common::types::string::Datetime, +} + +impl jacquard_common::IntoStatic for SetView<'_> { + type Output = SetView<'static>; + fn into_static(self) -> Self::Output { + SetView { + created_at: self.created_at.into_static(), + description: self.description.into_static(), + name: self.name.into_static(), + set_size: self.set_size.into_static(), + updated_at: self.updated_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/set/add_values.rs b/crates/jacquard-api/src/tools_ozone/set/add_values.rs index 55673e0f2..1dffd5304 100644 --- a/crates/jacquard-api/src/tools_ozone/set/add_values.rs +++ b/crates/jacquard-api/src/tools_ozone/set/add_values.rs @@ -17,6 +17,17 @@ pub struct AddValues<'a> { pub values: Vec>, } +impl jacquard_common::IntoStatic for AddValues<'_> { + type Output = AddValues<'static>; + fn into_static(self) -> Self::Output { + AddValues { + name: self.name.into_static(), + values: self.values.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for AddValues<'_> { const NSID: &'static str = "tools.ozone.set.addValues"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -24,5 +35,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for AddValues<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = (); - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/set/delete_set.rs b/crates/jacquard-api/src/tools_ozone/set/delete_set.rs index fbc37138f..a5f838934 100644 --- a/crates/jacquard-api/src/tools_ozone/set/delete_set.rs +++ b/crates/jacquard-api/src/tools_ozone/set/delete_set.rs @@ -14,10 +14,29 @@ pub struct DeleteSet<'a> { pub name: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for DeleteSet<'_> { + type Output = DeleteSet<'static>; + fn into_static(self) -> Self::Output { + DeleteSet { + name: self.name.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct DeleteSetOutput<'a> {} +impl jacquard_common::IntoStatic for DeleteSetOutput<'_> { + type Output = DeleteSetOutput<'static>; + fn into_static(self) -> Self::Output { + DeleteSetOutput { + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -52,6 +71,18 @@ impl std::fmt::Display for DeleteSetError<'_> { } } +impl jacquard_common::IntoStatic for DeleteSetError<'_> { + type Output = DeleteSetError<'static>; + fn into_static(self) -> Self::Output { + match self { + DeleteSetError::SetNotFound(v) => { + DeleteSetError::SetNotFound(v.into_static()) + } + DeleteSetError::Unknown(v) => DeleteSetError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteSet<'_> { const NSID: &'static str = "tools.ozone.set.deleteSet"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/set/delete_values.rs b/crates/jacquard-api/src/tools_ozone/set/delete_values.rs index 9183ee7fd..fc59ebb3b 100644 --- a/crates/jacquard-api/src/tools_ozone/set/delete_values.rs +++ b/crates/jacquard-api/src/tools_ozone/set/delete_values.rs @@ -17,6 +17,17 @@ pub struct DeleteValues<'a> { pub values: Vec>, } +impl jacquard_common::IntoStatic for DeleteValues<'_> { + type Output = DeleteValues<'static>; + fn into_static(self) -> Self::Output { + DeleteValues { + name: self.name.into_static(), + values: self.values.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -51,6 +62,18 @@ impl std::fmt::Display for DeleteValuesError<'_> { } } +impl jacquard_common::IntoStatic for DeleteValuesError<'_> { + type Output = DeleteValuesError<'static>; + fn into_static(self) -> Self::Output { + match self { + DeleteValuesError::SetNotFound(v) => { + DeleteValuesError::SetNotFound(v.into_static()) + } + DeleteValuesError::Unknown(v) => DeleteValuesError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteValues<'_> { const NSID: &'static str = "tools.ozone.set.deleteValues"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/set/get_values.rs b/crates/jacquard-api/src/tools_ozone/set/get_values.rs index 6c0fc235c..488105539 100644 --- a/crates/jacquard-api/src/tools_ozone/set/get_values.rs +++ b/crates/jacquard-api/src/tools_ozone/set/get_values.rs @@ -5,24 +5,26 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for GetValues<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(100i64), - name: Default::default(), +impl jacquard_common::IntoStatic for GetValues<'_> { + type Output = GetValues<'static>; + fn into_static(self) -> Self::Output { + GetValues { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + name: self.name.into_static(), } } } @@ -40,6 +42,18 @@ pub struct GetValuesOutput<'a> { pub values: Vec>, } +impl jacquard_common::IntoStatic for GetValuesOutput<'_> { + type Output = GetValuesOutput<'static>; + fn into_static(self) -> Self::Output { + GetValuesOutput { + cursor: self.cursor.into_static(), + set: self.set.into_static(), + values: self.values.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -74,6 +88,18 @@ impl std::fmt::Display for GetValuesError<'_> { } } +impl jacquard_common::IntoStatic for GetValuesError<'_> { + type Output = GetValuesError<'static>; + fn into_static(self) -> Self::Output { + match self { + GetValuesError::SetNotFound(v) => { + GetValuesError::SetNotFound(v.into_static()) + } + GetValuesError::Unknown(v) => GetValuesError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GetValues<'_> { const NSID: &'static str = "tools.ozone.set.getValues"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; diff --git a/crates/jacquard-api/src/tools_ozone/set/query_sets.rs b/crates/jacquard-api/src/tools_ozone/set/query_sets.rs index beedb27a9..a5f380e00 100644 --- a/crates/jacquard-api/src/tools_ozone/set/query_sets.rs +++ b/crates/jacquard-api/src/tools_ozone/set/query_sets.rs @@ -5,33 +5,37 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for QuerySets<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - name_prefix: Default::default(), - sort_by: Some(jacquard_common::CowStr::from("name")), - sort_direction: Some(jacquard_common::CowStr::from("asc")), +impl jacquard_common::IntoStatic for QuerySets<'_> { + type Output = QuerySets<'static>; + fn into_static(self) -> Self::Output { + QuerySets { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + name_prefix: self.name_prefix.into_static(), + sort_by: self.sort_by.into_static(), + sort_direction: self.sort_direction.into_static(), } } } @@ -47,10 +51,21 @@ pub struct QuerySetsOutput<'a> { pub sets: Vec>, } +impl jacquard_common::IntoStatic for QuerySetsOutput<'_> { + type Output = QuerySetsOutput<'static>; + fn into_static(self) -> Self::Output { + QuerySetsOutput { + cursor: self.cursor.into_static(), + sets: self.sets.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for QuerySets<'_> { const NSID: &'static str = "tools.ozone.set.querySets"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = QuerySetsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/set/upsert_set.rs b/crates/jacquard-api/src/tools_ozone/set/upsert_set.rs index b1d6f1607..4b24be88c 100644 --- a/crates/jacquard-api/src/tools_ozone/set/upsert_set.rs +++ b/crates/jacquard-api/src/tools_ozone/set/upsert_set.rs @@ -14,6 +14,16 @@ pub struct UpsertSet<'a> { pub value: crate::tools_ozone::set::Set<'a>, } +impl jacquard_common::IntoStatic for UpsertSet<'_> { + type Output = UpsertSet<'static>; + fn into_static(self) -> Self::Output { + UpsertSet { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -23,6 +33,16 @@ pub struct UpsertSetOutput<'a> { pub value: crate::tools_ozone::set::SetView<'a>, } +impl jacquard_common::IntoStatic for UpsertSetOutput<'_> { + type Output = UpsertSetOutput<'static>; + fn into_static(self) -> Self::Output { + UpsertSetOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpsertSet<'_> { const NSID: &'static str = "tools.ozone.set.upsertSet"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -30,5 +50,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpsertSet<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = UpsertSetOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/setting.rs b/crates/jacquard-api/src/tools_ozone/setting.rs index 44c4b5966..bbe86aad3 100644 --- a/crates/jacquard-api/src/tools_ozone/setting.rs +++ b/crates/jacquard-api/src/tools_ozone/setting.rs @@ -35,4 +35,23 @@ pub struct Option<'a> { pub updated_at: std::option::Option, #[serde(borrow)] pub value: jacquard_common::types::value::Data<'a>, +} + +impl jacquard_common::IntoStatic for Option<'_> { + type Output = Option<'static>; + fn into_static(self) -> Self::Output { + Option { + created_at: self.created_at.into_static(), + created_by: self.created_by.into_static(), + description: self.description.into_static(), + did: self.did.into_static(), + key: self.key.into_static(), + last_updated_by: self.last_updated_by.into_static(), + manager_role: self.manager_role.into_static(), + scope: self.scope.into_static(), + updated_at: self.updated_at.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/setting/list_options.rs b/crates/jacquard-api/src/tools_ozone/setting/list_options.rs index e41aa1758..1ded5315f 100644 --- a/crates/jacquard-api/src/tools_ozone/setting/list_options.rs +++ b/crates/jacquard-api/src/tools_ozone/setting/list_options.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ListOptions<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -14,24 +14,27 @@ pub struct ListOptions<'a> { #[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>, } -impl Default for ListOptions<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - keys: Default::default(), - limit: Some(50i64), - prefix: Default::default(), - scope: Some(jacquard_common::CowStr::from("instance")), +impl jacquard_common::IntoStatic for ListOptions<'_> { + type Output = ListOptions<'static>; + fn into_static(self) -> Self::Output { + ListOptions { + cursor: self.cursor.into_static(), + keys: self.keys.into_static(), + limit: self.limit.into_static(), + prefix: self.prefix.into_static(), + scope: self.scope.into_static(), } } } @@ -47,10 +50,21 @@ pub struct ListOptionsOutput<'a> { pub options: Vec>, } +impl jacquard_common::IntoStatic for ListOptionsOutput<'_> { + type Output = ListOptionsOutput<'static>; + fn into_static(self) -> Self::Output { + ListOptionsOutput { + cursor: self.cursor.into_static(), + options: self.options.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListOptions<'_> { const NSID: &'static str = "tools.ozone.setting.listOptions"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListOptionsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/setting/remove_options.rs b/crates/jacquard-api/src/tools_ozone/setting/remove_options.rs index fd135bb6e..a54d11407 100644 --- a/crates/jacquard-api/src/tools_ozone/setting/remove_options.rs +++ b/crates/jacquard-api/src/tools_ozone/setting/remove_options.rs @@ -15,10 +15,30 @@ pub struct RemoveOptions<'a> { pub scope: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for RemoveOptions<'_> { + type Output = RemoveOptions<'static>; + fn into_static(self) -> Self::Output { + RemoveOptions { + keys: self.keys.into_static(), + scope: self.scope.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct RemoveOptionsOutput<'a> {} +impl jacquard_common::IntoStatic for RemoveOptionsOutput<'_> { + type Output = RemoveOptionsOutput<'static>; + fn into_static(self) -> Self::Output { + RemoveOptionsOutput { + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RemoveOptions<'_> { const NSID: &'static str = "tools.ozone.setting.removeOptions"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -26,5 +46,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for RemoveOptions<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = RemoveOptionsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/setting/upsert_option.rs b/crates/jacquard-api/src/tools_ozone/setting/upsert_option.rs index 4184c7ddc..a03cc004c 100644 --- a/crates/jacquard-api/src/tools_ozone/setting/upsert_option.rs +++ b/crates/jacquard-api/src/tools_ozone/setting/upsert_option.rs @@ -23,6 +23,20 @@ pub struct UpsertOption<'a> { pub value: jacquard_common::types::value::Data<'a>, } +impl jacquard_common::IntoStatic for UpsertOption<'_> { + type Output = UpsertOption<'static>; + fn into_static(self) -> Self::Output { + UpsertOption { + description: self.description.into_static(), + key: self.key.into_static(), + manager_role: self.manager_role.into_static(), + scope: self.scope.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -31,6 +45,16 @@ pub struct UpsertOptionOutput<'a> { pub option: crate::tools_ozone::setting::Option<'a>, } +impl jacquard_common::IntoStatic for UpsertOptionOutput<'_> { + type Output = UpsertOptionOutput<'static>; + fn into_static(self) -> Self::Output { + UpsertOptionOutput { + option: self.option.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpsertOption<'_> { const NSID: &'static str = "tools.ozone.setting.upsertOption"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -38,5 +62,5 @@ impl jacquard_common::types::xrpc::XrpcRequest for UpsertOption<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = UpsertOptionOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/signature.rs b/crates/jacquard-api/src/tools_ozone/signature.rs index 9a089a2ac..895fb537f 100644 --- a/crates/jacquard-api/src/tools_ozone/signature.rs +++ b/crates/jacquard-api/src/tools_ozone/signature.rs @@ -17,4 +17,15 @@ pub struct SigDetail<'a> { pub property: jacquard_common::CowStr<'a>, #[serde(borrow)] pub value: jacquard_common::CowStr<'a>, +} + +impl jacquard_common::IntoStatic for SigDetail<'_> { + type Output = SigDetail<'static>; + fn into_static(self) -> Self::Output { + SigDetail { + property: self.property.into_static(), + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/signature/find_correlation.rs b/crates/jacquard-api/src/tools_ozone/signature/find_correlation.rs index 1ed8b975e..12617797f 100644 --- a/crates/jacquard-api/src/tools_ozone/signature/find_correlation.rs +++ b/crates/jacquard-api/src/tools_ozone/signature/find_correlation.rs @@ -12,6 +12,15 @@ pub struct FindCorrelation<'a> { pub dids: Vec>, } +impl jacquard_common::IntoStatic for FindCorrelation<'_> { + type Output = FindCorrelation<'static>; + fn into_static(self) -> Self::Output { + FindCorrelation { + dids: self.dids.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -20,10 +29,20 @@ pub struct FindCorrelationOutput<'a> { pub details: Vec>, } +impl jacquard_common::IntoStatic for FindCorrelationOutput<'_> { + type Output = FindCorrelationOutput<'static>; + fn into_static(self) -> Self::Output { + FindCorrelationOutput { + details: self.details.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for FindCorrelation<'_> { const NSID: &'static str = "tools.ozone.signature.findCorrelation"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = FindCorrelationOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/signature/find_related_accounts.rs b/crates/jacquard-api/src/tools_ozone/signature/find_related_accounts.rs index 1c7f52152..ad83058bb 100644 --- a/crates/jacquard-api/src/tools_ozone/signature/find_related_accounts.rs +++ b/crates/jacquard-api/src/tools_ozone/signature/find_related_accounts.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct FindRelatedAccounts<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -13,16 +13,18 @@ pub struct FindRelatedAccounts<'a> { 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, } -impl Default for FindRelatedAccounts<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - did: Default::default(), - limit: Some(50i64), +impl jacquard_common::IntoStatic for FindRelatedAccounts<'_> { + type Output = FindRelatedAccounts<'static>; + fn into_static(self) -> Self::Output { + FindRelatedAccounts { + cursor: self.cursor.into_static(), + did: self.did.into_static(), + limit: self.limit.into_static(), } } } @@ -38,12 +40,23 @@ pub struct FindRelatedAccountsOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for FindRelatedAccountsOutput<'_> { + type Output = FindRelatedAccountsOutput<'static>; + fn into_static(self) -> Self::Output { + FindRelatedAccountsOutput { + accounts: self.accounts.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for FindRelatedAccounts<'_> { const NSID: &'static str = "tools.ozone.signature.findRelatedAccounts"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = FindRelatedAccountsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -57,4 +70,15 @@ pub struct RelatedAccount<'a> { pub similarities: std::option::Option< Vec>, >, +} + +impl jacquard_common::IntoStatic for RelatedAccount<'_> { + type Output = RelatedAccount<'static>; + fn into_static(self) -> Self::Output { + RelatedAccount { + account: self.account.into_static(), + similarities: self.similarities.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/signature/search_accounts.rs b/crates/jacquard-api/src/tools_ozone/signature/search_accounts.rs index 553a43a2f..6fe994287 100644 --- a/crates/jacquard-api/src/tools_ozone/signature/search_accounts.rs +++ b/crates/jacquard-api/src/tools_ozone/signature/search_accounts.rs @@ -5,24 +5,26 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[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>, } -impl Default for SearchAccounts<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - limit: Some(50i64), - values: Default::default(), +impl jacquard_common::IntoStatic for SearchAccounts<'_> { + type Output = SearchAccounts<'static>; + fn into_static(self) -> Self::Output { + SearchAccounts { + cursor: self.cursor.into_static(), + limit: self.limit.into_static(), + values: self.values.into_static(), } } } @@ -38,10 +40,21 @@ pub struct SearchAccountsOutput<'a> { pub cursor: std::option::Option>, } +impl jacquard_common::IntoStatic for SearchAccountsOutput<'_> { + type Output = SearchAccountsOutput<'static>; + fn into_static(self) -> Self::Output { + SearchAccountsOutput { + accounts: self.accounts.into_static(), + cursor: self.cursor.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for SearchAccounts<'_> { const NSID: &'static str = "tools.ozone.signature.searchAccounts"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = SearchAccountsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/team.rs b/crates/jacquard-api/src/tools_ozone/team.rs index 5f53ee08e..0c05b5d40 100644 --- a/crates/jacquard-api/src/tools_ozone/team.rs +++ b/crates/jacquard-api/src/tools_ozone/team.rs @@ -30,4 +30,20 @@ pub struct Member<'a> { pub role: jacquard_common::CowStr<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub updated_at: std::option::Option, +} + +impl jacquard_common::IntoStatic for Member<'_> { + type Output = Member<'static>; + fn into_static(self) -> Self::Output { + Member { + created_at: self.created_at.into_static(), + did: self.did.into_static(), + disabled: self.disabled.into_static(), + last_updated_by: self.last_updated_by.into_static(), + profile: self.profile.into_static(), + role: self.role.into_static(), + updated_at: self.updated_at.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/team/add_member.rs b/crates/jacquard-api/src/tools_ozone/team/add_member.rs index ea8ef4407..37def561e 100644 --- a/crates/jacquard-api/src/tools_ozone/team/add_member.rs +++ b/crates/jacquard-api/src/tools_ozone/team/add_member.rs @@ -15,6 +15,17 @@ pub struct AddMember<'a> { pub role: jacquard_common::CowStr<'a>, } +impl jacquard_common::IntoStatic for AddMember<'_> { + type Output = AddMember<'static>; + fn into_static(self) -> Self::Output { + AddMember { + did: self.did.into_static(), + role: self.role.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -24,6 +35,16 @@ pub struct AddMemberOutput<'a> { pub value: crate::tools_ozone::team::Member<'a>, } +impl jacquard_common::IntoStatic for AddMemberOutput<'_> { + type Output = AddMemberOutput<'static>; + fn into_static(self) -> Self::Output { + AddMemberOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -58,6 +79,18 @@ impl std::fmt::Display for AddMemberError<'_> { } } +impl jacquard_common::IntoStatic for AddMemberError<'_> { + type Output = AddMemberError<'static>; + fn into_static(self) -> Self::Output { + match self { + AddMemberError::MemberAlreadyExists(v) => { + AddMemberError::MemberAlreadyExists(v.into_static()) + } + AddMemberError::Unknown(v) => AddMemberError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for AddMember<'_> { const NSID: &'static str = "tools.ozone.team.addMember"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/team/delete_member.rs b/crates/jacquard-api/src/tools_ozone/team/delete_member.rs index d686e9cbd..c1bb6d424 100644 --- a/crates/jacquard-api/src/tools_ozone/team/delete_member.rs +++ b/crates/jacquard-api/src/tools_ozone/team/delete_member.rs @@ -13,6 +13,16 @@ pub struct DeleteMember<'a> { pub did: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for DeleteMember<'_> { + type Output = DeleteMember<'static>; + fn into_static(self) -> Self::Output { + DeleteMember { + did: self.did.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -57,6 +67,21 @@ impl std::fmt::Display for DeleteMemberError<'_> { } } +impl jacquard_common::IntoStatic for DeleteMemberError<'_> { + type Output = DeleteMemberError<'static>; + fn into_static(self) -> Self::Output { + match self { + DeleteMemberError::MemberNotFound(v) => { + DeleteMemberError::MemberNotFound(v.into_static()) + } + DeleteMemberError::CannotDeleteSelf(v) => { + DeleteMemberError::CannotDeleteSelf(v.into_static()) + } + DeleteMemberError::Unknown(v) => DeleteMemberError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for DeleteMember<'_> { const NSID: &'static str = "tools.ozone.team.deleteMember"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/team/list_members.rs b/crates/jacquard-api/src/tools_ozone/team/list_members.rs index ee58e85be..c19069579 100644 --- a/crates/jacquard-api/src/tools_ozone/team/list_members.rs +++ b/crates/jacquard-api/src/tools_ozone/team/list_members.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ListMembers<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -13,6 +13,7 @@ pub struct ListMembers<'a> { 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")] @@ -23,14 +24,15 @@ pub struct ListMembers<'a> { pub roles: std::option::Option>>, } -impl Default for ListMembers<'_> { - fn default() -> Self { - Self { - cursor: Default::default(), - disabled: Default::default(), - limit: Some(50i64), - q: Default::default(), - roles: Default::default(), +impl jacquard_common::IntoStatic for ListMembers<'_> { + type Output = ListMembers<'static>; + fn into_static(self) -> Self::Output { + ListMembers { + cursor: self.cursor.into_static(), + disabled: self.disabled.into_static(), + limit: self.limit.into_static(), + q: self.q.into_static(), + roles: self.roles.into_static(), } } } @@ -46,10 +48,21 @@ pub struct ListMembersOutput<'a> { pub members: Vec>, } +impl jacquard_common::IntoStatic for ListMembersOutput<'_> { + type Output = ListMembersOutput<'static>; + fn into_static(self) -> Self::Output { + ListMembersOutput { + cursor: self.cursor.into_static(), + members: self.members.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListMembers<'_> { const NSID: &'static str = "tools.ozone.team.listMembers"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListMembersOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/team/update_member.rs b/crates/jacquard-api/src/tools_ozone/team/update_member.rs index 039967b2f..28f7e33fa 100644 --- a/crates/jacquard-api/src/tools_ozone/team/update_member.rs +++ b/crates/jacquard-api/src/tools_ozone/team/update_member.rs @@ -18,6 +18,18 @@ pub struct UpdateMember<'a> { pub role: std::option::Option>, } +impl jacquard_common::IntoStatic for UpdateMember<'_> { + type Output = UpdateMember<'static>; + fn into_static(self) -> Self::Output { + UpdateMember { + did: self.did.into_static(), + disabled: self.disabled.into_static(), + role: self.role.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -27,6 +39,16 @@ pub struct UpdateMemberOutput<'a> { pub value: crate::tools_ozone::team::Member<'a>, } +impl jacquard_common::IntoStatic for UpdateMemberOutput<'_> { + type Output = UpdateMemberOutput<'static>; + fn into_static(self) -> Self::Output { + UpdateMemberOutput { + value: self.value.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::open_union] #[derive( serde::Serialize, @@ -61,6 +83,18 @@ impl std::fmt::Display for UpdateMemberError<'_> { } } +impl jacquard_common::IntoStatic for UpdateMemberError<'_> { + type Output = UpdateMemberError<'static>; + fn into_static(self) -> Self::Output { + match self { + UpdateMemberError::MemberNotFound(v) => { + UpdateMemberError::MemberNotFound(v.into_static()) + } + UpdateMemberError::Unknown(v) => UpdateMemberError::Unknown(v.into_static()), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for UpdateMember<'_> { const NSID: &'static str = "tools.ozone.team.updateMember"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( diff --git a/crates/jacquard-api/src/tools_ozone/verification.rs b/crates/jacquard-api/src/tools_ozone/verification.rs index e7e4a5972..46141b892 100644 --- a/crates/jacquard-api/src/tools_ozone/verification.rs +++ b/crates/jacquard-api/src/tools_ozone/verification.rs @@ -61,6 +61,17 @@ pub struct VerificationView<'a> { #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum VerificationViewRecordIssuerProfile<'a> {} +impl jacquard_common::IntoStatic for VerificationViewRecordIssuerProfile<'_> { + type Output = VerificationViewRecordIssuerProfile<'static>; + fn into_static(self) -> Self::Output { + match self { + VerificationViewRecordIssuerProfile::Unknown(v) => { + VerificationViewRecordIssuerProfile::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] @@ -72,11 +83,39 @@ pub enum VerificationViewRecordIssuerRepo<'a> { DefsRepoViewNotFound(Box>), } +impl jacquard_common::IntoStatic for VerificationViewRecordIssuerRepo<'_> { + type Output = VerificationViewRecordIssuerRepo<'static>; + fn into_static(self) -> Self::Output { + match self { + VerificationViewRecordIssuerRepo::DefsRepoViewDetail(v) => { + VerificationViewRecordIssuerRepo::DefsRepoViewDetail(v.into_static()) + } + VerificationViewRecordIssuerRepo::DefsRepoViewNotFound(v) => { + VerificationViewRecordIssuerRepo::DefsRepoViewNotFound(v.into_static()) + } + VerificationViewRecordIssuerRepo::Unknown(v) => { + VerificationViewRecordIssuerRepo::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum VerificationViewRecordSubjectProfile<'a> {} +impl jacquard_common::IntoStatic for VerificationViewRecordSubjectProfile<'_> { + type Output = VerificationViewRecordSubjectProfile<'static>; + fn into_static(self) -> Self::Output { + match self { + VerificationViewRecordSubjectProfile::Unknown(v) => { + VerificationViewRecordSubjectProfile::Unknown(v.into_static()) + } + } + } +} + #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(tag = "$type")] @@ -86,4 +125,43 @@ pub enum VerificationViewRecordSubjectRepo<'a> { DefsRepoViewDetail(Box>), #[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")] DefsRepoViewNotFound(Box>), +} + +impl jacquard_common::IntoStatic for VerificationViewRecordSubjectRepo<'_> { + type Output = VerificationViewRecordSubjectRepo<'static>; + fn into_static(self) -> Self::Output { + match self { + VerificationViewRecordSubjectRepo::DefsRepoViewDetail(v) => { + VerificationViewRecordSubjectRepo::DefsRepoViewDetail(v.into_static()) + } + VerificationViewRecordSubjectRepo::DefsRepoViewNotFound(v) => { + VerificationViewRecordSubjectRepo::DefsRepoViewNotFound(v.into_static()) + } + VerificationViewRecordSubjectRepo::Unknown(v) => { + VerificationViewRecordSubjectRepo::Unknown(v.into_static()) + } + } + } +} + +impl jacquard_common::IntoStatic for VerificationView<'_> { + type Output = VerificationView<'static>; + fn into_static(self) -> Self::Output { + VerificationView { + created_at: self.created_at.into_static(), + display_name: self.display_name.into_static(), + handle: self.handle.into_static(), + issuer: self.issuer.into_static(), + issuer_profile: self.issuer_profile.into_static(), + issuer_repo: self.issuer_repo.into_static(), + revoke_reason: self.revoke_reason.into_static(), + revoked_at: self.revoked_at.into_static(), + revoked_by: self.revoked_by.into_static(), + subject: self.subject.into_static(), + subject_profile: self.subject_profile.into_static(), + subject_repo: self.subject_repo.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/verification/grant_verifications.rs b/crates/jacquard-api/src/tools_ozone/verification/grant_verifications.rs index 72e4c4ef6..11b39a5d3 100644 --- a/crates/jacquard-api/src/tools_ozone/verification/grant_verifications.rs +++ b/crates/jacquard-api/src/tools_ozone/verification/grant_verifications.rs @@ -18,6 +18,17 @@ pub struct GrantError<'a> { pub subject: jacquard_common::types::string::Did<'a>, } +impl jacquard_common::IntoStatic for GrantError<'_> { + type Output = GrantError<'static>; + fn into_static(self) -> Self::Output { + GrantError { + error: self.error.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -27,6 +38,16 @@ pub struct GrantVerifications<'a> { pub verifications: Vec>, } +impl jacquard_common::IntoStatic for GrantVerifications<'_> { + type Output = GrantVerifications<'static>; + fn into_static(self) -> Self::Output { + GrantVerifications { + verifications: self.verifications.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -37,6 +58,17 @@ pub struct GrantVerificationsOutput<'a> { pub verifications: Vec>, } +impl jacquard_common::IntoStatic for GrantVerificationsOutput<'_> { + type Output = GrantVerificationsOutput<'static>; + fn into_static(self) -> Self::Output { + GrantVerificationsOutput { + failed_verifications: self.failed_verifications.into_static(), + verifications: self.verifications.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for GrantVerifications<'_> { const NSID: &'static str = "tools.ozone.verification.grantVerifications"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -44,7 +76,7 @@ impl jacquard_common::types::xrpc::XrpcRequest for GrantVerifications<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = GrantVerificationsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } #[jacquard_derive::lexicon] @@ -63,4 +95,17 @@ pub struct VerificationInput<'a> { ///The did of the subject being verified #[serde(borrow)] pub subject: jacquard_common::types::string::Did<'a>, +} + +impl jacquard_common::IntoStatic for VerificationInput<'_> { + type Output = VerificationInput<'static>; + fn into_static(self) -> Self::Output { + VerificationInput { + created_at: self.created_at.into_static(), + display_name: self.display_name.into_static(), + handle: self.handle.into_static(), + subject: self.subject.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/verification/list_verifications.rs b/crates/jacquard-api/src/tools_ozone/verification/list_verifications.rs index 029cd9a68..570e7a451 100644 --- a/crates/jacquard-api/src/tools_ozone/verification/list_verifications.rs +++ b/crates/jacquard-api/src/tools_ozone/verification/list_verifications.rs @@ -5,7 +5,7 @@ // 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, Default)] +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct ListVerifications<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -20,8 +20,10 @@ pub struct ListVerifications<'a> { #[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>, @@ -30,17 +32,18 @@ pub struct ListVerifications<'a> { pub subjects: std::option::Option>>, } -impl Default for ListVerifications<'_> { - fn default() -> Self { - Self { - created_after: Default::default(), - created_before: Default::default(), - cursor: Default::default(), - is_revoked: Default::default(), - issuers: Default::default(), - limit: Some(50i64), - sort_direction: Some(jacquard_common::CowStr::from("desc")), - subjects: Default::default(), +impl jacquard_common::IntoStatic for ListVerifications<'_> { + type Output = ListVerifications<'static>; + fn into_static(self) -> Self::Output { + ListVerifications { + created_after: self.created_after.into_static(), + created_before: self.created_before.into_static(), + cursor: self.cursor.into_static(), + is_revoked: self.is_revoked.into_static(), + issuers: self.issuers.into_static(), + limit: self.limit.into_static(), + sort_direction: self.sort_direction.into_static(), + subjects: self.subjects.into_static(), } } } @@ -56,10 +59,21 @@ pub struct ListVerificationsOutput<'a> { pub verifications: Vec>, } +impl jacquard_common::IntoStatic for ListVerificationsOutput<'_> { + type Output = ListVerificationsOutput<'static>; + fn into_static(self) -> Self::Output { + ListVerificationsOutput { + cursor: self.cursor.into_static(), + verifications: self.verifications.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for ListVerifications<'_> { const NSID: &'static str = "tools.ozone.verification.listVerifications"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Query; const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = ListVerificationsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } \ No newline at end of file diff --git a/crates/jacquard-api/src/tools_ozone/verification/revoke_verifications.rs b/crates/jacquard-api/src/tools_ozone/verification/revoke_verifications.rs index d84a5259a..85eeb313d 100644 --- a/crates/jacquard-api/src/tools_ozone/verification/revoke_verifications.rs +++ b/crates/jacquard-api/src/tools_ozone/verification/revoke_verifications.rs @@ -18,6 +18,17 @@ pub struct RevokeVerifications<'a> { pub uris: Vec>, } +impl jacquard_common::IntoStatic for RevokeVerifications<'_> { + type Output = RevokeVerifications<'static>; + fn into_static(self) -> Self::Output { + RevokeVerifications { + revoke_reason: self.revoke_reason.into_static(), + uris: self.uris.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + #[jacquard_derive::lexicon] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] @@ -30,6 +41,17 @@ pub struct RevokeVerificationsOutput<'a> { pub revoked_verifications: Vec>, } +impl jacquard_common::IntoStatic for RevokeVerificationsOutput<'_> { + type Output = RevokeVerificationsOutput<'static>; + fn into_static(self) -> Self::Output { + RevokeVerificationsOutput { + failed_revocations: self.failed_revocations.into_static(), + revoked_verifications: self.revoked_verifications.into_static(), + extra_data: self.extra_data.into_static(), + } + } +} + impl jacquard_common::types::xrpc::XrpcRequest for RevokeVerifications<'_> { const NSID: &'static str = "tools.ozone.verification.revokeVerifications"; const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( @@ -37,7 +59,7 @@ impl jacquard_common::types::xrpc::XrpcRequest for RevokeVerifications<'_> { ); const OUTPUT_ENCODING: &'static str = "application/json"; type Output<'de> = RevokeVerificationsOutput<'de>; - type Err<'de> = jacquard_common::types::xrpc::GenericError; + type Err<'de> = jacquard_common::types::xrpc::GenericError<'de>; } ///Error object for failed revocations @@ -51,4 +73,15 @@ pub struct RevokeError<'a> { ///The AT-URI of the verification record that failed to revoke. #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, +} + +impl jacquard_common::IntoStatic for RevokeError<'_> { + type Output = RevokeError<'static>; + fn into_static(self) -> Self::Output { + RevokeError { + error: self.error.into_static(), + uri: self.uri.into_static(), + extra_data: self.extra_data.into_static(), + } + } } \ No newline at end of file diff --git a/crates/jacquard-common/src/into_static.rs b/crates/jacquard-common/src/into_static.rs index 537eb6553..e00a15ceb 100644 --- a/crates/jacquard-common/src/into_static.rs +++ b/crates/jacquard-common/src/into_static.rs @@ -96,6 +96,22 @@ impl IntoStatic for Box { } } +impl IntoStatic for bytes::Bytes { + type Output = bytes::Bytes; + + fn into_static(self) -> Self::Output { + self + } +} + +impl IntoStatic for () { + type Output = (); + + fn into_static(self) -> Self::Output { + self + } +} + impl IntoStatic for Option { type Output = Option; diff --git a/crates/jacquard-common/src/types/datetime.rs b/crates/jacquard-common/src/types/datetime.rs index 06f1e02c6..95cad10f3 100644 --- a/crates/jacquard-common/src/types/datetime.rs +++ b/crates/jacquard-common/src/types/datetime.rs @@ -204,6 +204,14 @@ impl fmt::Display for Datetime { } } +impl IntoStatic for Datetime { + type Output = Datetime; + + fn into_static(self) -> Self::Output { + self + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/jacquard-common/src/types/language.rs b/crates/jacquard-common/src/types/language.rs index c508f8613..71c6694d4 100644 --- a/crates/jacquard-common/src/types/language.rs +++ b/crates/jacquard-common/src/types/language.rs @@ -119,6 +119,14 @@ impl Deref for Language { } } +impl crate::IntoStatic for Language { + type Output = Language; + + fn into_static(self) -> Self::Output { + self + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/jacquard-common/src/types/tid.rs b/crates/jacquard-common/src/types/tid.rs index 1aec5fe3f..1b1ea1a4b 100644 --- a/crates/jacquard-common/src/types/tid.rs +++ b/crates/jacquard-common/src/types/tid.rs @@ -219,6 +219,14 @@ impl From for SmolStr { } } +impl crate::IntoStatic for Tid { + type Output = Tid; + + fn into_static(self) -> Self::Output { + self + } +} + impl From for Tid { fn from(value: String) -> Self { if value.len() != 13 { diff --git a/crates/jacquard-common/src/types/value.rs b/crates/jacquard-common/src/types/value.rs index ee29071dc..b0f04f809 100644 --- a/crates/jacquard-common/src/types/value.rs +++ b/crates/jacquard-common/src/types/value.rs @@ -1,4 +1,7 @@ -use crate::types::{DataModelType, LexiconStringType, UriType, blob::Blob, string::*}; +use crate::{ + IntoStatic, + types::{DataModelType, LexiconStringType, UriType, blob::Blob, string::*}, +}; use bytes::Bytes; use ipld_core::ipld::Ipld; use smol_str::{SmolStr, ToSmolStr}; @@ -101,9 +104,33 @@ impl<'s> Data<'s> { } } +impl IntoStatic for Data<'_> { + type Output = Data<'static>; + fn into_static(self) -> Data<'static> { + match self { + Data::Null => Data::Null, + Data::Boolean(bool) => Data::Boolean(bool), + Data::Integer(int) => Data::Integer(int), + Data::String(string) => Data::String(string.into_static()), + Data::Bytes(bytes) => Data::Bytes(bytes), + Data::Array(array) => Data::Array(array.into_static()), + Data::Object(object) => Data::Object(object.into_static()), + Data::CidLink(cid) => Data::CidLink(cid.into_static()), + Data::Blob(blob) => Data::Blob(blob.into_static()), + } + } +} + #[derive(Debug, Clone, PartialEq, Eq)] pub struct Array<'s>(pub Vec>); +impl IntoStatic for Array<'_> { + type Output = Array<'static>; + fn into_static(self) -> Array<'static> { + Array(self.0.into_static()) + } +} + impl<'s> Array<'s> { pub fn from_json(json: &'s Vec) -> Result { let mut array = Vec::with_capacity(json.len()); @@ -124,6 +151,13 @@ impl<'s> Array<'s> { #[derive(Debug, Clone, PartialEq, Eq)] pub struct Object<'s>(pub BTreeMap>); +impl IntoStatic for Object<'_> { + type Output = Object<'static>; + fn into_static(self) -> Object<'static> { + Object(self.0.into_static()) + } +} + impl<'s> Object<'s> { pub fn from_json( json: &'s serde_json::Map, diff --git a/crates/jacquard-common/src/types/xrpc.rs b/crates/jacquard-common/src/types/xrpc.rs index d7ce5bf52..223a15494 100644 --- a/crates/jacquard-common/src/types/xrpc.rs +++ b/crates/jacquard-common/src/types/xrpc.rs @@ -1,7 +1,9 @@ +use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; use std::error::Error; use std::fmt::{self, Debug}; +use crate::IntoStatic; use crate::types::value::Data; /// XRPC method type @@ -47,20 +49,28 @@ pub trait XrpcRequest: Serialize { const OUTPUT_ENCODING: &'static str; /// Response output type - type Output<'de>: Deserialize<'de>; + type Output<'de>: Deserialize<'de> + IntoStatic; /// Error type for this request - type Err<'de>: Error; + type Err<'de>: Error + Deserialize<'de> + IntoStatic; } /// Error type for XRPC endpoints that don't define any errors -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct GenericError(Data<'static>); +#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] +#[serde(bound(deserialize = "'de: 'a"))] +pub struct GenericError<'a>(Data<'a>); -impl fmt::Display for GenericError { +impl fmt::Display for GenericError<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { self.0.fmt(f) } } -impl Error for GenericError {} +impl Error for GenericError<'_> {} + +impl IntoStatic for GenericError<'_> { + type Output = GenericError<'static>; + fn into_static(self) -> Self::Output { + GenericError(self.0.into_static()) + } +} diff --git a/crates/jacquard-derive/src/lib.rs b/crates/jacquard-derive/src/lib.rs index c9726086c..d92df33fe 100644 --- a/crates/jacquard-derive/src/lib.rs +++ b/crates/jacquard-derive/src/lib.rs @@ -103,8 +103,8 @@ pub fn open_union(_attr: TokenStream, item: TokenStream) -> TokenStream { match &mut input.data { Data::Enum(data_enum) => { - // Check if Other variant already exists - let has_other = data_enum.variants.iter().any(|v| v.ident == "Other"); + // Check if Unknown variant already exists + let has_other = data_enum.variants.iter().any(|v| v.ident == "Unknown"); if !has_other { // Determine the lifetime parameter to use @@ -114,7 +114,7 @@ pub fn open_union(_attr: TokenStream, item: TokenStream) -> TokenStream { quote! { 'static } }; - // Add the Other variant + // Add the Unknown variant let new_variant: syn::Variant = syn::parse_quote! { #[serde(untagged)] Unknown(::jacquard_common::types::value::Data<#lifetime>) diff --git a/crates/jacquard-lexicon/Cargo.toml b/crates/jacquard-lexicon/Cargo.toml index 65984f778..84e191c81 100644 --- a/crates/jacquard-lexicon/Cargo.toml +++ b/crates/jacquard-lexicon/Cargo.toml @@ -20,7 +20,7 @@ clap = { workspace = true } heck = "0.5.0" itertools = "0.14.0" jacquard-common = { version = "0.1.0", path = "../jacquard-common" } -miette = "7.6.0" +miette = { version = "7.6.0", features = ["fancy"] } prettyplease = "0.2.37" proc-macro2 = "1.0.101" quote = "1.0.41" diff --git a/crates/jacquard-lexicon/src/codegen.rs b/crates/jacquard-lexicon/src/codegen.rs index 68df8bf45..05b1a08c4 100644 --- a/crates/jacquard-lexicon/src/codegen.rs +++ b/crates/jacquard-lexicon/src/codegen.rs @@ -188,10 +188,16 @@ impl<'c> CodeGenerator<'c> { } }; + // Generate IntoStatic impl + let field_names: Vec<&str> = obj.properties.keys().map(|k| k.as_str()).collect(); + let into_static_impl = + self.generate_into_static_for_struct(&type_name, &field_names, true, true); + Ok(quote! { #struct_def #(#unions)* #collection_impl + #into_static_impl }) } } @@ -233,9 +239,15 @@ impl<'c> CodeGenerator<'c> { } } + // Generate IntoStatic impl + let field_names: Vec<&str> = obj.properties.keys().map(|k| k.as_str()).collect(); + let into_static_impl = + self.generate_into_static_for_struct(&type_name, &field_names, true, true); + Ok(quote! { #struct_def #(#unions)* + #into_static_impl }) } @@ -607,9 +619,13 @@ impl<'c> CodeGenerator<'c> { let type_base = self.def_to_type_name(nsid, def_name); let mut output = Vec::new(); - let params_has_lifetime = query.parameters.as_ref() + let params_has_lifetime = query + .parameters + .as_ref() .map(|p| match p { - crate::lexicon::LexXrpcQueryParameter::Params(params) => self.params_need_lifetime(params), + crate::lexicon::LexXrpcQueryParameter::Params(params) => { + self.params_need_lifetime(params) + } }) .unwrap_or(false); let has_params = query.parameters.is_some(); @@ -632,7 +648,9 @@ impl<'c> CodeGenerator<'c> { } // Generate XrpcRequest impl - let output_encoding = query.output.as_ref() + let output_encoding = query + .output + .as_ref() .map(|o| o.encoding.as_ref()) .unwrap_or("application/json"); let xrpc_impl = self.generate_xrpc_request_impl( @@ -689,10 +707,14 @@ impl<'c> CodeGenerator<'c> { } // Generate XrpcRequest impl - let input_encoding = proc.input.as_ref() + let input_encoding = proc + .input + .as_ref() .map(|i| i.encoding.as_ref()) .unwrap_or("application/json"); - let output_encoding = proc.output.as_ref() + let output_encoding = proc + .output + .as_ref() .map(|o| o.encoding.as_ref()) .unwrap_or("application/json"); let xrpc_impl = self.generate_xrpc_request_impl( @@ -790,6 +812,31 @@ impl<'c> CodeGenerator<'c> { let doc = self.generate_doc_comment(union.description.as_ref()); + // Generate IntoStatic impl for the enum + let variant_info: Vec<(String, EnumVariantKind)> = union + .refs + .iter() + .map(|ref_str| { + let ref_def = if let Some((_, fragment)) = ref_str.split_once('#') { + fragment + } else { + "main" + }; + let variant_name = if ref_def == "main" { + ref_str.split('.').last().unwrap().to_pascal_case() + } else { + ref_def.to_pascal_case() + }; + (variant_name, EnumVariantKind::Tuple) + }) + .collect(); + let into_static_impl = self.generate_into_static_for_enum( + &enum_name, + &variant_info, + true, + true, // open union + ); + Ok(quote! { #doc #[jacquard_derive::open_union] @@ -799,6 +846,8 @@ impl<'c> CodeGenerator<'c> { pub enum #enum_ident<'a> { #(#variants,)* } + + #into_static_impl }) } LexXrpcSubscriptionMessageSchema::Object(obj) => { @@ -834,9 +883,15 @@ impl<'c> CodeGenerator<'c> { } } + // Generate IntoStatic impl + let field_names: Vec<&str> = obj.properties.keys().map(|k| k.as_str()).collect(); + let into_static_impl = + self.generate_into_static_for_struct(&struct_name, &field_names, true, true); + Ok(quote! { #struct_def #(#unions)* + #into_static_impl }) } LexXrpcSubscriptionMessageSchema::Ref(ref_type) => { @@ -1181,63 +1236,36 @@ impl<'c> CodeGenerator<'c> { ident: &syn::Ident, p: &crate::lexicon::LexXrpcParameters<'static>, ) -> Result { - let required = p.required.as_ref().map(|r| r.as_slice()).unwrap_or(&[]); let mut fields = Vec::new(); - let mut default_fields = Vec::new(); + let mut default_fns = Vec::new(); for (field_name, field_type) in &p.properties { let is_required = required.contains(field_name); - let field_tokens = - self.generate_param_field("", field_name, field_type, is_required)?; + let (field_tokens, default_fn) = + self.generate_param_field_with_default("", field_name, field_type, is_required)?; fields.push(field_tokens); - - // Track field defaults - let field_ident = make_ident(&field_name.to_snake_case()); - let default_value = self.get_param_default_value(field_type, is_required); - default_fields.push((field_ident, default_value)); + if let Some(fn_def) = default_fn { + default_fns.push(fn_def); + } } let doc = self.generate_doc_comment(p.description.as_ref()); let needs_lifetime = self.params_need_lifetime(p); - // Check if we should generate Default impl - let has_any_defaults = default_fields.iter().any(|(_, default)| default.is_some()); - - let derives = if has_any_defaults { - quote! { #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, Default)] } - } else { - quote! { #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] } - }; - - let default_impl = if has_any_defaults { - let field_inits: Vec<_> = default_fields.iter().map(|(field_ident, default_value)| { - if let Some(value) = default_value { - quote! { #field_ident: #value } - } else { - quote! { #field_ident: Default::default() } - } - }).collect(); + let derives = + quote! { #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] }; - if needs_lifetime { - quote! { - impl Default for #ident<'_> { - fn default() -> Self { - Self { - #(#field_inits,)* - } - } - } - } - } else { - quote! {} // Default derive handles this - } - } else { - quote! {} - }; + // Generate IntoStatic impl + let field_names: Vec<&str> = p.properties.keys().map(|k| k.as_str()).collect(); + let type_name = ident.to_string(); + let into_static_impl = + self.generate_into_static_for_struct(&type_name, &field_names, needs_lifetime, false); if needs_lifetime { Ok(quote! { + #(#default_fns)* + #doc #derives #[serde(rename_all = "camelCase")] @@ -1245,44 +1273,147 @@ impl<'c> CodeGenerator<'c> { #(#fields)* } - #default_impl + #into_static_impl }) } else { Ok(quote! { + #(#default_fns)* + #doc #derives #[serde(rename_all = "camelCase")] pub struct #ident { #(#fields)* } + + #into_static_impl }) } } - /// Get default value for a param field - fn get_param_default_value( + /// Generate param field with serde default if present + /// Returns (field_tokens, optional_default_function) + fn generate_param_field_with_default( &self, + nsid: &str, + field_name: &str, field_type: &crate::lexicon::LexXrpcParametersProperty<'static>, is_required: bool, - ) -> Option { + ) -> Result<(TokenStream, Option)> { use crate::lexicon::LexXrpcParametersProperty; + use heck::ToSnakeCase; + + // Get base field + let base_field = self.generate_param_field(nsid, field_name, field_type, is_required)?; + + // Generate default function and attribute for required fields with defaults + // For optional fields, just add doc comments + let (doc_comment, serde_attr, default_fn) = if is_required { + match field_type { + LexXrpcParametersProperty::Boolean(b) if b.default.is_some() => { + let v = b.default.unwrap(); + let fn_name = format!("_default_{}", field_name.to_snake_case()); + let fn_ident = syn::Ident::new(&fn_name, proc_macro2::Span::call_site()); + ( + Some(format!("Defaults to `{}`", v)), + Some(quote! { #[serde(default = #fn_name)] }), + Some(quote! { + fn #fn_ident() -> bool { #v } + }), + ) + } + LexXrpcParametersProperty::Integer(i) if i.default.is_some() => { + let v = i.default.unwrap(); + let fn_name = format!("_default_{}", field_name.to_snake_case()); + let fn_ident = syn::Ident::new(&fn_name, proc_macro2::Span::call_site()); + ( + Some(format!("Defaults to `{}`", v)), + Some(quote! { #[serde(default = #fn_name)] }), + Some(quote! { + fn #fn_ident() -> i64 { #v } + }), + ) + } + LexXrpcParametersProperty::String(s) if s.default.is_some() => { + let v = s.default.as_ref().unwrap().as_ref(); + let fn_name = format!("_default_{}", field_name.to_snake_case()); + let fn_ident = syn::Ident::new(&fn_name, proc_macro2::Span::call_site()); + ( + Some(format!("Defaults to `\"{}\"`", v)), + Some(quote! { #[serde(default = #fn_name)] }), + Some(quote! { + fn #fn_ident() -> jacquard_common::CowStr<'static> { + jacquard_common::CowStr::from(#v) + } + }), + ) + } + _ => (None, None, None), + } + } else { + // Optional fields - just doc comments, no serde defaults + let doc = match field_type { + LexXrpcParametersProperty::Integer(i) => { + let mut parts = Vec::new(); + if let Some(def) = i.default { + parts.push(format!("default: {}", def)); + } + if let Some(min) = i.minimum { + parts.push(format!("min: {}", min)); + } + if let Some(max) = i.maximum { + parts.push(format!("max: {}", max)); + } + if !parts.is_empty() { + Some(format!("({})", parts.join(", "))) + } else { + None + } + } + LexXrpcParametersProperty::String(s) => { + let mut parts = Vec::new(); + if let Some(def) = s.default.as_ref() { + parts.push(format!("default: \"{}\"", def.as_ref())); + } + if let Some(min) = s.min_length { + parts.push(format!("min length: {}", min)); + } + if let Some(max) = s.max_length { + parts.push(format!("max length: {}", max)); + } + if !parts.is_empty() { + Some(format!("({})", parts.join(", "))) + } else { + None + } + } + LexXrpcParametersProperty::Boolean(b) => { + b.default.map(|v| format!("(default: {})", v)) + } + _ => None, + }; + (doc, None, None) + }; - let default_opt = match field_type { - LexXrpcParametersProperty::Boolean(b) => b.default.map(|v| quote! { #v }), - LexXrpcParametersProperty::Integer(i) => i.default.map(|v| quote! { #v }), - LexXrpcParametersProperty::String(s) => s.default.as_ref().map(|v| { - let s = v.as_ref(); - quote! { jacquard_common::CowStr::from(#s) } - }), - LexXrpcParametersProperty::Unknown(_) | LexXrpcParametersProperty::Array(_) => None, + let doc = doc_comment.as_ref().map(|d| quote! { #[doc = #d] }); + let field_with_attrs = match (doc, serde_attr) { + (Some(doc), Some(attr)) => quote! { + #doc + #attr + #base_field + }, + (Some(doc), None) => quote! { + #doc + #base_field + }, + (None, Some(attr)) => quote! { + #attr + #base_field + }, + (None, None) => base_field, }; - if is_required { - default_opt - } else { - // Optional fields: wrap in Some() if there's a default, otherwise None - default_opt.map(|v| quote! { Some(#v) }) - } + Ok((field_with_attrs, default_fn)) } /// Generate input struct from XRPC body @@ -1318,8 +1449,7 @@ impl<'c> CodeGenerator<'c> { if let Some(crate::lexicon::LexXrpcBodySchema::Object(obj)) = &body.schema { for (field_name, field_type) in &obj.properties { if let LexObjectProperty::Union(union) = field_type { - let union_name = - format!("{}Record{}", type_base, field_name.to_pascal_case()); + let union_name = format!("{}Record{}", type_base, field_name.to_pascal_case()); let refs: Vec<_> = union.refs.iter().cloned().collect(); let union_def = self.generate_union(&union_name, &refs, None, union.closed)?; unions.push(union_def); @@ -1327,9 +1457,27 @@ impl<'c> CodeGenerator<'c> { } } + // Generate IntoStatic impl + let field_names: Vec<&str> = match &body.schema { + Some(crate::lexicon::LexXrpcBodySchema::Object(obj)) => { + obj.properties.keys().map(|k| k.as_str()).collect() + } + Some(_) => { + // For Ref or Union schemas, there's just a single flattened field + vec!["value"] + } + None => { + // No schema means no fields, just extra_data + vec![] + } + }; + let into_static_impl = + self.generate_into_static_for_struct(type_base, &field_names, true, true); + Ok(quote! { #struct_def #(#unions)* + #into_static_impl }) } @@ -1376,9 +1524,27 @@ impl<'c> CodeGenerator<'c> { } } + // Generate IntoStatic impl + let field_names: Vec<&str> = match &body.schema { + Some(crate::lexicon::LexXrpcBodySchema::Object(obj)) => { + obj.properties.keys().map(|k| k.as_str()).collect() + } + Some(_) => { + // For Ref or Union schemas, there's just a single flattened field + vec!["value"] + } + None => { + // No schema means no fields, just extra_data + vec![] + } + }; + let into_static_impl = + self.generate_into_static_for_struct(&struct_name, &field_names, true, true); + Ok(quote! { #struct_def #(#unions)* + #into_static_impl }) } @@ -1515,6 +1681,14 @@ impl<'c> CodeGenerator<'c> { }); } + // Generate IntoStatic impl + let variant_info: Vec<(String, EnumVariantKind)> = errors + .iter() + .map(|e| (e.name.to_pascal_case(), EnumVariantKind::Tuple)) + .collect(); + let into_static_impl = + self.generate_into_static_for_enum(&enum_name, &variant_info, true, true); + Ok(quote! { #[jacquard_derive::open_union] #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic)] @@ -1532,6 +1706,8 @@ impl<'c> CodeGenerator<'c> { } } } + + #into_static_impl }) } @@ -1571,6 +1747,21 @@ impl<'c> CodeGenerator<'c> { let doc = self.generate_doc_comment(string.description.as_ref()); + // Generate IntoStatic impl + let variant_info: Vec<(String, EnumVariantKind)> = known_values + .iter() + .map(|value| { + let variant_name = value_to_variant_name(value.as_ref()); + (variant_name, EnumVariantKind::Unit) + }) + .chain(std::iter::once(( + "Other".to_string(), + EnumVariantKind::Tuple, + ))) + .collect(); + let into_static_impl = + self.generate_into_static_for_enum(&type_name, &variant_info, true, false); + Ok(quote! { #doc #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -1633,6 +1824,8 @@ impl<'c> CodeGenerator<'c> { Ok(Self::from(s)) } } + + #into_static_impl }) } @@ -1732,17 +1925,23 @@ impl<'c> CodeGenerator<'c> { has_errors: bool, ) -> Result { let output_type = if has_output { - let output_ident = syn::Ident::new(&format!("{}Output", type_base), proc_macro2::Span::call_site()); + let output_ident = syn::Ident::new( + &format!("{}Output", type_base), + proc_macro2::Span::call_site(), + ); quote! { #output_ident<'de> } } else { quote! { () } }; let error_type = if has_errors { - let error_ident = syn::Ident::new(&format!("{}Error", type_base), proc_macro2::Span::call_site()); + let error_ident = syn::Ident::new( + &format!("{}Error", type_base), + proc_macro2::Span::call_site(), + ); quote! { #error_ident<'de> } } else { - quote! { jacquard_common::types::xrpc::GenericError } + quote! { jacquard_common::types::xrpc::GenericError<'de> } }; if has_params { @@ -1839,6 +2038,33 @@ impl<'c> CodeGenerator<'c> { // Only add open_union if not closed let is_open = closed != Some(true); + // Generate IntoStatic impl + let variant_info: Vec<(String, EnumVariantKind)> = refs + .iter() + .filter_map(|ref_str| { + // Skip unknown refs + if !self.corpus.ref_exists(ref_str.as_ref()) { + return None; + } + + let (ref_nsid, ref_def) = if let Some((nsid, fragment)) = ref_str.split_once('#') { + (nsid, fragment) + } else { + (ref_str.as_ref(), "main") + }; + + let variant_name = if ref_def == "main" { + ref_nsid.split('.').last().unwrap().to_pascal_case() + } else { + let last_segment = ref_nsid.split('.').last().unwrap().to_pascal_case(); + format!("{}{}", last_segment, ref_def.to_pascal_case()) + }; + Some((variant_name, EnumVariantKind::Tuple)) + }) + .collect(); + let into_static_impl = + self.generate_into_static_for_enum(union_name, &variant_info, true, is_open); + if is_open { Ok(quote! { #doc @@ -1849,6 +2075,8 @@ impl<'c> CodeGenerator<'c> { pub enum #enum_ident<'a> { #(#variants,)* } + + #into_static_impl }) } else { Ok(quote! { @@ -1859,9 +2087,150 @@ impl<'c> CodeGenerator<'c> { pub enum #enum_ident<'a> { #(#variants,)* } + + #into_static_impl }) } } + + /// Generate IntoStatic impl for a struct + fn generate_into_static_for_struct( + &self, + type_name: &str, + field_names: &[&str], + has_lifetime: bool, + has_extra_data: bool, + ) -> TokenStream { + let ident = syn::Ident::new(type_name, proc_macro2::Span::call_site()); + + let field_idents: Vec<_> = field_names + .iter() + .map(|name| make_ident(&name.to_snake_case())) + .collect(); + + if has_lifetime { + let field_conversions: Vec<_> = field_idents + .iter() + .map(|field| quote! { #field: self.#field.into_static() }) + .collect(); + + let extra_data_conversion = if has_extra_data { + quote! { extra_data: self.extra_data.into_static(), } + } else { + quote! {} + }; + + quote! { + impl jacquard_common::IntoStatic for #ident<'_> { + type Output = #ident<'static>; + + fn into_static(self) -> Self::Output { + #ident { + #(#field_conversions,)* + #extra_data_conversion + } + } + } + } + } else { + quote! { + impl jacquard_common::IntoStatic for #ident { + type Output = #ident; + + fn into_static(self) -> Self::Output { + self + } + } + } + } + } + + /// Generate IntoStatic impl for an enum + fn generate_into_static_for_enum( + &self, + type_name: &str, + variant_info: &[(String, EnumVariantKind)], + has_lifetime: bool, + is_open: bool, + ) -> TokenStream { + let ident = syn::Ident::new(type_name, proc_macro2::Span::call_site()); + + if has_lifetime { + let variant_conversions: Vec<_> = variant_info + .iter() + .map(|(variant_name, kind)| { + let variant_ident = syn::Ident::new(variant_name, proc_macro2::Span::call_site()); + match kind { + EnumVariantKind::Unit => { + quote! { + #ident::#variant_ident => #ident::#variant_ident + } + } + EnumVariantKind::Tuple => { + quote! { + #ident::#variant_ident(v) => #ident::#variant_ident(v.into_static()) + } + } + EnumVariantKind::Struct(fields) => { + let field_idents: Vec<_> = fields + .iter() + .map(|f| make_ident(&f.to_snake_case())) + .collect(); + let field_conversions: Vec<_> = field_idents + .iter() + .map(|f| quote! { #f: #f.into_static() }) + .collect(); + quote! { + #ident::#variant_ident { #(#field_idents,)* } => #ident::#variant_ident { + #(#field_conversions,)* + } + } + } + } + }) + .collect(); + + let unknown_conversion = if is_open { + quote! { + #ident::Unknown(v) => #ident::Unknown(v.into_static()), + } + } else { + quote! {} + }; + + quote! { + impl jacquard_common::IntoStatic for #ident<'_> { + type Output = #ident<'static>; + + fn into_static(self) -> Self::Output { + match self { + #(#variant_conversions,)* + #unknown_conversion + } + } + } + } + } else { + quote! { + impl jacquard_common::IntoStatic for #ident { + type Output = #ident; + + fn into_static(self) -> Self::Output { + self + } + } + } + } + } +} + +/// Enum variant kind for IntoStatic generation +#[derive(Debug, Clone)] +#[allow(dead_code)] +enum EnumVariantKind { + Unit, + Tuple, + Struct(Vec), } #[cfg(test)] diff --git a/crates/jacquard/Cargo.toml b/crates/jacquard/Cargo.toml index bab6edb16..24c513fc5 100644 --- a/crates/jacquard/Cargo.toml +++ b/crates/jacquard/Cargo.toml @@ -8,8 +8,24 @@ edition.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lib] +name = "jacquard" +path = "src/lib.rs" + +[[bin]] +name = "jacquard" +path = "src/main.rs" + [dependencies] +bytes = "1.10" clap = { workspace = true } +http = "1.3.1" jacquard-api = { version = "0.1.0", path = "../jacquard-api" } jacquard-common = { path = "../jacquard-common" } +miette = "7.6.0" reqwest = { version = "0.12.23", default-features = false, features = ["charset", "http2", "json", "system-proxy", "gzip", "rustls-tls"] } +serde = { version = "1.0", features = ["derive"] } +serde_html_form = "0.2" +serde_ipld_dagcbor = "0.6.4" +serde_json = "1.0" +thiserror = "2.0" diff --git a/crates/jacquard/src/client.rs b/crates/jacquard/src/client.rs new file mode 100644 index 000000000..82b9fade2 --- /dev/null +++ b/crates/jacquard/src/client.rs @@ -0,0 +1,171 @@ +mod error; +mod response; + +use std::fmt::Display; +use std::future::Future; + +pub use error::{ClientError, Result}; +use bytes::Bytes; +use http::{ + HeaderName, HeaderValue, Request, + header::{AUTHORIZATION, CONTENT_TYPE, InvalidHeaderValue}, +}; +pub use response::Response; +use serde::Serialize; + +use jacquard_common::{CowStr, types::xrpc::{XrpcMethod, XrpcRequest}}; + +pub trait HttpClient { + type Error: std::error::Error + Display + Send + Sync + 'static; + /// Send an HTTP request and return the response. + fn send_http( + &self, + request: Request>, + ) -> impl Future>, Self::Error>>; +} +/// XRPC client trait +pub trait XrpcClient: HttpClient { + fn base_uri(&self) -> CowStr<'_>; + #[allow(unused_variables)] + fn authorization_token( + &self, + is_refresh: bool, + ) -> impl Future>> { + async { None } + } + /// Get the `atproto-proxy` header. + fn atproto_proxy_header(&self) -> impl Future> { + async { None } + } + /// Get the `atproto-accept-labelers` header. + fn atproto_accept_labelers_header(&self) -> impl Future>> { + async { None } + } + /// Send an XRPC request and get back a response + fn send(&self, request: R) -> impl Future>> + where + Self: Sized, + { + send_xrpc(self, request) + } +} + +pub(crate) const NSID_REFRESH_SESSION: &str = "com.atproto.server.refreshSession"; + +pub enum AuthorizationToken<'s> { + Bearer(CowStr<'s>), + Dpop(CowStr<'s>), +} + +impl TryFrom> for HeaderValue { + type Error = InvalidHeaderValue; + + fn try_from(token: AuthorizationToken) -> core::result::Result { + HeaderValue::from_str(&match token { + AuthorizationToken::Bearer(t) => format!("Bearer {t}"), + AuthorizationToken::Dpop(t) => format!("DPoP {t}"), + }) + } +} + +/// HTTP headers which can be used in XPRC requests. +pub enum Header { + ContentType, + Authorization, + AtprotoProxy, + AtprotoAcceptLabelers, +} + +impl From
for HeaderName { + fn from(value: Header) -> Self { + match value { + Header::ContentType => CONTENT_TYPE, + Header::Authorization => AUTHORIZATION, + Header::AtprotoProxy => HeaderName::from_static("atproto-proxy"), + Header::AtprotoAcceptLabelers => HeaderName::from_static("atproto-accept-labelers"), + } + } +} + +/// Generic XRPC send implementation that uses HttpClient +async fn send_xrpc(client: &C, request: R) -> Result> +where + R: XrpcRequest, + C: XrpcClient + ?Sized, +{ + // Build URI: base_uri + /xrpc/ + NSID + let mut uri = format!("{}/xrpc/{}", client.base_uri(), R::NSID); + + // Add query parameters for Query methods + if let XrpcMethod::Query = R::METHOD { + if let Ok(qs) = serde_html_form::to_string(&request) { + if !qs.is_empty() { + uri.push('?'); + uri.push_str(&qs); + } + } + } + + // Build HTTP request + let method = match R::METHOD { + XrpcMethod::Query => http::Method::GET, + XrpcMethod::Procedure(_) => http::Method::POST, + }; + + let mut builder = Request::builder().method(method).uri(&uri); + + // Add Content-Type for procedures + if let XrpcMethod::Procedure(encoding) = R::METHOD { + builder = builder.header(Header::ContentType, encoding); + } + + // Add authorization header + let is_refresh = R::NSID == NSID_REFRESH_SESSION; + if let Some(token) = client.authorization_token(is_refresh).await { + let header_value: HeaderValue = token.try_into().map_err(|e| { + error::TransportError::InvalidRequest(format!("Invalid authorization token: {}", e)) + })?; + builder = builder.header(Header::Authorization, header_value); + } + + // Add atproto-proxy header + if let Some(proxy) = client.atproto_proxy_header().await { + builder = builder.header(Header::AtprotoProxy, proxy); + } + + // Add atproto-accept-labelers header + if let Some(labelers) = client.atproto_accept_labelers_header().await { + builder = builder.header(Header::AtprotoAcceptLabelers, labelers.join(", ")); + } + + // Serialize body for procedures + let body = if let XrpcMethod::Procedure(encoding) = R::METHOD { + if encoding == "application/json" { + serde_json::to_vec(&request).map_err(error::EncodeError::Json)? + } else { + // For other encodings, we'd need different serialization + vec![] + } + } else { + vec![] + }; + + let http_request = builder.body(body).expect("Failed to build HTTP request"); + + // Send HTTP request + let http_response = client.send_http(http_request).await.map_err(|e| { + error::TransportError::Other(Box::new(e)) + })?; + + // Check status + if !http_response.status().is_success() { + return Err(ClientError::Http(error::HttpError { + status: http_response.status(), + body: Some(Bytes::from(http_response.body().clone())), + })); + } + + // Convert to Response + let buffer = Bytes::from(http_response.into_body()); + Ok(Response::new(buffer)) +} diff --git a/crates/jacquard/src/client/error.rs b/crates/jacquard/src/client/error.rs new file mode 100644 index 000000000..ee366a21f --- /dev/null +++ b/crates/jacquard/src/client/error.rs @@ -0,0 +1,149 @@ +use bytes::Bytes; + +/// Client error type +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +pub enum ClientError { + /// HTTP transport error + #[error("HTTP transport error: {0}")] + Transport( + #[from] + #[diagnostic_source] + TransportError, + ), + + /// Request serialization failed + #[error("{0}")] + Encode( + #[from] + #[diagnostic_source] + EncodeError, + ), + + /// Response deserialization failed + #[error("{0}")] + Decode( + #[from] + #[diagnostic_source] + DecodeError, + ), + + /// HTTP error response + #[error("HTTP {0}")] + Http( + #[from] + #[diagnostic_source] + HttpError, + ), + + /// Authentication error + #[error("Authentication error: {0}")] + Auth( + #[from] + #[diagnostic_source] + AuthError, + ), +} + +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +pub enum TransportError { + #[error("Connection error: {0}")] + Connect(String), + + #[error("Request timeout")] + Timeout, + + #[error("Invalid request: {0}")] + InvalidRequest(String), + + #[error("Transport error: {0}")] + Other(Box), +} + +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +pub enum EncodeError { + #[error("Failed to serialize query: {0}")] + Query( + #[from] + #[source] + serde_html_form::ser::Error, + ), + #[error("Failed to serialize JSON: {0}")] + Json( + #[from] + #[source] + serde_json::Error, + ), +} + +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +pub enum DecodeError { + #[error("Failed to deserialize JSON: {0}")] + Json( + #[from] + #[source] + serde_json::Error, + ), + #[error("Failed to deserialize CBOR: {0}")] + CborLocal( + #[from] + #[source] + serde_ipld_dagcbor::DecodeError, + ), + #[error("Failed to deserialize CBOR: {0}")] + CborRemote( + #[from] + #[source] + serde_ipld_dagcbor::DecodeError, + ), +} + +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +pub struct HttpError { + pub status: http::StatusCode, + pub body: Option, +} + +impl std::fmt::Display for HttpError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "HTTP {}", self.status)?; + if let Some(body) = &self.body { + if let Ok(s) = std::str::from_utf8(body) { + write!(f, ":\n{}", s)?; + } + } + Ok(()) + } +} + +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +pub enum AuthError { + #[error("Access token expired")] + TokenExpired, + + #[error("Invalid access token")] + InvalidToken, + + #[error("Token refresh failed")] + RefreshFailed, + + #[error("No authentication provided")] + NotAuthenticated, + #[error("Authentication error: {0:?}")] + Other(http::HeaderValue), +} + +pub type Result = std::result::Result; + +impl From for TransportError { + fn from(e: reqwest::Error) -> Self { + if e.is_timeout() { + Self::Timeout + } else if e.is_connect() { + Self::Connect(e.to_string()) + } else if e.is_builder() || e.is_request() { + Self::InvalidRequest(e.to_string()) + } else { + Self::Other(Box::new(e)) + } + } +} diff --git a/crates/jacquard/src/client/response.rs b/crates/jacquard/src/client/response.rs new file mode 100644 index 000000000..363078112 --- /dev/null +++ b/crates/jacquard/src/client/response.rs @@ -0,0 +1,93 @@ +use bytes::Bytes; +use jacquard_common::IntoStatic; +use jacquard_common::types::xrpc::XrpcRequest; +use std::marker::PhantomData; + +/// XRPC response wrapper that owns the response buffer +/// +/// Allows borrowing from the buffer when parsing to avoid unnecessary allocations. +pub struct Response { + buffer: Bytes, + _marker: PhantomData, +} + +impl Response { + /// Create a new response from a buffer + pub fn new(buffer: Bytes) -> Self { + Self { + buffer, + _marker: PhantomData, + } + } + + /// Parse the response, borrowing from the internal buffer + pub fn parse(&self) -> Result, XrpcError>> { + // Use a helper to make lifetime inference work + fn parse_output<'b, R: XrpcRequest>( + buffer: &'b [u8], + ) -> Result, serde_json::Error> { + serde_json::from_slice(buffer) + } + + fn parse_error<'b, R: XrpcRequest>( + buffer: &'b [u8], + ) -> Result, serde_json::Error> { + serde_json::from_slice(buffer) + } + + let output = parse_output::(&self.buffer); + if let Ok(output) = output { + Ok(output) + } else { + // Try to parse as error + match parse_error::(&self.buffer) { + Ok(error) => Err(XrpcError::Xrpc(error)), + Err(e) => Err(XrpcError::Decode(e)), + } + } + } + + /// Parse the response into an owned output + pub fn into_output(self) -> Result, XrpcError>> + where + for<'a> R::Output<'a>: IntoStatic>, + for<'a> R::Err<'a>: IntoStatic>, + { + // Use a helper to make lifetime inference work + fn parse_output<'b, R: XrpcRequest>( + buffer: &'b [u8], + ) -> Result, serde_json::Error> { + serde_json::from_slice(buffer) + } + + fn parse_error<'b, R: XrpcRequest>( + buffer: &'b [u8], + ) -> Result, serde_json::Error> { + serde_json::from_slice(buffer) + } + + let output = parse_output::(&self.buffer); + if let Ok(output) = output { + Ok(output.into_static()) + } else { + // Try to parse as error + match parse_error::(&self.buffer) { + Ok(error) => Err(XrpcError::Xrpc(error.into_static())), + Err(e) => Err(XrpcError::Decode(e)), + } + } + } + + /// Get the raw buffer + pub fn buffer(&self) -> &Bytes { + &self.buffer + } +} + +#[derive(Debug, thiserror::Error, miette::Diagnostic)] +pub enum XrpcError { + #[error("XRPC error: {0}")] + Xrpc(E), + #[error("Failed to decode response: {0}")] + Decode(#[from] serde_json::Error), +} diff --git a/crates/jacquard/src/lib.rs b/crates/jacquard/src/lib.rs new file mode 100644 index 000000000..2ddbd03d2 --- /dev/null +++ b/crates/jacquard/src/lib.rs @@ -0,0 +1,4 @@ +pub mod client; + +// Re-export common types +pub use jacquard_common::*; -- 2.51.2