From 2098f49088e751b5f6e3ec452ed50bc90ccaafdb Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Tue, 25 Aug 2026 12:07:21 -0400 Subject: [PATCH 1/2] chore(api): consume the published contract packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FlipcashAPI vendored a copy of both proto sets and their generated Swift. It now depends on code-payments/ocp-client-protocol and code-payments/flipcash2-client-protocol at 0.1.0 and re-exports them, so the contract is generated in one place instead of once per app. Android consumes the Kotlin half of the same two packages. Exports.swift uses @_exported so `import FlipcashAPI` keeps working: none of the 109 importers change, and no target gains a package dependency, because the app already reaches FlipcashAPI transitively through FlipcashCore. The released Swift is byte-identical to what was committed here, with one filename difference: Core's messaging service shipped as flipcash_messaging_v1_* because the local generator renamed it to dodge a basename collision in the merged module. The two packages are separate modules, so the collision is gone and the rename with it — the Swift types (Flipcash_Messaging_V1_* vs Ocp_Messaging_V1_*) never differed. grpc-swift-2 and grpc-swift-protobuf drop out of this manifest; they arrive transitively from the packages, which pin them. --- .../xcshareddata/swiftpm/Package.resolved | 18 + FlipcashAPI/Package.swift | 14 +- ...unt_v1_flipcash_account_service.grpc.swift | 605 -- ...count_v1_flipcash_account_service.pb.swift | 1212 --- ...tivity_v1_activity_feed_service.grpc.swift | 469 -- ...activity_v1_activity_feed_service.pb.swift | 501 -- .../Core/Generated/activity_v1_model.pb.swift | 1209 --- .../blob_v1_blob_storage_service.grpc.swift | 671 -- .../blob_v1_blob_storage_service.pb.swift | 796 -- .../Core/Generated/blob_v1_model.pb.swift | 1454 ---- .../blocklist_v1_blocklist_service.grpc.swift | 617 -- .../blocklist_v1_blocklist_service.pb.swift | 694 -- .../Generated/blocklist_v1_model.pb.swift | 98 - .../Generated/chat_v1_chat_service.grpc.swift | 417 - .../Generated/chat_v1_chat_service.pb.swift | 415 - .../Core/Generated/chat_v1_model.pb.swift | 569 -- .../Core/Generated/common_v1_common.pb.swift | 1386 --- ...contact_v1_contact_list_service.grpc.swift | 634 -- .../contact_v1_contact_list_service.pb.swift | 741 -- .../Core/Generated/contact_v1_model.pb.swift | 113 - ...l_v1_email_verification_service.grpc.swift | 477 -- ...ail_v1_email_verification_service.pb.swift | 540 -- .../Core/Generated/email_v1_model.pb.swift | 68 - ...vent_v1_event_streaming_service.grpc.swift | 328 - .../event_v1_event_streaming_service.pb.swift | 542 -- .../Core/Generated/event_v1_model.pb.swift | 786 -- ..._messaging_v1_messaging_service.grpc.swift | 1947 ----- ...sh_messaging_v1_messaging_service.pb.swift | 2742 ------ .../Generated/iap_v1_iap_service.grpc.swift | 201 - .../Generated/iap_v1_iap_service.pb.swift | 309 - .../Core/Generated/intent_v1_model.pb.swift | 370 - .../Generated/messaging_v1_model.pb.swift | 2160 ----- .../Generated/moderation_v1_model.pb.swift | 196 - ...oderation_v1_moderation_service.grpc.swift | 333 - .../moderation_v1_moderation_service.pb.swift | 394 - .../Core/Generated/phone_v1_model.pb.swift | 68 - ...e_v1_phone_verification_service.grpc.swift | 609 -- ...one_v1_phone_verification_service.pb.swift | 702 -- .../Core/Generated/profile_v1_model.pb.swift | 473 -- .../profile_v1_profile_service.grpc.swift | 993 --- .../profile_v1_profile_service.pb.swift | 1396 --- .../Core/Generated/push_v1_model.pb.swift | 432 - .../Generated/push_v1_push_service.grpc.swift | 333 - .../Generated/push_v1_push_service.pb.swift | 335 - .../Core/Generated/resolver_v1_model.pb.swift | 227 - .../resolver_v1_resolver_service.grpc.swift | 211 - .../resolver_v1_resolver_service.pb.swift | 200 - .../settings_v1_settings_service.grpc.swift | 185 - .../settings_v1_settings_service.pb.swift | 200 - .../Generated/thirdparty_v1_model.pb.swift | 154 - ...irdparty_v1_third_party_service.grpc.swift | 201 - ...thirdparty_v1_third_party_service.pb.swift | 232 - .../account/v1/flipcash_account_service.proto | 184 - .../activity/v1/activity_feed_service.proto | 88 - .../Core/proto/activity/v1/model.proto | 158 - .../proto/blob/v1/blob_storage_service.proto | 152 - .../Core/proto/blob/v1/model.proto | 326 - .../blocklist/v1/blocklist_service.proto | 116 - .../Core/proto/blocklist/v1/model.proto | 20 - .../Core/proto/chat/v1/chat_service.proto | 106 - .../Core/proto/chat/v1/model.proto | 98 - .../Core/proto/common/v1/common.proto | 235 - .../contact/v1/contact_list_service.proto | 134 - .../Core/proto/contact/v1/model.proto | 22 - .../email/v1/email_verification_service.proto | 95 - .../Core/proto/email/v1/model.proto | 16 - .../event/v1/event_streaming_service.proto | 69 - .../Core/proto/event/v1/model.proto | 132 - .../Core/proto/iap/v1/iap_service.proto | 57 - .../Core/proto/intent/v1/model.proto | 50 - .../messaging/v1/messaging_service.proto | 484 -- .../Core/proto/messaging/v1/model.proto | 449 - .../Core/proto/moderation/v1/model.proto | 38 - .../moderation/v1/moderation_service.proto | 75 - .../Core/proto/phone/v1/model.proto | 16 - .../phone/v1/phone_verification_service.proto | 116 - .../Core/proto/profile/v1/model.proto | 119 - .../proto/profile/v1/profile_service.proto | 215 - .../Core/proto/push/v1/model.proto | 79 - .../Core/proto/push/v1/push_service.proto | 53 - .../Core/proto/resolver/v1/model.proto | 32 - .../proto/resolver/v1/resolver_service.proto | 36 - .../proto/settings/v1/settings_service.proto | 34 - .../Core/proto/thirdparty/v1/model.proto | 30 - .../thirdparty/v1/third_party_service.proto | 51 - .../Core/proto/validate/validate.proto | 863 -- .../Core/proto_deps/validate/validate.proto | 863 -- FlipcashAPI/Sources/FlipcashAPI/Exports.swift | 12 + .../account_v1_ocp_account_service.grpc.swift | 345 - .../account_v1_ocp_account_service.pb.swift | 1062 --- .../Generated/common_v1_model.pb.swift | 834 -- ...urrency_v1_ocp_currency_service.grpc.swift | 1114 --- .../currency_v1_ocp_currency_service.pb.swift | 3558 -------- ...saging_v1_ocp_messaging_service.grpc.swift | 910 -- ...essaging_v1_ocp_messaging_service.pb.swift | 1336 --- ...tion_v1_ocp_transaction_service.grpc.swift | 1454 ---- ...action_v1_ocp_transaction_service.pb.swift | 7500 ----------------- .../account/v1/ocp_account_service.proto | 215 - .../Payments/proto/common/v1/model.proto | 143 - .../currency/v1/ocp_currency_service.proto | 594 -- .../messaging/v1/ocp_messaging_service.proto | 246 - .../v1/ocp_transaction_service.proto | 1433 ---- .../Payments/proto/validate/validate.proto | 863 -- .../proto_deps/validate/validate.proto | 863 -- Scripts/generate | 106 - Scripts/install-grpc-swift-2-plugin.sh | 49 - Scripts/pull_protos | 56 - Scripts/run | 110 - 108 files changed, 34 insertions(+), 59357 deletions(-) delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/account_v1_flipcash_account_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/account_v1_flipcash_account_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_activity_feed_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_activity_feed_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_blob_storage_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_blob_storage_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_blocklist_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_blocklist_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_chat_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_chat_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/common_v1_common.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_contact_list_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_contact_list_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_email_verification_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_email_verification_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_event_streaming_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_event_streaming_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/flipcash_messaging_v1_messaging_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/flipcash_messaging_v1_messaging_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/iap_v1_iap_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/iap_v1_iap_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/intent_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/messaging_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_moderation_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_moderation_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_phone_verification_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_phone_verification_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_profile_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_profile_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_push_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_push_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_resolver_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_resolver_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/settings_v1_settings_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/settings_v1_settings_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_third_party_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_third_party_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/account/v1/flipcash_account_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/activity/v1/activity_feed_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/activity/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/blob/v1/blob_storage_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/blob/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/blocklist/v1/blocklist_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/blocklist/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/chat/v1/chat_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/chat/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/common/v1/common.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/contact/v1/contact_list_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/contact/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/email/v1/email_verification_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/email/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/event/v1/event_streaming_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/event/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/iap/v1/iap_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/intent/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/messaging/v1/messaging_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/messaging/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/moderation/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/moderation/v1/moderation_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/phone/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/phone/v1/phone_verification_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/profile/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/profile/v1/profile_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/push/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/push/v1/push_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/resolver/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/resolver/v1/resolver_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/settings/v1/settings_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/thirdparty/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/thirdparty/v1/third_party_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto/validate/validate.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Core/proto_deps/validate/validate.proto create mode 100644 FlipcashAPI/Sources/FlipcashAPI/Exports.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/account_v1_ocp_account_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/account_v1_ocp_account_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/common_v1_model.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/currency_v1_ocp_currency_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/currency_v1_ocp_currency_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/messaging_v1_ocp_messaging_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/messaging_v1_ocp_messaging_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/transaction_v1_ocp_transaction_service.grpc.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/transaction_v1_ocp_transaction_service.pb.swift delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/proto/account/v1/ocp_account_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/proto/common/v1/model.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/proto/currency/v1/ocp_currency_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/proto/messaging/v1/ocp_messaging_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/proto/transaction/v1/ocp_transaction_service.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/proto/validate/validate.proto delete mode 100644 FlipcashAPI/Sources/FlipcashAPI/Payments/proto_deps/validate/validate.proto delete mode 100755 Scripts/generate delete mode 100755 Scripts/install-grpc-swift-2-plugin.sh delete mode 100755 Scripts/pull_protos delete mode 100755 Scripts/run diff --git a/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 41bfcb189..76cf4f875 100644 --- a/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Code.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -81,6 +81,15 @@ "version" : "0.3.1" } }, + { + "identity" : "flipcash2-client-protocol", + "kind" : "remoteSourceControl", + "location" : "https://github.com/code-payments/flipcash2-client-protocol", + "state" : { + "revision" : "73372b30748d8eb36c1a2f5a18ea9c8d1f7c6241", + "version" : "0.1.0" + } + }, { "identity" : "googleappmeasurement", "kind" : "remoteSourceControl", @@ -198,6 +207,15 @@ "version" : "2.30910.0" } }, + { + "identity" : "ocp-client-protocol", + "kind" : "remoteSourceControl", + "location" : "https://github.com/code-payments/ocp-client-protocol", + "state" : { + "revision" : "7ebdcdff462307abd2bb7548010d455e6eca1f3a", + "version" : "0.1.0" + } + }, { "identity" : "phonenumberkit", "kind" : "remoteSourceControl", diff --git a/FlipcashAPI/Package.swift b/FlipcashAPI/Package.swift index 051b4592f..ebadc5f7e 100644 --- a/FlipcashAPI/Package.swift +++ b/FlipcashAPI/Package.swift @@ -15,21 +15,15 @@ let package = Package( ), ], dependencies: [ - .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.4.0"), - .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.0.0"), + .package(url: "https://github.com/code-payments/ocp-client-protocol", exact: "0.1.0"), + .package(url: "https://github.com/code-payments/flipcash2-client-protocol", exact: "0.1.0"), ], targets: [ .target( name: "FlipcashAPI", dependencies: [ - .product(name: "GRPCCore", package: "grpc-swift-2"), - .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), - ], - exclude: [ - "Payments/proto", - "Payments/proto_deps", - "Core/proto", - "Core/proto_deps", + .product(name: "OCPClientProtocol", package: "ocp-client-protocol"), + .product(name: "Flipcash2ClientProtocol", package: "flipcash2-client-protocol"), ] ), ] diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/account_v1_flipcash_account_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/account_v1_flipcash_account_service.grpc.swift deleted file mode 100644 index 2b6ae9cf8..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/account_v1_flipcash_account_service.grpc.swift +++ /dev/null @@ -1,605 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: account/v1/flipcash_account_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.account.v1.Account - -/// Namespace containing generated types for the "flipcash.account.v1.Account" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Account_V1_Account { - /// Service descriptor for the "flipcash.account.v1.Account" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.account.v1.Account") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "Register" metadata. - public enum Register { - /// Request type for "Register". - public typealias Input = Flipcash_Account_V1_RegisterRequest - /// Response type for "Register". - public typealias Output = Flipcash_Account_V1_RegisterResponse - /// Descriptor for "Register". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.account.v1.Account"), - method: "Register" - ) - } - /// Namespace for "Login" metadata. - public enum Login { - /// Request type for "Login". - public typealias Input = Flipcash_Account_V1_LoginRequest - /// Response type for "Login". - public typealias Output = Flipcash_Account_V1_LoginResponse - /// Descriptor for "Login". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.account.v1.Account"), - method: "Login" - ) - } - /// Namespace for "GetUserFlags" metadata. - public enum GetUserFlags { - /// Request type for "GetUserFlags". - public typealias Input = Flipcash_Account_V1_GetUserFlagsRequest - /// Response type for "GetUserFlags". - public typealias Output = Flipcash_Account_V1_GetUserFlagsResponse - /// Descriptor for "GetUserFlags". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.account.v1.Account"), - method: "GetUserFlags" - ) - } - /// Namespace for "GetUnauthenticatedUserFlags" metadata. - public enum GetUnauthenticatedUserFlags { - /// Request type for "GetUnauthenticatedUserFlags". - public typealias Input = Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest - /// Response type for "GetUnauthenticatedUserFlags". - public typealias Output = Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse - /// Descriptor for "GetUnauthenticatedUserFlags". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.account.v1.Account"), - method: "GetUnauthenticatedUserFlags" - ) - } - /// Descriptors for all methods in the "flipcash.account.v1.Account" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - Register.descriptor, - Login.descriptor, - GetUserFlags.descriptor, - GetUnauthenticatedUserFlags.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.account.v1.Account" service. - public static let flipcash_account_v1_Account = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.account.v1.Account") -} - -// MARK: flipcash.account.v1.Account (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Account_V1_Account { - /// Generated client protocol for the "flipcash.account.v1.Account" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "Register" method. - /// - /// > Source IDL Documentation: - /// > - /// > Register registers a new user, bound to the provided PublicKey. - /// > If the PublicKey is already in use, the previous user account is returned. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_RegisterRequest` message. - /// - serializer: A serializer for `Flipcash_Account_V1_RegisterRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Account_V1_RegisterResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func register( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "Login" method. - /// - /// > Source IDL Documentation: - /// > - /// > Login retrieves the UserId (and in the future, potentially other information) - /// > required for 'recovering' an account. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_LoginRequest` message. - /// - serializer: A serializer for `Flipcash_Account_V1_LoginRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Account_V1_LoginResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func login( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetUserFlags" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUserFlags gets user-specific flags. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_GetUserFlagsRequest` message. - /// - serializer: A serializer for `Flipcash_Account_V1_GetUserFlagsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Account_V1_GetUserFlagsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getUserFlags( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetUnauthenticatedUserFlags" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUserFlags gets user flags for unauthenticated users - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest` message. - /// - serializer: A serializer for `Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getUnauthenticatedUserFlags( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.account.v1.Account" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "Register" method. - /// - /// > Source IDL Documentation: - /// > - /// > Register registers a new user, bound to the provided PublicKey. - /// > If the PublicKey is already in use, the previous user account is returned. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_RegisterRequest` message. - /// - serializer: A serializer for `Flipcash_Account_V1_RegisterRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Account_V1_RegisterResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func register( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Account_V1_Account.Method.Register.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Login" method. - /// - /// > Source IDL Documentation: - /// > - /// > Login retrieves the UserId (and in the future, potentially other information) - /// > required for 'recovering' an account. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_LoginRequest` message. - /// - serializer: A serializer for `Flipcash_Account_V1_LoginRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Account_V1_LoginResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func login( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Account_V1_Account.Method.Login.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetUserFlags" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUserFlags gets user-specific flags. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_GetUserFlagsRequest` message. - /// - serializer: A serializer for `Flipcash_Account_V1_GetUserFlagsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Account_V1_GetUserFlagsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUserFlags( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Account_V1_Account.Method.GetUserFlags.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetUnauthenticatedUserFlags" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUserFlags gets user flags for unauthenticated users - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest` message. - /// - serializer: A serializer for `Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUnauthenticatedUserFlags( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Account_V1_Account.Method.GetUnauthenticatedUserFlags.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Account_V1_Account.ClientProtocol { - /// Call the "Register" method. - /// - /// > Source IDL Documentation: - /// > - /// > Register registers a new user, bound to the provided PublicKey. - /// > If the PublicKey is already in use, the previous user account is returned. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_RegisterRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func register( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.register( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Login" method. - /// - /// > Source IDL Documentation: - /// > - /// > Login retrieves the UserId (and in the future, potentially other information) - /// > required for 'recovering' an account. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_LoginRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func login( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.login( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetUserFlags" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUserFlags gets user-specific flags. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_GetUserFlagsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUserFlags( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getUserFlags( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetUnauthenticatedUserFlags" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUserFlags gets user flags for unauthenticated users - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUnauthenticatedUserFlags( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getUnauthenticatedUserFlags( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Account_V1_Account.ClientProtocol { - /// Call the "Register" method. - /// - /// > Source IDL Documentation: - /// > - /// > Register registers a new user, bound to the provided PublicKey. - /// > If the PublicKey is already in use, the previous user account is returned. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func register( - _ message: Flipcash_Account_V1_RegisterRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.register( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Login" method. - /// - /// > Source IDL Documentation: - /// > - /// > Login retrieves the UserId (and in the future, potentially other information) - /// > required for 'recovering' an account. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func login( - _ message: Flipcash_Account_V1_LoginRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.login( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetUserFlags" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUserFlags gets user-specific flags. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUserFlags( - _ message: Flipcash_Account_V1_GetUserFlagsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getUserFlags( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetUnauthenticatedUserFlags" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUserFlags gets user flags for unauthenticated users - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUnauthenticatedUserFlags( - _ message: Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getUnauthenticatedUserFlags( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/account_v1_flipcash_account_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/account_v1_flipcash_account_service.pb.swift deleted file mode 100644 index 10519db65..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/account_v1_flipcash_account_service.pb.swift +++ /dev/null @@ -1,1212 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: account/v1/flipcash_account_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Account_V1_RegisterRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// PublicKey the public key that is authorized to perform actions on the - /// registered users behalf. - public var publicKey: Flipcash_Common_V1_PublicKey { - get {return _publicKey ?? Flipcash_Common_V1_PublicKey()} - set {_publicKey = newValue} - } - /// Returns true if `publicKey` has been explicitly set. - public var hasPublicKey: Bool {return self._publicKey != nil} - /// Clears the value of `publicKey`. Subsequent reads from it will return its default value. - public mutating func clearPublicKey() {self._publicKey = nil} - - /// Signature of this message (without the signature), using the provided keypair. - public var signature: Flipcash_Common_V1_Signature { - get {return _signature ?? Flipcash_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _publicKey: Flipcash_Common_V1_PublicKey? = nil - fileprivate var _signature: Flipcash_Common_V1_Signature? = nil -} - -public struct Flipcash_Account_V1_RegisterResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Account_V1_RegisterResponse.Result = .ok - - /// The UserId associated with the account. - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case invalidSignature // = 1 - case denied // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .invalidSignature - case 2: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .invalidSignature: return 1 - case .denied: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Account_V1_RegisterResponse.Result] = [ - .ok, - .invalidSignature, - .denied, - ] - - } - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil -} - -public struct Flipcash_Account_V1_LoginRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Timestamp is the timestamp the request was generated - /// - /// The server may reject the request if the timestamp is too far off - /// the current (server) time. This is to prevent replay attacks. - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Account_V1_LoginResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Account_V1_LoginResponse.Result = .ok - - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case invalidTimestamp // = 1 - case denied // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .invalidTimestamp - case 2: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .invalidTimestamp: return 1 - case .denied: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Account_V1_LoginResponse.Result] = [ - .ok, - .invalidTimestamp, - .denied, - ] - - } - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil -} - -public struct Flipcash_Account_V1_GetUserFlagsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var platform: Flipcash_Common_V1_Platform = .unknown - - public var countryCode: Flipcash_Common_V1_CountryCode { - get {return _countryCode ?? Flipcash_Common_V1_CountryCode()} - set {_countryCode = newValue} - } - /// Returns true if `countryCode` has been explicitly set. - public var hasCountryCode: Bool {return self._countryCode != nil} - /// Clears the value of `countryCode`. Subsequent reads from it will return its default value. - public mutating func clearCountryCode() {self._countryCode = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _countryCode: Flipcash_Common_V1_CountryCode? = nil -} - -public struct Flipcash_Account_V1_GetUserFlagsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Account_V1_GetUserFlagsResponse.Result = .ok - - public var userFlags: Flipcash_Account_V1_UserFlags { - get {return _userFlags ?? Flipcash_Account_V1_UserFlags()} - set {_userFlags = newValue} - } - /// Returns true if `userFlags` has been explicitly set. - public var hasUserFlags: Bool {return self._userFlags != nil} - /// Clears the value of `userFlags`. Subsequent reads from it will return its default value. - public mutating func clearUserFlags() {self._userFlags = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Account_V1_GetUserFlagsResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} - - fileprivate var _userFlags: Flipcash_Account_V1_UserFlags? = nil -} - -public struct Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var platform: Flipcash_Common_V1_Platform = .unknown - - public var countryCode: Flipcash_Common_V1_CountryCode { - get {return _countryCode ?? Flipcash_Common_V1_CountryCode()} - set {_countryCode = newValue} - } - /// Returns true if `countryCode` has been explicitly set. - public var hasCountryCode: Bool {return self._countryCode != nil} - /// Clears the value of `countryCode`. Subsequent reads from it will return its default value. - public mutating func clearCountryCode() {self._countryCode = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _countryCode: Flipcash_Common_V1_CountryCode? = nil -} - -public struct Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse.Result = .ok - - public var userFlags: Flipcash_Account_V1_UserFlags { - get {return _userFlags ?? Flipcash_Account_V1_UserFlags()} - set {_userFlags = newValue} - } - /// Returns true if `userFlags` has been explicitly set. - public var hasUserFlags: Bool {return self._userFlags != nil} - /// Clears the value of `userFlags`. Subsequent reads from it will return its default value. - public mutating func clearUserFlags() {self._userFlags = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse.Result] = [ - .ok, - ] - - } - - public init() {} - - fileprivate var _userFlags: Flipcash_Account_V1_UserFlags? = nil -} - -public struct Flipcash_Account_V1_UserFlags: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Is this a fully registered account using IAP for account creation? - public var isRegisteredAccount: Bool { - get {return _storage._isRegisteredAccount} - set {_uniqueStorage()._isRegisteredAccount = newValue} - } - - /// Is this user associated with a Flipcash staff member? - public var isStaff: Bool { - get {return _storage._isStaff} - set {_uniqueStorage()._isStaff = newValue} - } - - /// Does this user require IAP for registration in the account creation flow? - public var requiresIapForRegistration: Bool { - get {return _storage._requiresIapForRegistration} - set {_uniqueStorage()._requiresIapForRegistration = newValue} - } - - /// The set of supported on ramp providers for the user, based on their platform - /// and locale if provided - public var supportedOnRampProviders: [Flipcash_Account_V1_UserFlags.OnRampProvider] { - get {return _storage._supportedOnRampProviders} - set {_uniqueStorage()._supportedOnRampProviders = newValue} - } - - /// The preferred on ramp provider for this user. If the value is UNKNOWN, client - /// should show the list of all supported providers. - public var preferredOnRampProvider: Flipcash_Account_V1_UserFlags.OnRampProvider { - get {return _storage._preferredOnRampProvider} - set {_uniqueStorage()._preferredOnRampProvider = newValue} - } - - /// The minumum build number for this user. If their build number is less than the - /// provided value, client should show a forced upgrade screen. - public var minBuildNumber: UInt32 { - get {return _storage._minBuildNumber} - set {_uniqueStorage()._minBuildNumber = newValue} - } - - /// Exchange data timeout for sequential give/grabs for bills - public var billExchangeDataTimeout: SwiftProtobuf.Google_Protobuf_Duration { - get {return _storage._billExchangeDataTimeout ?? SwiftProtobuf.Google_Protobuf_Duration()} - set {_uniqueStorage()._billExchangeDataTimeout = newValue} - } - /// Returns true if `billExchangeDataTimeout` has been explicitly set. - public var hasBillExchangeDataTimeout: Bool {return _storage._billExchangeDataTimeout != nil} - /// Clears the value of `billExchangeDataTimeout`. Subsequent reads from it will return its default value. - public mutating func clearBillExchangeDataTimeout() {_uniqueStorage()._billExchangeDataTimeout = nil} - - /// USDF amount, in quarks, that must be purchased when launching a new currency - public var newCurrencyPurchaseAmount: UInt64 { - get {return _storage._newCurrencyPurchaseAmount} - set {_uniqueStorage()._newCurrencyPurchaseAmount = newValue} - } - - /// USDF amount, in quarks, that must be paid in a fee when launching a new currency - public var newCurrencyFeeAmount: UInt64 { - get {return _storage._newCurrencyFeeAmount} - set {_uniqueStorage()._newCurrencyFeeAmount = newValue} - } - - /// USDF amount, in quarks, that must be paid when doing a withdrawal - public var withdrawalFeeAmount: UInt64 { - get {return _storage._withdrawalFeeAmount} - set {_uniqueStorage()._withdrawalFeeAmount = newValue} - } - - /// The preferred USDC liquidity pool for external wallet on ramp flows - public var preferredOnRampUsdcLiquidityPool: Flipcash_Account_V1_UserFlags.UsdcLiquidityPool { - get {return _storage._preferredOnRampUsdcLiquidityPool} - set {_uniqueStorage()._preferredOnRampUsdcLiquidityPool = newValue} - } - - /// Whether the send by phone number feature is enabled - public var enablePhoneNumberSend: Bool { - get {return _storage._enablePhoneNumberSend} - set {_uniqueStorage()._enablePhoneNumberSend = newValue} - } - - /// USDF amount, in quarks, that a user must hold to be counted as a holder on the leaderboard - public var minimumHolderValue: UInt64 { - get {return _storage._minimumHolderValue} - set {_uniqueStorage()._minimumHolderValue = newValue} - } - - /// Whether email verification is required for Coinbase purchase flows - public var requireCoinbaseEmailVerification: Bool { - get {return _storage._requireCoinbaseEmailVerification} - set {_uniqueStorage()._requireCoinbaseEmailVerification = newValue} - } - - /// Tip presets for all currencies - public var tipPresets: [Flipcash_Account_V1_TipPresets] { - get {return _storage._tipPresets} - set {_uniqueStorage()._tipPresets = newValue} - } - - /// USDF amount, in quarks, that must be held across all currencies in order to set a username - public var usernameMinBalance: UInt64 { - get {return _storage._usernameMinBalance} - set {_uniqueStorage()._usernameMinBalance = newValue} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OnRampProvider: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknownOnRampProvider // = 0 - case coinbaseVirtual // = 1 - case coinbasePhysicalDebit // = 2 - case coinbasePhysicalCredit // = 3 - case manualDeposit // = 4 - case phantom // = 5 - case solflare // = 6 - case backpack // = 7 - case base // = 8 - case UNRECOGNIZED(Int) - - public init() { - self = .unknownOnRampProvider - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownOnRampProvider - case 1: self = .coinbaseVirtual - case 2: self = .coinbasePhysicalDebit - case 3: self = .coinbasePhysicalCredit - case 4: self = .manualDeposit - case 5: self = .phantom - case 6: self = .solflare - case 7: self = .backpack - case 8: self = .base - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknownOnRampProvider: return 0 - case .coinbaseVirtual: return 1 - case .coinbasePhysicalDebit: return 2 - case .coinbasePhysicalCredit: return 3 - case .manualDeposit: return 4 - case .phantom: return 5 - case .solflare: return 6 - case .backpack: return 7 - case .base: return 8 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Account_V1_UserFlags.OnRampProvider] = [ - .unknownOnRampProvider, - .coinbaseVirtual, - .coinbasePhysicalDebit, - .coinbasePhysicalCredit, - .manualDeposit, - .phantom, - .solflare, - .backpack, - .base, - ] - - } - - public enum UsdcLiquidityPool: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknownUsdcLiquidityPool // = 0 - case flipcash // = 1 - case coinbaseStableSwapper // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknownUsdcLiquidityPool - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownUsdcLiquidityPool - case 1: self = .flipcash - case 2: self = .coinbaseStableSwapper - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknownUsdcLiquidityPool: return 0 - case .flipcash: return 1 - case .coinbaseStableSwapper: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Account_V1_UserFlags.UsdcLiquidityPool] = [ - .unknownUsdcLiquidityPool, - .flipcash, - .coinbaseStableSwapper, - ] - - } - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -public struct Flipcash_Account_V1_TipPresets: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var region: Flipcash_Common_V1_Region { - get {return _region ?? Flipcash_Common_V1_Region()} - set {_region = newValue} - } - /// Returns true if `region` has been explicitly set. - public var hasRegion: Bool {return self._region != nil} - /// Clears the value of `region`. Subsequent reads from it will return its default value. - public mutating func clearRegion() {self._region = nil} - - public var minimum: Double = 0 - - public var low: Double = 0 - - public var medium: Double = 0 - - public var high: Double = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _region: Flipcash_Common_V1_Region? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.account.v1" - -extension Flipcash_Account_V1_RegisterRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RegisterRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}public_key\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._publicKey) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._publicKey { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_RegisterRequest, rhs: Flipcash_Account_V1_RegisterRequest) -> Bool { - if lhs._publicKey != rhs._publicKey {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_RegisterResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RegisterResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}user_id\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_RegisterResponse, rhs: Flipcash_Account_V1_RegisterResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._userID != rhs._userID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_RegisterResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}INVALID_SIGNATURE\0\u{1}DENIED\0") -} - -extension Flipcash_Account_V1_LoginRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LoginRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}timestamp\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_LoginRequest, rhs: Flipcash_Account_V1_LoginRequest) -> Bool { - if lhs._timestamp != rhs._timestamp {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_LoginResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LoginResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}user_id\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_LoginResponse, rhs: Flipcash_Account_V1_LoginResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._userID != rhs._userID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_LoginResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}INVALID_TIMESTAMP\0\u{1}DENIED\0") -} - -extension Flipcash_Account_V1_GetUserFlagsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetUserFlagsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{1}auth\0\u{1}platform\0\u{3}country_code\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 3: try { try decoder.decodeSingularEnumField(value: &self.platform) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._countryCode) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.platform != .unknown { - try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 3) - } - try { if let v = self._countryCode { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_GetUserFlagsRequest, rhs: Flipcash_Account_V1_GetUserFlagsRequest) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.platform != rhs.platform {return false} - if lhs._countryCode != rhs._countryCode {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_GetUserFlagsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetUserFlagsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}user_flags\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._userFlags) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._userFlags { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_GetUserFlagsResponse, rhs: Flipcash_Account_V1_GetUserFlagsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._userFlags != rhs._userFlags {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_GetUserFlagsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetUnauthenticatedUserFlagsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}platform\0\u{3}country_code\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.platform) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._countryCode) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.platform != .unknown { - try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 1) - } - try { if let v = self._countryCode { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest, rhs: Flipcash_Account_V1_GetUnauthenticatedUserFlagsRequest) -> Bool { - if lhs.platform != rhs.platform {return false} - if lhs._countryCode != rhs._countryCode {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetUnauthenticatedUserFlagsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}user_flags\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._userFlags) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._userFlags { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse, rhs: Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._userFlags != rhs._userFlags {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0") -} - -extension Flipcash_Account_V1_UserFlags: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UserFlags" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}is_registered_account\0\u{3}is_staff\0\u{3}requires_iap_for_registration\0\u{3}supported_on_ramp_providers\0\u{3}preferred_on_ramp_provider\0\u{3}min_build_number\0\u{3}bill_exchange_data_timeout\0\u{3}new_currency_purchase_amount\0\u{3}new_currency_fee_amount\0\u{3}withdrawal_fee_amount\0\u{3}preferred_on_ramp_usdc_liquidity_pool\0\u{3}enable_phone_number_send\0\u{3}minimum_holder_value\0\u{3}require_coinbase_email_verification\0\u{3}tip_presets\0\u{3}username_min_balance\0") - - fileprivate class _StorageClass { - var _isRegisteredAccount: Bool = false - var _isStaff: Bool = false - var _requiresIapForRegistration: Bool = false - var _supportedOnRampProviders: [Flipcash_Account_V1_UserFlags.OnRampProvider] = [] - var _preferredOnRampProvider: Flipcash_Account_V1_UserFlags.OnRampProvider = .unknownOnRampProvider - var _minBuildNumber: UInt32 = 0 - var _billExchangeDataTimeout: SwiftProtobuf.Google_Protobuf_Duration? = nil - var _newCurrencyPurchaseAmount: UInt64 = 0 - var _newCurrencyFeeAmount: UInt64 = 0 - var _withdrawalFeeAmount: UInt64 = 0 - var _preferredOnRampUsdcLiquidityPool: Flipcash_Account_V1_UserFlags.UsdcLiquidityPool = .unknownUsdcLiquidityPool - var _enablePhoneNumberSend: Bool = false - var _minimumHolderValue: UInt64 = 0 - var _requireCoinbaseEmailVerification: Bool = false - var _tipPresets: [Flipcash_Account_V1_TipPresets] = [] - var _usernameMinBalance: UInt64 = 0 - - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _isRegisteredAccount = source._isRegisteredAccount - _isStaff = source._isStaff - _requiresIapForRegistration = source._requiresIapForRegistration - _supportedOnRampProviders = source._supportedOnRampProviders - _preferredOnRampProvider = source._preferredOnRampProvider - _minBuildNumber = source._minBuildNumber - _billExchangeDataTimeout = source._billExchangeDataTimeout - _newCurrencyPurchaseAmount = source._newCurrencyPurchaseAmount - _newCurrencyFeeAmount = source._newCurrencyFeeAmount - _withdrawalFeeAmount = source._withdrawalFeeAmount - _preferredOnRampUsdcLiquidityPool = source._preferredOnRampUsdcLiquidityPool - _enablePhoneNumberSend = source._enablePhoneNumberSend - _minimumHolderValue = source._minimumHolderValue - _requireCoinbaseEmailVerification = source._requireCoinbaseEmailVerification - _tipPresets = source._tipPresets - _usernameMinBalance = source._usernameMinBalance - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &_storage._isRegisteredAccount) }() - case 2: try { try decoder.decodeSingularBoolField(value: &_storage._isStaff) }() - case 3: try { try decoder.decodeSingularBoolField(value: &_storage._requiresIapForRegistration) }() - case 4: try { try decoder.decodeRepeatedEnumField(value: &_storage._supportedOnRampProviders) }() - case 5: try { try decoder.decodeSingularEnumField(value: &_storage._preferredOnRampProvider) }() - case 6: try { try decoder.decodeSingularUInt32Field(value: &_storage._minBuildNumber) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._billExchangeDataTimeout) }() - case 8: try { try decoder.decodeSingularUInt64Field(value: &_storage._newCurrencyPurchaseAmount) }() - case 9: try { try decoder.decodeSingularUInt64Field(value: &_storage._newCurrencyFeeAmount) }() - case 10: try { try decoder.decodeSingularUInt64Field(value: &_storage._withdrawalFeeAmount) }() - case 11: try { try decoder.decodeSingularEnumField(value: &_storage._preferredOnRampUsdcLiquidityPool) }() - case 12: try { try decoder.decodeSingularBoolField(value: &_storage._enablePhoneNumberSend) }() - case 13: try { try decoder.decodeSingularUInt64Field(value: &_storage._minimumHolderValue) }() - case 14: try { try decoder.decodeSingularBoolField(value: &_storage._requireCoinbaseEmailVerification) }() - case 15: try { try decoder.decodeRepeatedMessageField(value: &_storage._tipPresets) }() - case 16: try { try decoder.decodeSingularUInt64Field(value: &_storage._usernameMinBalance) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if _storage._isRegisteredAccount != false { - try visitor.visitSingularBoolField(value: _storage._isRegisteredAccount, fieldNumber: 1) - } - if _storage._isStaff != false { - try visitor.visitSingularBoolField(value: _storage._isStaff, fieldNumber: 2) - } - if _storage._requiresIapForRegistration != false { - try visitor.visitSingularBoolField(value: _storage._requiresIapForRegistration, fieldNumber: 3) - } - if !_storage._supportedOnRampProviders.isEmpty { - try visitor.visitPackedEnumField(value: _storage._supportedOnRampProviders, fieldNumber: 4) - } - if _storage._preferredOnRampProvider != .unknownOnRampProvider { - try visitor.visitSingularEnumField(value: _storage._preferredOnRampProvider, fieldNumber: 5) - } - if _storage._minBuildNumber != 0 { - try visitor.visitSingularUInt32Field(value: _storage._minBuildNumber, fieldNumber: 6) - } - try { if let v = _storage._billExchangeDataTimeout { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - if _storage._newCurrencyPurchaseAmount != 0 { - try visitor.visitSingularUInt64Field(value: _storage._newCurrencyPurchaseAmount, fieldNumber: 8) - } - if _storage._newCurrencyFeeAmount != 0 { - try visitor.visitSingularUInt64Field(value: _storage._newCurrencyFeeAmount, fieldNumber: 9) - } - if _storage._withdrawalFeeAmount != 0 { - try visitor.visitSingularUInt64Field(value: _storage._withdrawalFeeAmount, fieldNumber: 10) - } - if _storage._preferredOnRampUsdcLiquidityPool != .unknownUsdcLiquidityPool { - try visitor.visitSingularEnumField(value: _storage._preferredOnRampUsdcLiquidityPool, fieldNumber: 11) - } - if _storage._enablePhoneNumberSend != false { - try visitor.visitSingularBoolField(value: _storage._enablePhoneNumberSend, fieldNumber: 12) - } - if _storage._minimumHolderValue != 0 { - try visitor.visitSingularUInt64Field(value: _storage._minimumHolderValue, fieldNumber: 13) - } - if _storage._requireCoinbaseEmailVerification != false { - try visitor.visitSingularBoolField(value: _storage._requireCoinbaseEmailVerification, fieldNumber: 14) - } - if !_storage._tipPresets.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._tipPresets, fieldNumber: 15) - } - if _storage._usernameMinBalance != 0 { - try visitor.visitSingularUInt64Field(value: _storage._usernameMinBalance, fieldNumber: 16) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_UserFlags, rhs: Flipcash_Account_V1_UserFlags) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._isRegisteredAccount != rhs_storage._isRegisteredAccount {return false} - if _storage._isStaff != rhs_storage._isStaff {return false} - if _storage._requiresIapForRegistration != rhs_storage._requiresIapForRegistration {return false} - if _storage._supportedOnRampProviders != rhs_storage._supportedOnRampProviders {return false} - if _storage._preferredOnRampProvider != rhs_storage._preferredOnRampProvider {return false} - if _storage._minBuildNumber != rhs_storage._minBuildNumber {return false} - if _storage._billExchangeDataTimeout != rhs_storage._billExchangeDataTimeout {return false} - if _storage._newCurrencyPurchaseAmount != rhs_storage._newCurrencyPurchaseAmount {return false} - if _storage._newCurrencyFeeAmount != rhs_storage._newCurrencyFeeAmount {return false} - if _storage._withdrawalFeeAmount != rhs_storage._withdrawalFeeAmount {return false} - if _storage._preferredOnRampUsdcLiquidityPool != rhs_storage._preferredOnRampUsdcLiquidityPool {return false} - if _storage._enablePhoneNumberSend != rhs_storage._enablePhoneNumberSend {return false} - if _storage._minimumHolderValue != rhs_storage._minimumHolderValue {return false} - if _storage._requireCoinbaseEmailVerification != rhs_storage._requireCoinbaseEmailVerification {return false} - if _storage._tipPresets != rhs_storage._tipPresets {return false} - if _storage._usernameMinBalance != rhs_storage._usernameMinBalance {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Account_V1_UserFlags.OnRampProvider: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_ON_RAMP_PROVIDER\0\u{1}COINBASE_VIRTUAL\0\u{1}COINBASE_PHYSICAL_DEBIT\0\u{1}COINBASE_PHYSICAL_CREDIT\0\u{1}MANUAL_DEPOSIT\0\u{1}PHANTOM\0\u{1}SOLFLARE\0\u{1}BACKPACK\0\u{1}BASE\0") -} - -extension Flipcash_Account_V1_UserFlags.UsdcLiquidityPool: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_USDC_LIQUIDITY_POOL\0\u{1}FLIPCASH\0\u{1}COINBASE_STABLE_SWAPPER\0") -} - -extension Flipcash_Account_V1_TipPresets: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TipPresets" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}region\0\u{1}minimum\0\u{1}low\0\u{1}medium\0\u{1}high\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._region) }() - case 2: try { try decoder.decodeSingularDoubleField(value: &self.minimum) }() - case 3: try { try decoder.decodeSingularDoubleField(value: &self.low) }() - case 4: try { try decoder.decodeSingularDoubleField(value: &self.medium) }() - case 5: try { try decoder.decodeSingularDoubleField(value: &self.high) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._region { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.minimum.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.minimum, fieldNumber: 2) - } - if self.low.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.low, fieldNumber: 3) - } - if self.medium.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.medium, fieldNumber: 4) - } - if self.high.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.high, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Account_V1_TipPresets, rhs: Flipcash_Account_V1_TipPresets) -> Bool { - if lhs._region != rhs._region {return false} - if lhs.minimum != rhs.minimum {return false} - if lhs.low != rhs.low {return false} - if lhs.medium != rhs.medium {return false} - if lhs.high != rhs.high {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_activity_feed_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_activity_feed_service.grpc.swift deleted file mode 100644 index 5de8fa2fa..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_activity_feed_service.grpc.swift +++ /dev/null @@ -1,469 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: activity/v1/activity_feed_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.activity.v1.ActivityFeed - -/// Namespace containing generated types for the "flipcash.activity.v1.ActivityFeed" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Activity_V1_ActivityFeed { - /// Service descriptor for the "flipcash.activity.v1.ActivityFeed" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.activity.v1.ActivityFeed") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "GetLatestNotifications" metadata. - public enum GetLatestNotifications { - /// Request type for "GetLatestNotifications". - public typealias Input = Flipcash_Activity_V1_GetLatestNotificationsRequest - /// Response type for "GetLatestNotifications". - public typealias Output = Flipcash_Activity_V1_GetLatestNotificationsResponse - /// Descriptor for "GetLatestNotifications". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.activity.v1.ActivityFeed"), - method: "GetLatestNotifications" - ) - } - /// Namespace for "GetPagedNotifications" metadata. - public enum GetPagedNotifications { - /// Request type for "GetPagedNotifications". - public typealias Input = Flipcash_Activity_V1_GetPagedNotificationsRequest - /// Response type for "GetPagedNotifications". - public typealias Output = Flipcash_Activity_V1_GetPagedNotificationsResponse - /// Descriptor for "GetPagedNotifications". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.activity.v1.ActivityFeed"), - method: "GetPagedNotifications" - ) - } - /// Namespace for "GetBatchNotifications" metadata. - public enum GetBatchNotifications { - /// Request type for "GetBatchNotifications". - public typealias Input = Flipcash_Activity_V1_GetBatchNotificationsRequest - /// Response type for "GetBatchNotifications". - public typealias Output = Flipcash_Activity_V1_GetBatchNotificationsResponse - /// Descriptor for "GetBatchNotifications". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.activity.v1.ActivityFeed"), - method: "GetBatchNotifications" - ) - } - /// Descriptors for all methods in the "flipcash.activity.v1.ActivityFeed" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - GetLatestNotifications.descriptor, - GetPagedNotifications.descriptor, - GetBatchNotifications.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.activity.v1.ActivityFeed" service. - public static let flipcash_activity_v1_ActivityFeed = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.activity.v1.ActivityFeed") -} - -// MARK: flipcash.activity.v1.ActivityFeed (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Activity_V1_ActivityFeed { - /// Generated client protocol for the "flipcash.activity.v1.ActivityFeed" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "GetLatestNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetLatestNotifications gets the latest N notifications in a user's - /// > activity feed. Results will be ordered by descending timestamp. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetLatestNotificationsRequest` message. - /// - serializer: A serializer for `Flipcash_Activity_V1_GetLatestNotificationsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Activity_V1_GetLatestNotificationsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getLatestNotifications( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetPagedNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetPagedNotifications gets all notifications using a paging API. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetPagedNotificationsRequest` message. - /// - serializer: A serializer for `Flipcash_Activity_V1_GetPagedNotificationsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Activity_V1_GetPagedNotificationsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getPagedNotifications( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetBatchNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBatchNotifications gets a batch of notifications by ID. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetBatchNotificationsRequest` message. - /// - serializer: A serializer for `Flipcash_Activity_V1_GetBatchNotificationsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Activity_V1_GetBatchNotificationsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getBatchNotifications( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.activity.v1.ActivityFeed" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "GetLatestNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetLatestNotifications gets the latest N notifications in a user's - /// > activity feed. Results will be ordered by descending timestamp. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetLatestNotificationsRequest` message. - /// - serializer: A serializer for `Flipcash_Activity_V1_GetLatestNotificationsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Activity_V1_GetLatestNotificationsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getLatestNotifications( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Activity_V1_ActivityFeed.Method.GetLatestNotifications.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetPagedNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetPagedNotifications gets all notifications using a paging API. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetPagedNotificationsRequest` message. - /// - serializer: A serializer for `Flipcash_Activity_V1_GetPagedNotificationsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Activity_V1_GetPagedNotificationsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getPagedNotifications( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Activity_V1_ActivityFeed.Method.GetPagedNotifications.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBatchNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBatchNotifications gets a batch of notifications by ID. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetBatchNotificationsRequest` message. - /// - serializer: A serializer for `Flipcash_Activity_V1_GetBatchNotificationsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Activity_V1_GetBatchNotificationsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBatchNotifications( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Activity_V1_ActivityFeed.Method.GetBatchNotifications.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Activity_V1_ActivityFeed.ClientProtocol { - /// Call the "GetLatestNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetLatestNotifications gets the latest N notifications in a user's - /// > activity feed. Results will be ordered by descending timestamp. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetLatestNotificationsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getLatestNotifications( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getLatestNotifications( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetPagedNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetPagedNotifications gets all notifications using a paging API. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetPagedNotificationsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getPagedNotifications( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getPagedNotifications( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBatchNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBatchNotifications gets a batch of notifications by ID. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Activity_V1_GetBatchNotificationsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBatchNotifications( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getBatchNotifications( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Activity_V1_ActivityFeed.ClientProtocol { - /// Call the "GetLatestNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetLatestNotifications gets the latest N notifications in a user's - /// > activity feed. Results will be ordered by descending timestamp. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getLatestNotifications( - _ message: Flipcash_Activity_V1_GetLatestNotificationsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getLatestNotifications( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetPagedNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetPagedNotifications gets all notifications using a paging API. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getPagedNotifications( - _ message: Flipcash_Activity_V1_GetPagedNotificationsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getPagedNotifications( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBatchNotifications" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBatchNotifications gets a batch of notifications by ID. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBatchNotifications( - _ message: Flipcash_Activity_V1_GetBatchNotificationsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getBatchNotifications( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_activity_feed_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_activity_feed_service.pb.swift deleted file mode 100644 index 20edbd043..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_activity_feed_service.pb.swift +++ /dev/null @@ -1,501 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: activity/v1/activity_feed_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Activity_V1_GetLatestNotificationsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The activity feed to fetch notifications from - public var type: Flipcash_Activity_V1_ActivityFeedType = .unknown - - /// Maximum number of notifications to return. If <= 0, the server default is used - public var maxItems: Int32 = 0 - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Activity_V1_GetLatestNotificationsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Activity_V1_GetLatestNotificationsResponse.Result = .ok - - public var notifications: [Flipcash_Activity_V1_Notification] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Activity_V1_GetLatestNotificationsResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -public struct Flipcash_Activity_V1_GetPagedNotificationsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The activity feed to fetch notifications from - public var type: Flipcash_Activity_V1_ActivityFeedType = .unknown - - public var queryOptions: Flipcash_Common_V1_QueryOptions { - get {return _queryOptions ?? Flipcash_Common_V1_QueryOptions()} - set {_queryOptions = newValue} - } - /// Returns true if `queryOptions` has been explicitly set. - public var hasQueryOptions: Bool {return self._queryOptions != nil} - /// Clears the value of `queryOptions`. Subsequent reads from it will return its default value. - public mutating func clearQueryOptions() {self._queryOptions = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _queryOptions: Flipcash_Common_V1_QueryOptions? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Activity_V1_GetPagedNotificationsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Activity_V1_GetPagedNotificationsResponse.Result = .ok - - public var notifications: [Flipcash_Activity_V1_Notification] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Activity_V1_GetPagedNotificationsResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -public struct Flipcash_Activity_V1_GetBatchNotificationsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var ids: [Flipcash_Activity_V1_NotificationId] = [] - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Activity_V1_GetBatchNotificationsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Activity_V1_GetBatchNotificationsResponse.Result = .ok - - public var notifications: [Flipcash_Activity_V1_Notification] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case notFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .notFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Activity_V1_GetBatchNotificationsResponse.Result] = [ - .ok, - .denied, - .notFound, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.activity.v1" - -extension Flipcash_Activity_V1_GetLatestNotificationsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetLatestNotificationsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{3}max_items\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() - case 2: try { try decoder.decodeSingularInt32Field(value: &self.maxItems) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.type != .unknown { - try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) - } - if self.maxItems != 0 { - try visitor.visitSingularInt32Field(value: self.maxItems, fieldNumber: 2) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_GetLatestNotificationsRequest, rhs: Flipcash_Activity_V1_GetLatestNotificationsRequest) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.maxItems != rhs.maxItems {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_GetLatestNotificationsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetLatestNotificationsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}notifications\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.notifications) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.notifications.isEmpty { - try visitor.visitRepeatedMessageField(value: self.notifications, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_GetLatestNotificationsResponse, rhs: Flipcash_Activity_V1_GetLatestNotificationsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.notifications != rhs.notifications {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_GetLatestNotificationsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Activity_V1_GetPagedNotificationsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetPagedNotificationsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{3}query_options\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._queryOptions) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.type != .unknown { - try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) - } - try { if let v = self._queryOptions { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_GetPagedNotificationsRequest, rhs: Flipcash_Activity_V1_GetPagedNotificationsRequest) -> Bool { - if lhs.type != rhs.type {return false} - if lhs._queryOptions != rhs._queryOptions {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_GetPagedNotificationsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetPagedNotificationsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}notifications\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.notifications) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.notifications.isEmpty { - try visitor.visitRepeatedMessageField(value: self.notifications, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_GetPagedNotificationsResponse, rhs: Flipcash_Activity_V1_GetPagedNotificationsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.notifications != rhs.notifications {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_GetPagedNotificationsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Activity_V1_GetBatchNotificationsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetBatchNotificationsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}ids\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.ids) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.ids.isEmpty { - try visitor.visitRepeatedMessageField(value: self.ids, fieldNumber: 1) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_GetBatchNotificationsRequest, rhs: Flipcash_Activity_V1_GetBatchNotificationsRequest) -> Bool { - if lhs.ids != rhs.ids {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_GetBatchNotificationsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetBatchNotificationsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}notifications\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.notifications) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.notifications.isEmpty { - try visitor.visitRepeatedMessageField(value: self.notifications, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_GetBatchNotificationsResponse, rhs: Flipcash_Activity_V1_GetBatchNotificationsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.notifications != rhs.notifications {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_GetBatchNotificationsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}NOT_FOUND\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_model.pb.swift deleted file mode 100644 index 7b204ae7f..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/activity_v1_model.pb.swift +++ /dev/null @@ -1,1209 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: activity/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// ActivityFeedType enables multiple activity feeds, where notifications may be -/// split across different parts of the app -public enum Flipcash_Activity_V1_ActivityFeedType: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// Activity feed displayed under the Balance tab - case transactionHistory // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .transactionHistory - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .transactionHistory: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Activity_V1_ActivityFeedType] = [ - .unknown, - .transactionHistory, - ] - -} - -/// NotificationState determines the mutability of a notification, and whether -/// client should attempt to refetch state. -public enum Flipcash_Activity_V1_NotificationState: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// Notification state will change based on some app action in the future - case pending // = 1 - - /// Notification state will not change - case completed // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .pending - case 2: self = .completed - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .pending: return 1 - case .completed: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Activity_V1_NotificationState] = [ - .unknown, - .pending, - .completed, - ] - -} - -public enum Flipcash_Activity_V1_SwapState: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case pending // = 1 - case succeeded // = 2 - case failed // = 3 - case none // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .pending - case 2: self = .succeeded - case 3: self = .failed - case 4: self = .none - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .pending: return 1 - case .succeeded: return 2 - case .failed: return 3 - case .none: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Activity_V1_SwapState] = [ - .unknown, - .pending, - .succeeded, - .failed, - .none, - ] - -} - -/// The ID of the notification -public struct Flipcash_Activity_V1_NotificationId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Notification is a message that is displayed in an activity feed -public struct Flipcash_Activity_V1_Notification: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The ID of this notification - public var id: Flipcash_Activity_V1_NotificationId { - get {return _storage._id ?? Flipcash_Activity_V1_NotificationId()} - set {_uniqueStorage()._id = newValue} - } - /// Returns true if `id` has been explicitly set. - public var hasID: Bool {return _storage._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - public mutating func clearID() {_uniqueStorage()._id = nil} - - /// The localized title text for the notification - public var localizedText: String { - get {return _storage._localizedText} - set {_uniqueStorage()._localizedText = newValue} - } - - /// If a payment applies, the amount that was paid - /// - /// Note: For multi-mint operations, amounts are carried in additional_metadata - /// (eg. swapped_crypto). - public var paymentAmount: Flipcash_Common_V1_CryptoPaymentAmount { - get {return _storage._paymentAmount ?? Flipcash_Common_V1_CryptoPaymentAmount()} - set {_uniqueStorage()._paymentAmount = newValue} - } - /// Returns true if `paymentAmount` has been explicitly set. - public var hasPaymentAmount: Bool {return _storage._paymentAmount != nil} - /// Clears the value of `paymentAmount`. Subsequent reads from it will return its default value. - public mutating func clearPaymentAmount() {_uniqueStorage()._paymentAmount = nil} - - /// The timestamp of this notification - public var ts: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _storage._ts ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_uniqueStorage()._ts = newValue} - } - /// Returns true if `ts` has been explicitly set. - public var hasTs: Bool {return _storage._ts != nil} - /// Clears the value of `ts`. Subsequent reads from it will return its default value. - public mutating func clearTs() {_uniqueStorage()._ts = nil} - - /// The state of this notification - public var state: Flipcash_Activity_V1_NotificationState { - get {return _storage._state} - set {_uniqueStorage()._state = newValue} - } - - /// Additional metadata for this notification specific to the notification - public var additionalMetadata: OneOf_AdditionalMetadata? { - get {return _storage._additionalMetadata} - set {_uniqueStorage()._additionalMetadata = newValue} - } - - public var directlySentCrypto: Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata { - get { - if case .directlySentCrypto(let v)? = _storage._additionalMetadata {return v} - return Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata() - } - set {_uniqueStorage()._additionalMetadata = .directlySentCrypto(newValue)} - } - - public var receivedCrypto: Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata { - get { - if case .receivedCrypto(let v)? = _storage._additionalMetadata {return v} - return Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata() - } - set {_uniqueStorage()._additionalMetadata = .receivedCrypto(newValue)} - } - - public var withdrewCrypto: Flipcash_Activity_V1_WithdrewCryptoNotificationMetadata { - get { - if case .withdrewCrypto(let v)? = _storage._additionalMetadata {return v} - return Flipcash_Activity_V1_WithdrewCryptoNotificationMetadata() - } - set {_uniqueStorage()._additionalMetadata = .withdrewCrypto(newValue)} - } - - public var indirectlySentCrypto: Flipcash_Activity_V1_IndirectlySentCryptoNotificationMetadata { - get { - if case .indirectlySentCrypto(let v)? = _storage._additionalMetadata {return v} - return Flipcash_Activity_V1_IndirectlySentCryptoNotificationMetadata() - } - set {_uniqueStorage()._additionalMetadata = .indirectlySentCrypto(newValue)} - } - - public var depositedCrypto: Flipcash_Activity_V1_DepositedCryptoNotificationMetadata { - get { - if case .depositedCrypto(let v)? = _storage._additionalMetadata {return v} - return Flipcash_Activity_V1_DepositedCryptoNotificationMetadata() - } - set {_uniqueStorage()._additionalMetadata = .depositedCrypto(newValue)} - } - - /// NOTE: This field was marked as deprecated in the .proto file. - public var boughtCrypto: Flipcash_Activity_V1_BoughtCryptoNotificationMetadata { - get { - if case .boughtCrypto(let v)? = _storage._additionalMetadata {return v} - return Flipcash_Activity_V1_BoughtCryptoNotificationMetadata() - } - set {_uniqueStorage()._additionalMetadata = .boughtCrypto(newValue)} - } - - /// NOTE: This field was marked as deprecated in the .proto file. - public var soldCrypto: Flipcash_Activity_V1_SoldCryptoNotificationMetadata { - get { - if case .soldCrypto(let v)? = _storage._additionalMetadata {return v} - return Flipcash_Activity_V1_SoldCryptoNotificationMetadata() - } - set {_uniqueStorage()._additionalMetadata = .soldCrypto(newValue)} - } - - public var swappedCrypto: Flipcash_Activity_V1_SwappedCryptoNotificationMetadata { - get { - if case .swappedCrypto(let v)? = _storage._additionalMetadata {return v} - return Flipcash_Activity_V1_SwappedCryptoNotificationMetadata() - } - set {_uniqueStorage()._additionalMetadata = .swappedCrypto(newValue)} - } - - /// Ordered substitutions to apply to localized_text - public var textSubstitutions: [Flipcash_Common_V1_Substitution] { - get {return _storage._textSubstitutions} - set {_uniqueStorage()._textSubstitutions = newValue} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Additional metadata for this notification specific to the notification - public enum OneOf_AdditionalMetadata: Equatable, Sendable { - case directlySentCrypto(Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata) - case receivedCrypto(Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata) - case withdrewCrypto(Flipcash_Activity_V1_WithdrewCryptoNotificationMetadata) - case indirectlySentCrypto(Flipcash_Activity_V1_IndirectlySentCryptoNotificationMetadata) - case depositedCrypto(Flipcash_Activity_V1_DepositedCryptoNotificationMetadata) - /// NOTE: This field was marked as deprecated in the .proto file. - case boughtCrypto(Flipcash_Activity_V1_BoughtCryptoNotificationMetadata) - /// NOTE: This field was marked as deprecated in the .proto file. - case soldCrypto(Flipcash_Activity_V1_SoldCryptoNotificationMetadata) - case swappedCrypto(Flipcash_Activity_V1_SwappedCryptoNotificationMetadata) - - } - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -public struct Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var destinationIdentifier: Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata.OneOf_DestinationIdentifier? = nil - - public var phone: Flipcash_Common_V1_PhoneNumber { - get { - if case .phone(let v)? = destinationIdentifier {return v} - return Flipcash_Common_V1_PhoneNumber() - } - set {destinationIdentifier = .phone(newValue)} - } - - public var userID: Flipcash_Common_V1_UserId { - get { - if case .userID(let v)? = destinationIdentifier {return v} - return Flipcash_Common_V1_UserId() - } - set {destinationIdentifier = .userID(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_DestinationIdentifier: Equatable, Sendable { - case phone(Flipcash_Common_V1_PhoneNumber) - case userID(Flipcash_Common_V1_UserId) - - } - - public init() {} -} - -public struct Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var sourceIdentifier: Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata.OneOf_SourceIdentifier? = nil - - public var phone: Flipcash_Common_V1_PhoneNumber { - get { - if case .phone(let v)? = sourceIdentifier {return v} - return Flipcash_Common_V1_PhoneNumber() - } - set {sourceIdentifier = .phone(newValue)} - } - - public var userID: Flipcash_Common_V1_UserId { - get { - if case .userID(let v)? = sourceIdentifier {return v} - return Flipcash_Common_V1_UserId() - } - set {sourceIdentifier = .userID(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_SourceIdentifier: Equatable, Sendable { - case phone(Flipcash_Common_V1_PhoneNumber) - case userID(Flipcash_Common_V1_UserId) - - } - - public init() {} -} - -public struct Flipcash_Activity_V1_WithdrewCryptoNotificationMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Deprecated in favour of swap_metadata - public var swapState: Flipcash_Activity_V1_SwapState = .unknown - - /// When a withdraw is a swap, the metadata for that swap - public var swapMetadata: Flipcash_Activity_V1_SwappedCryptoNotificationMetadata { - get {return _swapMetadata ?? Flipcash_Activity_V1_SwappedCryptoNotificationMetadata()} - set {_swapMetadata = newValue} - } - /// Returns true if `swapMetadata` has been explicitly set. - public var hasSwapMetadata: Bool {return self._swapMetadata != nil} - /// Clears the value of `swapMetadata`. Subsequent reads from it will return its default value. - public mutating func clearSwapMetadata() {self._swapMetadata = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _swapMetadata: Flipcash_Activity_V1_SwappedCryptoNotificationMetadata? = nil -} - -public struct Flipcash_Activity_V1_IndirectlySentCryptoNotificationMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The vault of the gift card account that was created for the cash link - public var vault: Flipcash_Common_V1_PublicKey { - get {return _vault ?? Flipcash_Common_V1_PublicKey()} - set {_vault = newValue} - } - /// Returns true if `vault` has been explicitly set. - public var hasVault: Bool {return self._vault != nil} - /// Clears the value of `vault`. Subsequent reads from it will return its default value. - public mutating func clearVault() {self._vault = nil} - - /// Whether the cancel action can be initiated by the user - public var canInitiateCancelAction: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _vault: Flipcash_Common_V1_PublicKey? = nil -} - -public struct Flipcash_Activity_V1_DepositedCryptoNotificationMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Deprecated: Use SwappedCryptoNotificationMetadata, which models both halves -/// of the swap in a single notification. -public struct Flipcash_Activity_V1_BoughtCryptoNotificationMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var swapState: Flipcash_Activity_V1_SwapState = .unknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Deprecated: Use SwappedCryptoNotificationMetadata, which models both halves -/// of the swap in a single notification. -public struct Flipcash_Activity_V1_SoldCryptoNotificationMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var swapState: Flipcash_Activity_V1_SwapState = .unknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// SwappedCryptoNotificationMetadata represents a swap between two mints as a -/// single notification. It supersedes BoughtCryptoNotificationMetadata and -/// SoldCryptoNotificationMetadata, which modelled the two halves of a swap as -/// separate notifications. -public struct Flipcash_Activity_V1_SwappedCryptoNotificationMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The amount the user gave up in the source mint - public var from: Flipcash_Common_V1_CryptoPaymentAmount { - get {return _from ?? Flipcash_Common_V1_CryptoPaymentAmount()} - set {_from = newValue} - } - /// Returns true if `from` has been explicitly set. - public var hasFrom: Bool {return self._from != nil} - /// Clears the value of `from`. Subsequent reads from it will return its default value. - public mutating func clearFrom() {self._from = nil} - - /// What the user received in the destination mint. The mint is always known, - /// but the amount is only known once the swap has executed. - public var to: Flipcash_Activity_V1_SwappedCryptoNotificationMetadata.OneOf_To? = nil - - /// The destination mint, when the amount isn't yet known - public var toMint: Flipcash_Common_V1_PublicKey { - get { - if case .toMint(let v)? = to {return v} - return Flipcash_Common_V1_PublicKey() - } - set {to = .toMint(newValue)} - } - - /// The amount the user received in the destination mint - public var toAmount: Flipcash_Common_V1_CryptoPaymentAmount { - get { - if case .toAmount(let v)? = to {return v} - return Flipcash_Common_V1_CryptoPaymentAmount() - } - set {to = .toAmount(newValue)} - } - - /// The fee charged for the swap, which is known upfront and is set regardless - /// of the state of the swap - public var fee: Flipcash_Common_V1_FiatPaymentAmount { - get {return _fee ?? Flipcash_Common_V1_FiatPaymentAmount()} - set {_fee = newValue} - } - /// Returns true if `fee` has been explicitly set. - public var hasFee: Bool {return self._fee != nil} - /// Clears the value of `fee`. Subsequent reads from it will return its default value. - public mutating func clearFee() {self._fee = nil} - - /// The state of the swap as a whole - public var swapState: Flipcash_Activity_V1_SwapState = .unknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// What the user received in the destination mint. The mint is always known, - /// but the amount is only known once the swap has executed. - public enum OneOf_To: Equatable, Sendable { - /// The destination mint, when the amount isn't yet known - case toMint(Flipcash_Common_V1_PublicKey) - /// The amount the user received in the destination mint - case toAmount(Flipcash_Common_V1_CryptoPaymentAmount) - - } - - public init() {} - - fileprivate var _from: Flipcash_Common_V1_CryptoPaymentAmount? = nil - fileprivate var _fee: Flipcash_Common_V1_FiatPaymentAmount? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.activity.v1" - -extension Flipcash_Activity_V1_ActivityFeedType: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}TRANSACTION_HISTORY\0") -} - -extension Flipcash_Activity_V1_NotificationState: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0NOTIFICATION_STATE_UNKNOWN\0\u{1}NOTIFICATION_STATE_PENDING\0\u{1}NOTIFICATION_STATE_COMPLETED\0") -} - -extension Flipcash_Activity_V1_SwapState: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0SWAP_STATE_UNKNOWN\0\u{1}SWAP_STATE_PENDING\0\u{1}SWAP_STATE_SUCCEEDED\0\u{1}SWAP_STATE_FAILED\0\u{1}SWAP_STATE_NONE\0") -} - -extension Flipcash_Activity_V1_NotificationId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NotificationId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_NotificationId, rhs: Flipcash_Activity_V1_NotificationId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_Notification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Notification" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{3}localized_text\0\u{3}payment_amount\0\u{1}ts\0\u{1}state\0\u{4}\u{2}directly_sent_crypto\0\u{3}received_crypto\0\u{3}withdrew_crypto\0\u{3}indirectly_sent_crypto\0\u{3}deposited_crypto\0\u{3}bought_crypto\0\u{3}sold_crypto\0\u{3}swapped_crypto\0\u{4}V\u{1}text_substitutions\0\u{c}\u{6}\u{1}") - - fileprivate class _StorageClass { - var _id: Flipcash_Activity_V1_NotificationId? = nil - var _localizedText: String = String() - var _paymentAmount: Flipcash_Common_V1_CryptoPaymentAmount? = nil - var _ts: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - var _state: Flipcash_Activity_V1_NotificationState = .unknown - var _additionalMetadata: Flipcash_Activity_V1_Notification.OneOf_AdditionalMetadata? - var _textSubstitutions: [Flipcash_Common_V1_Substitution] = [] - - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _id = source._id - _localizedText = source._localizedText - _paymentAmount = source._paymentAmount - _ts = source._ts - _state = source._state - _additionalMetadata = source._additionalMetadata - _textSubstitutions = source._textSubstitutions - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._id) }() - case 2: try { try decoder.decodeSingularStringField(value: &_storage._localizedText) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._paymentAmount) }() - case 4: try { try decoder.decodeSingularMessageField(value: &_storage._ts) }() - case 5: try { try decoder.decodeSingularEnumField(value: &_storage._state) }() - case 7: try { - var v: Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata? - var hadOneofValue = false - if let current = _storage._additionalMetadata { - hadOneofValue = true - if case .directlySentCrypto(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._additionalMetadata = .directlySentCrypto(v) - } - }() - case 8: try { - var v: Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata? - var hadOneofValue = false - if let current = _storage._additionalMetadata { - hadOneofValue = true - if case .receivedCrypto(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._additionalMetadata = .receivedCrypto(v) - } - }() - case 9: try { - var v: Flipcash_Activity_V1_WithdrewCryptoNotificationMetadata? - var hadOneofValue = false - if let current = _storage._additionalMetadata { - hadOneofValue = true - if case .withdrewCrypto(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._additionalMetadata = .withdrewCrypto(v) - } - }() - case 10: try { - var v: Flipcash_Activity_V1_IndirectlySentCryptoNotificationMetadata? - var hadOneofValue = false - if let current = _storage._additionalMetadata { - hadOneofValue = true - if case .indirectlySentCrypto(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._additionalMetadata = .indirectlySentCrypto(v) - } - }() - case 11: try { - var v: Flipcash_Activity_V1_DepositedCryptoNotificationMetadata? - var hadOneofValue = false - if let current = _storage._additionalMetadata { - hadOneofValue = true - if case .depositedCrypto(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._additionalMetadata = .depositedCrypto(v) - } - }() - case 12: try { - var v: Flipcash_Activity_V1_BoughtCryptoNotificationMetadata? - var hadOneofValue = false - if let current = _storage._additionalMetadata { - hadOneofValue = true - if case .boughtCrypto(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._additionalMetadata = .boughtCrypto(v) - } - }() - case 13: try { - var v: Flipcash_Activity_V1_SoldCryptoNotificationMetadata? - var hadOneofValue = false - if let current = _storage._additionalMetadata { - hadOneofValue = true - if case .soldCrypto(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._additionalMetadata = .soldCrypto(v) - } - }() - case 14: try { - var v: Flipcash_Activity_V1_SwappedCryptoNotificationMetadata? - var hadOneofValue = false - if let current = _storage._additionalMetadata { - hadOneofValue = true - if case .swappedCrypto(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._additionalMetadata = .swappedCrypto(v) - } - }() - case 100: try { try decoder.decodeRepeatedMessageField(value: &_storage._textSubstitutions) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._id { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !_storage._localizedText.isEmpty { - try visitor.visitSingularStringField(value: _storage._localizedText, fieldNumber: 2) - } - try { if let v = _storage._paymentAmount { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = _storage._ts { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if _storage._state != .unknown { - try visitor.visitSingularEnumField(value: _storage._state, fieldNumber: 5) - } - switch _storage._additionalMetadata { - case .directlySentCrypto?: try { - guard case .directlySentCrypto(let v)? = _storage._additionalMetadata else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - }() - case .receivedCrypto?: try { - guard case .receivedCrypto(let v)? = _storage._additionalMetadata else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - }() - case .withdrewCrypto?: try { - guard case .withdrewCrypto(let v)? = _storage._additionalMetadata else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - }() - case .indirectlySentCrypto?: try { - guard case .indirectlySentCrypto(let v)? = _storage._additionalMetadata else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - }() - case .depositedCrypto?: try { - guard case .depositedCrypto(let v)? = _storage._additionalMetadata else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - }() - case .boughtCrypto?: try { - guard case .boughtCrypto(let v)? = _storage._additionalMetadata else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - }() - case .soldCrypto?: try { - guard case .soldCrypto(let v)? = _storage._additionalMetadata else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - }() - case .swappedCrypto?: try { - guard case .swappedCrypto(let v)? = _storage._additionalMetadata else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - }() - case nil: break - } - if !_storage._textSubstitutions.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._textSubstitutions, fieldNumber: 100) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_Notification, rhs: Flipcash_Activity_V1_Notification) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._id != rhs_storage._id {return false} - if _storage._localizedText != rhs_storage._localizedText {return false} - if _storage._paymentAmount != rhs_storage._paymentAmount {return false} - if _storage._ts != rhs_storage._ts {return false} - if _storage._state != rhs_storage._state {return false} - if _storage._additionalMetadata != rhs_storage._additionalMetadata {return false} - if _storage._textSubstitutions != rhs_storage._textSubstitutions {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DirectlySentCryptoNotificationMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}phone\0\u{3}user_id\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Common_V1_PhoneNumber? - var hadOneofValue = false - if let current = self.destinationIdentifier { - hadOneofValue = true - if case .phone(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.destinationIdentifier = .phone(v) - } - }() - case 2: try { - var v: Flipcash_Common_V1_UserId? - var hadOneofValue = false - if let current = self.destinationIdentifier { - hadOneofValue = true - if case .userID(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.destinationIdentifier = .userID(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.destinationIdentifier { - case .phone?: try { - guard case .phone(let v)? = self.destinationIdentifier else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .userID?: try { - guard case .userID(let v)? = self.destinationIdentifier else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata, rhs: Flipcash_Activity_V1_DirectlySentCryptoNotificationMetadata) -> Bool { - if lhs.destinationIdentifier != rhs.destinationIdentifier {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ReceivedCryptoNotificationMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}phone\0\u{3}user_id\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Common_V1_PhoneNumber? - var hadOneofValue = false - if let current = self.sourceIdentifier { - hadOneofValue = true - if case .phone(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.sourceIdentifier = .phone(v) - } - }() - case 2: try { - var v: Flipcash_Common_V1_UserId? - var hadOneofValue = false - if let current = self.sourceIdentifier { - hadOneofValue = true - if case .userID(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.sourceIdentifier = .userID(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.sourceIdentifier { - case .phone?: try { - guard case .phone(let v)? = self.sourceIdentifier else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .userID?: try { - guard case .userID(let v)? = self.sourceIdentifier else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata, rhs: Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata) -> Bool { - if lhs.sourceIdentifier != rhs.sourceIdentifier {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_WithdrewCryptoNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".WithdrewCryptoNotificationMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}swap_state\0\u{3}swap_metadata\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.swapState) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._swapMetadata) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.swapState != .unknown { - try visitor.visitSingularEnumField(value: self.swapState, fieldNumber: 1) - } - try { if let v = self._swapMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_WithdrewCryptoNotificationMetadata, rhs: Flipcash_Activity_V1_WithdrewCryptoNotificationMetadata) -> Bool { - if lhs.swapState != rhs.swapState {return false} - if lhs._swapMetadata != rhs._swapMetadata {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_IndirectlySentCryptoNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IndirectlySentCryptoNotificationMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}vault\0\u{3}can_initiate_cancel_action\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._vault) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.canInitiateCancelAction) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._vault { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.canInitiateCancelAction != false { - try visitor.visitSingularBoolField(value: self.canInitiateCancelAction, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_IndirectlySentCryptoNotificationMetadata, rhs: Flipcash_Activity_V1_IndirectlySentCryptoNotificationMetadata) -> Bool { - if lhs._vault != rhs._vault {return false} - if lhs.canInitiateCancelAction != rhs.canInitiateCancelAction {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_DepositedCryptoNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DepositedCryptoNotificationMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_DepositedCryptoNotificationMetadata, rhs: Flipcash_Activity_V1_DepositedCryptoNotificationMetadata) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_BoughtCryptoNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BoughtCryptoNotificationMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}swap_state\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.swapState) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.swapState != .unknown { - try visitor.visitSingularEnumField(value: self.swapState, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_BoughtCryptoNotificationMetadata, rhs: Flipcash_Activity_V1_BoughtCryptoNotificationMetadata) -> Bool { - if lhs.swapState != rhs.swapState {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_SoldCryptoNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SoldCryptoNotificationMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}swap_state\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.swapState) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.swapState != .unknown { - try visitor.visitSingularEnumField(value: self.swapState, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_SoldCryptoNotificationMetadata, rhs: Flipcash_Activity_V1_SoldCryptoNotificationMetadata) -> Bool { - if lhs.swapState != rhs.swapState {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Activity_V1_SwappedCryptoNotificationMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SwappedCryptoNotificationMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}from\0\u{3}to_mint\0\u{3}to_amount\0\u{1}fee\0\u{3}swap_state\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._from) }() - case 2: try { - var v: Flipcash_Common_V1_PublicKey? - var hadOneofValue = false - if let current = self.to { - hadOneofValue = true - if case .toMint(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.to = .toMint(v) - } - }() - case 3: try { - var v: Flipcash_Common_V1_CryptoPaymentAmount? - var hadOneofValue = false - if let current = self.to { - hadOneofValue = true - if case .toAmount(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.to = .toAmount(v) - } - }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._fee) }() - case 5: try { try decoder.decodeSingularEnumField(value: &self.swapState) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._from { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - switch self.to { - case .toMint?: try { - guard case .toMint(let v)? = self.to else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .toAmount?: try { - guard case .toAmount(let v)? = self.to else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try { if let v = self._fee { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if self.swapState != .unknown { - try visitor.visitSingularEnumField(value: self.swapState, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Activity_V1_SwappedCryptoNotificationMetadata, rhs: Flipcash_Activity_V1_SwappedCryptoNotificationMetadata) -> Bool { - if lhs._from != rhs._from {return false} - if lhs.to != rhs.to {return false} - if lhs._fee != rhs._fee {return false} - if lhs.swapState != rhs.swapState {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_blob_storage_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_blob_storage_service.grpc.swift deleted file mode 100644 index 2a5288088..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_blob_storage_service.grpc.swift +++ /dev/null @@ -1,671 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: blob/v1/blob_storage_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.blob.v1.BlobStorage - -/// Namespace containing generated types for the "flipcash.blob.v1.BlobStorage" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Blob_V1_BlobStorage { - /// Service descriptor for the "flipcash.blob.v1.BlobStorage" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blob.v1.BlobStorage") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "GetUploadPolicy" metadata. - public enum GetUploadPolicy { - /// Request type for "GetUploadPolicy". - public typealias Input = Flipcash_Blob_V1_GetUploadPolicyRequest - /// Response type for "GetUploadPolicy". - public typealias Output = Flipcash_Blob_V1_GetUploadPolicyResponse - /// Descriptor for "GetUploadPolicy". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blob.v1.BlobStorage"), - method: "GetUploadPolicy" - ) - } - /// Namespace for "InitiateExternalUpload" metadata. - public enum InitiateExternalUpload { - /// Request type for "InitiateExternalUpload". - public typealias Input = Flipcash_Blob_V1_InitiateExternalUploadRequest - /// Response type for "InitiateExternalUpload". - public typealias Output = Flipcash_Blob_V1_InitiateExternalUploadResponse - /// Descriptor for "InitiateExternalUpload". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blob.v1.BlobStorage"), - method: "InitiateExternalUpload" - ) - } - /// Namespace for "CompleteExternalUpload" metadata. - public enum CompleteExternalUpload { - /// Request type for "CompleteExternalUpload". - public typealias Input = Flipcash_Blob_V1_CompleteExternalUploadRequest - /// Response type for "CompleteExternalUpload". - public typealias Output = Flipcash_Blob_V1_CompleteExternalUploadResponse - /// Descriptor for "CompleteExternalUpload". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blob.v1.BlobStorage"), - method: "CompleteExternalUpload" - ) - } - /// Namespace for "GetBlobs" metadata. - public enum GetBlobs { - /// Request type for "GetBlobs". - public typealias Input = Flipcash_Blob_V1_GetBlobsRequest - /// Response type for "GetBlobs". - public typealias Output = Flipcash_Blob_V1_GetBlobsResponse - /// Descriptor for "GetBlobs". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blob.v1.BlobStorage"), - method: "GetBlobs" - ) - } - /// Descriptors for all methods in the "flipcash.blob.v1.BlobStorage" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - GetUploadPolicy.descriptor, - InitiateExternalUpload.descriptor, - CompleteExternalUpload.descriptor, - GetBlobs.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.blob.v1.BlobStorage" service. - public static let flipcash_blob_v1_BlobStorage = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blob.v1.BlobStorage") -} - -// MARK: flipcash.blob.v1.BlobStorage (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Blob_V1_BlobStorage { - /// Generated client protocol for the "flipcash.blob.v1.BlobStorage" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - /// - /// > Source IDL Documentation: - /// > - /// > BlobStorage manages direct-to-storage uploads and authorized, time-limited reads - /// > of the bytes behind MediaItem renditions (and other blobs). Clients upload bytes - /// > straight to object storage via a presigned target — the server never proxies - /// > them — and all blob metadata is server-derived from the stored bytes. - public protocol ClientProtocol: Sendable { - /// Call the "GetUploadPolicy" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUploadPolicy returns the current upload constraints — which MIME types - /// > are accepted and the per-type ceilings the server enforces — so the client - /// > can validate (and resize/transcode) BEFORE reserving an upload. The policy - /// > is advisory and cacheable; InitiateExternalUpload remains authoritative and - /// > may still deny. Clients re-fetch when version changes or ttl lapses. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_GetUploadPolicyRequest` message. - /// - serializer: A serializer for `Flipcash_Blob_V1_GetUploadPolicyRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blob_V1_GetUploadPolicyResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getUploadPolicy( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "InitiateExternalUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > InitiateExternalUpload reserves a BlobId and returns a short-lived presigned - /// > target the client uploads the bytes to directly. Clients only ever upload - /// > ORIGINALs; the server derives any additional renditions itself. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_InitiateExternalUploadRequest` message. - /// - serializer: A serializer for `Flipcash_Blob_V1_InitiateExternalUploadRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blob_V1_InitiateExternalUploadResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func initiateExternalUpload( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "CompleteExternalUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > CompleteExternalUpload is an ADVISORY signal that the client finished uploading, - /// > letting the server finalize (validate, derive metadata, transcode - /// > renditions, moderate) without waiting for the storage-completion event. - /// > It is idempotent; if never called, the storage event finalizes the blob - /// > anyway. Clients must not depend on it for correctness. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_CompleteExternalUploadRequest` message. - /// - serializer: A serializer for `Flipcash_Blob_V1_CompleteExternalUploadRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blob_V1_CompleteExternalUploadResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func completeExternalUpload( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetBlobs" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBlobs resolves known BlobIds to their current status and metadata, - /// > minting a FRESH, short-lived download_url for each READY blob. Clients - /// > call it to reissue a URL that has expired — the BlobId is the durable - /// > handle; the URL is disposable. A caller must set GetBlobsRequest.context - /// > to the surface it is reading from (e.g. a chat) to authorize blobs it - /// > does not own. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_GetBlobsRequest` message. - /// - serializer: A serializer for `Flipcash_Blob_V1_GetBlobsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blob_V1_GetBlobsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getBlobs( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.blob.v1.BlobStorage" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - /// - /// > Source IDL Documentation: - /// > - /// > BlobStorage manages direct-to-storage uploads and authorized, time-limited reads - /// > of the bytes behind MediaItem renditions (and other blobs). Clients upload bytes - /// > straight to object storage via a presigned target — the server never proxies - /// > them — and all blob metadata is server-derived from the stored bytes. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "GetUploadPolicy" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUploadPolicy returns the current upload constraints — which MIME types - /// > are accepted and the per-type ceilings the server enforces — so the client - /// > can validate (and resize/transcode) BEFORE reserving an upload. The policy - /// > is advisory and cacheable; InitiateExternalUpload remains authoritative and - /// > may still deny. Clients re-fetch when version changes or ttl lapses. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_GetUploadPolicyRequest` message. - /// - serializer: A serializer for `Flipcash_Blob_V1_GetUploadPolicyRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blob_V1_GetUploadPolicyResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUploadPolicy( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Blob_V1_BlobStorage.Method.GetUploadPolicy.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "InitiateExternalUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > InitiateExternalUpload reserves a BlobId and returns a short-lived presigned - /// > target the client uploads the bytes to directly. Clients only ever upload - /// > ORIGINALs; the server derives any additional renditions itself. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_InitiateExternalUploadRequest` message. - /// - serializer: A serializer for `Flipcash_Blob_V1_InitiateExternalUploadRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blob_V1_InitiateExternalUploadResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func initiateExternalUpload( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Blob_V1_BlobStorage.Method.InitiateExternalUpload.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CompleteExternalUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > CompleteExternalUpload is an ADVISORY signal that the client finished uploading, - /// > letting the server finalize (validate, derive metadata, transcode - /// > renditions, moderate) without waiting for the storage-completion event. - /// > It is idempotent; if never called, the storage event finalizes the blob - /// > anyway. Clients must not depend on it for correctness. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_CompleteExternalUploadRequest` message. - /// - serializer: A serializer for `Flipcash_Blob_V1_CompleteExternalUploadRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blob_V1_CompleteExternalUploadResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func completeExternalUpload( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Blob_V1_BlobStorage.Method.CompleteExternalUpload.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBlobs" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBlobs resolves known BlobIds to their current status and metadata, - /// > minting a FRESH, short-lived download_url for each READY blob. Clients - /// > call it to reissue a URL that has expired — the BlobId is the durable - /// > handle; the URL is disposable. A caller must set GetBlobsRequest.context - /// > to the surface it is reading from (e.g. a chat) to authorize blobs it - /// > does not own. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_GetBlobsRequest` message. - /// - serializer: A serializer for `Flipcash_Blob_V1_GetBlobsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blob_V1_GetBlobsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBlobs( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Blob_V1_BlobStorage.Method.GetBlobs.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Blob_V1_BlobStorage.ClientProtocol { - /// Call the "GetUploadPolicy" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUploadPolicy returns the current upload constraints — which MIME types - /// > are accepted and the per-type ceilings the server enforces — so the client - /// > can validate (and resize/transcode) BEFORE reserving an upload. The policy - /// > is advisory and cacheable; InitiateExternalUpload remains authoritative and - /// > may still deny. Clients re-fetch when version changes or ttl lapses. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_GetUploadPolicyRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUploadPolicy( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getUploadPolicy( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "InitiateExternalUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > InitiateExternalUpload reserves a BlobId and returns a short-lived presigned - /// > target the client uploads the bytes to directly. Clients only ever upload - /// > ORIGINALs; the server derives any additional renditions itself. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_InitiateExternalUploadRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func initiateExternalUpload( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.initiateExternalUpload( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CompleteExternalUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > CompleteExternalUpload is an ADVISORY signal that the client finished uploading, - /// > letting the server finalize (validate, derive metadata, transcode - /// > renditions, moderate) without waiting for the storage-completion event. - /// > It is idempotent; if never called, the storage event finalizes the blob - /// > anyway. Clients must not depend on it for correctness. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_CompleteExternalUploadRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func completeExternalUpload( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.completeExternalUpload( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBlobs" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBlobs resolves known BlobIds to their current status and metadata, - /// > minting a FRESH, short-lived download_url for each READY blob. Clients - /// > call it to reissue a URL that has expired — the BlobId is the durable - /// > handle; the URL is disposable. A caller must set GetBlobsRequest.context - /// > to the surface it is reading from (e.g. a chat) to authorize blobs it - /// > does not own. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blob_V1_GetBlobsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBlobs( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getBlobs( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Blob_V1_BlobStorage.ClientProtocol { - /// Call the "GetUploadPolicy" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetUploadPolicy returns the current upload constraints — which MIME types - /// > are accepted and the per-type ceilings the server enforces — so the client - /// > can validate (and resize/transcode) BEFORE reserving an upload. The policy - /// > is advisory and cacheable; InitiateExternalUpload remains authoritative and - /// > may still deny. Clients re-fetch when version changes or ttl lapses. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getUploadPolicy( - _ message: Flipcash_Blob_V1_GetUploadPolicyRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getUploadPolicy( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "InitiateExternalUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > InitiateExternalUpload reserves a BlobId and returns a short-lived presigned - /// > target the client uploads the bytes to directly. Clients only ever upload - /// > ORIGINALs; the server derives any additional renditions itself. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func initiateExternalUpload( - _ message: Flipcash_Blob_V1_InitiateExternalUploadRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.initiateExternalUpload( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CompleteExternalUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > CompleteExternalUpload is an ADVISORY signal that the client finished uploading, - /// > letting the server finalize (validate, derive metadata, transcode - /// > renditions, moderate) without waiting for the storage-completion event. - /// > It is idempotent; if never called, the storage event finalizes the blob - /// > anyway. Clients must not depend on it for correctness. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func completeExternalUpload( - _ message: Flipcash_Blob_V1_CompleteExternalUploadRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.completeExternalUpload( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBlobs" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBlobs resolves known BlobIds to their current status and metadata, - /// > minting a FRESH, short-lived download_url for each READY blob. Clients - /// > call it to reissue a URL that has expired — the BlobId is the durable - /// > handle; the URL is disposable. A caller must set GetBlobsRequest.context - /// > to the surface it is reading from (e.g. a chat) to authorize blobs it - /// > does not own. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBlobs( - _ message: Flipcash_Blob_V1_GetBlobsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getBlobs( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_blob_storage_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_blob_storage_service.pb.swift deleted file mode 100644 index 555e34ed0..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_blob_storage_service.pb.swift +++ /dev/null @@ -1,796 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: blob/v1/blob_storage_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Blob_V1_GetUploadPolicyRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Blob_V1_GetUploadPolicyResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Blob_V1_GetUploadPolicyResponse.Result = .ok - - /// The constraints in force for the caller. Set when result == OK. - public var policy: Flipcash_Blob_V1_UploadPolicy { - get {return _policy ?? Flipcash_Blob_V1_UploadPolicy()} - set {_policy = newValue} - } - /// Returns true if `policy` has been explicitly set. - public var hasPolicy: Bool {return self._policy != nil} - /// Clears the value of `policy`. Subsequent reads from it will return its default value. - public mutating func clearPolicy() {self._policy = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blob_V1_GetUploadPolicyResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} - - fileprivate var _policy: Flipcash_Blob_V1_UploadPolicy? = nil -} - -public struct Flipcash_Blob_V1_InitiateExternalUploadRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - /// Declared MIME type of the bytes the client intends to upload. The server - /// pins it into the signed upload policy (storage rejects a mismatched - /// Content-Type) and re-derives it authoritatively from the bytes after - /// upload. A hint that constrains the upload, never blindly trusted. - public var mimeType: String = String() - - /// Declared byte size. The server bakes it into the policy's - /// content-length-range so storage rejects an upload that exceeds it. - public var sizeBytes: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Blob_V1_InitiateExternalUploadResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Blob_V1_InitiateExternalUploadResponse.Result = .ok - - /// Server-assigned handle. On OK the client references this as the ORIGINAL - /// rendition's blob_id on SendMessage. - public var blobID: Flipcash_Blob_V1_BlobId { - get {return _blobID ?? Flipcash_Blob_V1_BlobId()} - set {_blobID = newValue} - } - /// Returns true if `blobID` has been explicitly set. - public var hasBlobID: Bool {return self._blobID != nil} - /// Clears the value of `blobID`. Subsequent reads from it will return its default value. - public mutating func clearBlobID() {self._blobID = nil} - - /// Where and how to upload the bytes. Set only when result == OK. - public var uploadTarget: Flipcash_Blob_V1_UploadTarget { - get {return _uploadTarget ?? Flipcash_Blob_V1_UploadTarget()} - set {_uploadTarget = newValue} - } - /// Returns true if `uploadTarget` has been explicitly set. - public var hasUploadTarget: Bool {return self._uploadTarget != nil} - /// Clears the value of `uploadTarget`. Subsequent reads from it will return its default value. - public mutating func clearUploadTarget() {self._uploadTarget = nil} - - /// On a policy-driven denial (UNSUPPORTED_TYPE / TOO_LARGE), the UploadPolicy - /// version in force, so the client can detect a stale cached policy and - /// re-fetch. Unset otherwise. - public var policyVersion: Flipcash_Blob_V1_PolicyVersion { - get {return _policyVersion ?? Flipcash_Blob_V1_PolicyVersion()} - set {_policyVersion = newValue} - } - /// Returns true if `policyVersion` has been explicitly set. - public var hasPolicyVersion: Bool {return self._policyVersion != nil} - /// Clears the value of `policyVersion`. Subsequent reads from it will return its default value. - public mutating func clearPolicyVersion() {self._policyVersion = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// MIME type not accepted - case unsupportedType // = 2 - - /// declared size over the per-type ceiling - case tooLarge // = 3 - - /// caller is over their storage/upload quota - case quotaExceeded // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .unsupportedType - case 3: self = .tooLarge - case 4: self = .quotaExceeded - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .unsupportedType: return 2 - case .tooLarge: return 3 - case .quotaExceeded: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blob_V1_InitiateExternalUploadResponse.Result] = [ - .ok, - .denied, - .unsupportedType, - .tooLarge, - .quotaExceeded, - ] - - } - - public init() {} - - fileprivate var _blobID: Flipcash_Blob_V1_BlobId? = nil - fileprivate var _uploadTarget: Flipcash_Blob_V1_UploadTarget? = nil - fileprivate var _policyVersion: Flipcash_Blob_V1_PolicyVersion? = nil -} - -public struct Flipcash_Blob_V1_CompleteExternalUploadRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - /// The blob whose upload just finished. - public var blobID: Flipcash_Blob_V1_BlobId { - get {return _blobID ?? Flipcash_Blob_V1_BlobId()} - set {_blobID = newValue} - } - /// Returns true if `blobID` has been explicitly set. - public var hasBlobID: Bool {return self._blobID != nil} - /// Clears the value of `blobID`. Subsequent reads from it will return its default value. - public mutating func clearBlobID() {self._blobID = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _blobID: Flipcash_Blob_V1_BlobId? = nil -} - -public struct Flipcash_Blob_V1_CompleteExternalUploadResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Blob_V1_CompleteExternalUploadResponse.Result = .ok - - /// Blob state after this call (often still PROCESSING). - public var status: Flipcash_Blob_V1_BlobStatus = .unknown - - /// Why the blob was rejected. Set only when status == REJECTED. - public var rejectionMetadata: Flipcash_Blob_V1_RejectionMetadata { - get {return _rejectionMetadata ?? Flipcash_Blob_V1_RejectionMetadata()} - set {_rejectionMetadata = newValue} - } - /// Returns true if `rejectionMetadata` has been explicitly set. - public var hasRejectionMetadata: Bool {return self._rejectionMetadata != nil} - /// Clears the value of `rejectionMetadata`. Subsequent reads from it will return its default value. - public mutating func clearRejectionMetadata() {self._rejectionMetadata = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - - /// no pending blob with this id for the caller - case notFound // = 1 - - /// bytes not present / upload incomplete - case notUploaded // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - case 2: self = .notUploaded - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .notUploaded: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blob_V1_CompleteExternalUploadResponse.Result] = [ - .ok, - .notFound, - .notUploaded, - ] - - } - - public init() {} - - fileprivate var _rejectionMetadata: Flipcash_Blob_V1_RejectionMetadata? = nil -} - -public struct Flipcash_Blob_V1_GetBlobsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - /// The blobs to resolve. - public var blobIds: Flipcash_Blob_V1_BlobIdBatch { - get {return _blobIds ?? Flipcash_Blob_V1_BlobIdBatch()} - set {_blobIds = newValue} - } - /// Returns true if `blobIds` has been explicitly set. - public var hasBlobIds: Bool {return self._blobIds != nil} - /// Clears the value of `blobIds`. Subsequent reads from it will return its default value. - public mutating func clearBlobIds() {self._blobIds = nil} - - /// The surface the caller is accessing these blobs from. When set, the - /// server authorizes the entire batch through this single context, turning - /// the read into a direct membership check instead of a search across the - /// blob's grants. - /// - /// OPTIONAL on the wire, but REQUIRED in practice for any blob the caller - /// does not OWN: blobs the caller owns resolve without a context, while a - /// non-owned id is treated as unauthorized (and omitted from the response) - /// unless a context that authorizes it is supplied. A caller reading only - /// its own blobs may omit it, so existing owner-only clients are unaffected. - public var context: Flipcash_Blob_V1_AccessContext { - get {return _context ?? Flipcash_Blob_V1_AccessContext()} - set {_context = newValue} - } - /// Returns true if `context` has been explicitly set. - public var hasContext: Bool {return self._context != nil} - /// Clears the value of `context`. Subsequent reads from it will return its default value. - public mutating func clearContext() {self._context = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _blobIds: Flipcash_Blob_V1_BlobIdBatch? = nil - fileprivate var _context: Flipcash_Blob_V1_AccessContext? = nil -} - -public struct Flipcash_Blob_V1_GetBlobsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Blob_V1_GetBlobsResponse.Result = .ok - - /// The resolved blobs. Unknown or unauthorized ids are omitted; the batch - /// is left unset (not empty) when none resolve. - public var blobs: Flipcash_Blob_V1_BlobBatch { - get {return _blobs ?? Flipcash_Blob_V1_BlobBatch()} - set {_blobs = newValue} - } - /// Returns true if `blobs` has been explicitly set. - public var hasBlobs: Bool {return self._blobs != nil} - /// Clears the value of `blobs`. Subsequent reads from it will return its default value. - public mutating func clearBlobs() {self._blobs = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blob_V1_GetBlobsResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} - - fileprivate var _blobs: Flipcash_Blob_V1_BlobBatch? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.blob.v1" - -extension Flipcash_Blob_V1_GetUploadPolicyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetUploadPolicyRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_GetUploadPolicyRequest, rhs: Flipcash_Blob_V1_GetUploadPolicyRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_GetUploadPolicyResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetUploadPolicyResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}policy\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._policy) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._policy { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_GetUploadPolicyResponse, rhs: Flipcash_Blob_V1_GetUploadPolicyResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._policy != rhs._policy {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_GetUploadPolicyResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Blob_V1_InitiateExternalUploadRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".InitiateExternalUploadRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{3}mime_type\0\u{3}size_bytes\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.mimeType) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.sizeBytes) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.mimeType.isEmpty { - try visitor.visitSingularStringField(value: self.mimeType, fieldNumber: 2) - } - if self.sizeBytes != 0 { - try visitor.visitSingularUInt64Field(value: self.sizeBytes, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_InitiateExternalUploadRequest, rhs: Flipcash_Blob_V1_InitiateExternalUploadRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs.mimeType != rhs.mimeType {return false} - if lhs.sizeBytes != rhs.sizeBytes {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_InitiateExternalUploadResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".InitiateExternalUploadResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}blob_id\0\u{3}upload_target\0\u{3}policy_version\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blobID) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._uploadTarget) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._policyVersion) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._blobID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._uploadTarget { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._policyVersion { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_InitiateExternalUploadResponse, rhs: Flipcash_Blob_V1_InitiateExternalUploadResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._blobID != rhs._blobID {return false} - if lhs._uploadTarget != rhs._uploadTarget {return false} - if lhs._policyVersion != rhs._policyVersion {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_InitiateExternalUploadResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}UNSUPPORTED_TYPE\0\u{1}TOO_LARGE\0\u{1}QUOTA_EXCEEDED\0") -} - -extension Flipcash_Blob_V1_CompleteExternalUploadRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CompleteExternalUploadRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{3}blob_id\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blobID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._blobID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_CompleteExternalUploadRequest, rhs: Flipcash_Blob_V1_CompleteExternalUploadRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs._blobID != rhs._blobID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_CompleteExternalUploadResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CompleteExternalUploadResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}status\0\u{3}rejection_metadata\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.status) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._rejectionMetadata) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if self.status != .unknown { - try visitor.visitSingularEnumField(value: self.status, fieldNumber: 2) - } - try { if let v = self._rejectionMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_CompleteExternalUploadResponse, rhs: Flipcash_Blob_V1_CompleteExternalUploadResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.status != rhs.status {return false} - if lhs._rejectionMetadata != rhs._rejectionMetadata {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_CompleteExternalUploadResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0\u{1}NOT_UPLOADED\0") -} - -extension Flipcash_Blob_V1_GetBlobsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetBlobsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{3}blob_ids\0\u{1}context\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blobIds) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._context) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._blobIds { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._context { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_GetBlobsRequest, rhs: Flipcash_Blob_V1_GetBlobsRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs._blobIds != rhs._blobIds {return false} - if lhs._context != rhs._context {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_GetBlobsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetBlobsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}blobs\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blobs) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._blobs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_GetBlobsResponse, rhs: Flipcash_Blob_V1_GetBlobsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._blobs != rhs._blobs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_GetBlobsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_model.pb.swift deleted file mode 100644 index 36c9dc99c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blob_v1_model.pb.swift +++ /dev/null @@ -1,1454 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: blob/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Lifecycle state of a blob. -public enum Flipcash_Blob_V1_BlobStatus: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// reserved; awaiting the client's upload - case pending // = 1 - - /// bytes present; deriving metadata / transcoding / moderating - case processing // = 2 - - /// available; metadata populated and moderation passed - case ready // = 3 - - /// failed validation or moderation; not servable - case rejected // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .pending - case 2: self = .processing - case 3: self = .ready - case 4: self = .rejected - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .pending: return 1 - case .processing: return 2 - case .ready: return 3 - case .rejected: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blob_V1_BlobStatus] = [ - .unknown, - .pending, - .processing, - .ready, - .rejected, - ] - -} - -/// Why a blob failed finalization, after its bytes were uploaded. Distinct from -/// the pre-upload denials in InitiateExternalUploadResponse.Result, which reject -/// before any bytes are stored. -public enum Flipcash_Blob_V1_RejectionReason: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// tripped content moderation; see flagged_category - case moderation // = 1 - - /// MIME type derived from the bytes is not accepted - case unsupportedType // = 2 - - /// derived type didn't match the declared mime_type - case mismatchedType // = 3 - - /// stored bytes exceeded the per-type ceiling - case tooLarge // = 4 - - /// bytes unreadable; failed to decode or transcode - case corrupt // = 5 - - /// server-side processing error - case `internal` // = 6 - - /// blob contains privacy metadata that was not stripped - case privacyMetadata // = 7 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .moderation - case 2: self = .unsupportedType - case 3: self = .mismatchedType - case 4: self = .tooLarge - case 5: self = .corrupt - case 6: self = .internal - case 7: self = .privacyMetadata - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .moderation: return 1 - case .unsupportedType: return 2 - case .mismatchedType: return 3 - case .tooLarge: return 4 - case .corrupt: return 5 - case .internal: return 6 - case .privacyMetadata: return 7 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blob_V1_RejectionReason] = [ - .unknown, - .moderation, - .unsupportedType, - .mismatchedType, - .tooLarge, - .corrupt, - .internal, - .privacyMetadata, - ] - -} - -/// Opaque, client-held handle to a stored blob. This is the durable identity for -/// the bytes; the bytes it points at are immutable once the upload is finalized. -public struct Flipcash_Blob_V1_BlobId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// A batch of BlobIds -public struct Flipcash_Blob_V1_BlobIdBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var blobIds: [Flipcash_Blob_V1_BlobId] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// A blob's current status, plus its metadata once READY — or, once REJECTED, -/// the reason it was rejected. -public struct Flipcash_Blob_V1_Blob: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var id: Flipcash_Blob_V1_BlobId { - get {return _id ?? Flipcash_Blob_V1_BlobId()} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - public var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - public mutating func clearID() {self._id = nil} - - public var status: Flipcash_Blob_V1_BlobStatus = .unknown - - /// Server-authoritative metadata, including a freshly minted download_url. - /// Set only when status == READY. - public var metadata: Flipcash_Blob_V1_BlobMetadata { - get {return _metadata ?? Flipcash_Blob_V1_BlobMetadata()} - set {_metadata = newValue} - } - /// Returns true if `metadata` has been explicitly set. - public var hasMetadata: Bool {return self._metadata != nil} - /// Clears the value of `metadata`. Subsequent reads from it will return its default value. - public mutating func clearMetadata() {self._metadata = nil} - - /// Why the blob was rejected. Set only when status == REJECTED. - public var rejection: Flipcash_Blob_V1_RejectionMetadata { - get {return _rejection ?? Flipcash_Blob_V1_RejectionMetadata()} - set {_rejection = newValue} - } - /// Returns true if `rejection` has been explicitly set. - public var hasRejection: Bool {return self._rejection != nil} - /// Clears the value of `rejection`. Subsequent reads from it will return its default value. - public mutating func clearRejection() {self._rejection = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _id: Flipcash_Blob_V1_BlobId? = nil - fileprivate var _metadata: Flipcash_Blob_V1_BlobMetadata? = nil - fileprivate var _rejection: Flipcash_Blob_V1_RejectionMetadata? = nil -} - -/// A batch of Blobs. -public struct Flipcash_Blob_V1_BlobBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var blobs: [Flipcash_Blob_V1_Blob] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Server-authoritative metadata describing a stored blob. Never set by clients. -/// With the exception of download_url, every field is intrinsic to the stored -/// bytes and immutable, derived once by the server. -public struct Flipcash_Blob_V1_BlobMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// MIME type (e.g. "image/jpeg"). - public var mimeType: String = String() - - /// Total size of the blob in bytes. - public var sizeBytes: UInt64 = 0 - - /// Ephemeral, server-minted URL for fetching the blob bytes, together with - /// the instant it expires. Re-issued on every fetch — see DownloadUrl. - public var downloadURL: Flipcash_Blob_V1_DownloadUrl { - get {return _downloadURL ?? Flipcash_Blob_V1_DownloadUrl()} - set {_downloadURL = newValue} - } - /// Returns true if `downloadURL` has been explicitly set. - public var hasDownloadURL: Bool {return self._downloadURL != nil} - /// Clears the value of `downloadURL`. Subsequent reads from it will return its default value. - public mutating func clearDownloadURL() {self._downloadURL = nil} - - /// Kind-specific metadata the server derived from the bytes. Exactly one - /// variant is set for a recognized media kind; left unset for opaque blobs. - /// Only images are supported today; video/audio/etc. will be added as new - /// variants. - public var kind: Flipcash_Blob_V1_BlobMetadata.OneOf_Kind? = nil - - public var image: Flipcash_Blob_V1_ImageMetadata { - get { - if case .image(let v)? = kind {return v} - return Flipcash_Blob_V1_ImageMetadata() - } - set {kind = .image(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Kind-specific metadata the server derived from the bytes. Exactly one - /// variant is set for a recognized media kind; left unset for opaque blobs. - /// Only images are supported today; video/audio/etc. will be added as new - /// variants. - public enum OneOf_Kind: Equatable, Sendable { - case image(Flipcash_Blob_V1_ImageMetadata) - - } - - public init() {} - - fileprivate var _downloadURL: Flipcash_Blob_V1_DownloadUrl? = nil -} - -/// Intrinsic descriptors for a still image. -public struct Flipcash_Blob_V1_ImageMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Pixel dimensions, for reserving layout before the bytes arrive. - public var width: UInt32 = 0 - - public var height: UInt32 = 0 - - /// Compact preview shown while the full image downloads (BlurHash string). - public var blurhash: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// One logical piece of media — a chat image, a profile picture — carried as the -/// set of renditions it is stored as. Distinct from Blob: a Blob is ONE stored -/// object, while a Media is the several stored objects that together represent -/// the same content at different qualities/sizes. -/// -/// Wherever a surface attaches media, it embeds this type: the client uploads a -/// single ORIGINAL and the server derives the rest, identically everywhere. -public struct Flipcash_Blob_V1_Media: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The renditions of this media, each an independently-stored blob. When a - /// client attaches media (e.g. SendMessage, SetProfilePicture) it supplies - /// exactly one ORIGINAL rendition (its blob_id); the server fills that - /// rendition's metadata and appends any derived renditions (e.g. a - /// downscaled DISPLAY and a THUMBNAIL). - public var renditions: [Flipcash_Blob_V1_Rendition] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// A single stored variant of a Media. -public struct Flipcash_Blob_V1_Rendition: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The intended use of this rendition within the media. - public var role: Flipcash_Blob_V1_Rendition.Role = .unknown - - /// Handle to the blob holding this rendition's bytes. Client-set on the - /// ORIGINAL when attaching the media; server-set for derived renditions. - public var blobID: Flipcash_Blob_V1_BlobId { - get {return _blobID ?? Flipcash_Blob_V1_BlobId()} - set {_blobID = newValue} - } - /// Returns true if `blobID` has been explicitly set. - public var hasBlobID: Bool {return self._blobID != nil} - /// Clears the value of `blobID`. Subsequent reads from it will return its default value. - public mutating func clearBlobID() {self._blobID = nil} - - /// Server-authoritative blob metadata (mime type, size, download URL, and - /// the image dimensions/preview), resolved from the blob record. Omitted on - /// the request that attaches the media and populated on returned copies. - /// - /// If unavailable at the time the media is retrieved, the client can use - /// GetBlobs to query for the blob metadata. - public var blob: Flipcash_Blob_V1_BlobMetadata { - get {return _blob ?? Flipcash_Blob_V1_BlobMetadata()} - set {_blob = newValue} - } - /// Returns true if `blob` has been explicitly set. - public var hasBlob: Bool {return self._blob != nil} - /// Clears the value of `blob`. Subsequent reads from it will return its default value. - public mutating func clearBlob() {self._blob = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Role: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// full-quality source the client uploaded - case original // = 1 - - /// downscaled/compressed for inline display - case display // = 2 - - /// tiny preview (grid cell, avatar, ...) - case thumbnail // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .original - case 2: self = .display - case 3: self = .thumbnail - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .original: return 1 - case .display: return 2 - case .thumbnail: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blob_V1_Rendition.Role] = [ - .unknown, - .original, - .display, - .thumbnail, - ] - - } - - public init() {} - - fileprivate var _blobID: Flipcash_Blob_V1_BlobId? = nil - fileprivate var _blob: Flipcash_Blob_V1_BlobMetadata? = nil -} - -/// The constraints the server enforces on uploads, surfaced so clients can -/// validate and resize/transcode before reserving an upload. Advisory and -/// cacheable; InitiateExternalUpload remains authoritative. Constraints can -/// depend on the caller (quota, tier), so this is fetched per-user, not static. -public struct Flipcash_Blob_V1_UploadPolicy: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Opaque generation token for this policy. Clients cache the policy under it - /// and re-fetch when they observe a different version — including one echoed - /// on a denied upload. - public var version: Flipcash_Blob_V1_PolicyVersion { - get {return _version ?? Flipcash_Blob_V1_PolicyVersion()} - set {_version = newValue} - } - /// Returns true if `version` has been explicitly set. - public var hasVersion: Bool {return self._version != nil} - /// Clears the value of `version`. Subsequent reads from it will return its default value. - public mutating func clearVersion() {self._version = nil} - - /// How long the client may rely on this policy before re-fetching. The client - /// should also refresh on any version mismatch, whichever comes first. - public var ttl: SwiftProtobuf.Google_Protobuf_Duration { - get {return _ttl ?? SwiftProtobuf.Google_Protobuf_Duration()} - set {_ttl = newValue} - } - /// Returns true if `ttl` has been explicitly set. - public var hasTtl: Bool {return self._ttl != nil} - /// Clears the value of `ttl`. Subsequent reads from it will return its default value. - public mutating func clearTtl() {self._ttl = nil} - - /// Per-MIME-type constraints, ordered MOST SPECIFIC FIRST. The client picks - /// the FIRST entry whose mime_type_pattern matches the bytes' declared MIME - /// type; later entries (e.g. "image/*", then "*/*") act as fallbacks. An - /// upload whose type matches no entry is not accepted. - public var mimeTypeConstraints: [Flipcash_Blob_V1_MimeTypeConstraints] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _version: Flipcash_Blob_V1_PolicyVersion? = nil - fileprivate var _ttl: SwiftProtobuf.Google_Protobuf_Duration? = nil -} - -/// Opaque generation token identifying a snapshot of an UploadPolicy. Compared -/// by equality, never parsed; clients cache the policy under it and re-fetch when -/// they observe a different value (including one echoed on a denied upload). -public struct Flipcash_Blob_V1_PolicyVersion: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Upload constraints for one MIME-type matcher. -public struct Flipcash_Blob_V1_MimeTypeConstraints: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The MIME type(s) this entry governs: an exact type ("image/jpeg"), a - /// subtype wildcard ("image/*"), or the catch-all "*/*". - public var mimeTypePattern: String = String() - - /// Hard ceiling on a matching blob's byte size. - public var maxSizeBytes: UInt64 = 0 - - /// Kind-specific bounds, mirroring BlobMetadata.kind. Set the variant for the - /// pattern's media kind; left unset for opaque blobs. - public var kind: Flipcash_Blob_V1_MimeTypeConstraints.OneOf_Kind? = nil - - public var image: Flipcash_Blob_V1_ImageConstraints { - get { - if case .image(let v)? = kind {return v} - return Flipcash_Blob_V1_ImageConstraints() - } - set {kind = .image(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Kind-specific bounds, mirroring BlobMetadata.kind. Set the variant for the - /// pattern's media kind; left unset for opaque blobs. - public enum OneOf_Kind: Equatable, Sendable { - case image(Flipcash_Blob_V1_ImageConstraints) - - } - - public init() {} -} - -/// Bounds on a still image, mirroring ImageMetadata. -public struct Flipcash_Blob_V1_ImageConstraints: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Max pixel dimensions the server will accept (or downscale to). - public var maxWidth: UInt32 = 0 - - public var maxHeight: UInt32 = 0 - - /// Max total pixel count (width * height), guarding against decompression - /// bombs that slip under the per-axis caps. - public var maxPixels: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// A short-lived, presigned target for a direct-to-storage upload. Bearer -/// credential: anyone holding it can upload to the reserved key until it expires -/// — the client must not share or persist it. -/// -/// Provider-agnostic by design: it describes the HTTP request the client must -/// make, with all signed material opaque to the client. Today the server mints -/// S3 POST policies (method POST with form_fields); the same shape also -/// expresses presigned PUT (S3/GCS) and Azure SAS without a contract change. -public struct Flipcash_Blob_V1_UploadTarget: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// How the client issues the upload request. - public var method: Flipcash_Blob_V1_UploadTarget.Method = .unknown - - /// Signed URL to send the request to. For PUT-style uploads this often - /// already carries the signature in its query string (presigned PUT, SAS). - public var url: String = String() - - /// Headers the client MUST send verbatim (e.g. Content-Type, x-ms-blob-type, - /// and any signed headers the presign requires). - public var headers: Dictionary = [:] - - /// For method == POST: multipart/form-data fields sent before the file part, - /// carrying the server-chosen key and the SIGNED policy that storage enforces - /// (Content-Type, content-length-range, key prefix, ...). The client cannot - /// alter them without invalidating the signature. Empty for PUT uploads. - public var formFields: Dictionary = [:] - - /// When the target expires; after this the client must call InitiateUpload - /// again for a fresh one. - public var expiresAt: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _expiresAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_expiresAt = newValue} - } - /// Returns true if `expiresAt` has been explicitly set. - public var hasExpiresAt: Bool {return self._expiresAt != nil} - /// Clears the value of `expiresAt`. Subsequent reads from it will return its default value. - public mutating func clearExpiresAt() {self._expiresAt = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Method: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// raw-body upload - case put // = 1 - - /// multipart/form-data carrying form_fields - case post // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .put - case 2: self = .post - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .put: return 1 - case .post: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blob_V1_UploadTarget.Method] = [ - .unknown, - .put, - .post, - ] - - } - - public init() {} - - fileprivate var _expiresAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -/// An ephemeral, server-minted URL for fetching the blob bytes, paired with the -/// instant it expires. Unlike the intrinsic blob metadata, the URL is NOT a -/// property of the bytes: it is re-issued on every fetch, expires (signed URL -/// with a short TTL), and is authorized at mint time, not at fetch time. Clients -/// MUST NOT persist or cache it across fetches; treat the BlobId as the durable -/// handle and this as disposable. -public struct Flipcash_Blob_V1_DownloadUrl: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Signed URL for fetching the blob bytes. - public var url: String = String() - - /// When the URL expires; after this the client must call GetBlobs again to - /// mint a fresh one. - public var expiresAt: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _expiresAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_expiresAt = newValue} - } - /// Returns true if `expiresAt` has been explicitly set. - public var hasExpiresAt: Bool {return self._expiresAt != nil} - /// Clears the value of `expiresAt`. Subsequent reads from it will return its default value. - public mutating func clearExpiresAt() {self._expiresAt = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _expiresAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -/// Explains why a blob was rejected during finalization. Set on a Blob only when -/// status == REJECTED. Rejection is TERMINAL: the bytes behind a BlobId are -/// immutable, so this id will never become READY — to try again the client must -/// reserve a fresh upload via InitiateExternalUpload. -public struct Flipcash_Blob_V1_RejectionMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The top-level reason finalization failed. - public var reason: Flipcash_Blob_V1_RejectionReason = .unknown - - /// The best-fit category that tripped moderation, mirroring the Moderation - /// service's vocabulary. Set only when reason == REJECTION_REASON_MODERATION; - /// NONE otherwise. - public var flaggedCategory: Flipcash_Moderation_V1_FlaggedCategory = .none - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// AccessContext names the surface a caller is accessing blobs THROUGH on a -/// request — the "place" the read is happening from. It is the extension point -/// for blob authorization contexts: each scope maps to a server-side membership -/// check (e.g. a chat scope authorizes the caller iff they belong to that chat -/// AND the blob was shared into it). -/// -/// It is a hint that can only ever NARROW a read, never widen it: the server -/// still independently verifies both that the blob is granted to the named scope -/// and that the caller belongs to it. A caller never needs a context to read -/// blobs it OWNS, but does need one for any blob it does not own. New surfaces (a -/// feed, a profile, a public link) are added as new arms of `scope` without -/// changing any request plumbing. -public struct Flipcash_Blob_V1_AccessContext: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var scope: Flipcash_Blob_V1_AccessContext.OneOf_Scope? = nil - - /// The caller is accessing these blobs from within this chat. Authorized - /// iff the caller is a member of the chat and the blob was shared into it. - public var chat: Flipcash_Common_V1_ChatId { - get { - if case .chat(let v)? = scope {return v} - return Flipcash_Common_V1_ChatId() - } - set {scope = .chat(newValue)} - } - - /// The caller is accessing these blobs from this user's public profile. - /// Authorized iff the blob is a rendition of that user's CURRENT profile - /// picture — a profile grants nothing else, and a superseded picture's - /// renditions stop resolving through it. - /// - /// A caller never needs this for its OWN profile picture, since it owns - /// those blobs. - public var profile: Flipcash_Common_V1_UserId { - get { - if case .profile(let v)? = scope {return v} - return Flipcash_Common_V1_UserId() - } - set {scope = .profile(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Scope: Equatable, Sendable { - /// The caller is accessing these blobs from within this chat. Authorized - /// iff the caller is a member of the chat and the blob was shared into it. - case chat(Flipcash_Common_V1_ChatId) - /// The caller is accessing these blobs from this user's public profile. - /// Authorized iff the blob is a rendition of that user's CURRENT profile - /// picture — a profile grants nothing else, and a superseded picture's - /// renditions stop resolving through it. - /// - /// A caller never needs this for its OWN profile picture, since it owns - /// those blobs. - case profile(Flipcash_Common_V1_UserId) - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.blob.v1" - -extension Flipcash_Blob_V1_BlobStatus: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0BLOB_STATUS_UNKNOWN\0\u{1}BLOB_STATUS_PENDING\0\u{1}BLOB_STATUS_PROCESSING\0\u{1}BLOB_STATUS_READY\0\u{1}BLOB_STATUS_REJECTED\0") -} - -extension Flipcash_Blob_V1_RejectionReason: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0REJECTION_REASON_UNKNOWN\0\u{1}REJECTION_REASON_MODERATION\0\u{1}REJECTION_REASON_UNSUPPORTED_TYPE\0\u{1}REJECTION_REASON_MISMATCHED_TYPE\0\u{1}REJECTION_REASON_TOO_LARGE\0\u{1}REJECTION_REASON_CORRUPT\0\u{1}REJECTION_REASON_INTERNAL\0\u{1}REJECTION_REASON_PRIVACY_METADATA\0") -} - -extension Flipcash_Blob_V1_BlobId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BlobId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_BlobId, rhs: Flipcash_Blob_V1_BlobId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_BlobIdBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BlobIdBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}blob_ids\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.blobIds) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.blobIds.isEmpty { - try visitor.visitRepeatedMessageField(value: self.blobIds, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_BlobIdBatch, rhs: Flipcash_Blob_V1_BlobIdBatch) -> Bool { - if lhs.blobIds != rhs.blobIds {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_Blob: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Blob" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}status\0\u{1}metadata\0\u{1}rejection\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._id) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.status) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._metadata) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._rejection) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._id { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.status != .unknown { - try visitor.visitSingularEnumField(value: self.status, fieldNumber: 2) - } - try { if let v = self._metadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._rejection { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_Blob, rhs: Flipcash_Blob_V1_Blob) -> Bool { - if lhs._id != rhs._id {return false} - if lhs.status != rhs.status {return false} - if lhs._metadata != rhs._metadata {return false} - if lhs._rejection != rhs._rejection {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_BlobBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BlobBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}blobs\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.blobs) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.blobs.isEmpty { - try visitor.visitRepeatedMessageField(value: self.blobs, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_BlobBatch, rhs: Flipcash_Blob_V1_BlobBatch) -> Bool { - if lhs.blobs != rhs.blobs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_BlobMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BlobMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}mime_type\0\u{3}size_bytes\0\u{3}download_url\0\u{1}image\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.mimeType) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.sizeBytes) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._downloadURL) }() - case 4: try { - var v: Flipcash_Blob_V1_ImageMetadata? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .image(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .image(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.mimeType.isEmpty { - try visitor.visitSingularStringField(value: self.mimeType, fieldNumber: 1) - } - if self.sizeBytes != 0 { - try visitor.visitSingularUInt64Field(value: self.sizeBytes, fieldNumber: 2) - } - try { if let v = self._downloadURL { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if case .image(let v)? = self.kind { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_BlobMetadata, rhs: Flipcash_Blob_V1_BlobMetadata) -> Bool { - if lhs.mimeType != rhs.mimeType {return false} - if lhs.sizeBytes != rhs.sizeBytes {return false} - if lhs._downloadURL != rhs._downloadURL {return false} - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_ImageMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ImageMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}width\0\u{1}height\0\u{1}blurhash\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt32Field(value: &self.width) }() - case 2: try { try decoder.decodeSingularUInt32Field(value: &self.height) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.blurhash) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.width != 0 { - try visitor.visitSingularUInt32Field(value: self.width, fieldNumber: 1) - } - if self.height != 0 { - try visitor.visitSingularUInt32Field(value: self.height, fieldNumber: 2) - } - if !self.blurhash.isEmpty { - try visitor.visitSingularStringField(value: self.blurhash, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_ImageMetadata, rhs: Flipcash_Blob_V1_ImageMetadata) -> Bool { - if lhs.width != rhs.width {return false} - if lhs.height != rhs.height {return false} - if lhs.blurhash != rhs.blurhash {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_Media: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Media" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}renditions\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.renditions) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.renditions.isEmpty { - try visitor.visitRepeatedMessageField(value: self.renditions, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_Media, rhs: Flipcash_Blob_V1_Media) -> Bool { - if lhs.renditions != rhs.renditions {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_Rendition: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Rendition" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}role\0\u{3}blob_id\0\u{1}blob\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.role) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blobID) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._blob) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.role != .unknown { - try visitor.visitSingularEnumField(value: self.role, fieldNumber: 1) - } - try { if let v = self._blobID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._blob { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_Rendition, rhs: Flipcash_Blob_V1_Rendition) -> Bool { - if lhs.role != rhs.role {return false} - if lhs._blobID != rhs._blobID {return false} - if lhs._blob != rhs._blob {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_Rendition.Role: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}ORIGINAL\0\u{1}DISPLAY\0\u{1}THUMBNAIL\0") -} - -extension Flipcash_Blob_V1_UploadPolicy: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UploadPolicy" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{1}ttl\0\u{3}mime_type_constraints\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._version) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._ttl) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.mimeTypeConstraints) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._version { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._ttl { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.mimeTypeConstraints.isEmpty { - try visitor.visitRepeatedMessageField(value: self.mimeTypeConstraints, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_UploadPolicy, rhs: Flipcash_Blob_V1_UploadPolicy) -> Bool { - if lhs._version != rhs._version {return false} - if lhs._ttl != rhs._ttl {return false} - if lhs.mimeTypeConstraints != rhs.mimeTypeConstraints {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_PolicyVersion: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PolicyVersion" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_PolicyVersion, rhs: Flipcash_Blob_V1_PolicyVersion) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_MimeTypeConstraints: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MimeTypeConstraints" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}mime_type_pattern\0\u{3}max_size_bytes\0\u{1}image\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.mimeTypePattern) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.maxSizeBytes) }() - case 3: try { - var v: Flipcash_Blob_V1_ImageConstraints? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .image(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .image(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.mimeTypePattern.isEmpty { - try visitor.visitSingularStringField(value: self.mimeTypePattern, fieldNumber: 1) - } - if self.maxSizeBytes != 0 { - try visitor.visitSingularUInt64Field(value: self.maxSizeBytes, fieldNumber: 2) - } - try { if case .image(let v)? = self.kind { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_MimeTypeConstraints, rhs: Flipcash_Blob_V1_MimeTypeConstraints) -> Bool { - if lhs.mimeTypePattern != rhs.mimeTypePattern {return false} - if lhs.maxSizeBytes != rhs.maxSizeBytes {return false} - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_ImageConstraints: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ImageConstraints" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}max_width\0\u{3}max_height\0\u{3}max_pixels\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt32Field(value: &self.maxWidth) }() - case 2: try { try decoder.decodeSingularUInt32Field(value: &self.maxHeight) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.maxPixels) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.maxWidth != 0 { - try visitor.visitSingularUInt32Field(value: self.maxWidth, fieldNumber: 1) - } - if self.maxHeight != 0 { - try visitor.visitSingularUInt32Field(value: self.maxHeight, fieldNumber: 2) - } - if self.maxPixels != 0 { - try visitor.visitSingularUInt64Field(value: self.maxPixels, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_ImageConstraints, rhs: Flipcash_Blob_V1_ImageConstraints) -> Bool { - if lhs.maxWidth != rhs.maxWidth {return false} - if lhs.maxHeight != rhs.maxHeight {return false} - if lhs.maxPixels != rhs.maxPixels {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_UploadTarget: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UploadTarget" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}method\0\u{1}url\0\u{1}headers\0\u{3}form_fields\0\u{3}expires_at\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.method) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.url) }() - case 3: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.headers) }() - case 4: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.formFields) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._expiresAt) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.method != .unknown { - try visitor.visitSingularEnumField(value: self.method, fieldNumber: 1) - } - if !self.url.isEmpty { - try visitor.visitSingularStringField(value: self.url, fieldNumber: 2) - } - if !self.headers.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.headers, fieldNumber: 3) - } - if !self.formFields.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.formFields, fieldNumber: 4) - } - try { if let v = self._expiresAt { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_UploadTarget, rhs: Flipcash_Blob_V1_UploadTarget) -> Bool { - if lhs.method != rhs.method {return false} - if lhs.url != rhs.url {return false} - if lhs.headers != rhs.headers {return false} - if lhs.formFields != rhs.formFields {return false} - if lhs._expiresAt != rhs._expiresAt {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_UploadTarget.Method: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}PUT\0\u{1}POST\0") -} - -extension Flipcash_Blob_V1_DownloadUrl: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DownloadUrl" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}url\0\u{3}expires_at\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.url) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._expiresAt) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.url.isEmpty { - try visitor.visitSingularStringField(value: self.url, fieldNumber: 1) - } - try { if let v = self._expiresAt { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_DownloadUrl, rhs: Flipcash_Blob_V1_DownloadUrl) -> Bool { - if lhs.url != rhs.url {return false} - if lhs._expiresAt != rhs._expiresAt {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_RejectionMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RejectionMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}reason\0\u{3}flagged_category\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.reason) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.flaggedCategory) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.reason != .unknown { - try visitor.visitSingularEnumField(value: self.reason, fieldNumber: 1) - } - if self.flaggedCategory != .none { - try visitor.visitSingularEnumField(value: self.flaggedCategory, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_RejectionMetadata, rhs: Flipcash_Blob_V1_RejectionMetadata) -> Bool { - if lhs.reason != rhs.reason {return false} - if lhs.flaggedCategory != rhs.flaggedCategory {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blob_V1_AccessContext: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AccessContext" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}chat\0\u{1}profile\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Common_V1_ChatId? - var hadOneofValue = false - if let current = self.scope { - hadOneofValue = true - if case .chat(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.scope = .chat(v) - } - }() - case 2: try { - var v: Flipcash_Common_V1_UserId? - var hadOneofValue = false - if let current = self.scope { - hadOneofValue = true - if case .profile(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.scope = .profile(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.scope { - case .chat?: try { - guard case .chat(let v)? = self.scope else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .profile?: try { - guard case .profile(let v)? = self.scope else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blob_V1_AccessContext, rhs: Flipcash_Blob_V1_AccessContext) -> Bool { - if lhs.scope != rhs.scope {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_blocklist_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_blocklist_service.grpc.swift deleted file mode 100644 index ba7b76d74..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_blocklist_service.grpc.swift +++ /dev/null @@ -1,617 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: blocklist/v1/blocklist_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.blocklist.v1.Blocklist - -/// Namespace containing generated types for the "flipcash.blocklist.v1.Blocklist" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Blocklist_V1_Blocklist { - /// Service descriptor for the "flipcash.blocklist.v1.Blocklist" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blocklist.v1.Blocklist") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "BlockUser" metadata. - public enum BlockUser { - /// Request type for "BlockUser". - public typealias Input = Flipcash_Blocklist_V1_BlockUserRequest - /// Response type for "BlockUser". - public typealias Output = Flipcash_Blocklist_V1_BlockUserResponse - /// Descriptor for "BlockUser". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blocklist.v1.Blocklist"), - method: "BlockUser" - ) - } - /// Namespace for "UnblockUser" metadata. - public enum UnblockUser { - /// Request type for "UnblockUser". - public typealias Input = Flipcash_Blocklist_V1_UnblockUserRequest - /// Response type for "UnblockUser". - public typealias Output = Flipcash_Blocklist_V1_UnblockUserResponse - /// Descriptor for "UnblockUser". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blocklist.v1.Blocklist"), - method: "UnblockUser" - ) - } - /// Namespace for "IsBlocked" metadata. - public enum IsBlocked { - /// Request type for "IsBlocked". - public typealias Input = Flipcash_Blocklist_V1_IsBlockedRequest - /// Response type for "IsBlocked". - public typealias Output = Flipcash_Blocklist_V1_IsBlockedResponse - /// Descriptor for "IsBlocked". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blocklist.v1.Blocklist"), - method: "IsBlocked" - ) - } - /// Namespace for "GetBlocklist" metadata. - public enum GetBlocklist { - /// Request type for "GetBlocklist". - public typealias Input = Flipcash_Blocklist_V1_GetBlocklistRequest - /// Response type for "GetBlocklist". - public typealias Output = Flipcash_Blocklist_V1_GetBlocklistResponse - /// Descriptor for "GetBlocklist". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blocklist.v1.Blocklist"), - method: "GetBlocklist" - ) - } - /// Descriptors for all methods in the "flipcash.blocklist.v1.Blocklist" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - BlockUser.descriptor, - UnblockUser.descriptor, - IsBlocked.descriptor, - GetBlocklist.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.blocklist.v1.Blocklist" service. - public static let flipcash_blocklist_v1_Blocklist = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.blocklist.v1.Blocklist") -} - -// MARK: flipcash.blocklist.v1.Blocklist (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Blocklist_V1_Blocklist { - /// Generated client protocol for the "flipcash.blocklist.v1.Blocklist" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - /// - /// > Source IDL Documentation: - /// > - /// > Blocklist manages the set of users a user has blocked. - public protocol ClientProtocol: Sendable { - /// Call the "BlockUser" method. - /// - /// > Source IDL Documentation: - /// > - /// > BlockUser adds a user to the caller's blocklist. Blocking a user that - /// > is already blocked is a no-op and returns OK. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_BlockUserRequest` message. - /// - serializer: A serializer for `Flipcash_Blocklist_V1_BlockUserRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blocklist_V1_BlockUserResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func blockUser( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "UnblockUser" method. - /// - /// > Source IDL Documentation: - /// > - /// > UnblockUser removes a user from the caller's blocklist. Unblocking a - /// > user that isn't blocked is a no-op and returns OK. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_UnblockUserRequest` message. - /// - serializer: A serializer for `Flipcash_Blocklist_V1_UnblockUserRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blocklist_V1_UnblockUserResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func unblockUser( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "IsBlocked" method. - /// - /// > Source IDL Documentation: - /// > - /// > IsBlocked checks whether a user is on the caller's blocklist. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_IsBlockedRequest` message. - /// - serializer: A serializer for `Flipcash_Blocklist_V1_IsBlockedRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blocklist_V1_IsBlockedResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func isBlocked( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetBlocklist" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBlocklist gets the caller's blocklist using a paged API, ordered by - /// > most recently blocked first. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_GetBlocklistRequest` message. - /// - serializer: A serializer for `Flipcash_Blocklist_V1_GetBlocklistRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blocklist_V1_GetBlocklistResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getBlocklist( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.blocklist.v1.Blocklist" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - /// - /// > Source IDL Documentation: - /// > - /// > Blocklist manages the set of users a user has blocked. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "BlockUser" method. - /// - /// > Source IDL Documentation: - /// > - /// > BlockUser adds a user to the caller's blocklist. Blocking a user that - /// > is already blocked is a no-op and returns OK. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_BlockUserRequest` message. - /// - serializer: A serializer for `Flipcash_Blocklist_V1_BlockUserRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blocklist_V1_BlockUserResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func blockUser( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Blocklist_V1_Blocklist.Method.BlockUser.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UnblockUser" method. - /// - /// > Source IDL Documentation: - /// > - /// > UnblockUser removes a user from the caller's blocklist. Unblocking a - /// > user that isn't blocked is a no-op and returns OK. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_UnblockUserRequest` message. - /// - serializer: A serializer for `Flipcash_Blocklist_V1_UnblockUserRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blocklist_V1_UnblockUserResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unblockUser( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Blocklist_V1_Blocklist.Method.UnblockUser.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "IsBlocked" method. - /// - /// > Source IDL Documentation: - /// > - /// > IsBlocked checks whether a user is on the caller's blocklist. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_IsBlockedRequest` message. - /// - serializer: A serializer for `Flipcash_Blocklist_V1_IsBlockedRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blocklist_V1_IsBlockedResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func isBlocked( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Blocklist_V1_Blocklist.Method.IsBlocked.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBlocklist" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBlocklist gets the caller's blocklist using a paged API, ordered by - /// > most recently blocked first. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_GetBlocklistRequest` message. - /// - serializer: A serializer for `Flipcash_Blocklist_V1_GetBlocklistRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Blocklist_V1_GetBlocklistResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBlocklist( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Blocklist_V1_Blocklist.Method.GetBlocklist.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Blocklist_V1_Blocklist.ClientProtocol { - /// Call the "BlockUser" method. - /// - /// > Source IDL Documentation: - /// > - /// > BlockUser adds a user to the caller's blocklist. Blocking a user that - /// > is already blocked is a no-op and returns OK. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_BlockUserRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func blockUser( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.blockUser( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UnblockUser" method. - /// - /// > Source IDL Documentation: - /// > - /// > UnblockUser removes a user from the caller's blocklist. Unblocking a - /// > user that isn't blocked is a no-op and returns OK. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_UnblockUserRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unblockUser( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.unblockUser( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "IsBlocked" method. - /// - /// > Source IDL Documentation: - /// > - /// > IsBlocked checks whether a user is on the caller's blocklist. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_IsBlockedRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func isBlocked( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.isBlocked( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBlocklist" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBlocklist gets the caller's blocklist using a paged API, ordered by - /// > most recently blocked first. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Blocklist_V1_GetBlocklistRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBlocklist( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getBlocklist( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Blocklist_V1_Blocklist.ClientProtocol { - /// Call the "BlockUser" method. - /// - /// > Source IDL Documentation: - /// > - /// > BlockUser adds a user to the caller's blocklist. Blocking a user that - /// > is already blocked is a no-op and returns OK. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func blockUser( - _ message: Flipcash_Blocklist_V1_BlockUserRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.blockUser( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UnblockUser" method. - /// - /// > Source IDL Documentation: - /// > - /// > UnblockUser removes a user from the caller's blocklist. Unblocking a - /// > user that isn't blocked is a no-op and returns OK. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unblockUser( - _ message: Flipcash_Blocklist_V1_UnblockUserRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.unblockUser( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "IsBlocked" method. - /// - /// > Source IDL Documentation: - /// > - /// > IsBlocked checks whether a user is on the caller's blocklist. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func isBlocked( - _ message: Flipcash_Blocklist_V1_IsBlockedRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.isBlocked( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetBlocklist" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetBlocklist gets the caller's blocklist using a paged API, ordered by - /// > most recently blocked first. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getBlocklist( - _ message: Flipcash_Blocklist_V1_GetBlocklistRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getBlocklist( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_blocklist_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_blocklist_service.pb.swift deleted file mode 100644 index b19224811..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_blocklist_service.pb.swift +++ /dev/null @@ -1,694 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: blocklist/v1/blocklist_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Blocklist_V1_BlockUserRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The user to block - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Blocklist_V1_BlockUserResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Blocklist_V1_BlockUserResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// The user to block doesn't exist - case userNotFound // = 2 - - /// Users cannot block themselves - case cannotBlockSelf // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .userNotFound - case 3: self = .cannotBlockSelf - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .userNotFound: return 2 - case .cannotBlockSelf: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blocklist_V1_BlockUserResponse.Result] = [ - .ok, - .denied, - .userNotFound, - .cannotBlockSelf, - ] - - } - - public init() {} -} - -public struct Flipcash_Blocklist_V1_UnblockUserRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The user to unblock - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Blocklist_V1_UnblockUserResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Blocklist_V1_UnblockUserResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blocklist_V1_UnblockUserResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -public struct Flipcash_Blocklist_V1_IsBlockedRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The user to check against the caller's blocklist - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Blocklist_V1_IsBlockedResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Blocklist_V1_IsBlockedResponse.Result = .ok - - /// Whether the user is on the caller's blocklist. Set when result is OK. - public var isBlocked: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blocklist_V1_IsBlockedResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -public struct Flipcash_Blocklist_V1_GetBlocklistRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// QueryOptions controls page_size. Ordering is fixed to most recently - /// blocked first and is not client-selectable. - /// - /// Leave query_options.paging_token unset on the first request. On every - /// subsequent request, set query_options.paging_token to the paging_token - /// from the most recent response to advance to the next page. The token is - /// opaque and server-generated; do not construct it. - public var queryOptions: Flipcash_Common_V1_QueryOptions { - get {return _queryOptions ?? Flipcash_Common_V1_QueryOptions()} - set {_queryOptions = newValue} - } - /// Returns true if `queryOptions` has been explicitly set. - public var hasQueryOptions: Bool {return self._queryOptions != nil} - /// Clears the value of `queryOptions`. Subsequent reads from it will return its default value. - public mutating func clearQueryOptions() {self._queryOptions = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _queryOptions: Flipcash_Common_V1_QueryOptions? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Blocklist_V1_GetBlocklistResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Blocklist_V1_GetBlocklistResponse.Result = .ok - - public var blockedUsers: [Flipcash_Blocklist_V1_BlockedUser] = [] - - /// PagingToken is the server-generated cursor for this paginated read. The - /// client MUST send the most recent value back in query_options.paging_token - /// on the next GetBlocklistRequest. Set when result is OK. - public var pagingToken: Flipcash_Common_V1_PagingToken { - get {return _pagingToken ?? Flipcash_Common_V1_PagingToken()} - set {_pagingToken = newValue} - } - /// Returns true if `pagingToken` has been explicitly set. - public var hasPagingToken: Bool {return self._pagingToken != nil} - /// Clears the value of `pagingToken`. Subsequent reads from it will return its default value. - public mutating func clearPagingToken() {self._pagingToken = nil} - - /// HasMore indicates whether further pages remain. When true, the client - /// should issue another GetBlocklistRequest with the returned paging_token. - public var hasMore_p: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Blocklist_V1_GetBlocklistResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} - - fileprivate var _pagingToken: Flipcash_Common_V1_PagingToken? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.blocklist.v1" - -extension Flipcash_Blocklist_V1_BlockUserRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BlockUserRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_BlockUserRequest, rhs: Flipcash_Blocklist_V1_BlockUserRequest) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blocklist_V1_BlockUserResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BlockUserResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_BlockUserResponse, rhs: Flipcash_Blocklist_V1_BlockUserResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blocklist_V1_BlockUserResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}USER_NOT_FOUND\0\u{1}CANNOT_BLOCK_SELF\0") -} - -extension Flipcash_Blocklist_V1_UnblockUserRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnblockUserRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_UnblockUserRequest, rhs: Flipcash_Blocklist_V1_UnblockUserRequest) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blocklist_V1_UnblockUserResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnblockUserResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_UnblockUserResponse, rhs: Flipcash_Blocklist_V1_UnblockUserResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blocklist_V1_UnblockUserResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Blocklist_V1_IsBlockedRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IsBlockedRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_IsBlockedRequest, rhs: Flipcash_Blocklist_V1_IsBlockedRequest) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blocklist_V1_IsBlockedResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IsBlockedResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}is_blocked\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.isBlocked) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if self.isBlocked != false { - try visitor.visitSingularBoolField(value: self.isBlocked, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_IsBlockedResponse, rhs: Flipcash_Blocklist_V1_IsBlockedResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.isBlocked != rhs.isBlocked {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blocklist_V1_IsBlockedResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Blocklist_V1_GetBlocklistRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetBlocklistRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}query_options\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._queryOptions) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._queryOptions { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_GetBlocklistRequest, rhs: Flipcash_Blocklist_V1_GetBlocklistRequest) -> Bool { - if lhs._queryOptions != rhs._queryOptions {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blocklist_V1_GetBlocklistResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetBlocklistResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}blocked_users\0\u{3}paging_token\0\u{3}has_more\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.blockedUsers) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._pagingToken) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.hasMore_p) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.blockedUsers.isEmpty { - try visitor.visitRepeatedMessageField(value: self.blockedUsers, fieldNumber: 2) - } - try { if let v = self._pagingToken { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.hasMore_p != false { - try visitor.visitSingularBoolField(value: self.hasMore_p, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_GetBlocklistResponse, rhs: Flipcash_Blocklist_V1_GetBlocklistResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.blockedUsers != rhs.blockedUsers {return false} - if lhs._pagingToken != rhs._pagingToken {return false} - if lhs.hasMore_p != rhs.hasMore_p {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Blocklist_V1_GetBlocklistResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_model.pb.swift deleted file mode 100644 index ce815be9f..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/blocklist_v1_model.pb.swift +++ /dev/null @@ -1,98 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: blocklist/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// BlockedUser is a single entry in a user's blocklist -public struct Flipcash_Blocklist_V1_BlockedUser: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The user that is blocked - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - /// Timestamp when the user was blocked - public var blockedAt: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _blockedAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_blockedAt = newValue} - } - /// Returns true if `blockedAt` has been explicitly set. - public var hasBlockedAt: Bool {return self._blockedAt != nil} - /// Clears the value of `blockedAt`. Subsequent reads from it will return its default value. - public mutating func clearBlockedAt() {self._blockedAt = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _blockedAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.blocklist.v1" - -extension Flipcash_Blocklist_V1_BlockedUser: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BlockedUser" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{3}blocked_at\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blockedAt) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._blockedAt { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Blocklist_V1_BlockedUser, rhs: Flipcash_Blocklist_V1_BlockedUser) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs._blockedAt != rhs._blockedAt {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_chat_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_chat_service.grpc.swift deleted file mode 100644 index cb4c20ecc..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_chat_service.grpc.swift +++ /dev/null @@ -1,417 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: chat/v1/chat_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.chat.v1.Chat - -/// Namespace containing generated types for the "flipcash.chat.v1.Chat" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Chat_V1_Chat { - /// Service descriptor for the "flipcash.chat.v1.Chat" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "GetChat" metadata. - public enum GetChat { - /// Request type for "GetChat". - public typealias Input = Flipcash_Chat_V1_GetChatRequest - /// Response type for "GetChat". - public typealias Output = Flipcash_Chat_V1_GetChatResponse - /// Descriptor for "GetChat". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat"), - method: "GetChat" - ) - } - /// Namespace for "GetDmChatFeed" metadata. - public enum GetDmChatFeed { - /// Request type for "GetDmChatFeed". - public typealias Input = Flipcash_Chat_V1_GetDmChatFeedRequest - /// Response type for "GetDmChatFeed". - public typealias Output = Flipcash_Chat_V1_GetDmChatFeedResponse - /// Descriptor for "GetDmChatFeed". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat"), - method: "GetDmChatFeed" - ) - } - /// Descriptors for all methods in the "flipcash.chat.v1.Chat" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - GetChat.descriptor, - GetDmChatFeed.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.chat.v1.Chat" service. - public static let flipcash_chat_v1_Chat = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat") -} - -// MARK: flipcash.chat.v1.Chat (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Chat_V1_Chat { - /// Generated client protocol for the "flipcash.chat.v1.Chat" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "GetChat" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetChat returns the metadata for a specific chat - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Chat_V1_GetChatRequest` message. - /// - serializer: A serializer for `Flipcash_Chat_V1_GetChatRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Chat_V1_GetChatResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getChat( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetDmChatFeed" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetDmChatFeed gets the set of DM chats for an owner account using - /// > a paged API, ordered by last activity with the most recent first. - /// > - /// > Chats are ordered by a mutable key (last_activity), so pagination alone - /// > cannot guarantee a complete read: a chat can receive new activity and - /// > move into a region the client has already paged past. To get the full - /// > list, the client MUST combine this RPC with the event stream: - /// > - /// > 1. Open the event stream to receive ChatUpdate and begin buffering updates - /// > BEFORE the first GetDmChatFeed call. This ordering is the contract that - /// > closes the gap; subscribing after pagination starts can drop chats. - /// > 2. Page through GetDmChatFeed to exhaustion (until has_more is false), - /// > always echoing back the paging token returned by the prior response. - /// > All pages are served against a single snapshot pinned by that token, - /// > so the set is read consistently. - /// > 3. Merge the buffered and ongoing stream updates onto the paginated - /// > set. Any chat whose activity changed after the snapshot watermark - /// > is delivered via the stream rather than via pagination. - /// > - /// > Read together, pagination guarantees the set (every chat exactly once) - /// > and the stream guarantees freshness and ordering. The local last_activity - /// > sort is maintained by the client from the stream after the initial read. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Chat_V1_GetDmChatFeedRequest` message. - /// - serializer: A serializer for `Flipcash_Chat_V1_GetDmChatFeedRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Chat_V1_GetDmChatFeedResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getDmChatFeed( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.chat.v1.Chat" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "GetChat" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetChat returns the metadata for a specific chat - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Chat_V1_GetChatRequest` message. - /// - serializer: A serializer for `Flipcash_Chat_V1_GetChatRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Chat_V1_GetChatResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getChat( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Chat_V1_Chat.Method.GetChat.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetDmChatFeed" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetDmChatFeed gets the set of DM chats for an owner account using - /// > a paged API, ordered by last activity with the most recent first. - /// > - /// > Chats are ordered by a mutable key (last_activity), so pagination alone - /// > cannot guarantee a complete read: a chat can receive new activity and - /// > move into a region the client has already paged past. To get the full - /// > list, the client MUST combine this RPC with the event stream: - /// > - /// > 1. Open the event stream to receive ChatUpdate and begin buffering updates - /// > BEFORE the first GetDmChatFeed call. This ordering is the contract that - /// > closes the gap; subscribing after pagination starts can drop chats. - /// > 2. Page through GetDmChatFeed to exhaustion (until has_more is false), - /// > always echoing back the paging token returned by the prior response. - /// > All pages are served against a single snapshot pinned by that token, - /// > so the set is read consistently. - /// > 3. Merge the buffered and ongoing stream updates onto the paginated - /// > set. Any chat whose activity changed after the snapshot watermark - /// > is delivered via the stream rather than via pagination. - /// > - /// > Read together, pagination guarantees the set (every chat exactly once) - /// > and the stream guarantees freshness and ordering. The local last_activity - /// > sort is maintained by the client from the stream after the initial read. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Chat_V1_GetDmChatFeedRequest` message. - /// - serializer: A serializer for `Flipcash_Chat_V1_GetDmChatFeedRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Chat_V1_GetDmChatFeedResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getDmChatFeed( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Chat_V1_Chat.Method.GetDmChatFeed.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Chat_V1_Chat.ClientProtocol { - /// Call the "GetChat" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetChat returns the metadata for a specific chat - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Chat_V1_GetChatRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getChat( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getChat( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetDmChatFeed" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetDmChatFeed gets the set of DM chats for an owner account using - /// > a paged API, ordered by last activity with the most recent first. - /// > - /// > Chats are ordered by a mutable key (last_activity), so pagination alone - /// > cannot guarantee a complete read: a chat can receive new activity and - /// > move into a region the client has already paged past. To get the full - /// > list, the client MUST combine this RPC with the event stream: - /// > - /// > 1. Open the event stream to receive ChatUpdate and begin buffering updates - /// > BEFORE the first GetDmChatFeed call. This ordering is the contract that - /// > closes the gap; subscribing after pagination starts can drop chats. - /// > 2. Page through GetDmChatFeed to exhaustion (until has_more is false), - /// > always echoing back the paging token returned by the prior response. - /// > All pages are served against a single snapshot pinned by that token, - /// > so the set is read consistently. - /// > 3. Merge the buffered and ongoing stream updates onto the paginated - /// > set. Any chat whose activity changed after the snapshot watermark - /// > is delivered via the stream rather than via pagination. - /// > - /// > Read together, pagination guarantees the set (every chat exactly once) - /// > and the stream guarantees freshness and ordering. The local last_activity - /// > sort is maintained by the client from the stream after the initial read. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Chat_V1_GetDmChatFeedRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getDmChatFeed( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getDmChatFeed( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Chat_V1_Chat.ClientProtocol { - /// Call the "GetChat" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetChat returns the metadata for a specific chat - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getChat( - _ message: Flipcash_Chat_V1_GetChatRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getChat( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetDmChatFeed" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetDmChatFeed gets the set of DM chats for an owner account using - /// > a paged API, ordered by last activity with the most recent first. - /// > - /// > Chats are ordered by a mutable key (last_activity), so pagination alone - /// > cannot guarantee a complete read: a chat can receive new activity and - /// > move into a region the client has already paged past. To get the full - /// > list, the client MUST combine this RPC with the event stream: - /// > - /// > 1. Open the event stream to receive ChatUpdate and begin buffering updates - /// > BEFORE the first GetDmChatFeed call. This ordering is the contract that - /// > closes the gap; subscribing after pagination starts can drop chats. - /// > 2. Page through GetDmChatFeed to exhaustion (until has_more is false), - /// > always echoing back the paging token returned by the prior response. - /// > All pages are served against a single snapshot pinned by that token, - /// > so the set is read consistently. - /// > 3. Merge the buffered and ongoing stream updates onto the paginated - /// > set. Any chat whose activity changed after the snapshot watermark - /// > is delivered via the stream rather than via pagination. - /// > - /// > Read together, pagination guarantees the set (every chat exactly once) - /// > and the stream guarantees freshness and ordering. The local last_activity - /// > sort is maintained by the client from the stream after the initial read. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getDmChatFeed( - _ message: Flipcash_Chat_V1_GetDmChatFeedRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getDmChatFeed( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_chat_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_chat_service.pb.swift deleted file mode 100644 index 9819047c5..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_chat_service.pb.swift +++ /dev/null @@ -1,415 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: chat/v1/chat_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Chat_V1_GetChatRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Chat_V1_GetChatResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Chat_V1_GetChatResponse.Result = .ok - - public var metadata: Flipcash_Chat_V1_Metadata { - get {return _metadata ?? Flipcash_Chat_V1_Metadata()} - set {_metadata = newValue} - } - /// Returns true if `metadata` has been explicitly set. - public var hasMetadata: Bool {return self._metadata != nil} - /// Clears the value of `metadata`. Subsequent reads from it will return its default value. - public mutating func clearMetadata() {self._metadata = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case notFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .notFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Chat_V1_GetChatResponse.Result] = [ - .ok, - .denied, - .notFound, - ] - - } - - public init() {} - - fileprivate var _metadata: Flipcash_Chat_V1_Metadata? = nil -} - -public struct Flipcash_Chat_V1_GetDmChatFeedRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// QueryOptions controls page_size. Ordering is fixed to most-recent - /// activity first and is not client-selectable. - /// - /// Leave query_options.paging_token unset on the first request: the server - /// mints a token that pins a new snapshot and returns it in the response. On - /// every subsequent request, set query_options.paging_token to the - /// paging_token from the most recent response to advance within the same - /// snapshot. The token is opaque and server-generated; do not construct it. - public var queryOptions: Flipcash_Common_V1_QueryOptions { - get {return _queryOptions ?? Flipcash_Common_V1_QueryOptions()} - set {_queryOptions = newValue} - } - /// Returns true if `queryOptions` has been explicitly set. - public var hasQueryOptions: Bool {return self._queryOptions != nil} - /// Clears the value of `queryOptions`. Subsequent reads from it will return its default value. - public mutating func clearQueryOptions() {self._queryOptions = nil} - - /// The type of DM chat to filter for - /// - /// For backwards compatiblity, UNKNOWN maps to CONTACT_DM for legacy clients - public var dmChatType: Flipcash_Chat_V1_ChatType = .unknown - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _queryOptions: Flipcash_Common_V1_QueryOptions? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Chat_V1_GetDmChatFeedResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Chat_V1_GetDmChatFeedResponse.Result = .ok - - public var chats: [Flipcash_Chat_V1_Metadata] = [] - - /// PagingToken is the server-generated token for this paginated read. On the - /// first response it pins a new snapshot; on later responses it carries the - /// advanced cursor over (last_activity, chat_id). The client MUST send the - /// most recent value back in query_options.paging_token on the next - /// GetDmChatFeedRequest. Set when result is OK. - public var pagingToken: Flipcash_Common_V1_PagingToken { - get {return _pagingToken ?? Flipcash_Common_V1_PagingToken()} - set {_pagingToken = newValue} - } - /// Returns true if `pagingToken` has been explicitly set. - public var hasPagingToken: Bool {return self._pagingToken != nil} - /// Clears the value of `pagingToken`. Subsequent reads from it will return its default value. - public mutating func clearPagingToken() {self._pagingToken = nil} - - /// HasMore indicates whether further pages remain in this snapshot. When - /// false, the paginated set has been fully read; the complete chat list is - /// this set reconciled with the event stream (see GetDmChatFeed). When true, the - /// client should issue another GetDmChatFeedRequest with the returned - /// paging_token. - public var hasMore_p: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case notFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .notFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Chat_V1_GetDmChatFeedResponse.Result] = [ - .ok, - .denied, - .notFound, - ] - - } - - public init() {} - - fileprivate var _pagingToken: Flipcash_Common_V1_PagingToken? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.chat.v1" - -extension Flipcash_Chat_V1_GetChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetChatRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_GetChatRequest, rhs: Flipcash_Chat_V1_GetChatRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Chat_V1_GetChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetChatResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}metadata\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._metadata) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._metadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_GetChatResponse, rhs: Flipcash_Chat_V1_GetChatResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._metadata != rhs._metadata {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Chat_V1_GetChatResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}NOT_FOUND\0") -} - -extension Flipcash_Chat_V1_GetDmChatFeedRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetDmChatFeedRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}query_options\0\u{3}dm_chat_type\0\u{2}\u{8}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._queryOptions) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.dmChatType) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._queryOptions { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.dmChatType != .unknown { - try visitor.visitSingularEnumField(value: self.dmChatType, fieldNumber: 2) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_GetDmChatFeedRequest, rhs: Flipcash_Chat_V1_GetDmChatFeedRequest) -> Bool { - if lhs._queryOptions != rhs._queryOptions {return false} - if lhs.dmChatType != rhs.dmChatType {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Chat_V1_GetDmChatFeedResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetDmChatFeedResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}chats\0\u{3}paging_token\0\u{3}has_more\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.chats) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._pagingToken) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.hasMore_p) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.chats.isEmpty { - try visitor.visitRepeatedMessageField(value: self.chats, fieldNumber: 2) - } - try { if let v = self._pagingToken { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.hasMore_p != false { - try visitor.visitSingularBoolField(value: self.hasMore_p, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_GetDmChatFeedResponse, rhs: Flipcash_Chat_V1_GetDmChatFeedResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.chats != rhs.chats {return false} - if lhs._pagingToken != rhs._pagingToken {return false} - if lhs.hasMore_p != rhs.hasMore_p {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Chat_V1_GetDmChatFeedResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}NOT_FOUND\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_model.pb.swift deleted file mode 100644 index 3edc52444..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/chat_v1_model.pb.swift +++ /dev/null @@ -1,569 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: chat/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public enum Flipcash_Chat_V1_ChatType: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case contactDm // = 1 - case tipDm // = 2 - case group // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .contactDm - case 2: self = .tipDm - case 3: self = .group - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .contactDm: return 1 - case .tipDm: return 2 - case .group: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Chat_V1_ChatType] = [ - .unknown, - .contactDm, - .tipDm, - .group, - ] - -} - -public struct Flipcash_Chat_V1_Metadata: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _storage._chatID ?? Flipcash_Common_V1_ChatId()} - set {_uniqueStorage()._chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return _storage._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {_uniqueStorage()._chatID = nil} - - /// The type of chat - public var type: Flipcash_Chat_V1_ChatType { - get {return _storage._type} - set {_uniqueStorage()._type = newValue} - } - - /// Members of this chat - /// - /// For large group chats, this is a subset of all members. - public var members: [Flipcash_Chat_V1_Member] { - get {return _storage._members} - set {_uniqueStorage()._members = newValue} - } - - /// The last message in this chat - public var lastMessage: Flipcash_Messaging_V1_Message { - get {return _storage._lastMessage ?? Flipcash_Messaging_V1_Message()} - set {_uniqueStorage()._lastMessage = newValue} - } - /// Returns true if `lastMessage` has been explicitly set. - public var hasLastMessage: Bool {return _storage._lastMessage != nil} - /// Clears the value of `lastMessage`. Subsequent reads from it will return its default value. - public mutating func clearLastMessage() {_uniqueStorage()._lastMessage = nil} - - /// The timestamp of the last activity in this chat - public var lastActivity: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _storage._lastActivity ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_uniqueStorage()._lastActivity = newValue} - } - /// Returns true if `lastActivity` has been explicitly set. - public var hasLastActivity: Bool {return _storage._lastActivity != nil} - /// Clears the value of `lastActivity`. Subsequent reads from it will return its default value. - public mutating func clearLastActivity() {_uniqueStorage()._lastActivity = nil} - - /// The chat's head event sequence — the value of the most recent event in its - /// event log. A client compares this against its locally stored cursor for - /// the chat to decide whether catch-up is needed: if its cursor is behind, it - /// calls Messaging.GetDelta; if equal, it is current and can skip it. - /// - /// This is NOT derivable from last_message: an edit or deletion of an older - /// message advances the head without changing last_message, so this value can - /// exceed last_message.event_sequence. It is the same head reported by - /// GetDeltaResponse.latest_sequence. - public var latestEventSequence: UInt64 { - get {return _storage._latestEventSequence} - set {_uniqueStorage()._latestEventSequence = newValue} - } - - /// Whether this chat is hidden from the requesting owner's chat list. - /// Per-viewer and server-computed (e.g. the chat's peer is on the caller's - /// blocklist). Clients should exclude hidden chats from the primary DM list. - public var isHidden: Bool { - get {return _storage._isHidden} - set {_uniqueStorage()._isHidden = newValue} - } - - /// Title for this chat. Only supported for group chats - public var title: String { - get {return _storage._title} - set {_uniqueStorage()._title = newValue} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -public struct Flipcash_Chat_V1_Member: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - /// The user profile for this member. It contains a subset of identifiers - /// that can be publicly viewed within the chat. - public var userProfile: Flipcash_Profile_V1_UserProfile { - get {return _userProfile ?? Flipcash_Profile_V1_UserProfile()} - set {_userProfile = newValue} - } - /// Returns true if `userProfile` has been explicitly set. - public var hasUserProfile: Bool {return self._userProfile != nil} - /// Clears the value of `userProfile`. Subsequent reads from it will return its default value. - public mutating func clearUserProfile() {self._userProfile = nil} - - /// Chat message state for this member. - /// - /// If set, the list may contain DELIVERED and READ pointers. SENT pointers - /// are only shared between the sender and server, to indicate persistence. - public var pointers: [Flipcash_Messaging_V1_Pointer] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _userProfile: Flipcash_Profile_V1_UserProfile? = nil -} - -public struct Flipcash_Chat_V1_MetadataUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Flipcash_Chat_V1_MetadataUpdate.OneOf_Kind? = nil - - public var fullRefresh: Flipcash_Chat_V1_MetadataUpdate.FullRefresh { - get { - if case .fullRefresh(let v)? = kind {return v} - return Flipcash_Chat_V1_MetadataUpdate.FullRefresh() - } - set {kind = .fullRefresh(newValue)} - } - - public var lastActivityChanged: Flipcash_Chat_V1_MetadataUpdate.LastActivityChanged { - get { - if case .lastActivityChanged(let v)? = kind {return v} - return Flipcash_Chat_V1_MetadataUpdate.LastActivityChanged() - } - set {kind = .lastActivityChanged(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case fullRefresh(Flipcash_Chat_V1_MetadataUpdate.FullRefresh) - case lastActivityChanged(Flipcash_Chat_V1_MetadataUpdate.LastActivityChanged) - - } - - /// Refreshes the entire chat metadata - public struct FullRefresh: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var metadata: Flipcash_Chat_V1_Metadata { - get {return _metadata ?? Flipcash_Chat_V1_Metadata()} - set {_metadata = newValue} - } - /// Returns true if `metadata` has been explicitly set. - public var hasMetadata: Bool {return self._metadata != nil} - /// Clears the value of `metadata`. Subsequent reads from it will return its default value. - public mutating func clearMetadata() {self._metadata = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _metadata: Flipcash_Chat_V1_Metadata? = nil - } - - /// The last activity timestamp has changed to a newer value - public struct LastActivityChanged: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var newLastActivity: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _newLastActivity ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_newLastActivity = newValue} - } - /// Returns true if `newLastActivity` has been explicitly set. - public var hasNewLastActivity: Bool {return self._newLastActivity != nil} - /// Clears the value of `newLastActivity`. Subsequent reads from it will return its default value. - public mutating func clearNewLastActivity() {self._newLastActivity = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _newLastActivity: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.chat.v1" - -extension Flipcash_Chat_V1_ChatType: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}CONTACT_DM\0\u{1}TIP_DM\0\u{1}GROUP\0") -} - -extension Flipcash_Chat_V1_Metadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Metadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}type\0\u{1}members\0\u{3}last_message\0\u{3}last_activity\0\u{3}latest_event_sequence\0\u{3}is_hidden\0\u{1}title\0") - - fileprivate class _StorageClass { - var _chatID: Flipcash_Common_V1_ChatId? = nil - var _type: Flipcash_Chat_V1_ChatType = .unknown - var _members: [Flipcash_Chat_V1_Member] = [] - var _lastMessage: Flipcash_Messaging_V1_Message? = nil - var _lastActivity: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - var _latestEventSequence: UInt64 = 0 - var _isHidden: Bool = false - var _title: String = String() - - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _chatID = source._chatID - _type = source._type - _members = source._members - _lastMessage = source._lastMessage - _lastActivity = source._lastActivity - _latestEventSequence = source._latestEventSequence - _isHidden = source._isHidden - _title = source._title - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._chatID) }() - case 2: try { try decoder.decodeSingularEnumField(value: &_storage._type) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &_storage._members) }() - case 4: try { try decoder.decodeSingularMessageField(value: &_storage._lastMessage) }() - case 5: try { try decoder.decodeSingularMessageField(value: &_storage._lastActivity) }() - case 6: try { try decoder.decodeSingularUInt64Field(value: &_storage._latestEventSequence) }() - case 7: try { try decoder.decodeSingularBoolField(value: &_storage._isHidden) }() - case 8: try { try decoder.decodeSingularStringField(value: &_storage._title) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if _storage._type != .unknown { - try visitor.visitSingularEnumField(value: _storage._type, fieldNumber: 2) - } - if !_storage._members.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._members, fieldNumber: 3) - } - try { if let v = _storage._lastMessage { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = _storage._lastActivity { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - if _storage._latestEventSequence != 0 { - try visitor.visitSingularUInt64Field(value: _storage._latestEventSequence, fieldNumber: 6) - } - if _storage._isHidden != false { - try visitor.visitSingularBoolField(value: _storage._isHidden, fieldNumber: 7) - } - if !_storage._title.isEmpty { - try visitor.visitSingularStringField(value: _storage._title, fieldNumber: 8) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_Metadata, rhs: Flipcash_Chat_V1_Metadata) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._chatID != rhs_storage._chatID {return false} - if _storage._type != rhs_storage._type {return false} - if _storage._members != rhs_storage._members {return false} - if _storage._lastMessage != rhs_storage._lastMessage {return false} - if _storage._lastActivity != rhs_storage._lastActivity {return false} - if _storage._latestEventSequence != rhs_storage._latestEventSequence {return false} - if _storage._isHidden != rhs_storage._isHidden {return false} - if _storage._title != rhs_storage._title {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Chat_V1_Member: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Member" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{3}user_profile\0\u{1}pointers\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._userProfile) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.pointers) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._userProfile { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.pointers.isEmpty { - try visitor.visitRepeatedMessageField(value: self.pointers, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_Member, rhs: Flipcash_Chat_V1_Member) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs._userProfile != rhs._userProfile {return false} - if lhs.pointers != rhs.pointers {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Chat_V1_MetadataUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MetadataUpdate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}full_refresh\0\u{3}last_activity_changed\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Chat_V1_MetadataUpdate.FullRefresh? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .fullRefresh(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .fullRefresh(v) - } - }() - case 2: try { - var v: Flipcash_Chat_V1_MetadataUpdate.LastActivityChanged? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .lastActivityChanged(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .lastActivityChanged(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.kind { - case .fullRefresh?: try { - guard case .fullRefresh(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .lastActivityChanged?: try { - guard case .lastActivityChanged(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_MetadataUpdate, rhs: Flipcash_Chat_V1_MetadataUpdate) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Chat_V1_MetadataUpdate.FullRefresh: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Chat_V1_MetadataUpdate.protoMessageName + ".FullRefresh" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}metadata\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._metadata) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._metadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_MetadataUpdate.FullRefresh, rhs: Flipcash_Chat_V1_MetadataUpdate.FullRefresh) -> Bool { - if lhs._metadata != rhs._metadata {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Chat_V1_MetadataUpdate.LastActivityChanged: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Chat_V1_MetadataUpdate.protoMessageName + ".LastActivityChanged" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}new_last_activity\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._newLastActivity) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._newLastActivity { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Chat_V1_MetadataUpdate.LastActivityChanged, rhs: Flipcash_Chat_V1_MetadataUpdate.LastActivityChanged) -> Bool { - if lhs._newLastActivity != rhs._newLastActivity {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/common_v1_common.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/common_v1_common.pb.swift deleted file mode 100644 index 09ac91df8..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/common_v1_common.pb.swift +++ /dev/null @@ -1,1386 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: common/v1/common.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public enum Flipcash_Common_V1_Platform: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case apple // = 1 - case google // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .apple - case 2: self = .google - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .apple: return 1 - case .google: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Common_V1_Platform] = [ - .unknown, - .apple, - .google, - ] - -} - -public struct Flipcash_Common_V1_PublicKey: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Common_V1_Signature: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Common_V1_Hash: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Auth provides an authentication information for RPCs/messages. -/// -/// Currently, only a single form is supported, but it may be useful in -/// the future to rely on session tokens instead. -public struct Flipcash_Common_V1_Auth: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Flipcash_Common_V1_Auth.OneOf_Kind? = nil - - /// KeyPair uses pub key cryptography to verify. - public var keyPair: Flipcash_Common_V1_Auth.KeyPair { - get { - if case .keyPair(let v)? = kind {return v} - return Flipcash_Common_V1_Auth.KeyPair() - } - set {kind = .keyPair(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - /// KeyPair uses pub key cryptography to verify. - case keyPair(Flipcash_Common_V1_Auth.KeyPair) - - } - - /// KeyPair uses a keypair to verify a message. - /// - /// The signature should be of the encapsulating proto message, - /// _without_ the Auth section being set. - public struct KeyPair: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var pubKey: Flipcash_Common_V1_PublicKey { - get {return _pubKey ?? Flipcash_Common_V1_PublicKey()} - set {_pubKey = newValue} - } - /// Returns true if `pubKey` has been explicitly set. - public var hasPubKey: Bool {return self._pubKey != nil} - /// Clears the value of `pubKey`. Subsequent reads from it will return its default value. - public mutating func clearPubKey() {self._pubKey = nil} - - public var signature: Flipcash_Common_V1_Signature { - get {return _signature ?? Flipcash_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _pubKey: Flipcash_Common_V1_PublicKey? = nil - fileprivate var _signature: Flipcash_Common_V1_Signature? = nil - } - - public init() {} -} - -public struct Flipcash_Common_V1_UserId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Username is a user's unique handle on Flipcash. It uses the same character -/// set as X — letters, digits and underscores — with the exception that it must -/// be lowercase. -public struct Flipcash_Common_V1_Username: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Common_V1_ChatId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// value has the following structure: - /// - 32 byte hash for DMs - /// - 16 byte UUID for group chats - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Common_V1_IntentId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// AppInstallId is a unque ID tied to a client app installation. It does not -/// identify a device. Value should remain private and not be shared across -/// installs. -public struct Flipcash_Common_V1_AppInstallId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// PhoneNumber is an E.164 phone number -public struct Flipcash_Common_V1_PhoneNumber: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Regex provided by Twilio here: https://www.twilio.com/docs/glossary/what-e164#regex-matching-for-e164 - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// EmailAddress is an email address -public struct Flipcash_Common_V1_EmailAddress: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// CryptoPaymentAmount defines an amount of crypto with currency exchange data -public struct Flipcash_Common_V1_CryptoPaymentAmount: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// ISO 4217 alpha-3 currency code the payment was made in - public var currency: String = String() - - /// The amount in the native currency that was paid - public var nativeAmount: Double = 0 - - /// The amount in quarks of crypto that was paid - public var quarks: UInt64 = 0 - - /// The crypto mint that was paid - public var mint: Flipcash_Common_V1_PublicKey { - get {return _mint ?? Flipcash_Common_V1_PublicKey()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _mint: Flipcash_Common_V1_PublicKey? = nil -} - -/// FiatPaymentAmount defines an amount of fiat -public struct Flipcash_Common_V1_FiatPaymentAmount: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// ISO 4217 alpha-3 currency code the payment was made in - public var currency: String = String() - - /// The amount in the native currency that was paid - public var nativeAmount: Double = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Common_V1_PagingToken: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Common_V1_QueryOptions: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// PageSize limits the maximum page size of a response. - /// - /// Server may choose to return less items. If <= 0, - /// server may select an arbitrary default page size. - public var pageSize: Int32 = 0 - - /// PagingToken is a token that can be extracted from the - /// identifier of a collection. - public var pagingToken: Flipcash_Common_V1_PagingToken { - get {return _pagingToken ?? Flipcash_Common_V1_PagingToken()} - set {_pagingToken = newValue} - } - /// Returns true if `pagingToken` has been explicitly set. - public var hasPagingToken: Bool {return self._pagingToken != nil} - /// Clears the value of `pagingToken`. Subsequent reads from it will return its default value. - public mutating func clearPagingToken() {self._pagingToken = nil} - - /// Order is the order of elements, if applicable. - public var order: Flipcash_Common_V1_QueryOptions.Order = .asc - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Order: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case asc // = 0 - case desc // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .asc - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .asc - case 1: self = .desc - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .asc: return 0 - case .desc: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Common_V1_QueryOptions.Order] = [ - .asc, - .desc, - ] - - } - - public init() {} - - fileprivate var _pagingToken: Flipcash_Common_V1_PagingToken? = nil -} - -/// Request is a generic wrapper for gRPC requests -public struct Flipcash_Common_V1_Request: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var version: String = String() - - public var service: String = String() - - public var method: String = String() - - public var body: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Response is a generic wrapper for gRPC responses -public struct Flipcash_Common_V1_Response: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Common_V1_Response.Result = .ok - - public var body: Data = Data() - - public var message: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case error // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .error - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .error: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Common_V1_Response.Result] = [ - .ok, - .error, - ] - - } - - public init() {} -} - -public struct Flipcash_Common_V1_CountryCode: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// ISO 3166-1 Alpha-2 - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Locale represents an IETF BCP 47 language tag (e.g. "en", "en-US", "zh-Hans-CN") -public struct Flipcash_Common_V1_Locale: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Region represents a fiat currency region identified by its ISO 4217 alpha-3 currency code (e.g. "usd", "eur") -public struct Flipcash_Common_V1_Region: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Color represents an RGB colour -public struct Flipcash_Common_V1_Color: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Hex colour value (e.g. "#19191A") - public var hex: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Substitution is a text subsitution -public struct Flipcash_Common_V1_Substitution: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Fallback string for forwards compatibility - public var fallback: String = String() - - public var kind: Flipcash_Common_V1_Substitution.OneOf_Kind? = nil - - /// Phone number -> contact name or formatted phone number - public var phoneNumberToContactName: Flipcash_Common_V1_PhoneNumber { - get { - if case .phoneNumberToContactName(let v)? = kind {return v} - return Flipcash_Common_V1_PhoneNumber() - } - set {kind = .phoneNumberToContactName(newValue)} - } - - /// User ID -> display name - public var userIDToDisplayName: Flipcash_Common_V1_UserId { - get { - if case .userIDToDisplayName(let v)? = kind {return v} - return Flipcash_Common_V1_UserId() - } - set {kind = .userIDToDisplayName(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - /// Phone number -> contact name or formatted phone number - case phoneNumberToContactName(Flipcash_Common_V1_PhoneNumber) - /// User ID -> display name - case userIDToDisplayName(Flipcash_Common_V1_UserId) - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.common.v1" - -extension Flipcash_Common_V1_Platform: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}APPLE\0\u{1}GOOGLE\0") -} - -extension Flipcash_Common_V1_PublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PublicKey" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_PublicKey, rhs: Flipcash_Common_V1_PublicKey) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Signature: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Signature" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Signature, rhs: Flipcash_Common_V1_Signature) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Hash: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Hash" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Hash, rhs: Flipcash_Common_V1_Hash) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Auth: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Auth" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}key_pair\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Common_V1_Auth.KeyPair? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .keyPair(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .keyPair(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .keyPair(let v)? = self.kind { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Auth, rhs: Flipcash_Common_V1_Auth) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Auth.KeyPair: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Common_V1_Auth.protoMessageName + ".KeyPair" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}pub_key\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._pubKey) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._pubKey { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Auth.KeyPair, rhs: Flipcash_Common_V1_Auth.KeyPair) -> Bool { - if lhs._pubKey != rhs._pubKey {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_UserId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UserId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_UserId, rhs: Flipcash_Common_V1_UserId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Username: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Username" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Username, rhs: Flipcash_Common_V1_Username) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_ChatId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ChatId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_ChatId, rhs: Flipcash_Common_V1_ChatId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_IntentId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IntentId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_IntentId, rhs: Flipcash_Common_V1_IntentId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_AppInstallId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AppInstallId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_AppInstallId, rhs: Flipcash_Common_V1_AppInstallId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_PhoneNumber: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PhoneNumber" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_PhoneNumber, rhs: Flipcash_Common_V1_PhoneNumber) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_EmailAddress: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EmailAddress" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_EmailAddress, rhs: Flipcash_Common_V1_EmailAddress) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_CryptoPaymentAmount: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CryptoPaymentAmount" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}currency\0\u{3}native_amount\0\u{1}quarks\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.currency) }() - case 2: try { try decoder.decodeSingularDoubleField(value: &self.nativeAmount) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.quarks) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.currency.isEmpty { - try visitor.visitSingularStringField(value: self.currency, fieldNumber: 1) - } - if self.nativeAmount.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.nativeAmount, fieldNumber: 2) - } - if self.quarks != 0 { - try visitor.visitSingularUInt64Field(value: self.quarks, fieldNumber: 3) - } - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_CryptoPaymentAmount, rhs: Flipcash_Common_V1_CryptoPaymentAmount) -> Bool { - if lhs.currency != rhs.currency {return false} - if lhs.nativeAmount != rhs.nativeAmount {return false} - if lhs.quarks != rhs.quarks {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_FiatPaymentAmount: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FiatPaymentAmount" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}currency\0\u{3}native_amount\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.currency) }() - case 2: try { try decoder.decodeSingularDoubleField(value: &self.nativeAmount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.currency.isEmpty { - try visitor.visitSingularStringField(value: self.currency, fieldNumber: 1) - } - if self.nativeAmount.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.nativeAmount, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_FiatPaymentAmount, rhs: Flipcash_Common_V1_FiatPaymentAmount) -> Bool { - if lhs.currency != rhs.currency {return false} - if lhs.nativeAmount != rhs.nativeAmount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_PagingToken: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PagingToken" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_PagingToken, rhs: Flipcash_Common_V1_PagingToken) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_QueryOptions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".QueryOptions" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}page_size\0\u{3}paging_token\0\u{1}order\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.pageSize) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._pagingToken) }() - case 3: try { try decoder.decodeSingularEnumField(value: &self.order) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.pageSize != 0 { - try visitor.visitSingularInt32Field(value: self.pageSize, fieldNumber: 1) - } - try { if let v = self._pagingToken { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.order != .asc { - try visitor.visitSingularEnumField(value: self.order, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_QueryOptions, rhs: Flipcash_Common_V1_QueryOptions) -> Bool { - if lhs.pageSize != rhs.pageSize {return false} - if lhs._pagingToken != rhs._pagingToken {return false} - if lhs.order != rhs.order {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_QueryOptions.Order: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0ASC\0\u{1}DESC\0") -} - -extension Flipcash_Common_V1_Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Request" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{1}service\0\u{1}method\0\u{1}body\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.version) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.service) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.method) }() - case 4: try { try decoder.decodeSingularBytesField(value: &self.body) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.version.isEmpty { - try visitor.visitSingularStringField(value: self.version, fieldNumber: 1) - } - if !self.service.isEmpty { - try visitor.visitSingularStringField(value: self.service, fieldNumber: 2) - } - if !self.method.isEmpty { - try visitor.visitSingularStringField(value: self.method, fieldNumber: 3) - } - if !self.body.isEmpty { - try visitor.visitSingularBytesField(value: self.body, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Request, rhs: Flipcash_Common_V1_Request) -> Bool { - if lhs.version != rhs.version {return false} - if lhs.service != rhs.service {return false} - if lhs.method != rhs.method {return false} - if lhs.body != rhs.body {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Response" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}body\0\u{1}message\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.body) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.message) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.body.isEmpty { - try visitor.visitSingularBytesField(value: self.body, fieldNumber: 2) - } - if !self.message.isEmpty { - try visitor.visitSingularStringField(value: self.message, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Response, rhs: Flipcash_Common_V1_Response) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.body != rhs.body {return false} - if lhs.message != rhs.message {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Response.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}ERROR\0") -} - -extension Flipcash_Common_V1_CountryCode: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CountryCode" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_CountryCode, rhs: Flipcash_Common_V1_CountryCode) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Locale: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Locale" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Locale, rhs: Flipcash_Common_V1_Locale) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Region: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Region" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Region, rhs: Flipcash_Common_V1_Region) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Color: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Color" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}hex\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.hex) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.hex.isEmpty { - try visitor.visitSingularStringField(value: self.hex, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Color, rhs: Flipcash_Common_V1_Color) -> Bool { - if lhs.hex != rhs.hex {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Common_V1_Substitution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Substitution" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}fallback\0\u{3}phone_number_to_contact_name\0\u{3}user_id_to_display_name\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.fallback) }() - case 2: try { - var v: Flipcash_Common_V1_PhoneNumber? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .phoneNumberToContactName(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .phoneNumberToContactName(v) - } - }() - case 3: try { - var v: Flipcash_Common_V1_UserId? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .userIDToDisplayName(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .userIDToDisplayName(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.fallback.isEmpty { - try visitor.visitSingularStringField(value: self.fallback, fieldNumber: 1) - } - switch self.kind { - case .phoneNumberToContactName?: try { - guard case .phoneNumberToContactName(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .userIDToDisplayName?: try { - guard case .userIDToDisplayName(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Common_V1_Substitution, rhs: Flipcash_Common_V1_Substitution) -> Bool { - if lhs.fallback != rhs.fallback {return false} - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_contact_list_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_contact_list_service.grpc.swift deleted file mode 100644 index c3151f8c7..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_contact_list_service.grpc.swift +++ /dev/null @@ -1,634 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: contact/v1/contact_list_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.contact.v1.ContactList - -/// Namespace containing generated types for the "flipcash.contact.v1.ContactList" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Contact_V1_ContactList { - /// Service descriptor for the "flipcash.contact.v1.ContactList" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.contact.v1.ContactList") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "CheckSync" metadata. - public enum CheckSync { - /// Request type for "CheckSync". - public typealias Input = Flipcash_Contact_V1_CheckSyncRequest - /// Response type for "CheckSync". - public typealias Output = Flipcash_Contact_V1_CheckSyncResponse - /// Descriptor for "CheckSync". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.contact.v1.ContactList"), - method: "CheckSync" - ) - } - /// Namespace for "DeltaUpload" metadata. - public enum DeltaUpload { - /// Request type for "DeltaUpload". - public typealias Input = Flipcash_Contact_V1_DeltaUploadRequest - /// Response type for "DeltaUpload". - public typealias Output = Flipcash_Contact_V1_DeltaUploadResponse - /// Descriptor for "DeltaUpload". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.contact.v1.ContactList"), - method: "DeltaUpload" - ) - } - /// Namespace for "FullUpload" metadata. - public enum FullUpload { - /// Request type for "FullUpload". - public typealias Input = Flipcash_Contact_V1_FullUploadRequest - /// Response type for "FullUpload". - public typealias Output = Flipcash_Contact_V1_FullUploadResponse - /// Descriptor for "FullUpload". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.contact.v1.ContactList"), - method: "FullUpload" - ) - } - /// Namespace for "GetFlipcashContacts" metadata. - public enum GetFlipcashContacts { - /// Request type for "GetFlipcashContacts". - public typealias Input = Flipcash_Contact_V1_GetFlipcashContactsRequest - /// Response type for "GetFlipcashContacts". - public typealias Output = Flipcash_Contact_V1_GetFlipcashContactsResponse - /// Descriptor for "GetFlipcashContacts". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.contact.v1.ContactList"), - method: "GetFlipcashContacts" - ) - } - /// Descriptors for all methods in the "flipcash.contact.v1.ContactList" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - CheckSync.descriptor, - DeltaUpload.descriptor, - FullUpload.descriptor, - GetFlipcashContacts.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.contact.v1.ContactList" service. - public static let flipcash_contact_v1_ContactList = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.contact.v1.ContactList") -} - -// MARK: flipcash.contact.v1.ContactList (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Contact_V1_ContactList { - /// Generated client protocol for the "flipcash.contact.v1.ContactList" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - /// - /// > Source IDL Documentation: - /// > - /// > ContactList manages a user's contact list and surfaces which contacts are - /// > Flipcash users. - /// > - /// > Sync model: - /// > - The client maintains a 32-byte XOR-of-SHA256 checksum over its current - /// > contact set, and an OS-specific cursor for incremental change discovery. - /// > The cursor is local-only and never leaves the device. - /// > - Steady state: client computes a delta from the OS cursor, sends it via - /// > DeltaUpload with old/new checksums for compare-and-swap. - /// > - Recovery: on first install, after OS history truncation, or after - /// > CHECKSUM_DRIFT, the client uses FullUpload to replace the server's state - /// > wholesale. - public protocol ClientProtocol: Sendable { - /// Call the "CheckSync" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckSync compares the client's checksum to the server's. Cheap, used - /// > on app foreground to decide whether any upload is needed. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_CheckSyncRequest` message. - /// - serializer: A serializer for `Flipcash_Contact_V1_CheckSyncRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Contact_V1_CheckSyncResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func checkSync( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "DeltaUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeltaUpload applies a delta under compare-and-swap on the checksum. - /// > Safe to retry indefinitely with the same payload. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_DeltaUploadRequest` message. - /// - serializer: A serializer for `Flipcash_Contact_V1_DeltaUploadRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Contact_V1_DeltaUploadResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func deltaUpload( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "FullUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > FullUpload replaces the user's contact set entirely. Used when - /// > a delta cannot be constructed or CHECKSUM_DRIFT was returned. - /// - /// - Parameters: - /// - request: A streaming request producing `Flipcash_Contact_V1_FullUploadRequest` messages. - /// - serializer: A serializer for `Flipcash_Contact_V1_FullUploadRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Contact_V1_FullUploadResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func fullUpload( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetFlipcashContacts" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetFlipcashContacts gets the set of contacts that are on Flipcash - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_GetFlipcashContactsRequest` message. - /// - serializer: A serializer for `Flipcash_Contact_V1_GetFlipcashContactsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Contact_V1_GetFlipcashContactsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getFlipcashContacts( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.contact.v1.ContactList" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - /// - /// > Source IDL Documentation: - /// > - /// > ContactList manages a user's contact list and surfaces which contacts are - /// > Flipcash users. - /// > - /// > Sync model: - /// > - The client maintains a 32-byte XOR-of-SHA256 checksum over its current - /// > contact set, and an OS-specific cursor for incremental change discovery. - /// > The cursor is local-only and never leaves the device. - /// > - Steady state: client computes a delta from the OS cursor, sends it via - /// > DeltaUpload with old/new checksums for compare-and-swap. - /// > - Recovery: on first install, after OS history truncation, or after - /// > CHECKSUM_DRIFT, the client uses FullUpload to replace the server's state - /// > wholesale. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "CheckSync" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckSync compares the client's checksum to the server's. Cheap, used - /// > on app foreground to decide whether any upload is needed. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_CheckSyncRequest` message. - /// - serializer: A serializer for `Flipcash_Contact_V1_CheckSyncRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Contact_V1_CheckSyncResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkSync( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Contact_V1_ContactList.Method.CheckSync.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeltaUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeltaUpload applies a delta under compare-and-swap on the checksum. - /// > Safe to retry indefinitely with the same payload. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_DeltaUploadRequest` message. - /// - serializer: A serializer for `Flipcash_Contact_V1_DeltaUploadRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Contact_V1_DeltaUploadResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deltaUpload( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Contact_V1_ContactList.Method.DeltaUpload.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "FullUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > FullUpload replaces the user's contact set entirely. Used when - /// > a delta cannot be constructed or CHECKSUM_DRIFT was returned. - /// - /// - Parameters: - /// - request: A streaming request producing `Flipcash_Contact_V1_FullUploadRequest` messages. - /// - serializer: A serializer for `Flipcash_Contact_V1_FullUploadRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Contact_V1_FullUploadResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func fullUpload( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.clientStreaming( - request: request, - descriptor: Flipcash_Contact_V1_ContactList.Method.FullUpload.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetFlipcashContacts" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetFlipcashContacts gets the set of contacts that are on Flipcash - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_GetFlipcashContactsRequest` message. - /// - serializer: A serializer for `Flipcash_Contact_V1_GetFlipcashContactsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Contact_V1_GetFlipcashContactsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getFlipcashContacts( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.serverStreaming( - request: request, - descriptor: Flipcash_Contact_V1_ContactList.Method.GetFlipcashContacts.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Contact_V1_ContactList.ClientProtocol { - /// Call the "CheckSync" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckSync compares the client's checksum to the server's. Cheap, used - /// > on app foreground to decide whether any upload is needed. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_CheckSyncRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkSync( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.checkSync( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeltaUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeltaUpload applies a delta under compare-and-swap on the checksum. - /// > Safe to retry indefinitely with the same payload. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_DeltaUploadRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deltaUpload( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.deltaUpload( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "FullUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > FullUpload replaces the user's contact set entirely. Used when - /// > a delta cannot be constructed or CHECKSUM_DRIFT was returned. - /// - /// - Parameters: - /// - request: A streaming request producing `Flipcash_Contact_V1_FullUploadRequest` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func fullUpload( - request: GRPCCore.StreamingClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.fullUpload( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetFlipcashContacts" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetFlipcashContacts gets the set of contacts that are on Flipcash - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Contact_V1_GetFlipcashContactsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getFlipcashContacts( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.getFlipcashContacts( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Contact_V1_ContactList.ClientProtocol { - /// Call the "CheckSync" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckSync compares the client's checksum to the server's. Cheap, used - /// > on app foreground to decide whether any upload is needed. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkSync( - _ message: Flipcash_Contact_V1_CheckSyncRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.checkSync( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeltaUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeltaUpload applies a delta under compare-and-swap on the checksum. - /// > Safe to retry indefinitely with the same payload. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deltaUpload( - _ message: Flipcash_Contact_V1_DeltaUploadRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.deltaUpload( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "FullUpload" method. - /// - /// > Source IDL Documentation: - /// > - /// > FullUpload replaces the user's contact set entirely. Used when - /// > a delta cannot be constructed or CHECKSUM_DRIFT was returned. - /// - /// - Parameters: - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - producer: A closure producing request messages to send to the server. The request - /// stream is closed when the closure returns. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func fullUpload( - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - requestProducer producer: @Sendable @escaping (GRPCCore.RPCWriter) async throws -> Void, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.StreamingClientRequest( - metadata: metadata, - producer: producer - ) - return try await self.fullUpload( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetFlipcashContacts" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetFlipcashContacts gets the set of contacts that are on Flipcash - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getFlipcashContacts( - _ message: Flipcash_Contact_V1_GetFlipcashContactsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getFlipcashContacts( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_contact_list_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_contact_list_service.pb.swift deleted file mode 100644 index 9ecb52490..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_contact_list_service.pb.swift +++ /dev/null @@ -1,741 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: contact/v1/contact_list_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Contact_V1_CheckSyncRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - /// XOR-of-SHA256 over the client's current set of normalized E.164 phones. - public var clientChecksum: Flipcash_Common_V1_Hash { - get {return _clientChecksum ?? Flipcash_Common_V1_Hash()} - set {_clientChecksum = newValue} - } - /// Returns true if `clientChecksum` has been explicitly set. - public var hasClientChecksum: Bool {return self._clientChecksum != nil} - /// Clears the value of `clientChecksum`. Subsequent reads from it will return its default value. - public mutating func clearClientChecksum() {self._clientChecksum = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _clientChecksum: Flipcash_Common_V1_Hash? = nil -} - -public struct Flipcash_Contact_V1_CheckSyncResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Contact_V1_CheckSyncResponse.Result = .ok - - /// Authoritative server-side checksum. Clients persist this and use it - /// as the basis for the next DeltaUpload.old_checksum. - public var serverChecksum: Flipcash_Common_V1_Hash { - get {return _serverChecksum ?? Flipcash_Common_V1_Hash()} - set {_serverChecksum = newValue} - } - /// Returns true if `serverChecksum` has been explicitly set. - public var hasServerChecksum: Bool {return self._serverChecksum != nil} - /// Clears the value of `serverChecksum`. Subsequent reads from it will return its default value. - public mutating func clearServerChecksum() {self._serverChecksum = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case outOfSync // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .outOfSync - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .outOfSync: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Contact_V1_CheckSyncResponse.Result] = [ - .ok, - .denied, - .outOfSync, - ] - - } - - public init() {} - - fileprivate var _serverChecksum: Flipcash_Common_V1_Hash? = nil -} - -public struct Flipcash_Contact_V1_DeltaUploadRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var adds: [Flipcash_Common_V1_PhoneNumber] = [] - - public var removes: [Flipcash_Common_V1_PhoneNumber] = [] - - /// The checksum the client expected the server to have *before* applying - /// this delta. Server applies only if stored == old_checksum. - public var oldChecksum: Flipcash_Common_V1_Hash { - get {return _oldChecksum ?? Flipcash_Common_V1_Hash()} - set {_oldChecksum = newValue} - } - /// Returns true if `oldChecksum` has been explicitly set. - public var hasOldChecksum: Bool {return self._oldChecksum != nil} - /// Clears the value of `oldChecksum`. Subsequent reads from it will return its default value. - public mutating func clearOldChecksum() {self._oldChecksum = nil} - - /// The checksum the client computes for the state *after* applying this - /// delta. Server persists this on success. Used to detect retries: if - /// stored == new_checksum, the server treats the request as a no-op. - public var newChecksum: Flipcash_Common_V1_Hash { - get {return _newChecksum ?? Flipcash_Common_V1_Hash()} - set {_newChecksum = newValue} - } - /// Returns true if `newChecksum` has been explicitly set. - public var hasNewChecksum: Bool {return self._newChecksum != nil} - /// Clears the value of `newChecksum`. Subsequent reads from it will return its default value. - public mutating func clearNewChecksum() {self._newChecksum = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _oldChecksum: Flipcash_Common_V1_Hash? = nil - fileprivate var _newChecksum: Flipcash_Common_V1_Hash? = nil -} - -public struct Flipcash_Contact_V1_DeltaUploadResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Contact_V1_DeltaUploadResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// Server's recomputed checksum did not match expected_checksum. - case checksumMismatch // = 2 - - /// Stored checksum matched neither old_checksum nor new_checksum. - /// Client should call FullUpload to reconcile. - case checksumDrift // = 3 - case tooManyContacts // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .checksumMismatch - case 3: self = .checksumDrift - case 4: self = .tooManyContacts - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .checksumMismatch: return 2 - case .checksumDrift: return 3 - case .tooManyContacts: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Contact_V1_DeltaUploadResponse.Result] = [ - .ok, - .denied, - .checksumMismatch, - .checksumDrift, - .tooManyContacts, - ] - - } - - public init() {} -} - -public struct Flipcash_Contact_V1_FullUploadRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - /// The complete current contact set. Server replaces stored state with - /// this list in one transaction. - public var phones: [Flipcash_Common_V1_PhoneNumber] = [] - - /// XOR-of-SHA256 over the client's current set of normalized E.164 phones. - /// Sent on the last streamed request to indicate the end of the upload. - public var expectedChecksum: Flipcash_Common_V1_Hash { - get {return _expectedChecksum ?? Flipcash_Common_V1_Hash()} - set {_expectedChecksum = newValue} - } - /// Returns true if `expectedChecksum` has been explicitly set. - public var hasExpectedChecksum: Bool {return self._expectedChecksum != nil} - /// Clears the value of `expectedChecksum`. Subsequent reads from it will return its default value. - public mutating func clearExpectedChecksum() {self._expectedChecksum = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _expectedChecksum: Flipcash_Common_V1_Hash? = nil -} - -public struct Flipcash_Contact_V1_FullUploadResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Contact_V1_FullUploadResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// Server's recomputed checksum did not match expected_checksum. - case checksumMismatch // = 2 - case tooManyContacts // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .checksumMismatch - case 3: self = .tooManyContacts - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .checksumMismatch: return 2 - case .tooManyContacts: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Contact_V1_FullUploadResponse.Result] = [ - .ok, - .denied, - .checksumMismatch, - .tooManyContacts, - ] - - } - - public init() {} -} - -public struct Flipcash_Contact_V1_GetFlipcashContactsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var checksum: Flipcash_Common_V1_Hash { - get {return _checksum ?? Flipcash_Common_V1_Hash()} - set {_checksum = newValue} - } - /// Returns true if `checksum` has been explicitly set. - public var hasChecksum: Bool {return self._checksum != nil} - /// Clears the value of `checksum`. Subsequent reads from it will return its default value. - public mutating func clearChecksum() {self._checksum = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _checksum: Flipcash_Common_V1_Hash? = nil -} - -public struct Flipcash_Contact_V1_GetFlipcashContactsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Contact_V1_GetFlipcashContactsResponse.Result = .ok - - public var contacts: [Flipcash_Contact_V1_FlipcashContact] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case notFound // = 2 - - /// Server checksum doesn't match client checksum. - case checksumDrift // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .notFound - case 3: self = .checksumDrift - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .notFound: return 2 - case .checksumDrift: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Contact_V1_GetFlipcashContactsResponse.Result] = [ - .ok, - .denied, - .notFound, - .checksumDrift, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.contact.v1" - -extension Flipcash_Contact_V1_CheckSyncRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CheckSyncRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{3}client_checksum\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._clientChecksum) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._clientChecksum { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_CheckSyncRequest, rhs: Flipcash_Contact_V1_CheckSyncRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs._clientChecksum != rhs._clientChecksum {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Contact_V1_CheckSyncResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CheckSyncResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}server_checksum\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._serverChecksum) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._serverChecksum { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_CheckSyncResponse, rhs: Flipcash_Contact_V1_CheckSyncResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._serverChecksum != rhs._serverChecksum {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Contact_V1_CheckSyncResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}OUT_OF_SYNC\0") -} - -extension Flipcash_Contact_V1_DeltaUploadRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DeltaUploadRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{1}adds\0\u{1}removes\0\u{3}old_checksum\0\u{3}new_checksum\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.adds) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.removes) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._oldChecksum) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._newChecksum) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.adds.isEmpty { - try visitor.visitRepeatedMessageField(value: self.adds, fieldNumber: 2) - } - if !self.removes.isEmpty { - try visitor.visitRepeatedMessageField(value: self.removes, fieldNumber: 3) - } - try { if let v = self._oldChecksum { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._newChecksum { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_DeltaUploadRequest, rhs: Flipcash_Contact_V1_DeltaUploadRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs.adds != rhs.adds {return false} - if lhs.removes != rhs.removes {return false} - if lhs._oldChecksum != rhs._oldChecksum {return false} - if lhs._newChecksum != rhs._newChecksum {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Contact_V1_DeltaUploadResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DeltaUploadResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_DeltaUploadResponse, rhs: Flipcash_Contact_V1_DeltaUploadResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Contact_V1_DeltaUploadResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}CHECKSUM_MISMATCH\0\u{1}CHECKSUM_DRIFT\0\u{1}TOO_MANY_CONTACTS\0") -} - -extension Flipcash_Contact_V1_FullUploadRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FullUploadRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{1}phones\0\u{3}expected_checksum\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.phones) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._expectedChecksum) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.phones.isEmpty { - try visitor.visitRepeatedMessageField(value: self.phones, fieldNumber: 2) - } - try { if let v = self._expectedChecksum { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_FullUploadRequest, rhs: Flipcash_Contact_V1_FullUploadRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs.phones != rhs.phones {return false} - if lhs._expectedChecksum != rhs._expectedChecksum {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Contact_V1_FullUploadResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FullUploadResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_FullUploadResponse, rhs: Flipcash_Contact_V1_FullUploadResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Contact_V1_FullUploadResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}CHECKSUM_MISMATCH\0\u{1}TOO_MANY_CONTACTS\0") -} - -extension Flipcash_Contact_V1_GetFlipcashContactsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetFlipcashContactsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{1}checksum\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._checksum) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._checksum { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_GetFlipcashContactsRequest, rhs: Flipcash_Contact_V1_GetFlipcashContactsRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs._checksum != rhs._checksum {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Contact_V1_GetFlipcashContactsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetFlipcashContactsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}contacts\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.contacts) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.contacts.isEmpty { - try visitor.visitRepeatedMessageField(value: self.contacts, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_GetFlipcashContactsResponse, rhs: Flipcash_Contact_V1_GetFlipcashContactsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.contacts != rhs.contacts {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Contact_V1_GetFlipcashContactsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}NOT_FOUND\0\u{1}CHECKSUM_DRIFT\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_model.pb.swift deleted file mode 100644 index ea7b39190..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/contact_v1_model.pb.swift +++ /dev/null @@ -1,113 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: contact/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Contact_V1_FlipcashContact: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var phone: Flipcash_Common_V1_PhoneNumber { - get {return _phone ?? Flipcash_Common_V1_PhoneNumber()} - set {_phone = newValue} - } - /// Returns true if `phone` has been explicitly set. - public var hasPhone: Bool {return self._phone != nil} - /// Clears the value of `phone`. Subsequent reads from it will return its default value. - public mutating func clearPhone() {self._phone = nil} - - /// The DM chat ID for the Flipcash contact. If the chat doesn't exist, it needs - /// to be initiated with a cash send to initialize it - public var dmChatID: Flipcash_Common_V1_ChatId { - get {return _dmChatID ?? Flipcash_Common_V1_ChatId()} - set {_dmChatID = newValue} - } - /// Returns true if `dmChatID` has been explicitly set. - public var hasDmChatID: Bool {return self._dmChatID != nil} - /// Clears the value of `dmChatID`. Subsequent reads from it will return its default value. - public mutating func clearDmChatID() {self._dmChatID = nil} - - /// Timestamp the contact joined Flipcash - public var joinTs: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _joinTs ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_joinTs = newValue} - } - /// Returns true if `joinTs` has been explicitly set. - public var hasJoinTs: Bool {return self._joinTs != nil} - /// Clears the value of `joinTs`. Subsequent reads from it will return its default value. - public mutating func clearJoinTs() {self._joinTs = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _phone: Flipcash_Common_V1_PhoneNumber? = nil - fileprivate var _dmChatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _joinTs: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.contact.v1" - -extension Flipcash_Contact_V1_FlipcashContact: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FlipcashContact" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}phone\0\u{3}dm_chat_id\0\u{3}join_ts\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._phone) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._dmChatID) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._joinTs) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._phone { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._dmChatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._joinTs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Contact_V1_FlipcashContact, rhs: Flipcash_Contact_V1_FlipcashContact) -> Bool { - if lhs._phone != rhs._phone {return false} - if lhs._dmChatID != rhs._dmChatID {return false} - if lhs._joinTs != rhs._joinTs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_email_verification_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_email_verification_service.grpc.swift deleted file mode 100644 index 478a05ae9..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_email_verification_service.grpc.swift +++ /dev/null @@ -1,477 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: email/v1/email_verification_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.email.v1.EmailVerification - -/// Namespace containing generated types for the "flipcash.email.v1.EmailVerification" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Email_V1_EmailVerification { - /// Service descriptor for the "flipcash.email.v1.EmailVerification" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.email.v1.EmailVerification") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "SendVerificationCode" metadata. - public enum SendVerificationCode { - /// Request type for "SendVerificationCode". - public typealias Input = Flipcash_Email_V1_SendVerificationCodeRequest - /// Response type for "SendVerificationCode". - public typealias Output = Flipcash_Email_V1_SendVerificationCodeResponse - /// Descriptor for "SendVerificationCode". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.email.v1.EmailVerification"), - method: "SendVerificationCode" - ) - } - /// Namespace for "CheckVerificationCode" metadata. - public enum CheckVerificationCode { - /// Request type for "CheckVerificationCode". - public typealias Input = Flipcash_Email_V1_CheckVerificationCodeRequest - /// Response type for "CheckVerificationCode". - public typealias Output = Flipcash_Email_V1_CheckVerificationCodeResponse - /// Descriptor for "CheckVerificationCode". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.email.v1.EmailVerification"), - method: "CheckVerificationCode" - ) - } - /// Namespace for "Unlink" metadata. - public enum Unlink { - /// Request type for "Unlink". - public typealias Input = Flipcash_Email_V1_UnlinkRequest - /// Response type for "Unlink". - public typealias Output = Flipcash_Email_V1_UnlinkResponse - /// Descriptor for "Unlink". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.email.v1.EmailVerification"), - method: "Unlink" - ) - } - /// Descriptors for all methods in the "flipcash.email.v1.EmailVerification" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - SendVerificationCode.descriptor, - CheckVerificationCode.descriptor, - Unlink.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.email.v1.EmailVerification" service. - public static let flipcash_email_v1_EmailVerification = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.email.v1.EmailVerification") -} - -// MARK: flipcash.email.v1.EmailVerification (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Email_V1_EmailVerification { - /// Generated client protocol for the "flipcash.email.v1.EmailVerification" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "SendVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendVerificationCode sends a verification code to the provided email address. - /// > If an active verification is already taking place, the existing code will be - /// > resent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_SendVerificationCodeRequest` message. - /// - serializer: A serializer for `Flipcash_Email_V1_SendVerificationCodeRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Email_V1_SendVerificationCodeResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func sendVerificationCode( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "CheckVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckVerificationCode validates a verification code. On success, the email - /// > address is linked to the user. Any previous links are overwritten. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_CheckVerificationCodeRequest` message. - /// - serializer: A serializer for `Flipcash_Email_V1_CheckVerificationCodeRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Email_V1_CheckVerificationCodeResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func checkVerificationCode( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "Unlink" method. - /// - /// > Source IDL Documentation: - /// > - /// > Unlink removes the link of an email address from a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_UnlinkRequest` message. - /// - serializer: A serializer for `Flipcash_Email_V1_UnlinkRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Email_V1_UnlinkResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func unlink( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.email.v1.EmailVerification" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "SendVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendVerificationCode sends a verification code to the provided email address. - /// > If an active verification is already taking place, the existing code will be - /// > resent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_SendVerificationCodeRequest` message. - /// - serializer: A serializer for `Flipcash_Email_V1_SendVerificationCodeRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Email_V1_SendVerificationCodeResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendVerificationCode( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Email_V1_EmailVerification.Method.SendVerificationCode.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckVerificationCode validates a verification code. On success, the email - /// > address is linked to the user. Any previous links are overwritten. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_CheckVerificationCodeRequest` message. - /// - serializer: A serializer for `Flipcash_Email_V1_CheckVerificationCodeRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Email_V1_CheckVerificationCodeResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkVerificationCode( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Email_V1_EmailVerification.Method.CheckVerificationCode.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Unlink" method. - /// - /// > Source IDL Documentation: - /// > - /// > Unlink removes the link of an email address from a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_UnlinkRequest` message. - /// - serializer: A serializer for `Flipcash_Email_V1_UnlinkRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Email_V1_UnlinkResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlink( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Email_V1_EmailVerification.Method.Unlink.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Email_V1_EmailVerification.ClientProtocol { - /// Call the "SendVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendVerificationCode sends a verification code to the provided email address. - /// > If an active verification is already taking place, the existing code will be - /// > resent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_SendVerificationCodeRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendVerificationCode( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.sendVerificationCode( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckVerificationCode validates a verification code. On success, the email - /// > address is linked to the user. Any previous links are overwritten. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_CheckVerificationCodeRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkVerificationCode( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.checkVerificationCode( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Unlink" method. - /// - /// > Source IDL Documentation: - /// > - /// > Unlink removes the link of an email address from a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Email_V1_UnlinkRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlink( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.unlink( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Email_V1_EmailVerification.ClientProtocol { - /// Call the "SendVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendVerificationCode sends a verification code to the provided email address. - /// > If an active verification is already taking place, the existing code will be - /// > resent. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendVerificationCode( - _ message: Flipcash_Email_V1_SendVerificationCodeRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.sendVerificationCode( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckVerificationCode validates a verification code. On success, the email - /// > address is linked to the user. Any previous links are overwritten. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkVerificationCode( - _ message: Flipcash_Email_V1_CheckVerificationCodeRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.checkVerificationCode( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Unlink" method. - /// - /// > Source IDL Documentation: - /// > - /// > Unlink removes the link of an email address from a user. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlink( - _ message: Flipcash_Email_V1_UnlinkRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.unlink( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_email_verification_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_email_verification_service.pb.swift deleted file mode 100644 index 18b5f3b5e..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_email_verification_service.pb.swift +++ /dev/null @@ -1,540 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: email/v1/email_verification_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Email_V1_SendVerificationCodeRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The email address to send a verification code to - public var emailAddress: Flipcash_Common_V1_EmailAddress { - get {return _emailAddress ?? Flipcash_Common_V1_EmailAddress()} - set {_emailAddress = newValue} - } - /// Returns true if `emailAddress` has been explicitly set. - public var hasEmailAddress: Bool {return self._emailAddress != nil} - /// Clears the value of `emailAddress`. Subsequent reads from it will return its default value. - public mutating func clearEmailAddress() {self._emailAddress = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - /// Additional client data that is sent in the deep link - public var clientData: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _emailAddress: Flipcash_Common_V1_EmailAddress? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Email_V1_SendVerificationCodeResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Email_V1_SendVerificationCodeResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - - /// Email is denied - case denied // = 1 - - /// Email is rate limited (eg. by IP, email address, user, etc) and was not sent. - case rateLimited // = 2 - - /// The email address is not real - case invalidEmailAddress // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .rateLimited - case 3: self = .invalidEmailAddress - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .rateLimited: return 2 - case .invalidEmailAddress: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Email_V1_SendVerificationCodeResponse.Result] = [ - .ok, - .denied, - .rateLimited, - .invalidEmailAddress, - ] - - } - - public init() {} -} - -public struct Flipcash_Email_V1_CheckVerificationCodeRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The email address being verified - public var emailAddress: Flipcash_Common_V1_EmailAddress { - get {return _emailAddress ?? Flipcash_Common_V1_EmailAddress()} - set {_emailAddress = newValue} - } - /// Returns true if `emailAddress` has been explicitly set. - public var hasEmailAddress: Bool {return self._emailAddress != nil} - /// Clears the value of `emailAddress`. Subsequent reads from it will return its default value. - public mutating func clearEmailAddress() {self._emailAddress = nil} - - /// The verification code received via email - public var code: Flipcash_Email_V1_VerificationCode { - get {return _code ?? Flipcash_Email_V1_VerificationCode()} - set {_code = newValue} - } - /// Returns true if `code` has been explicitly set. - public var hasCode: Bool {return self._code != nil} - /// Clears the value of `code`. Subsequent reads from it will return its default value. - public mutating func clearCode() {self._code = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _emailAddress: Flipcash_Common_V1_EmailAddress? = nil - fileprivate var _code: Flipcash_Email_V1_VerificationCode? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Email_V1_CheckVerificationCodeResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Email_V1_CheckVerificationCodeResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// The call is rate limited (eg. by IP, email address, etc). The code is - /// not verified. - case rateLimited // = 2 - - /// The provided verification code is invalid. The user may retry - /// enterring the code if this is received. When max attempts are - /// received, NO_VERIFICATION will be returned. - case invalidCode // = 3 - - /// There is no verification in progress for the email address. Several - /// reasons this can occur include a verification being expired or having - /// reached a maximum check threshold. The client must initiate a new - /// verification using SendVerificationCode. - case noVerification // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .rateLimited - case 3: self = .invalidCode - case 4: self = .noVerification - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .rateLimited: return 2 - case .invalidCode: return 3 - case .noVerification: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Email_V1_CheckVerificationCodeResponse.Result] = [ - .ok, - .denied, - .rateLimited, - .invalidCode, - .noVerification, - ] - - } - - public init() {} -} - -public struct Flipcash_Email_V1_UnlinkRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The email address to unlink - public var emailAddress: Flipcash_Common_V1_EmailAddress { - get {return _emailAddress ?? Flipcash_Common_V1_EmailAddress()} - set {_emailAddress = newValue} - } - /// Returns true if `emailAddress` has been explicitly set. - public var hasEmailAddress: Bool {return self._emailAddress != nil} - /// Clears the value of `emailAddress`. Subsequent reads from it will return its default value. - public mutating func clearEmailAddress() {self._emailAddress = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _emailAddress: Flipcash_Common_V1_EmailAddress? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Email_V1_UnlinkResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Email_V1_UnlinkResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Email_V1_UnlinkResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.email.v1" - -extension Flipcash_Email_V1_SendVerificationCodeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendVerificationCodeRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}email_address\0\u{1}auth\0\u{3}client_data\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._emailAddress) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.clientData) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._emailAddress { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.clientData.isEmpty { - try visitor.visitSingularStringField(value: self.clientData, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Email_V1_SendVerificationCodeRequest, rhs: Flipcash_Email_V1_SendVerificationCodeRequest) -> Bool { - if lhs._emailAddress != rhs._emailAddress {return false} - if lhs._auth != rhs._auth {return false} - if lhs.clientData != rhs.clientData {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Email_V1_SendVerificationCodeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendVerificationCodeResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Email_V1_SendVerificationCodeResponse, rhs: Flipcash_Email_V1_SendVerificationCodeResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Email_V1_SendVerificationCodeResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}RATE_LIMITED\0\u{1}INVALID_EMAIL_ADDRESS\0") -} - -extension Flipcash_Email_V1_CheckVerificationCodeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CheckVerificationCodeRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}email_address\0\u{1}code\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._emailAddress) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._code) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._emailAddress { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._code { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Email_V1_CheckVerificationCodeRequest, rhs: Flipcash_Email_V1_CheckVerificationCodeRequest) -> Bool { - if lhs._emailAddress != rhs._emailAddress {return false} - if lhs._code != rhs._code {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Email_V1_CheckVerificationCodeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CheckVerificationCodeResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Email_V1_CheckVerificationCodeResponse, rhs: Flipcash_Email_V1_CheckVerificationCodeResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Email_V1_CheckVerificationCodeResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}RATE_LIMITED\0\u{1}INVALID_CODE\0\u{1}NO_VERIFICATION\0") -} - -extension Flipcash_Email_V1_UnlinkRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnlinkRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}email_address\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._emailAddress) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._emailAddress { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Email_V1_UnlinkRequest, rhs: Flipcash_Email_V1_UnlinkRequest) -> Bool { - if lhs._emailAddress != rhs._emailAddress {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Email_V1_UnlinkResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnlinkResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Email_V1_UnlinkResponse, rhs: Flipcash_Email_V1_UnlinkResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Email_V1_UnlinkResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_model.pb.swift deleted file mode 100644 index 1cdec6223..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/email_v1_model.pb.swift +++ /dev/null @@ -1,68 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: email/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// VerificationCode is a 4-10 digit numerical code for verification -public struct Flipcash_Email_V1_VerificationCode: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.email.v1" - -extension Flipcash_Email_V1_VerificationCode: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerificationCode" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\u{2}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Email_V1_VerificationCode, rhs: Flipcash_Email_V1_VerificationCode) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_event_streaming_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_event_streaming_service.grpc.swift deleted file mode 100644 index 5911feda4..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_event_streaming_service.grpc.swift +++ /dev/null @@ -1,328 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: event/v1/event_streaming_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.event.v1.EventStreaming - -/// Namespace containing generated types for the "flipcash.event.v1.EventStreaming" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Event_V1_EventStreaming { - /// Service descriptor for the "flipcash.event.v1.EventStreaming" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.event.v1.EventStreaming") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "StreamEvents" metadata. - public enum StreamEvents { - /// Request type for "StreamEvents". - public typealias Input = Flipcash_Event_V1_StreamEventsRequest - /// Response type for "StreamEvents". - public typealias Output = Flipcash_Event_V1_StreamEventsResponse - /// Descriptor for "StreamEvents". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.event.v1.EventStreaming"), - method: "StreamEvents" - ) - } - /// Namespace for "ForwardEvents" metadata. - public enum ForwardEvents { - /// Request type for "ForwardEvents". - public typealias Input = Flipcash_Event_V1_ForwardEventsRequest - /// Response type for "ForwardEvents". - public typealias Output = Flipcash_Event_V1_ForwardEventsResponse - /// Descriptor for "ForwardEvents". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.event.v1.EventStreaming"), - method: "ForwardEvents" - ) - } - /// Descriptors for all methods in the "flipcash.event.v1.EventStreaming" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - StreamEvents.descriptor, - ForwardEvents.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.event.v1.EventStreaming" service. - public static let flipcash_event_v1_EventStreaming = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.event.v1.EventStreaming") -} - -// MARK: flipcash.event.v1.EventStreaming (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Event_V1_EventStreaming { - /// Generated client protocol for the "flipcash.event.v1.EventStreaming" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "StreamEvents" method. - /// - /// > Source IDL Documentation: - /// > - /// > StreamEvents streams events for the requesting user. - /// - /// - Parameters: - /// - request: A streaming request producing `Flipcash_Event_V1_StreamEventsRequest` messages. - /// - serializer: A serializer for `Flipcash_Event_V1_StreamEventsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Event_V1_StreamEventsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func streamEvents( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "ForwardEvents" method. - /// - /// > Source IDL Documentation: - /// > - /// > ForwardEvents is an internal RPC for forwarding events to another server. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Event_V1_ForwardEventsRequest` message. - /// - serializer: A serializer for `Flipcash_Event_V1_ForwardEventsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Event_V1_ForwardEventsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func forwardEvents( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.event.v1.EventStreaming" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "StreamEvents" method. - /// - /// > Source IDL Documentation: - /// > - /// > StreamEvents streams events for the requesting user. - /// - /// - Parameters: - /// - request: A streaming request producing `Flipcash_Event_V1_StreamEventsRequest` messages. - /// - serializer: A serializer for `Flipcash_Event_V1_StreamEventsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Event_V1_StreamEventsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func streamEvents( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.bidirectionalStreaming( - request: request, - descriptor: Flipcash_Event_V1_EventStreaming.Method.StreamEvents.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "ForwardEvents" method. - /// - /// > Source IDL Documentation: - /// > - /// > ForwardEvents is an internal RPC for forwarding events to another server. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Event_V1_ForwardEventsRequest` message. - /// - serializer: A serializer for `Flipcash_Event_V1_ForwardEventsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Event_V1_ForwardEventsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func forwardEvents( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Event_V1_EventStreaming.Method.ForwardEvents.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Event_V1_EventStreaming.ClientProtocol { - /// Call the "StreamEvents" method. - /// - /// > Source IDL Documentation: - /// > - /// > StreamEvents streams events for the requesting user. - /// - /// - Parameters: - /// - request: A streaming request producing `Flipcash_Event_V1_StreamEventsRequest` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func streamEvents( - request: GRPCCore.StreamingClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.streamEvents( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "ForwardEvents" method. - /// - /// > Source IDL Documentation: - /// > - /// > ForwardEvents is an internal RPC for forwarding events to another server. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Event_V1_ForwardEventsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func forwardEvents( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.forwardEvents( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Event_V1_EventStreaming.ClientProtocol { - /// Call the "StreamEvents" method. - /// - /// > Source IDL Documentation: - /// > - /// > StreamEvents streams events for the requesting user. - /// - /// - Parameters: - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - producer: A closure producing request messages to send to the server. The request - /// stream is closed when the closure returns. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func streamEvents( - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - requestProducer producer: @Sendable @escaping (GRPCCore.RPCWriter) async throws -> Void, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.StreamingClientRequest( - metadata: metadata, - producer: producer - ) - return try await self.streamEvents( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "ForwardEvents" method. - /// - /// > Source IDL Documentation: - /// > - /// > ForwardEvents is an internal RPC for forwarding events to another server. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func forwardEvents( - _ message: Flipcash_Event_V1_ForwardEventsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.forwardEvents( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_event_streaming_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_event_streaming_service.pb.swift deleted file mode 100644 index b16cc88e1..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_event_streaming_service.pb.swift +++ /dev/null @@ -1,542 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: event/v1/event_streaming_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Event_V1_StreamEventsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Flipcash_Event_V1_StreamEventsRequest.OneOf_Type? = nil - - public var params: Flipcash_Event_V1_StreamEventsRequest.Params { - get { - if case .params(let v)? = type {return v} - return Flipcash_Event_V1_StreamEventsRequest.Params() - } - set {type = .params(newValue)} - } - - public var pong: Flipcash_Event_V1_ClientPong { - get { - if case .pong(let v)? = type {return v} - return Flipcash_Event_V1_ClientPong() - } - set {type = .pong(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case params(Flipcash_Event_V1_StreamEventsRequest.Params) - case pong(Flipcash_Event_V1_ClientPong) - - } - - public struct Params: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - /// ts contains the time for stream open. - /// - /// It is used primarily as a nonce for auth. Server may reject - /// timestamps that are too far in the future or past. - public var ts: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _ts ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_ts = newValue} - } - /// Returns true if `ts` has been explicitly set. - public var hasTs: Bool {return self._ts != nil} - /// Clears the value of `ts`. Subsequent reads from it will return its default value. - public mutating func clearTs() {self._ts = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _ts: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - } - - public init() {} -} - -public struct Flipcash_Event_V1_StreamEventsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Flipcash_Event_V1_StreamEventsResponse.OneOf_Type? = nil - - public var ping: Flipcash_Event_V1_ServerPing { - get { - if case .ping(let v)? = type {return v} - return Flipcash_Event_V1_ServerPing() - } - set {type = .ping(newValue)} - } - - public var error: Flipcash_Event_V1_StreamEventsResponse.StreamError { - get { - if case .error(let v)? = type {return v} - return Flipcash_Event_V1_StreamEventsResponse.StreamError() - } - set {type = .error(newValue)} - } - - public var events: Flipcash_Event_V1_EventBatch { - get { - if case .events(let v)? = type {return v} - return Flipcash_Event_V1_EventBatch() - } - set {type = .events(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case ping(Flipcash_Event_V1_ServerPing) - case error(Flipcash_Event_V1_StreamEventsResponse.StreamError) - case events(Flipcash_Event_V1_EventBatch) - - } - - public struct StreamError: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Flipcash_Event_V1_StreamEventsResponse.StreamError.Code = .denied - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case denied // = 0 - case invalidTimestamp // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .denied - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .denied - case 1: self = .invalidTimestamp - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .denied: return 0 - case .invalidTimestamp: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Event_V1_StreamEventsResponse.StreamError.Code] = [ - .denied, - .invalidTimestamp, - ] - - } - - public init() {} - } - - public init() {} -} - -public struct Flipcash_Event_V1_ForwardEventsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var userEvents: Flipcash_Event_V1_UserEventBatch { - get {return _userEvents ?? Flipcash_Event_V1_UserEventBatch()} - set {_userEvents = newValue} - } - /// Returns true if `userEvents` has been explicitly set. - public var hasUserEvents: Bool {return self._userEvents != nil} - /// Clears the value of `userEvents`. Subsequent reads from it will return its default value. - public mutating func clearUserEvents() {self._userEvents = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userEvents: Flipcash_Event_V1_UserEventBatch? = nil -} - -public struct Flipcash_Event_V1_ForwardEventsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Event_V1_ForwardEventsResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Event_V1_ForwardEventsResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.event.v1" - -extension Flipcash_Event_V1_StreamEventsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StreamEventsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}params\0\u{1}pong\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Event_V1_StreamEventsRequest.Params? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .params(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .params(v) - } - }() - case 2: try { - var v: Flipcash_Event_V1_ClientPong? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .pong(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .pong(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .params?: try { - guard case .params(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .pong?: try { - guard case .pong(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_StreamEventsRequest, rhs: Flipcash_Event_V1_StreamEventsRequest) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_StreamEventsRequest.Params: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Event_V1_StreamEventsRequest.protoMessageName + ".Params" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{1}ts\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._ts) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._ts { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_StreamEventsRequest.Params, rhs: Flipcash_Event_V1_StreamEventsRequest.Params) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs._ts != rhs._ts {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_StreamEventsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StreamEventsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}ping\0\u{1}error\0\u{1}events\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Event_V1_ServerPing? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .ping(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .ping(v) - } - }() - case 2: try { - var v: Flipcash_Event_V1_StreamEventsResponse.StreamError? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .error(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .error(v) - } - }() - case 3: try { - var v: Flipcash_Event_V1_EventBatch? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .events(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .events(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .ping?: try { - guard case .ping(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .error?: try { - guard case .error(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .events?: try { - guard case .events(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_StreamEventsResponse, rhs: Flipcash_Event_V1_StreamEventsResponse) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_StreamEventsResponse.StreamError: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Event_V1_StreamEventsResponse.protoMessageName + ".StreamError" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .denied { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_StreamEventsResponse.StreamError, rhs: Flipcash_Event_V1_StreamEventsResponse.StreamError) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_StreamEventsResponse.StreamError.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DENIED\0\u{1}INVALID_TIMESTAMP\0") -} - -extension Flipcash_Event_V1_ForwardEventsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ForwardEventsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_events\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userEvents) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userEvents { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_ForwardEventsRequest, rhs: Flipcash_Event_V1_ForwardEventsRequest) -> Bool { - if lhs._userEvents != rhs._userEvents {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_ForwardEventsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ForwardEventsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_ForwardEventsResponse, rhs: Flipcash_Event_V1_ForwardEventsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_ForwardEventsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_model.pb.swift deleted file mode 100644 index 18e576ed2..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/event_v1_model.pb.swift +++ /dev/null @@ -1,786 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: event/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Event_V1_EventId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var id: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// todo: define additional events -public struct Flipcash_Event_V1_Event: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var id: Flipcash_Event_V1_EventId { - get {return _id ?? Flipcash_Event_V1_EventId()} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - public var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - public mutating func clearID() {self._id = nil} - - public var ts: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _ts ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_ts = newValue} - } - /// Returns true if `ts` has been explicitly set. - public var hasTs: Bool {return self._ts != nil} - /// Clears the value of `ts`. Subsequent reads from it will return its default value. - public mutating func clearTs() {self._ts = nil} - - public var type: Flipcash_Event_V1_Event.OneOf_Type? = nil - - public var test: Flipcash_Event_V1_TestEvent { - get { - if case .test(let v)? = type {return v} - return Flipcash_Event_V1_TestEvent() - } - set {type = .test(newValue)} - } - - public var chatUpdate: Flipcash_Event_V1_ChatUpdate { - get { - if case .chatUpdate(let v)? = type {return v} - return Flipcash_Event_V1_ChatUpdate() - } - set {type = .chatUpdate(newValue)} - } - - public var blobUpdate: Flipcash_Event_V1_BlobUpdate { - get { - if case .blobUpdate(let v)? = type {return v} - return Flipcash_Event_V1_BlobUpdate() - } - set {type = .blobUpdate(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case test(Flipcash_Event_V1_TestEvent) - case chatUpdate(Flipcash_Event_V1_ChatUpdate) - case blobUpdate(Flipcash_Event_V1_BlobUpdate) - - } - - public init() {} - - fileprivate var _id: Flipcash_Event_V1_EventId? = nil - fileprivate var _ts: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -public struct Flipcash_Event_V1_EventBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var events: [Flipcash_Event_V1_Event] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Event_V1_UserEvent: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - public var event: Flipcash_Event_V1_Event { - get {return _event ?? Flipcash_Event_V1_Event()} - set {_event = newValue} - } - /// Returns true if `event` has been explicitly set. - public var hasEvent: Bool {return self._event != nil} - /// Clears the value of `event`. Subsequent reads from it will return its default value. - public mutating func clearEvent() {self._event = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _event: Flipcash_Event_V1_Event? = nil -} - -public struct Flipcash_Event_V1_UserEventBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var events: [Flipcash_Event_V1_UserEvent] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Event_V1_TestEvent: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var hops: [String] = [] - - public var nonce: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Event_V1_ServerPing: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Timestamp the ping was sent on the stream, for client to get a sense - /// of potential network latency - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - /// The delay server will apply before sending the next ping - public var pingDelay: SwiftProtobuf.Google_Protobuf_Duration { - get {return _pingDelay ?? SwiftProtobuf.Google_Protobuf_Duration()} - set {_pingDelay = newValue} - } - /// Returns true if `pingDelay` has been explicitly set. - public var hasPingDelay: Bool {return self._pingDelay != nil} - /// Clears the value of `pingDelay`. Subsequent reads from it will return its default value. - public mutating func clearPingDelay() {self._pingDelay = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _pingDelay: SwiftProtobuf.Google_Protobuf_Duration? = nil -} - -public struct Flipcash_Event_V1_ClientPong: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Timestamp the Pong was sent on the stream, for server to get a sense - /// of potential network latency - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -public struct Flipcash_Event_V1_ChatUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The chat that this update is for - public var chat: Flipcash_Common_V1_ChatId { - get {return _chat ?? Flipcash_Common_V1_ChatId()} - set {_chat = newValue} - } - /// Returns true if `chat` has been explicitly set. - public var hasChat: Bool {return self._chat != nil} - /// Clears the value of `chat`. Subsequent reads from it will return its default value. - public mutating func clearChat() {self._chat = nil} - - /// If present, new real-time messages sent on the chat. - /// - /// Deprecated: superseded by `events` (Event.message_sent), which is - /// sequenced and gap-detectable. New messages now arrive as events. - /// - /// NOTE: This field was marked as deprecated in the .proto file. - public var newMessages: Flipcash_Messaging_V1_MessageBatch { - get {return _newMessages ?? Flipcash_Messaging_V1_MessageBatch()} - set {_newMessages = newValue} - } - /// Returns true if `newMessages` has been explicitly set. - public var hasNewMessages: Bool {return self._newMessages != nil} - /// Clears the value of `newMessages`. Subsequent reads from it will return its default value. - public mutating func clearNewMessages() {self._newMessages = nil} - - /// If present, message pointer updates for members in the chat. Pointers are - /// convergent (monotonic, last-writer-wins), so they ride the stream as a - /// best-effort overlay and are reconciled from current state on reconnect — - /// they are intentionally NOT part of the gap-detected event log. - public var pointerUpdates: Flipcash_Messaging_V1_PointerBatch { - get {return _pointerUpdates ?? Flipcash_Messaging_V1_PointerBatch()} - set {_pointerUpdates = newValue} - } - /// Returns true if `pointerUpdates` has been explicitly set. - public var hasPointerUpdates: Bool {return self._pointerUpdates != nil} - /// Clears the value of `pointerUpdates`. Subsequent reads from it will return its default value. - public mutating func clearPointerUpdates() {self._pointerUpdates = nil} - - /// If present, message typing notification state changes for members in the - /// chat. Transient and best-effort — not part of the event log. - public var isTypingNotifications: Flipcash_Messaging_V1_IsTypingNotificationBatch { - get {return _isTypingNotifications ?? Flipcash_Messaging_V1_IsTypingNotificationBatch()} - set {_isTypingNotifications = newValue} - } - /// Returns true if `isTypingNotifications` has been explicitly set. - public var hasIsTypingNotifications: Bool {return self._isTypingNotifications != nil} - /// Clears the value of `isTypingNotifications`. Subsequent reads from it will return its default value. - public mutating func clearIsTypingNotifications() {self._isTypingNotifications = nil} - - /// If present, updates to the chat metadata - public var metadataUpdates: [Flipcash_Chat_V1_MetadataUpdate] = [] - - /// If present, durable event-log events for the chat (messages sent, edited, - /// and deleted). These are contiguous and ordered: clients apply them by - /// ascending Event.sequence and gap-detect via Event.sequence/count, catching - /// up with Messaging.GetDelta on a gap. This supersedes new_messages. - public var events: Flipcash_Messaging_V1_EventBatch { - get {return _events ?? Flipcash_Messaging_V1_EventBatch()} - set {_events = newValue} - } - /// Returns true if `events` has been explicitly set. - public var hasEvents: Bool {return self._events != nil} - /// Clears the value of `events`. Subsequent reads from it will return its default value. - public mutating func clearEvents() {self._events = nil} - - /// If present, best-effort real-time reaction changes for messages in the - /// chat. Like pointer_updates, reactions are a convergent overlay — NOT part - /// of the gap-detected event log; clients apply them last-writer-wins by - /// ReactionUpdate.sequence and reconcile any misses by refreshing a message's - /// ReactionSummary on view. - public var reactionUpdates: Flipcash_Messaging_V1_ReactionUpdateBatch { - get {return _reactionUpdates ?? Flipcash_Messaging_V1_ReactionUpdateBatch()} - set {_reactionUpdates = newValue} - } - /// Returns true if `reactionUpdates` has been explicitly set. - public var hasReactionUpdates: Bool {return self._reactionUpdates != nil} - /// Clears the value of `reactionUpdates`. Subsequent reads from it will return its default value. - public mutating func clearReactionUpdates() {self._reactionUpdates = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chat: Flipcash_Common_V1_ChatId? = nil - fileprivate var _newMessages: Flipcash_Messaging_V1_MessageBatch? = nil - fileprivate var _pointerUpdates: Flipcash_Messaging_V1_PointerBatch? = nil - fileprivate var _isTypingNotifications: Flipcash_Messaging_V1_IsTypingNotificationBatch? = nil - fileprivate var _events: Flipcash_Messaging_V1_EventBatch? = nil - fileprivate var _reactionUpdates: Flipcash_Messaging_V1_ReactionUpdateBatch? = nil -} - -/// BlobUpdate notifies the recipient in real time that blobs they uploaded have -/// transitioned to a new lifecycle state — e.g. PROCESSING → READY once the -/// server finishes validating, transcoding, and moderating, or → REJECTED on -/// failure. It lets clients react to upload completion via the event stream -/// instead of polling BlobStorage.GetBlobs. -/// -/// Best-effort: a client that misses an update reconciles by calling -/// BlobStorage.GetBlobs. The BlobId is the durable handle; any download_url -/// carried here is ephemeral and may be re-minted via GetBlobs. -public struct Flipcash_Event_V1_BlobUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The blobs that transitioned, each carrying its new status and, when READY, - /// its resolved metadata (including a freshly minted download_url). - public var blobs: Flipcash_Blob_V1_BlobBatch { - get {return _blobs ?? Flipcash_Blob_V1_BlobBatch()} - set {_blobs = newValue} - } - /// Returns true if `blobs` has been explicitly set. - public var hasBlobs: Bool {return self._blobs != nil} - /// Clears the value of `blobs`. Subsequent reads from it will return its default value. - public mutating func clearBlobs() {self._blobs = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _blobs: Flipcash_Blob_V1_BlobBatch? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.event.v1" - -extension Flipcash_Event_V1_EventId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EventId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.id) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.id.isEmpty { - try visitor.visitSingularBytesField(value: self.id, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_EventId, rhs: Flipcash_Event_V1_EventId) -> Bool { - if lhs.id != rhs.id {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_Event: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Event" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}ts\0\u{1}test\0\u{3}chat_update\0\u{3}blob_update\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._id) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._ts) }() - case 3: try { - var v: Flipcash_Event_V1_TestEvent? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .test(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .test(v) - } - }() - case 4: try { - var v: Flipcash_Event_V1_ChatUpdate? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .chatUpdate(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .chatUpdate(v) - } - }() - case 5: try { - var v: Flipcash_Event_V1_BlobUpdate? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .blobUpdate(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .blobUpdate(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._id { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._ts { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - switch self.type { - case .test?: try { - guard case .test(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .chatUpdate?: try { - guard case .chatUpdate(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .blobUpdate?: try { - guard case .blobUpdate(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_Event, rhs: Flipcash_Event_V1_Event) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._ts != rhs._ts {return false} - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_EventBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EventBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}events\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.events) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.events.isEmpty { - try visitor.visitRepeatedMessageField(value: self.events, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_EventBatch, rhs: Flipcash_Event_V1_EventBatch) -> Bool { - if lhs.events != rhs.events {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_UserEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UserEvent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{1}event\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._event) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._event { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_UserEvent, rhs: Flipcash_Event_V1_UserEvent) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs._event != rhs._event {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_UserEventBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UserEventBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}events\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.events) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.events.isEmpty { - try visitor.visitRepeatedMessageField(value: self.events, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_UserEventBatch, rhs: Flipcash_Event_V1_UserEventBatch) -> Bool { - if lhs.events != rhs.events {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_TestEvent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TestEvent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}hops\0\u{1}nonce\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.hops) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.nonce) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.hops.isEmpty { - try visitor.visitRepeatedStringField(value: self.hops, fieldNumber: 1) - } - if self.nonce != 0 { - try visitor.visitSingularUInt64Field(value: self.nonce, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_TestEvent, rhs: Flipcash_Event_V1_TestEvent) -> Bool { - if lhs.hops != rhs.hops {return false} - if lhs.nonce != rhs.nonce {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_ServerPing: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ServerPing" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}timestamp\0\u{3}ping_delay\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._pingDelay) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._pingDelay { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_ServerPing, rhs: Flipcash_Event_V1_ServerPing) -> Bool { - if lhs._timestamp != rhs._timestamp {return false} - if lhs._pingDelay != rhs._pingDelay {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_ClientPong: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ClientPong" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}timestamp\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_ClientPong, rhs: Flipcash_Event_V1_ClientPong) -> Bool { - if lhs._timestamp != rhs._timestamp {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_ChatUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ChatUpdate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}chat\0\u{3}new_messages\0\u{3}pointer_updates\0\u{3}is_typing_notifications\0\u{3}metadata_updates\0\u{1}events\0\u{3}reaction_updates\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chat) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._newMessages) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._pointerUpdates) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._isTypingNotifications) }() - case 5: try { try decoder.decodeRepeatedMessageField(value: &self.metadataUpdates) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._events) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._reactionUpdates) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chat { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._newMessages { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._pointerUpdates { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._isTypingNotifications { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if !self.metadataUpdates.isEmpty { - try visitor.visitRepeatedMessageField(value: self.metadataUpdates, fieldNumber: 5) - } - try { if let v = self._events { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - try { if let v = self._reactionUpdates { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_ChatUpdate, rhs: Flipcash_Event_V1_ChatUpdate) -> Bool { - if lhs._chat != rhs._chat {return false} - if lhs._newMessages != rhs._newMessages {return false} - if lhs._pointerUpdates != rhs._pointerUpdates {return false} - if lhs._isTypingNotifications != rhs._isTypingNotifications {return false} - if lhs.metadataUpdates != rhs.metadataUpdates {return false} - if lhs._events != rhs._events {return false} - if lhs._reactionUpdates != rhs._reactionUpdates {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Event_V1_BlobUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BlobUpdate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}blobs\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._blobs) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._blobs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Event_V1_BlobUpdate, rhs: Flipcash_Event_V1_BlobUpdate) -> Bool { - if lhs._blobs != rhs._blobs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/flipcash_messaging_v1_messaging_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/flipcash_messaging_v1_messaging_service.grpc.swift deleted file mode 100644 index 0931f5088..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/flipcash_messaging_v1_messaging_service.grpc.swift +++ /dev/null @@ -1,1947 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: messaging/v1/messaging_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.messaging.v1.Messaging - -/// Namespace containing generated types for the "flipcash.messaging.v1.Messaging" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Messaging_V1_Messaging { - /// Service descriptor for the "flipcash.messaging.v1.Messaging" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "GetMessage" metadata. - public enum GetMessage { - /// Request type for "GetMessage". - public typealias Input = Flipcash_Messaging_V1_GetMessageRequest - /// Response type for "GetMessage". - public typealias Output = Flipcash_Messaging_V1_GetMessageResponse - /// Descriptor for "GetMessage". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "GetMessage" - ) - } - /// Namespace for "GetMessages" metadata. - public enum GetMessages { - /// Request type for "GetMessages". - public typealias Input = Flipcash_Messaging_V1_GetMessagesRequest - /// Response type for "GetMessages". - public typealias Output = Flipcash_Messaging_V1_GetMessagesResponse - /// Descriptor for "GetMessages". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "GetMessages" - ) - } - /// Namespace for "GetDelta" metadata. - public enum GetDelta { - /// Request type for "GetDelta". - public typealias Input = Flipcash_Messaging_V1_GetDeltaRequest - /// Response type for "GetDelta". - public typealias Output = Flipcash_Messaging_V1_GetDeltaResponse - /// Descriptor for "GetDelta". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "GetDelta" - ) - } - /// Namespace for "SendMessage" metadata. - public enum SendMessage { - /// Request type for "SendMessage". - public typealias Input = Flipcash_Messaging_V1_SendMessageRequest - /// Response type for "SendMessage". - public typealias Output = Flipcash_Messaging_V1_SendMessageResponse - /// Descriptor for "SendMessage". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "SendMessage" - ) - } - /// Namespace for "EditMessage" metadata. - public enum EditMessage { - /// Request type for "EditMessage". - public typealias Input = Flipcash_Messaging_V1_EditMessageRequest - /// Response type for "EditMessage". - public typealias Output = Flipcash_Messaging_V1_EditMessageResponse - /// Descriptor for "EditMessage". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "EditMessage" - ) - } - /// Namespace for "DeleteMessage" metadata. - public enum DeleteMessage { - /// Request type for "DeleteMessage". - public typealias Input = Flipcash_Messaging_V1_DeleteMessageRequest - /// Response type for "DeleteMessage". - public typealias Output = Flipcash_Messaging_V1_DeleteMessageResponse - /// Descriptor for "DeleteMessage". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "DeleteMessage" - ) - } - /// Namespace for "AddReaction" metadata. - public enum AddReaction { - /// Request type for "AddReaction". - public typealias Input = Flipcash_Messaging_V1_AddReactionRequest - /// Response type for "AddReaction". - public typealias Output = Flipcash_Messaging_V1_AddReactionResponse - /// Descriptor for "AddReaction". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "AddReaction" - ) - } - /// Namespace for "RemoveReaction" metadata. - public enum RemoveReaction { - /// Request type for "RemoveReaction". - public typealias Input = Flipcash_Messaging_V1_RemoveReactionRequest - /// Response type for "RemoveReaction". - public typealias Output = Flipcash_Messaging_V1_RemoveReactionResponse - /// Descriptor for "RemoveReaction". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "RemoveReaction" - ) - } - /// Namespace for "GetReactors" metadata. - public enum GetReactors { - /// Request type for "GetReactors". - public typealias Input = Flipcash_Messaging_V1_GetReactorsRequest - /// Response type for "GetReactors". - public typealias Output = Flipcash_Messaging_V1_GetReactorsResponse - /// Descriptor for "GetReactors". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "GetReactors" - ) - } - /// Namespace for "GetReactionSummary" metadata. - public enum GetReactionSummary { - /// Request type for "GetReactionSummary". - public typealias Input = Flipcash_Messaging_V1_GetReactionSummaryRequest - /// Response type for "GetReactionSummary". - public typealias Output = Flipcash_Messaging_V1_GetReactionSummaryResponse - /// Descriptor for "GetReactionSummary". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "GetReactionSummary" - ) - } - /// Namespace for "GetReactionSummaries" metadata. - public enum GetReactionSummaries { - /// Request type for "GetReactionSummaries". - public typealias Input = Flipcash_Messaging_V1_GetReactionSummariesRequest - /// Response type for "GetReactionSummaries". - public typealias Output = Flipcash_Messaging_V1_GetReactionSummariesResponse - /// Descriptor for "GetReactionSummaries". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "GetReactionSummaries" - ) - } - /// Namespace for "AdvancePointer" metadata. - public enum AdvancePointer { - /// Request type for "AdvancePointer". - public typealias Input = Flipcash_Messaging_V1_AdvancePointerRequest - /// Response type for "AdvancePointer". - public typealias Output = Flipcash_Messaging_V1_AdvancePointerResponse - /// Descriptor for "AdvancePointer". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "AdvancePointer" - ) - } - /// Namespace for "NotifyIsTyping" metadata. - public enum NotifyIsTyping { - /// Request type for "NotifyIsTyping". - public typealias Input = Flipcash_Messaging_V1_NotifyIsTypingRequest - /// Response type for "NotifyIsTyping". - public typealias Output = Flipcash_Messaging_V1_NotifyIsTypingResponse - /// Descriptor for "NotifyIsTyping". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging"), - method: "NotifyIsTyping" - ) - } - /// Descriptors for all methods in the "flipcash.messaging.v1.Messaging" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - GetMessage.descriptor, - GetMessages.descriptor, - GetDelta.descriptor, - SendMessage.descriptor, - EditMessage.descriptor, - DeleteMessage.descriptor, - AddReaction.descriptor, - RemoveReaction.descriptor, - GetReactors.descriptor, - GetReactionSummary.descriptor, - GetReactionSummaries.descriptor, - AdvancePointer.descriptor, - NotifyIsTyping.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.messaging.v1.Messaging" service. - public static let flipcash_messaging_v1_Messaging = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.messaging.v1.Messaging") -} - -// MARK: flipcash.messaging.v1.Messaging (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Messaging_V1_Messaging { - /// Generated client protocol for the "flipcash.messaging.v1.Messaging" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "GetMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMessage gets a single message in a chat - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetMessageRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetMessageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMessages gets the set of messages for a chat using paged and batched APIs - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetMessagesRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetMessagesRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetMessagesResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getMessages( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetDelta" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetDelta returns, for cold-boot and reconnect catch-up, the current state - /// > of every message changed since the client's cursor, up to the chat's - /// > current head. It is a state delta, not a contiguous replay: each changed - /// > message appears once in its latest state and the client applies it - /// > last-writer-wins. Transient signals (typing) and convergent state - /// > (pointers, reactions) are fetched separately, not returned here. - /// > - /// > GetDelta always catches up to the head; there is no caller-specified - /// > upper bound. An online client that detects a gap while already receiving - /// > live updates does NOT bound the fetch: it calls GetDelta to the head and - /// > lets last-writer-wins (Message.event_sequence) absorb the overlap with - /// > live events buffered during the call — a message delivered by both paths - /// > is applied once, newest wins. A client may also wait briefly for an - /// > out-of-order live update to close a small gap before calling at all. - /// > - /// > On stream completion the client advances its cursor to the highest - /// > checkpoint_sequence it received, which equals latest_sequence — the client - /// > is now at the head. When the client is already current the server sends a - /// > single response with messages omitted (and checkpoint_sequence unset), - /// > leaving the cursor unchanged; latest_sequence still reports the head. - /// > - /// > This is a BOUNDED server stream: the server emits one or more batches and - /// > then completes once the delta up to the head (as of stream open) is - /// > exhausted. Unlike StreamEvents it does NOT stay open for live updates. - /// > Streaming the delta in batches avoids a per-page round trip; the server may - /// > currently send the whole delta as a single response, so clients must handle - /// > any number of batches and treat stream completion as "caught up." - /// > - /// > The Result field is meaningful on the first response and is OK for - /// > subsequent data batches; a terminal DENIED or RESET_REQUIRED is delivered - /// > as a single response that ends the stream. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetDeltaRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetDeltaRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetDeltaResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getDelta( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "SendMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendMessage sends a message to a chat. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_SendMessageRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_SendMessageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_SendMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func sendMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "EditMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > EditMessage edits the content of a message the caller previously sent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_EditMessageRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_EditMessageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_EditMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func editMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "DeleteMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeleteMessage deletes a message the caller previously sent. The message is - /// > tombstoned (content replaced with DeletedContent), not removed, so the - /// > per-chat MessageId sequence stays gapless. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_DeleteMessageRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_DeleteMessageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_DeleteMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func deleteMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "AddReaction" method. - /// - /// > Source IDL Documentation: - /// > - /// > AddReaction adds the caller's reaction with a given emoji to a message. - /// > Idempotent: re-adding the same emoji the caller already reacted with is a - /// > no-op success. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_AddReactionRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_AddReactionRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_AddReactionResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func addReaction( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "RemoveReaction" method. - /// - /// > Source IDL Documentation: - /// > - /// > RemoveReaction removes the caller's reaction with a given emoji from a - /// > message. Idempotent: removing a reaction the caller does not have is a - /// > no-op success. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_RemoveReactionRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_RemoveReactionRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_RemoveReactionResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func removeReaction( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetReactors" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactors returns the paged list of users who reacted to a message with - /// > a given emoji — the on-demand drill-down behind EmojiReaction.count, which - /// > never inlines the full reactor list. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactorsRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetReactorsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetReactorsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getReactors( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetReactionSummary" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactionSummary fetches the current aggregate reaction state for a - /// > single message. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactionSummaryRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetReactionSummaryRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetReactionSummaryResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getReactionSummary( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetReactionSummaries" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactionSummaries fetches the current aggregate reaction state using - /// > paged and batched APIs - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactionSummariesRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetReactionSummariesRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetReactionSummariesResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getReactionSummaries( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "AdvancePointer" method. - /// - /// > Source IDL Documentation: - /// > - /// > AdvancePointer advances a pointer in message history for a chat member. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_AdvancePointerRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_AdvancePointerRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_AdvancePointerResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func advancePointer( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "NotifyIsTyping" method. - /// - /// > Source IDL Documentation: - /// > - /// > NotifyIsTypingRequest notifies a chat that the sending member is typing. - /// > - /// > These requests are transient, and may be dropped at any point. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_NotifyIsTypingRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_NotifyIsTypingRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_NotifyIsTypingResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func notifyIsTyping( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.messaging.v1.Messaging" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "GetMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMessage gets a single message in a chat - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetMessageRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetMessageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.GetMessage.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMessages gets the set of messages for a chat using paged and batched APIs - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetMessagesRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetMessagesRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetMessagesResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMessages( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.GetMessages.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetDelta" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetDelta returns, for cold-boot and reconnect catch-up, the current state - /// > of every message changed since the client's cursor, up to the chat's - /// > current head. It is a state delta, not a contiguous replay: each changed - /// > message appears once in its latest state and the client applies it - /// > last-writer-wins. Transient signals (typing) and convergent state - /// > (pointers, reactions) are fetched separately, not returned here. - /// > - /// > GetDelta always catches up to the head; there is no caller-specified - /// > upper bound. An online client that detects a gap while already receiving - /// > live updates does NOT bound the fetch: it calls GetDelta to the head and - /// > lets last-writer-wins (Message.event_sequence) absorb the overlap with - /// > live events buffered during the call — a message delivered by both paths - /// > is applied once, newest wins. A client may also wait briefly for an - /// > out-of-order live update to close a small gap before calling at all. - /// > - /// > On stream completion the client advances its cursor to the highest - /// > checkpoint_sequence it received, which equals latest_sequence — the client - /// > is now at the head. When the client is already current the server sends a - /// > single response with messages omitted (and checkpoint_sequence unset), - /// > leaving the cursor unchanged; latest_sequence still reports the head. - /// > - /// > This is a BOUNDED server stream: the server emits one or more batches and - /// > then completes once the delta up to the head (as of stream open) is - /// > exhausted. Unlike StreamEvents it does NOT stay open for live updates. - /// > Streaming the delta in batches avoids a per-page round trip; the server may - /// > currently send the whole delta as a single response, so clients must handle - /// > any number of batches and treat stream completion as "caught up." - /// > - /// > The Result field is meaningful on the first response and is OK for - /// > subsequent data batches; a terminal DENIED or RESET_REQUIRED is delivered - /// > as a single response that ends the stream. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetDeltaRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetDeltaRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetDeltaResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getDelta( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.serverStreaming( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.GetDelta.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SendMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendMessage sends a message to a chat. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_SendMessageRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_SendMessageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_SendMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.SendMessage.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "EditMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > EditMessage edits the content of a message the caller previously sent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_EditMessageRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_EditMessageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_EditMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func editMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.EditMessage.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeleteMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeleteMessage deletes a message the caller previously sent. The message is - /// > tombstoned (content replaced with DeletedContent), not removed, so the - /// > per-chat MessageId sequence stays gapless. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_DeleteMessageRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_DeleteMessageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_DeleteMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deleteMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.DeleteMessage.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AddReaction" method. - /// - /// > Source IDL Documentation: - /// > - /// > AddReaction adds the caller's reaction with a given emoji to a message. - /// > Idempotent: re-adding the same emoji the caller already reacted with is a - /// > no-op success. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_AddReactionRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_AddReactionRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_AddReactionResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func addReaction( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.AddReaction.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "RemoveReaction" method. - /// - /// > Source IDL Documentation: - /// > - /// > RemoveReaction removes the caller's reaction with a given emoji from a - /// > message. Idempotent: removing a reaction the caller does not have is a - /// > no-op success. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_RemoveReactionRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_RemoveReactionRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_RemoveReactionResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func removeReaction( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.RemoveReaction.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactors" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactors returns the paged list of users who reacted to a message with - /// > a given emoji — the on-demand drill-down behind EmojiReaction.count, which - /// > never inlines the full reactor list. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactorsRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetReactorsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetReactorsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactors( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.GetReactors.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactionSummary" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactionSummary fetches the current aggregate reaction state for a - /// > single message. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactionSummaryRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetReactionSummaryRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetReactionSummaryResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactionSummary( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.GetReactionSummary.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactionSummaries" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactionSummaries fetches the current aggregate reaction state using - /// > paged and batched APIs - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactionSummariesRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_GetReactionSummariesRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_GetReactionSummariesResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactionSummaries( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.GetReactionSummaries.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AdvancePointer" method. - /// - /// > Source IDL Documentation: - /// > - /// > AdvancePointer advances a pointer in message history for a chat member. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_AdvancePointerRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_AdvancePointerRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_AdvancePointerResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func advancePointer( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.AdvancePointer.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "NotifyIsTyping" method. - /// - /// > Source IDL Documentation: - /// > - /// > NotifyIsTypingRequest notifies a chat that the sending member is typing. - /// > - /// > These requests are transient, and may be dropped at any point. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_NotifyIsTypingRequest` message. - /// - serializer: A serializer for `Flipcash_Messaging_V1_NotifyIsTypingRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Messaging_V1_NotifyIsTypingResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func notifyIsTyping( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Messaging_V1_Messaging.Method.NotifyIsTyping.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Messaging_V1_Messaging.ClientProtocol { - /// Call the "GetMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMessage gets a single message in a chat - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetMessageRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMessage( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getMessage( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMessages gets the set of messages for a chat using paged and batched APIs - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetMessagesRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMessages( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getMessages( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetDelta" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetDelta returns, for cold-boot and reconnect catch-up, the current state - /// > of every message changed since the client's cursor, up to the chat's - /// > current head. It is a state delta, not a contiguous replay: each changed - /// > message appears once in its latest state and the client applies it - /// > last-writer-wins. Transient signals (typing) and convergent state - /// > (pointers, reactions) are fetched separately, not returned here. - /// > - /// > GetDelta always catches up to the head; there is no caller-specified - /// > upper bound. An online client that detects a gap while already receiving - /// > live updates does NOT bound the fetch: it calls GetDelta to the head and - /// > lets last-writer-wins (Message.event_sequence) absorb the overlap with - /// > live events buffered during the call — a message delivered by both paths - /// > is applied once, newest wins. A client may also wait briefly for an - /// > out-of-order live update to close a small gap before calling at all. - /// > - /// > On stream completion the client advances its cursor to the highest - /// > checkpoint_sequence it received, which equals latest_sequence — the client - /// > is now at the head. When the client is already current the server sends a - /// > single response with messages omitted (and checkpoint_sequence unset), - /// > leaving the cursor unchanged; latest_sequence still reports the head. - /// > - /// > This is a BOUNDED server stream: the server emits one or more batches and - /// > then completes once the delta up to the head (as of stream open) is - /// > exhausted. Unlike StreamEvents it does NOT stay open for live updates. - /// > Streaming the delta in batches avoids a per-page round trip; the server may - /// > currently send the whole delta as a single response, so clients must handle - /// > any number of batches and treat stream completion as "caught up." - /// > - /// > The Result field is meaningful on the first response and is OK for - /// > subsequent data batches; a terminal DENIED or RESET_REQUIRED is delivered - /// > as a single response that ends the stream. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetDeltaRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getDelta( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.getDelta( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SendMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendMessage sends a message to a chat. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_SendMessageRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendMessage( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.sendMessage( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "EditMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > EditMessage edits the content of a message the caller previously sent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_EditMessageRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func editMessage( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.editMessage( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeleteMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeleteMessage deletes a message the caller previously sent. The message is - /// > tombstoned (content replaced with DeletedContent), not removed, so the - /// > per-chat MessageId sequence stays gapless. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_DeleteMessageRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deleteMessage( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.deleteMessage( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AddReaction" method. - /// - /// > Source IDL Documentation: - /// > - /// > AddReaction adds the caller's reaction with a given emoji to a message. - /// > Idempotent: re-adding the same emoji the caller already reacted with is a - /// > no-op success. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_AddReactionRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func addReaction( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.addReaction( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "RemoveReaction" method. - /// - /// > Source IDL Documentation: - /// > - /// > RemoveReaction removes the caller's reaction with a given emoji from a - /// > message. Idempotent: removing a reaction the caller does not have is a - /// > no-op success. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_RemoveReactionRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func removeReaction( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.removeReaction( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactors" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactors returns the paged list of users who reacted to a message with - /// > a given emoji — the on-demand drill-down behind EmojiReaction.count, which - /// > never inlines the full reactor list. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactorsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactors( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getReactors( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactionSummary" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactionSummary fetches the current aggregate reaction state for a - /// > single message. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactionSummaryRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactionSummary( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getReactionSummary( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactionSummaries" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactionSummaries fetches the current aggregate reaction state using - /// > paged and batched APIs - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_GetReactionSummariesRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactionSummaries( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getReactionSummaries( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AdvancePointer" method. - /// - /// > Source IDL Documentation: - /// > - /// > AdvancePointer advances a pointer in message history for a chat member. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_AdvancePointerRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func advancePointer( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.advancePointer( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "NotifyIsTyping" method. - /// - /// > Source IDL Documentation: - /// > - /// > NotifyIsTypingRequest notifies a chat that the sending member is typing. - /// > - /// > These requests are transient, and may be dropped at any point. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Messaging_V1_NotifyIsTypingRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func notifyIsTyping( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.notifyIsTyping( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Messaging_V1_Messaging.ClientProtocol { - /// Call the "GetMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMessage gets a single message in a chat - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMessage( - _ message: Flipcash_Messaging_V1_GetMessageRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getMessage( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMessages gets the set of messages for a chat using paged and batched APIs - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMessages( - _ message: Flipcash_Messaging_V1_GetMessagesRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getMessages( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetDelta" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetDelta returns, for cold-boot and reconnect catch-up, the current state - /// > of every message changed since the client's cursor, up to the chat's - /// > current head. It is a state delta, not a contiguous replay: each changed - /// > message appears once in its latest state and the client applies it - /// > last-writer-wins. Transient signals (typing) and convergent state - /// > (pointers, reactions) are fetched separately, not returned here. - /// > - /// > GetDelta always catches up to the head; there is no caller-specified - /// > upper bound. An online client that detects a gap while already receiving - /// > live updates does NOT bound the fetch: it calls GetDelta to the head and - /// > lets last-writer-wins (Message.event_sequence) absorb the overlap with - /// > live events buffered during the call — a message delivered by both paths - /// > is applied once, newest wins. A client may also wait briefly for an - /// > out-of-order live update to close a small gap before calling at all. - /// > - /// > On stream completion the client advances its cursor to the highest - /// > checkpoint_sequence it received, which equals latest_sequence — the client - /// > is now at the head. When the client is already current the server sends a - /// > single response with messages omitted (and checkpoint_sequence unset), - /// > leaving the cursor unchanged; latest_sequence still reports the head. - /// > - /// > This is a BOUNDED server stream: the server emits one or more batches and - /// > then completes once the delta up to the head (as of stream open) is - /// > exhausted. Unlike StreamEvents it does NOT stay open for live updates. - /// > Streaming the delta in batches avoids a per-page round trip; the server may - /// > currently send the whole delta as a single response, so clients must handle - /// > any number of batches and treat stream completion as "caught up." - /// > - /// > The Result field is meaningful on the first response and is OK for - /// > subsequent data batches; a terminal DENIED or RESET_REQUIRED is delivered - /// > as a single response that ends the stream. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getDelta( - _ message: Flipcash_Messaging_V1_GetDeltaRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getDelta( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SendMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendMessage sends a message to a chat. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendMessage( - _ message: Flipcash_Messaging_V1_SendMessageRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.sendMessage( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "EditMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > EditMessage edits the content of a message the caller previously sent. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func editMessage( - _ message: Flipcash_Messaging_V1_EditMessageRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.editMessage( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeleteMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeleteMessage deletes a message the caller previously sent. The message is - /// > tombstoned (content replaced with DeletedContent), not removed, so the - /// > per-chat MessageId sequence stays gapless. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deleteMessage( - _ message: Flipcash_Messaging_V1_DeleteMessageRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.deleteMessage( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AddReaction" method. - /// - /// > Source IDL Documentation: - /// > - /// > AddReaction adds the caller's reaction with a given emoji to a message. - /// > Idempotent: re-adding the same emoji the caller already reacted with is a - /// > no-op success. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func addReaction( - _ message: Flipcash_Messaging_V1_AddReactionRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.addReaction( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "RemoveReaction" method. - /// - /// > Source IDL Documentation: - /// > - /// > RemoveReaction removes the caller's reaction with a given emoji from a - /// > message. Idempotent: removing a reaction the caller does not have is a - /// > no-op success. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func removeReaction( - _ message: Flipcash_Messaging_V1_RemoveReactionRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.removeReaction( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactors" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactors returns the paged list of users who reacted to a message with - /// > a given emoji — the on-demand drill-down behind EmojiReaction.count, which - /// > never inlines the full reactor list. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactors( - _ message: Flipcash_Messaging_V1_GetReactorsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getReactors( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactionSummary" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactionSummary fetches the current aggregate reaction state for a - /// > single message. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactionSummary( - _ message: Flipcash_Messaging_V1_GetReactionSummaryRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getReactionSummary( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetReactionSummaries" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetReactionSummaries fetches the current aggregate reaction state using - /// > paged and batched APIs - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getReactionSummaries( - _ message: Flipcash_Messaging_V1_GetReactionSummariesRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getReactionSummaries( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AdvancePointer" method. - /// - /// > Source IDL Documentation: - /// > - /// > AdvancePointer advances a pointer in message history for a chat member. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func advancePointer( - _ message: Flipcash_Messaging_V1_AdvancePointerRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.advancePointer( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "NotifyIsTyping" method. - /// - /// > Source IDL Documentation: - /// > - /// > NotifyIsTypingRequest notifies a chat that the sending member is typing. - /// > - /// > These requests are transient, and may be dropped at any point. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func notifyIsTyping( - _ message: Flipcash_Messaging_V1_NotifyIsTypingRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.notifyIsTyping( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/flipcash_messaging_v1_messaging_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/flipcash_messaging_v1_messaging_service.pb.swift deleted file mode 100644 index 7af2d7ef3..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/flipcash_messaging_v1_messaging_service.pb.swift +++ /dev/null @@ -1,2742 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: messaging/v1/messaging_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Messaging_V1_GetMessageRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_GetMessageResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_GetMessageResponse.Result = .ok - - public var message: Flipcash_Messaging_V1_Message { - get {return _message ?? Flipcash_Messaging_V1_Message()} - set {_message = newValue} - } - /// Returns true if `message` has been explicitly set. - public var hasMessage: Bool {return self._message != nil} - /// Clears the value of `message`. Subsequent reads from it will return its default value. - public mutating func clearMessage() {self._message = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case notFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .notFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_GetMessageResponse.Result] = [ - .ok, - .denied, - .notFound, - ] - - } - - public init() {} - - fileprivate var _message: Flipcash_Messaging_V1_Message? = nil -} - -public struct Flipcash_Messaging_V1_GetMessagesRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var query: Flipcash_Messaging_V1_GetMessagesRequest.OneOf_Query? = nil - - public var options: Flipcash_Common_V1_QueryOptions { - get { - if case .options(let v)? = query {return v} - return Flipcash_Common_V1_QueryOptions() - } - set {query = .options(newValue)} - } - - public var messageIds: Flipcash_Messaging_V1_MessageIdBatch { - get { - if case .messageIds(let v)? = query {return v} - return Flipcash_Messaging_V1_MessageIdBatch() - } - set {query = .messageIds(newValue)} - } - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Query: Equatable, Sendable { - case options(Flipcash_Common_V1_QueryOptions) - case messageIds(Flipcash_Messaging_V1_MessageIdBatch) - - } - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_GetMessagesResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_GetMessagesResponse.Result = .ok - - public var messages: Flipcash_Messaging_V1_MessageBatch { - get {return _messages ?? Flipcash_Messaging_V1_MessageBatch()} - set {_messages = newValue} - } - /// Returns true if `messages` has been explicitly set. - public var hasMessages: Bool {return self._messages != nil} - /// Clears the value of `messages`. Subsequent reads from it will return its default value. - public mutating func clearMessages() {self._messages = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case notFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .notFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_GetMessagesResponse.Result] = [ - .ok, - .denied, - .notFound, - ] - - } - - public init() {} - - fileprivate var _messages: Flipcash_Messaging_V1_MessageBatch? = nil -} - -public struct Flipcash_Messaging_V1_GetDeltaRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - /// The latest event sequence the client has already applied. The server - /// returns the current state of messages whose event_sequence is greater than - /// this value, up to the current head. Use 0 to fetch from the beginning of - /// the retained log. - public var afterSequence: UInt64 = 0 - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_GetDeltaResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_GetDeltaResponse.Result = .ok - - /// A batch of changed messages in STRICTLY ASCENDING event_sequence order, - /// continuing in order across batches (every sequence in a batch is higher - /// than every sequence in the prior batch). Across the whole stream this is - /// the current state of every message changed since after_sequence, up to the - /// head; a message normally appears once in its latest state, but one - /// re-edited mid-stream may reappear at its new, higher sequence (apply - /// last-writer-wins). Omitted (not an empty batch) when there are no changes - /// to report — e.g. when the client is already current; the server still - /// sets latest_sequence and the stream then completes. Note MessageBatch - /// itself requires at least one message, so "no changes" is signaled by - /// leaving this field unset, never by an empty batch. - public var messages: Flipcash_Messaging_V1_MessageBatch { - get {return _messages ?? Flipcash_Messaging_V1_MessageBatch()} - set {_messages = newValue} - } - /// Returns true if `messages` has been explicitly set. - public var hasMessages: Bool {return self._messages != nil} - /// Clears the value of `messages`. Subsequent reads from it will return its default value. - public mutating func clearMessages() {self._messages = nil} - - /// The chat's latest event sequence (head) as of stream open — the target this - /// catch-up converges to. Informational while streaming: it tells the client - /// how far the chat has advanced before the final batch arrives. Once the - /// stream completes, the client's cursor equals this; it does not need - /// contiguous coverage of the intervening points, only the resulting state. - public var latestSequence: UInt64 = 0 - - /// Resume checkpoint: the event_sequence through which the delta is complete - /// as of this batch — the batch's high-water mark, monotonically increasing - /// across the stream toward latest_sequence. Persist it AFTER fully applying - /// the batch. If the stream drops mid-catch-up, resume by calling GetDelta - /// again with after_sequence set to the last checkpoint_sequence received. - /// Because event_sequence only ever increases, this resumes exactly where you - /// left off with no skipped messages (and at worst a harmless last-writer-wins - /// re-apply of the boundary). - public var checkpointSequence: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// after_sequence is older than the oldest state the server can still - /// resolve a delta for. The client must discard its cursor and re-sync - /// chat history from GetMessages before resuming the event stream. - case resetRequired // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .resetRequired - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .resetRequired: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_GetDeltaResponse.Result] = [ - .ok, - .denied, - .resetRequired, - ] - - } - - public init() {} - - fileprivate var _messages: Flipcash_Messaging_V1_MessageBatch? = nil -} - -public struct Flipcash_Messaging_V1_SendMessageRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - /// Allowed content types that can be sent by client: - /// - TextContent - /// - ReplyContent - /// - MediaContent - public var content: [Flipcash_Messaging_V1_Content] = [] - - /// Client-generated idempotency token for this send. Used to dedup retried - /// sends and to correlate the optimistic local echo with the server-assigned - /// message returned in the response. - public var clientMessageID: Flipcash_Messaging_V1_ClientMessageId { - get {return _clientMessageID ?? Flipcash_Messaging_V1_ClientMessageId()} - set {_clientMessageID = newValue} - } - /// Returns true if `clientMessageID` has been explicitly set. - public var hasClientMessageID: Bool {return self._clientMessageID != nil} - /// Clears the value of `clientMessageID`. Subsequent reads from it will return its default value. - public mutating func clearClientMessageID() {self._clientMessageID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _clientMessageID: Flipcash_Messaging_V1_ClientMessageId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_SendMessageResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_SendMessageResponse.Result = .ok - - /// The chat message that was sent if the RPC was succesful, which includes - /// server-side metadata like the generated message ID and official timestamp - public var message: Flipcash_Messaging_V1_Message { - get {return _message ?? Flipcash_Messaging_V1_Message()} - set {_message = newValue} - } - /// Returns true if `message` has been explicitly set. - public var hasMessage: Bool {return self._message != nil} - /// Clears the value of `message`. Subsequent reads from it will return its default value. - public mutating func clearMessage() {self._message = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_SendMessageResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} - - fileprivate var _message: Flipcash_Messaging_V1_Message? = nil -} - -public struct Flipcash_Messaging_V1_EditMessageRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - /// The new content for the message. Allowed content types match SendMessage: - /// - TextContent - /// - ReplyContent - /// - MediaContent - public var content: [Flipcash_Messaging_V1_Content] = [] - - /// Required optimistic-concurrency guard: the message's event_sequence as the - /// client last observed it. The server applies the edit only if the message's - /// current event_sequence still equals this value, and returns CONFLICT - /// otherwise — so an edit based on a stale version (e.g. a concurrent - /// edit/delete from the sender's other device) is rejected rather than - /// clobbering the newer state. There is no last-writer-wins path. - public var expectedEventSequence: UInt64 = 0 - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_EditMessageResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_EditMessageResponse.Result = .ok - - /// On OK, the updated materialized message (advanced event_sequence, - /// last_edited_ts set). On CONFLICT, the message's current state. - public var message: Flipcash_Messaging_V1_Message { - get {return _message ?? Flipcash_Messaging_V1_Message()} - set {_message = newValue} - } - /// Returns true if `message` has been explicitly set. - public var hasMessage: Bool {return self._message != nil} - /// Clears the value of `message`. Subsequent reads from it will return its default value. - public mutating func clearMessage() {self._message = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case messageNotFound // = 2 - case cannotEdit // = 3 - - /// The message changed since expected_event_sequence (a concurrent - /// edit/delete won). The edit was not applied; `message` carries the - /// current state for the client to reconcile against and retry. - case conflict // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .messageNotFound - case 3: self = .cannotEdit - case 4: self = .conflict - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .messageNotFound: return 2 - case .cannotEdit: return 3 - case .conflict: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_EditMessageResponse.Result] = [ - .ok, - .denied, - .messageNotFound, - .cannotEdit, - .conflict, - ] - - } - - public init() {} - - fileprivate var _message: Flipcash_Messaging_V1_Message? = nil -} - -public struct Flipcash_Messaging_V1_DeleteMessageRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - /// Required optimistic-concurrency guard: the message's event_sequence as the - /// client last observed it. The server applies the delete only if the - /// message's current event_sequence still equals this value, and returns - /// CONFLICT otherwise — so a delete based on a stale version is rejected - /// rather than racing a concurrent edit/delete. There is no - /// last-writer-wins path. - public var expectedEventSequence: UInt64 = 0 - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_DeleteMessageResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_DeleteMessageResponse.Result = .ok - - /// On OK, the tombstoned materialized message (content replaced with - /// DeletedContent, event_sequence advanced). On CONFLICT, the current state. - public var message: Flipcash_Messaging_V1_Message { - get {return _message ?? Flipcash_Messaging_V1_Message()} - set {_message = newValue} - } - /// Returns true if `message` has been explicitly set. - public var hasMessage: Bool {return self._message != nil} - /// Clears the value of `message`. Subsequent reads from it will return its default value. - public mutating func clearMessage() {self._message = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case messageNotFound // = 2 - case cannotDelete // = 3 - - /// The message changed since expected_event_sequence (a concurrent - /// edit/delete won). The delete was not applied; `message` carries the - /// current state for the client to reconcile against and retry. - case conflict // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .messageNotFound - case 3: self = .cannotDelete - case 4: self = .conflict - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .messageNotFound: return 2 - case .cannotDelete: return 3 - case .conflict: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_DeleteMessageResponse.Result] = [ - .ok, - .denied, - .messageNotFound, - .cannotDelete, - .conflict, - ] - - } - - public init() {} - - fileprivate var _message: Flipcash_Messaging_V1_Message? = nil -} - -public struct Flipcash_Messaging_V1_AddReactionRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - /// The emoji to react with. - public var emoji: Flipcash_Messaging_V1_Emoji { - get {return _emoji ?? Flipcash_Messaging_V1_Emoji()} - set {_emoji = newValue} - } - /// Returns true if `emoji` has been explicitly set. - public var hasEmoji: Bool {return self._emoji != nil} - /// Clears the value of `emoji`. Subsequent reads from it will return its default value. - public mutating func clearEmoji() {self._emoji = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _emoji: Flipcash_Messaging_V1_Emoji? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_AddReactionResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_AddReactionResponse.Result = .ok - - /// The affected emoji's aggregate after the add (count, reacted_by_self true). - public var reaction: Flipcash_Messaging_V1_EmojiReaction { - get {return _reaction ?? Flipcash_Messaging_V1_EmojiReaction()} - set {_reaction = newValue} - } - /// Returns true if `reaction` has been explicitly set. - public var hasReaction: Bool {return self._reaction != nil} - /// Clears the value of `reaction`. Subsequent reads from it will return its default value. - public mutating func clearReaction() {self._reaction = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case messageNotFound // = 2 - case cannotReact // = 3 - - /// Adding this emoji would exceed the per-message distinct reaction-type - /// cap. Reactions to emojis already present on the message are unaffected. - case tooManyReactionTypes // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .messageNotFound - case 3: self = .cannotReact - case 4: self = .tooManyReactionTypes - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .messageNotFound: return 2 - case .cannotReact: return 3 - case .tooManyReactionTypes: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_AddReactionResponse.Result] = [ - .ok, - .denied, - .messageNotFound, - .cannotReact, - .tooManyReactionTypes, - ] - - } - - public init() {} - - fileprivate var _reaction: Flipcash_Messaging_V1_EmojiReaction? = nil -} - -public struct Flipcash_Messaging_V1_RemoveReactionRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - /// The emoji whose reaction to remove for the caller. - public var emoji: Flipcash_Messaging_V1_Emoji { - get {return _emoji ?? Flipcash_Messaging_V1_Emoji()} - set {_emoji = newValue} - } - /// Returns true if `emoji` has been explicitly set. - public var hasEmoji: Bool {return self._emoji != nil} - /// Clears the value of `emoji`. Subsequent reads from it will return its default value. - public mutating func clearEmoji() {self._emoji = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _emoji: Flipcash_Messaging_V1_Emoji? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_RemoveReactionResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_RemoveReactionResponse.Result = .ok - - /// The affected emoji's aggregate after the removal - public var reaction: Flipcash_Messaging_V1_EmojiReaction { - get {return _reaction ?? Flipcash_Messaging_V1_EmojiReaction()} - set {_reaction = newValue} - } - /// Returns true if `reaction` has been explicitly set. - public var hasReaction: Bool {return self._reaction != nil} - /// Clears the value of `reaction`. Subsequent reads from it will return its default value. - public mutating func clearReaction() {self._reaction = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case messageNotFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .messageNotFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .messageNotFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_RemoveReactionResponse.Result] = [ - .ok, - .denied, - .messageNotFound, - ] - - } - - public init() {} - - fileprivate var _reaction: Flipcash_Messaging_V1_EmojiReaction? = nil -} - -public struct Flipcash_Messaging_V1_GetReactorsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - /// The emoji whose reactors to list. - public var emoji: Flipcash_Messaging_V1_Emoji { - get {return _emoji ?? Flipcash_Messaging_V1_Emoji()} - set {_emoji = newValue} - } - /// Returns true if `emoji` has been explicitly set. - public var hasEmoji: Bool {return self._emoji != nil} - /// Clears the value of `emoji`. Subsequent reads from it will return its default value. - public mutating func clearEmoji() {self._emoji = nil} - - /// Paging over the reactor list (server-ordered, typically most-recent - /// first). Leave options.paging_token unset on the first request; on every - /// subsequent request, set it to the paging_token from the most recent - /// response to advance through the list. The token is opaque and - /// server-generated; do not construct it. - public var options: Flipcash_Common_V1_QueryOptions { - get {return _options ?? Flipcash_Common_V1_QueryOptions()} - set {_options = newValue} - } - /// Returns true if `options` has been explicitly set. - public var hasOptions: Bool {return self._options != nil} - /// Clears the value of `options`. Subsequent reads from it will return its default value. - public mutating func clearOptions() {self._options = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _emoji: Flipcash_Messaging_V1_Emoji? = nil - fileprivate var _options: Flipcash_Common_V1_QueryOptions? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_GetReactorsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_GetReactorsResponse.Result = .ok - - /// A page of users who reacted with the requested emoji, with their reaction - /// timestamps. Empty when the message exists but has no reactors for the emoji. - public var reactors: [Flipcash_Messaging_V1_Reactor] = [] - - /// The server-generated cursor advanced past this page. The client MUST send - /// the most recent value back in options.paging_token on the next - /// GetReactorsRequest to fetch the following page. Set when result is OK and - /// has_more is true. - public var pagingToken: Flipcash_Common_V1_PagingToken { - get {return _pagingToken ?? Flipcash_Common_V1_PagingToken()} - set {_pagingToken = newValue} - } - /// Returns true if `pagingToken` has been explicitly set. - public var hasPagingToken: Bool {return self._pagingToken != nil} - /// Clears the value of `pagingToken`. Subsequent reads from it will return its default value. - public mutating func clearPagingToken() {self._pagingToken = nil} - - /// HasMore indicates whether further pages of reactors remain. When false, - /// the reactor list has been fully read. When true, the client should issue - /// another GetReactorsRequest with the returned paging_token. - public var hasMore_p: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case messageNotFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .messageNotFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .messageNotFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_GetReactorsResponse.Result] = [ - .ok, - .denied, - .messageNotFound, - ] - - } - - public init() {} - - fileprivate var _pagingToken: Flipcash_Common_V1_PagingToken? = nil -} - -public struct Flipcash_Messaging_V1_GetReactionSummaryRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_GetReactionSummaryResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_GetReactionSummaryResponse.Result = .ok - - /// The aggregate reaction state for the message. reacted_by_self is computed - /// for the caller; clients still apply per (message, emoji) by - /// EmojiReaction.sequence, so a summary that is slightly behind a live update - /// is harmlessly ignored rather than regressing state. - public var summary: Flipcash_Messaging_V1_ReactionSummary { - get {return _summary ?? Flipcash_Messaging_V1_ReactionSummary()} - set {_summary = newValue} - } - /// Returns true if `summary` has been explicitly set. - public var hasSummary: Bool {return self._summary != nil} - /// Clears the value of `summary`. Subsequent reads from it will return its default value. - public mutating func clearSummary() {self._summary = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case messageNotFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .messageNotFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .messageNotFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_GetReactionSummaryResponse.Result] = [ - .ok, - .denied, - .messageNotFound, - ] - - } - - public init() {} - - fileprivate var _summary: Flipcash_Messaging_V1_ReactionSummary? = nil -} - -public struct Flipcash_Messaging_V1_GetReactionSummariesRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var query: Flipcash_Messaging_V1_GetReactionSummariesRequest.OneOf_Query? = nil - - public var options: Flipcash_Common_V1_QueryOptions { - get { - if case .options(let v)? = query {return v} - return Flipcash_Common_V1_QueryOptions() - } - set {query = .options(newValue)} - } - - public var messageIds: Flipcash_Messaging_V1_MessageIdBatch { - get { - if case .messageIds(let v)? = query {return v} - return Flipcash_Messaging_V1_MessageIdBatch() - } - set {query = .messageIds(newValue)} - } - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Query: Equatable, Sendable { - case options(Flipcash_Common_V1_QueryOptions) - case messageIds(Flipcash_Messaging_V1_MessageIdBatch) - - } - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_GetReactionSummariesResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_GetReactionSummariesResponse.Result = .ok - - /// One summary per requested message, keyed by ReactionSummary.message_id. - /// reacted_by_self in each summary is computed for the caller; clients still - /// apply per (message, emoji) by EmojiReaction.sequence, so a summary that - /// is slightly behind a live update is harmlessly ignored rather than regressing - /// state. - public var summaries: [Flipcash_Messaging_V1_ReactionSummary] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_GetReactionSummariesResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -public struct Flipcash_Messaging_V1_AdvancePointerRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var pointerType: Flipcash_Messaging_V1_Pointer.TypeEnum = .unknown - - public var newValue: Flipcash_Messaging_V1_MessageId { - get {return _newValue ?? Flipcash_Messaging_V1_MessageId()} - set {_newValue = newValue} - } - /// Returns true if `newValue` has been explicitly set. - public var hasNewValue: Bool {return self._newValue != nil} - /// Clears the value of `newValue`. Subsequent reads from it will return its default value. - public mutating func clearNewValue() {self._newValue = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _newValue: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_AdvancePointerResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_AdvancePointerResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case messageNotFound // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .messageNotFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .messageNotFound: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_AdvancePointerResponse.Result] = [ - .ok, - .denied, - .messageNotFound, - ] - - } - - public init() {} -} - -public struct Flipcash_Messaging_V1_NotifyIsTypingRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var state: Flipcash_Messaging_V1_IsTypingNotification.State = .unknownTypingState - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Messaging_V1_NotifyIsTypingResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Messaging_V1_NotifyIsTypingResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_NotifyIsTypingResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.messaging.v1" - -extension Flipcash_Messaging_V1_GetMessageRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetMessageRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}message_id\0\u{2}\u{8}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetMessageRequest, rhs: Flipcash_Messaging_V1_GetMessageRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._messageID != rhs._messageID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetMessageResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetMessageResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}message\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._message) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._message { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetMessageResponse, rhs: Flipcash_Messaging_V1_GetMessageResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._message != rhs._message {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetMessageResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}NOT_FOUND\0") -} - -extension Flipcash_Messaging_V1_GetMessagesRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetMessagesRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}options\0\u{3}message_ids\0\u{2}\u{7}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { - var v: Flipcash_Common_V1_QueryOptions? - var hadOneofValue = false - if let current = self.query { - hadOneofValue = true - if case .options(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.query = .options(v) - } - }() - case 3: try { - var v: Flipcash_Messaging_V1_MessageIdBatch? - var hadOneofValue = false - if let current = self.query { - hadOneofValue = true - if case .messageIds(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.query = .messageIds(v) - } - }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - switch self.query { - case .options?: try { - guard case .options(let v)? = self.query else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .messageIds?: try { - guard case .messageIds(let v)? = self.query else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetMessagesRequest, rhs: Flipcash_Messaging_V1_GetMessagesRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs.query != rhs.query {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetMessagesResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetMessagesResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}messages\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messages) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._messages { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetMessagesResponse, rhs: Flipcash_Messaging_V1_GetMessagesResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._messages != rhs._messages {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetMessagesResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}NOT_FOUND\0") -} - -extension Flipcash_Messaging_V1_GetDeltaRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetDeltaRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}after_sequence\0\u{2}\u{8}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.afterSequence) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.afterSequence != 0 { - try visitor.visitSingularUInt64Field(value: self.afterSequence, fieldNumber: 2) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetDeltaRequest, rhs: Flipcash_Messaging_V1_GetDeltaRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs.afterSequence != rhs.afterSequence {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetDeltaResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetDeltaResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}messages\0\u{3}latest_sequence\0\u{3}checkpoint_sequence\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messages) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.latestSequence) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.checkpointSequence) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._messages { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.latestSequence != 0 { - try visitor.visitSingularUInt64Field(value: self.latestSequence, fieldNumber: 3) - } - if self.checkpointSequence != 0 { - try visitor.visitSingularUInt64Field(value: self.checkpointSequence, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetDeltaResponse, rhs: Flipcash_Messaging_V1_GetDeltaResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._messages != rhs._messages {return false} - if lhs.latestSequence != rhs.latestSequence {return false} - if lhs.checkpointSequence != rhs.checkpointSequence {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetDeltaResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}RESET_REQUIRED\0") -} - -extension Flipcash_Messaging_V1_SendMessageRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendMessageRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}content\0\u{3}client_message_id\0\u{2}\u{7}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.content) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._clientMessageID) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.content.isEmpty { - try visitor.visitRepeatedMessageField(value: self.content, fieldNumber: 2) - } - try { if let v = self._clientMessageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_SendMessageRequest, rhs: Flipcash_Messaging_V1_SendMessageRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs.content != rhs.content {return false} - if lhs._clientMessageID != rhs._clientMessageID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_SendMessageResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendMessageResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}message\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._message) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._message { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_SendMessageResponse, rhs: Flipcash_Messaging_V1_SendMessageResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._message != rhs._message {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_SendMessageResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Messaging_V1_EditMessageRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EditMessageRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}message_id\0\u{1}content\0\u{3}expected_event_sequence\0\u{2}\u{6}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.content) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.expectedEventSequence) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.content.isEmpty { - try visitor.visitRepeatedMessageField(value: self.content, fieldNumber: 3) - } - if self.expectedEventSequence != 0 { - try visitor.visitSingularUInt64Field(value: self.expectedEventSequence, fieldNumber: 4) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_EditMessageRequest, rhs: Flipcash_Messaging_V1_EditMessageRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._messageID != rhs._messageID {return false} - if lhs.content != rhs.content {return false} - if lhs.expectedEventSequence != rhs.expectedEventSequence {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_EditMessageResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EditMessageResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}message\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._message) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._message { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_EditMessageResponse, rhs: Flipcash_Messaging_V1_EditMessageResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._message != rhs._message {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_EditMessageResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}MESSAGE_NOT_FOUND\0\u{1}CANNOT_EDIT\0\u{1}CONFLICT\0") -} - -extension Flipcash_Messaging_V1_DeleteMessageRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DeleteMessageRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}message_id\0\u{3}expected_event_sequence\0\u{2}\u{7}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.expectedEventSequence) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.expectedEventSequence != 0 { - try visitor.visitSingularUInt64Field(value: self.expectedEventSequence, fieldNumber: 3) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_DeleteMessageRequest, rhs: Flipcash_Messaging_V1_DeleteMessageRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._messageID != rhs._messageID {return false} - if lhs.expectedEventSequence != rhs.expectedEventSequence {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_DeleteMessageResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DeleteMessageResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}message\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._message) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._message { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_DeleteMessageResponse, rhs: Flipcash_Messaging_V1_DeleteMessageResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._message != rhs._message {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_DeleteMessageResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}MESSAGE_NOT_FOUND\0\u{1}CANNOT_DELETE\0\u{1}CONFLICT\0") -} - -extension Flipcash_Messaging_V1_AddReactionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AddReactionRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}message_id\0\u{1}emoji\0\u{2}\u{7}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._emoji) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._emoji { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_AddReactionRequest, rhs: Flipcash_Messaging_V1_AddReactionRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._messageID != rhs._messageID {return false} - if lhs._emoji != rhs._emoji {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_AddReactionResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AddReactionResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}reaction\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._reaction) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._reaction { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_AddReactionResponse, rhs: Flipcash_Messaging_V1_AddReactionResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._reaction != rhs._reaction {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_AddReactionResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}MESSAGE_NOT_FOUND\0\u{1}CANNOT_REACT\0\u{1}TOO_MANY_REACTION_TYPES\0") -} - -extension Flipcash_Messaging_V1_RemoveReactionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RemoveReactionRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}message_id\0\u{1}emoji\0\u{2}\u{7}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._emoji) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._emoji { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_RemoveReactionRequest, rhs: Flipcash_Messaging_V1_RemoveReactionRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._messageID != rhs._messageID {return false} - if lhs._emoji != rhs._emoji {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_RemoveReactionResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RemoveReactionResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}reaction\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._reaction) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._reaction { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_RemoveReactionResponse, rhs: Flipcash_Messaging_V1_RemoveReactionResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._reaction != rhs._reaction {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_RemoveReactionResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}MESSAGE_NOT_FOUND\0") -} - -extension Flipcash_Messaging_V1_GetReactorsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetReactorsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}message_id\0\u{1}emoji\0\u{1}options\0\u{2}\u{6}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._emoji) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._options) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._emoji { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._options { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetReactorsRequest, rhs: Flipcash_Messaging_V1_GetReactorsRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._messageID != rhs._messageID {return false} - if lhs._emoji != rhs._emoji {return false} - if lhs._options != rhs._options {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetReactorsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetReactorsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}reactors\0\u{3}paging_token\0\u{3}has_more\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.reactors) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._pagingToken) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.hasMore_p) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.reactors.isEmpty { - try visitor.visitRepeatedMessageField(value: self.reactors, fieldNumber: 2) - } - try { if let v = self._pagingToken { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.hasMore_p != false { - try visitor.visitSingularBoolField(value: self.hasMore_p, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetReactorsResponse, rhs: Flipcash_Messaging_V1_GetReactorsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.reactors != rhs.reactors {return false} - if lhs._pagingToken != rhs._pagingToken {return false} - if lhs.hasMore_p != rhs.hasMore_p {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetReactorsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}MESSAGE_NOT_FOUND\0") -} - -extension Flipcash_Messaging_V1_GetReactionSummaryRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetReactionSummaryRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}message_id\0\u{2}\u{8}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetReactionSummaryRequest, rhs: Flipcash_Messaging_V1_GetReactionSummaryRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._messageID != rhs._messageID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetReactionSummaryResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetReactionSummaryResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}summary\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._summary) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._summary { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetReactionSummaryResponse, rhs: Flipcash_Messaging_V1_GetReactionSummaryResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._summary != rhs._summary {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetReactionSummaryResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}MESSAGE_NOT_FOUND\0") -} - -extension Flipcash_Messaging_V1_GetReactionSummariesRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetReactionSummariesRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}options\0\u{3}message_ids\0\u{2}\u{7}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { - var v: Flipcash_Common_V1_QueryOptions? - var hadOneofValue = false - if let current = self.query { - hadOneofValue = true - if case .options(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.query = .options(v) - } - }() - case 3: try { - var v: Flipcash_Messaging_V1_MessageIdBatch? - var hadOneofValue = false - if let current = self.query { - hadOneofValue = true - if case .messageIds(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.query = .messageIds(v) - } - }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - switch self.query { - case .options?: try { - guard case .options(let v)? = self.query else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .messageIds?: try { - guard case .messageIds(let v)? = self.query else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetReactionSummariesRequest, rhs: Flipcash_Messaging_V1_GetReactionSummariesRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs.query != rhs.query {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetReactionSummariesResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetReactionSummariesResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}summaries\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.summaries) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.summaries.isEmpty { - try visitor.visitRepeatedMessageField(value: self.summaries, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_GetReactionSummariesResponse, rhs: Flipcash_Messaging_V1_GetReactionSummariesResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.summaries != rhs.summaries {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_GetReactionSummariesResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Messaging_V1_AdvancePointerRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AdvancePointerRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}pointer_type\0\u{3}new_value\0\u{2}\u{7}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.pointerType) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._newValue) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.pointerType != .unknown { - try visitor.visitSingularEnumField(value: self.pointerType, fieldNumber: 2) - } - try { if let v = self._newValue { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_AdvancePointerRequest, rhs: Flipcash_Messaging_V1_AdvancePointerRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs.pointerType != rhs.pointerType {return false} - if lhs._newValue != rhs._newValue {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_AdvancePointerResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AdvancePointerResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_AdvancePointerResponse, rhs: Flipcash_Messaging_V1_AdvancePointerResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_AdvancePointerResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}MESSAGE_NOT_FOUND\0") -} - -extension Flipcash_Messaging_V1_NotifyIsTypingRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NotifyIsTypingRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}state\0\u{2}\u{8}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.state) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.state != .unknownTypingState { - try visitor.visitSingularEnumField(value: self.state, fieldNumber: 2) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_NotifyIsTypingRequest, rhs: Flipcash_Messaging_V1_NotifyIsTypingRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs.state != rhs.state {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_NotifyIsTypingResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NotifyIsTypingResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_NotifyIsTypingResponse, rhs: Flipcash_Messaging_V1_NotifyIsTypingResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_NotifyIsTypingResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/iap_v1_iap_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/iap_v1_iap_service.grpc.swift deleted file mode 100644 index 77ddab50c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/iap_v1_iap_service.grpc.swift +++ /dev/null @@ -1,201 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: iap/v1/iap_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.iap.v1.Iap - -/// Namespace containing generated types for the "flipcash.iap.v1.Iap" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Iap_V1_Iap { - /// Service descriptor for the "flipcash.iap.v1.Iap" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.iap.v1.Iap") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "OnPurchaseCompleted" metadata. - public enum OnPurchaseCompleted { - /// Request type for "OnPurchaseCompleted". - public typealias Input = Flipcash_Iap_V1_OnPurchaseCompletedRequest - /// Response type for "OnPurchaseCompleted". - public typealias Output = Flipcash_Iap_V1_OnPurchaseCompletedResponse - /// Descriptor for "OnPurchaseCompleted". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.iap.v1.Iap"), - method: "OnPurchaseCompleted" - ) - } - /// Descriptors for all methods in the "flipcash.iap.v1.Iap" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - OnPurchaseCompleted.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.iap.v1.Iap" service. - public static let flipcash_iap_v1_Iap = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.iap.v1.Iap") -} - -// MARK: flipcash.iap.v1.Iap (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Iap_V1_Iap { - /// Generated client protocol for the "flipcash.iap.v1.Iap" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "OnPurchaseCompleted" method. - /// - /// > Source IDL Documentation: - /// > - /// > OnPurchaseCompleted is called when an IAP has been completed - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Iap_V1_OnPurchaseCompletedRequest` message. - /// - serializer: A serializer for `Flipcash_Iap_V1_OnPurchaseCompletedRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Iap_V1_OnPurchaseCompletedResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func onPurchaseCompleted( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.iap.v1.Iap" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "OnPurchaseCompleted" method. - /// - /// > Source IDL Documentation: - /// > - /// > OnPurchaseCompleted is called when an IAP has been completed - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Iap_V1_OnPurchaseCompletedRequest` message. - /// - serializer: A serializer for `Flipcash_Iap_V1_OnPurchaseCompletedRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Iap_V1_OnPurchaseCompletedResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func onPurchaseCompleted( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Iap_V1_Iap.Method.OnPurchaseCompleted.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Iap_V1_Iap.ClientProtocol { - /// Call the "OnPurchaseCompleted" method. - /// - /// > Source IDL Documentation: - /// > - /// > OnPurchaseCompleted is called when an IAP has been completed - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Iap_V1_OnPurchaseCompletedRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func onPurchaseCompleted( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.onPurchaseCompleted( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Iap_V1_Iap.ClientProtocol { - /// Call the "OnPurchaseCompleted" method. - /// - /// > Source IDL Documentation: - /// > - /// > OnPurchaseCompleted is called when an IAP has been completed - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func onPurchaseCompleted( - _ message: Flipcash_Iap_V1_OnPurchaseCompletedRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.onPurchaseCompleted( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/iap_v1_iap_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/iap_v1_iap_service.pb.swift deleted file mode 100644 index 50192abcc..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/iap_v1_iap_service.pb.swift +++ /dev/null @@ -1,309 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: iap/v1/iap_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Iap_V1_OnPurchaseCompletedRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var platform: Flipcash_Common_V1_Platform = .unknown - - public var receipt: Flipcash_Iap_V1_Receipt { - get {return _receipt ?? Flipcash_Iap_V1_Receipt()} - set {_receipt = newValue} - } - /// Returns true if `receipt` has been explicitly set. - public var hasReceipt: Bool {return self._receipt != nil} - /// Clears the value of `receipt`. Subsequent reads from it will return its default value. - public mutating func clearReceipt() {self._receipt = nil} - - public var metadata: Flipcash_Iap_V1_Metadata { - get {return _metadata ?? Flipcash_Iap_V1_Metadata()} - set {_metadata = newValue} - } - /// Returns true if `metadata` has been explicitly set. - public var hasMetadata: Bool {return self._metadata != nil} - /// Clears the value of `metadata`. Subsequent reads from it will return its default value. - public mutating func clearMetadata() {self._metadata = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _receipt: Flipcash_Iap_V1_Receipt? = nil - fileprivate var _metadata: Flipcash_Iap_V1_Metadata? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Iap_V1_OnPurchaseCompletedResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Iap_V1_OnPurchaseCompletedResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// Returned if the receipt is invalid, or not in a completed payment state - case invalidReceipt // = 2 - - /// Returned if the at least one field in the payment metadata is invalid - case invalidMetadata // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .invalidReceipt - case 3: self = .invalidMetadata - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .invalidReceipt: return 2 - case .invalidMetadata: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Iap_V1_OnPurchaseCompletedResponse.Result] = [ - .ok, - .denied, - .invalidReceipt, - .invalidMetadata, - ] - - } - - public init() {} -} - -public struct Flipcash_Iap_V1_Receipt: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Additional IAP metadata, which can be trusted given a verified receipt (they can -/// only be generated by production-signed apps). -public struct Flipcash_Iap_V1_Metadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var product: String = String() - - public var currency: String = String() - - public var amount: Double = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.iap.v1" - -extension Flipcash_Iap_V1_OnPurchaseCompletedRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OnPurchaseCompletedRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}platform\0\u{1}receipt\0\u{1}metadata\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.platform) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._receipt) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._metadata) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.platform != .unknown { - try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 1) - } - try { if let v = self._receipt { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._metadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Iap_V1_OnPurchaseCompletedRequest, rhs: Flipcash_Iap_V1_OnPurchaseCompletedRequest) -> Bool { - if lhs.platform != rhs.platform {return false} - if lhs._receipt != rhs._receipt {return false} - if lhs._metadata != rhs._metadata {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Iap_V1_OnPurchaseCompletedResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OnPurchaseCompletedResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Iap_V1_OnPurchaseCompletedResponse, rhs: Flipcash_Iap_V1_OnPurchaseCompletedResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Iap_V1_OnPurchaseCompletedResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}INVALID_RECEIPT\0\u{1}INVALID_METADATA\0") -} - -extension Flipcash_Iap_V1_Receipt: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Receipt" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Iap_V1_Receipt, rhs: Flipcash_Iap_V1_Receipt) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Iap_V1_Metadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Metadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}product\0\u{1}currency\0\u{1}amount\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.product) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.currency) }() - case 3: try { try decoder.decodeSingularDoubleField(value: &self.amount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.product.isEmpty { - try visitor.visitSingularStringField(value: self.product, fieldNumber: 1) - } - if !self.currency.isEmpty { - try visitor.visitSingularStringField(value: self.currency, fieldNumber: 2) - } - if self.amount.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.amount, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Iap_V1_Metadata, rhs: Flipcash_Iap_V1_Metadata) -> Bool { - if lhs.product != rhs.product {return false} - if lhs.currency != rhs.currency {return false} - if lhs.amount != rhs.amount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/intent_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/intent_v1_model.pb.swift deleted file mode 100644 index 20fb8dc9d..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/intent_v1_model.pb.swift +++ /dev/null @@ -1,370 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: intent/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Intent_V1_AppMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var domain: Flipcash_Intent_V1_AppMetadata.OneOf_Domain? = nil - - public var chat: Flipcash_Intent_V1_ChatMetadata { - get { - if case .chat(let v)? = domain {return v} - return Flipcash_Intent_V1_ChatMetadata() - } - set {domain = .chat(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Domain: Equatable, Sendable { - case chat(Flipcash_Intent_V1_ChatMetadata) - - } - - public init() {} -} - -/// Additional metadata provided to SubmitIntent when doing payments in a chat -public struct Flipcash_Intent_V1_ChatMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var chatID: Flipcash_Common_V1_ChatId { - get {return _chatID ?? Flipcash_Common_V1_ChatId()} - set {_chatID = newValue} - } - /// Returns true if `chatID` has been explicitly set. - public var hasChatID: Bool {return self._chatID != nil} - /// Clears the value of `chatID`. Subsequent reads from it will return its default value. - public mutating func clearChatID() {self._chatID = nil} - - public var type: Flipcash_Intent_V1_ChatMetadata.OneOf_Type? = nil - - public var contactDmPayment: Flipcash_Intent_V1_ChatMetadata.ContactDmPayment { - get { - if case .contactDmPayment(let v)? = type {return v} - return Flipcash_Intent_V1_ChatMetadata.ContactDmPayment() - } - set {type = .contactDmPayment(newValue)} - } - - public var tipDmPayment: Flipcash_Intent_V1_ChatMetadata.TipDmPayment { - get { - if case .tipDmPayment(let v)? = type {return v} - return Flipcash_Intent_V1_ChatMetadata.TipDmPayment() - } - set {type = .tipDmPayment(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case contactDmPayment(Flipcash_Intent_V1_ChatMetadata.ContactDmPayment) - case tipDmPayment(Flipcash_Intent_V1_ChatMetadata.TipDmPayment) - - } - - /// For sending a payment to a contact in a DM - public struct ContactDmPayment: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Source phone number that is paying. This is validated to be linked to the sender. - public var source: Flipcash_Common_V1_PhoneNumber { - get {return _source ?? Flipcash_Common_V1_PhoneNumber()} - set {_source = newValue} - } - /// Returns true if `source` has been explicitly set. - public var hasSource: Bool {return self._source != nil} - /// Clears the value of `source`. Subsequent reads from it will return its default value. - public mutating func clearSource() {self._source = nil} - - /// Destination phone number that is being paid. This is validated to be linked to the receiver. - public var destination: Flipcash_Common_V1_PhoneNumber { - get {return _destination ?? Flipcash_Common_V1_PhoneNumber()} - set {_destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - public var hasDestination: Bool {return self._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - public mutating func clearDestination() {self._destination = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _source: Flipcash_Common_V1_PhoneNumber? = nil - fileprivate var _destination: Flipcash_Common_V1_PhoneNumber? = nil - } - - /// For sending a DM payment to someone using their user ID, which maps - /// directly to/from a public key. - public struct TipDmPayment: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var location: Flipcash_Intent_V1_ChatMetadata.TipDmPayment.Location = .tipcard - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Location in the app the payment was sent from - public enum Location: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case tipcard // = 0 - case chat // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .tipcard - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .tipcard - case 1: self = .chat - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .tipcard: return 0 - case .chat: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Intent_V1_ChatMetadata.TipDmPayment.Location] = [ - .tipcard, - .chat, - ] - - } - - public init() {} - } - - public init() {} - - fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.intent.v1" - -extension Flipcash_Intent_V1_AppMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AppMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}chat\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Intent_V1_ChatMetadata? - var hadOneofValue = false - if let current = self.domain { - hadOneofValue = true - if case .chat(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.domain = .chat(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .chat(let v)? = self.domain { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Intent_V1_AppMetadata, rhs: Flipcash_Intent_V1_AppMetadata) -> Bool { - if lhs.domain != rhs.domain {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Intent_V1_ChatMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ChatMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}contact_dm_payment\0\u{3}tip_dm_payment\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() - case 2: try { - var v: Flipcash_Intent_V1_ChatMetadata.ContactDmPayment? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .contactDmPayment(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .contactDmPayment(v) - } - }() - case 3: try { - var v: Flipcash_Intent_V1_ChatMetadata.TipDmPayment? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .tipDmPayment(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .tipDmPayment(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._chatID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - switch self.type { - case .contactDmPayment?: try { - guard case .contactDmPayment(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .tipDmPayment?: try { - guard case .tipDmPayment(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Intent_V1_ChatMetadata, rhs: Flipcash_Intent_V1_ChatMetadata) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Intent_V1_ChatMetadata.ContactDmPayment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Intent_V1_ChatMetadata.protoMessageName + ".ContactDmPayment" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}source\0\u{1}destination\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._source) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._destination) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._source { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._destination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Intent_V1_ChatMetadata.ContactDmPayment, rhs: Flipcash_Intent_V1_ChatMetadata.ContactDmPayment) -> Bool { - if lhs._source != rhs._source {return false} - if lhs._destination != rhs._destination {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Intent_V1_ChatMetadata.TipDmPayment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Intent_V1_ChatMetadata.protoMessageName + ".TipDmPayment" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}location\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.location) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.location != .tipcard { - try visitor.visitSingularEnumField(value: self.location, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Intent_V1_ChatMetadata.TipDmPayment, rhs: Flipcash_Intent_V1_ChatMetadata.TipDmPayment) -> Bool { - if lhs.location != rhs.location {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Intent_V1_ChatMetadata.TipDmPayment.Location: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0TIPCARD\0\u{1}CHAT\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/messaging_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/messaging_v1_model.pb.swift deleted file mode 100644 index 346a3df17..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/messaging_v1_model.pb.swift +++ /dev/null @@ -1,2160 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: messaging/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Messaging_V1_MessageId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Per-chat, server-assigned, gapless sequence number. Together with the - /// chat ID this is the message's canonical identity, sort key, and - /// pagination cursor. Gapless ordering lets clients trivially detect missing - /// messages: a complete history has no gaps between consecutive numbers. - public var value: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// ClientMessageId is a client-generated identifier for a message send. -/// -/// It serves two purposes: -/// - Idempotency: the server dedups on this value, so a retried SendMessage -/// (e.g. after a network failure) returns the originally created message -/// instead of assigning a new sequence number and creating a duplicate. -/// - Correlation: clients use it to match an optimistic local echo to the -/// server-assigned Message returned in the response. -/// -/// Unlike MessageId, this is owned by the client and is not the message's -/// canonical identity; it is typically a randomly generated UUID. -public struct Flipcash_Messaging_V1_ClientMessageId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// A message in a chat -public struct Flipcash_Messaging_V1_Message: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Per-chat sequence number identifying this message - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - /// The chat member that sent the message. For system-level messages, - /// this will be ommitted. - public var senderID: Flipcash_Common_V1_UserId { - get {return _senderID ?? Flipcash_Common_V1_UserId()} - set {_senderID = newValue} - } - /// Returns true if `senderID` has been explicitly set. - public var hasSenderID: Bool {return self._senderID != nil} - /// Clears the value of `senderID`. Subsequent reads from it will return its default value. - public mutating func clearSenderID() {self._senderID = nil} - - /// Message content, which is currently guaranteed to have exactly one item. - public var content: [Flipcash_Messaging_V1_Content] = [] - - /// Timestamp this message was generated at. - public var ts: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _ts ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_ts = newValue} - } - /// Returns true if `ts` has been explicitly set. - public var hasTs: Bool {return self._ts != nil} - /// Clears the value of `ts`. Subsequent reads from it will return its default value. - public mutating func clearTs() {self._ts = nil} - - /// The number of unread-eligible messages in this chat up to and including - /// this message. This is a SEPARATE sequence from message_id: messages that - /// don't count toward unread keep their message_id but do NOT advance this - /// value — they carry the previous count forward, so every message reports - /// the running total. A member's unread count is computed entirely on the - /// client as the difference between the latest message's unread_seq and the - /// unread_seq of the message at their READ pointer. - public var unreadSeq: UInt64 = 0 - - /// If set, the timestamp this message was last edited at. Absent on messages - /// that have never been edited. The content above always reflects the - /// current (materialized) state, so clients render it directly; this field - /// only drives an "edited" affordance. Deletions are represented in content - /// via DeletedContent, not here. - public var lastEditedTs: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _lastEditedTs ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_lastEditedTs = newValue} - } - /// Returns true if `lastEditedTs` has been explicitly set. - public var hasLastEditedTs: Bool {return self._lastEditedTs != nil} - /// Clears the value of `lastEditedTs`. Subsequent reads from it will return its default value. - public mutating func clearLastEditedTs() {self._lastEditedTs = nil} - - /// The event-log sequence at which this message reached its current state: - /// the point of the most recent mutation (send, edit, or delete) affecting - /// it. A per-message VERSION stamp — distinct from message_id (fixed - /// identity/order) and unread_seq (unread accounting) — that advances on - /// every edit/delete while message_id stays fixed. - /// - /// It makes a Message self-locating regardless of how it was obtained (event - /// stream, GetMessages, SendMessage echo, last_message, push). Clients apply - /// last-writer-wins by this value: ignore a copy whose event_sequence is <= - /// the version already held, otherwise insert/replace. Cross-message gap - /// detection is separate, via the live event log's Event.sequence/count and - /// GetDelta catch-up. - public var eventSequence: UInt64 = 0 - - /// Aggregate reaction state for this message, current as of the time it was - /// read. This is a convergent overlay, NOT part of the content versioned by - /// event_sequence: reactions change without advancing event_sequence, so - /// clients refresh it on view and via live reaction updates rather than - /// through the event log. - public var reactions: Flipcash_Messaging_V1_ReactionSummary { - get {return _reactions ?? Flipcash_Messaging_V1_ReactionSummary()} - set {_reactions = newValue} - } - /// Returns true if `reactions` has been explicitly set. - public var hasReactions: Bool {return self._reactions != nil} - /// Clears the value of `reactions`. Subsequent reads from it will return its default value. - public mutating func clearReactions() {self._reactions = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _senderID: Flipcash_Common_V1_UserId? = nil - fileprivate var _ts: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _lastEditedTs: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _reactions: Flipcash_Messaging_V1_ReactionSummary? = nil -} - -/// Content for a chat message -public struct Flipcash_Messaging_V1_Content: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Flipcash_Messaging_V1_Content.OneOf_Type? = nil - - public var text: Flipcash_Messaging_V1_TextContent { - get { - if case .text(let v)? = type {return v} - return Flipcash_Messaging_V1_TextContent() - } - set {type = .text(newValue)} - } - - public var cash: Flipcash_Messaging_V1_CashContent { - get { - if case .cash(let v)? = type {return v} - return Flipcash_Messaging_V1_CashContent() - } - set {type = .cash(newValue)} - } - - public var reply: Flipcash_Messaging_V1_ReplyContent { - get { - if case .reply(let v)? = type {return v} - return Flipcash_Messaging_V1_ReplyContent() - } - set {type = .reply(newValue)} - } - - public var media: Flipcash_Messaging_V1_MediaContent { - get { - if case .media(let v)? = type {return v} - return Flipcash_Messaging_V1_MediaContent() - } - set {type = .media(newValue)} - } - - public var system: Flipcash_Messaging_V1_SystemContent { - get { - if case .system(let v)? = type {return v} - return Flipcash_Messaging_V1_SystemContent() - } - set {type = .system(newValue)} - } - - public var deleted: Flipcash_Messaging_V1_DeletedContent { - get { - if case .deleted(let v)? = type {return v} - return Flipcash_Messaging_V1_DeletedContent() - } - set {type = .deleted(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case text(Flipcash_Messaging_V1_TextContent) - case cash(Flipcash_Messaging_V1_CashContent) - case reply(Flipcash_Messaging_V1_ReplyContent) - case media(Flipcash_Messaging_V1_MediaContent) - case system(Flipcash_Messaging_V1_SystemContent) - case deleted(Flipcash_Messaging_V1_DeletedContent) - - } - - public init() {} -} - -/// Raw text content -public struct Flipcash_Messaging_V1_TextContent: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var text: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Cash content -public struct Flipcash_Messaging_V1_CashContent: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Intent ID identifying the cash transaction at the OCP layer - public var intentID: Flipcash_Common_V1_IntentId { - get {return _intentID ?? Flipcash_Common_V1_IntentId()} - set {_intentID = newValue} - } - /// Returns true if `intentID` has been explicitly set. - public var hasIntentID: Bool {return self._intentID != nil} - /// Clears the value of `intentID`. Subsequent reads from it will return its default value. - public mutating func clearIntentID() {self._intentID = nil} - - /// The amount of cash that was sent - public var amount: Flipcash_Common_V1_CryptoPaymentAmount { - get {return _amount ?? Flipcash_Common_V1_CryptoPaymentAmount()} - set {_amount = newValue} - } - /// Returns true if `amount` has been explicitly set. - public var hasAmount: Bool {return self._amount != nil} - /// Clears the value of `amount`. Subsequent reads from it will return its default value. - public mutating func clearAmount() {self._amount = nil} - - public var verb: Flipcash_Messaging_V1_CashContent.Verb = .sent - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Verb for how the cash was sent. Clietns should always show SENT as a - /// fallback. - public enum Verb: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case sent // = 0 - case tipped // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .sent - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .sent - case 1: self = .tipped - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .sent: return 0 - case .tipped: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_CashContent.Verb] = [ - .sent, - .tipped, - ] - - } - - public init() {} - - fileprivate var _intentID: Flipcash_Common_V1_IntentId? = nil - fileprivate var _amount: Flipcash_Common_V1_CryptoPaymentAmount? = nil -} - -/// Reply content -public struct Flipcash_Messaging_V1_ReplyContent: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// ID of the message being replied to - public var repliedMessageID: Flipcash_Messaging_V1_MessageId { - get {return _repliedMessageID ?? Flipcash_Messaging_V1_MessageId()} - set {_repliedMessageID = newValue} - } - /// Returns true if `repliedMessageID` has been explicitly set. - public var hasRepliedMessageID: Bool {return self._repliedMessageID != nil} - /// Clears the value of `repliedMessageID`. Subsequent reads from it will return its default value. - public mutating func clearRepliedMessageID() {self._repliedMessageID = nil} - - /// Reply message content. Allowed content types are: - /// - TextContent - /// - MediaContent - public var content: [Flipcash_Messaging_V1_Content] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _repliedMessageID: Flipcash_Messaging_V1_MessageId? = nil -} - -/// Media content from blobs the user has already uploaded. The following media -/// types are supported: -/// - Images -public struct Flipcash_Messaging_V1_MediaContent: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The media items attached to this message. A single item today; raising - /// this cap later enables albums (each item self-describes its kind). - /// - /// On SendMessage the client supplies exactly one ORIGINAL rendition per - /// item; the server fills its metadata and appends the derived renditions. - public var items: [Flipcash_Blob_V1_Media] = [] - - /// Optional caption rendered alongside the media - public var caption: Flipcash_Messaging_V1_TextContent { - get {return _caption ?? Flipcash_Messaging_V1_TextContent()} - set {_caption = newValue} - } - /// Returns true if `caption` has been explicitly set. - public var hasCaption: Bool {return self._caption != nil} - /// Clears the value of `caption`. Subsequent reads from it will return its default value. - public mutating func clearCaption() {self._caption = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _caption: Flipcash_Messaging_V1_TextContent? = nil -} - -/// System message content -public struct Flipcash_Messaging_V1_SystemContent: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Best-effort, server-rendered text in the user's locale setting. Today this - /// is the only way to display a system message; once the structured `event` - /// oneof exists it becomes a fallback, rendered ONLY when the client does not - /// recognize the variant (old client, new server). It is not localized per - /// viewer — clients that know a variant render their own localized string. - public var fallbackText: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Deleted message content -public struct Flipcash_Messaging_V1_DeletedContent: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Timestamp the message was deleted. Set whenever a message is tombstoned; - /// clients can surface it as a "deleted" affordance. This is the deletion - /// analog of Message.last_edited_ts, kept here so all deletion state lives in - /// the content rather than as a separate flag on Message. - public var deletedTs: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _deletedTs ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_deletedTs = newValue} - } - /// Returns true if `deletedTs` has been explicitly set. - public var hasDeletedTs: Bool {return self._deletedTs != nil} - /// Clears the value of `deletedTs`. Subsequent reads from it will return its default value. - public mutating func clearDeletedTs() {self._deletedTs = nil} - - /// When present, the user that deleted the message. If not present, a it is - /// a system-level deletion (eg. moderation check). - public var deletedBy: Flipcash_Common_V1_UserId { - get {return _deletedBy ?? Flipcash_Common_V1_UserId()} - set {_deletedBy = newValue} - } - /// Returns true if `deletedBy` has been explicitly set. - public var hasDeletedBy: Bool {return self._deletedBy != nil} - /// Clears the value of `deletedBy`. Subsequent reads from it will return its default value. - public mutating func clearDeletedBy() {self._deletedBy = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _deletedTs: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _deletedBy: Flipcash_Common_V1_UserId? = nil -} - -/// Emoji identifies an emoji used in a reaction. The value is a unicode emoji -/// sequence — a single grapheme cluster, which may include modifiers such as a -/// skin-tone selector or ZWJ joins — or a custom emoji identifier where -/// supported. -public struct Flipcash_Messaging_V1_Emoji: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Structural bounds only — these bound size as defense-in-depth (min_len/ - /// max_len count code points, max_bytes counts bytes; a complex ZWJ or - /// tag-flag sequence is ~8 code points but ~32 bytes, so both earn their - /// keep). True emoji validity (a real grapheme, normalization, any supported - /// set) is enforced in server code, not here. - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Reactor identifies a user who reacted to a message and when they did so. -public struct Flipcash_Messaging_V1_Reactor: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - /// Timestamp the user added this reaction. - public var reactedTs: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _reactedTs ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_reactedTs = newValue} - } - /// Returns true if `reactedTs` has been explicitly set. - public var hasReactedTs: Bool {return self._reactedTs != nil} - /// Clears the value of `reactedTs`. Subsequent reads from it will return its default value. - public mutating func clearReactedTs() {self._reactedTs = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _reactedTs: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -/// ReactionSummary is the aggregate reaction state attached to a message. It is -/// bounded: the number of distinct reaction types per message is capped, so the -/// summary stays small no matter how many users reacted. The full reactor list -/// for any emoji is fetched on demand (paged), never inlined here. -public struct Flipcash_Messaging_V1_ReactionSummary: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The message these reactions belong to. - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - /// One entry per distinct emoji reacted to this message - public var reactions: [Flipcash_Messaging_V1_EmojiReaction] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil -} - -/// EmojiReaction aggregates all reactions of a single emoji on a message. -public struct Flipcash_Messaging_V1_EmojiReaction: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The emoji reacted with. - public var emoji: Flipcash_Messaging_V1_Emoji { - get {return _emoji ?? Flipcash_Messaging_V1_Emoji()} - set {_emoji = newValue} - } - /// Returns true if `emoji` has been explicitly set. - public var hasEmoji: Bool {return self._emoji != nil} - /// Clears the value of `emoji`. Subsequent reads from it will return its default value. - public mutating func clearEmoji() {self._emoji = nil} - - /// Total number of users who reacted with this emoji. Authoritative and may - /// be arbitrarily large; the individual reactor identities are not all - /// returned here. - public var count: UInt64 = 0 - - /// Whether the requesting user reacted with this emoji. Per-viewer: count and - /// sample_reactors are shareable across users, but this bit is computed for - /// the caller. - public var reactedBySelf: Bool = false - - /// A small sample of reactors, with their reaction timestamps (e.g. for - /// rendering a few avatars), capped well below count. The complete, paged - /// reactor list is fetched on demand via GetReactors. - public var sampleReactors: [Flipcash_Messaging_V1_Reactor] = [] - - /// Monotonic version of this emoji's aggregate on the message, assigned by - /// the server and advanced on every change to it. Ordering only: clients - /// apply reaction updates last-writer-wins by this value per (message, emoji) - /// — and per actor for reacted_by_self — and treat a loaded summary as stale - /// when a higher sequence arrives. It is NOT the chat event sequence - /// (reactions never advance that), and it is NOT gapless: it carries no - /// gap-detection meaning. - public var sequence: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _emoji: Flipcash_Messaging_V1_Emoji? = nil -} - -/// ReactionUpdate is a best-effort, real-time reaction change for a single -/// (message, emoji) cell. Reactions are a convergent overlay, so these ride the -/// event stream OUTSIDE the gap-detected event log — a missed update is not -/// caught up via GetDelta but reconciled by refreshing the message's -/// ReactionSummary on view. -public struct Flipcash_Messaging_V1_ReactionUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The message whose reactions changed. - public var messageID: Flipcash_Messaging_V1_MessageId { - get {return _messageID ?? Flipcash_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - /// The emoji that was added or removed. - public var emoji: Flipcash_Messaging_V1_Emoji { - get {return _emoji ?? Flipcash_Messaging_V1_Emoji()} - set {_emoji = newValue} - } - /// Returns true if `emoji` has been explicitly set. - public var hasEmoji: Bool {return self._emoji != nil} - /// Clears the value of `emoji`. Subsequent reads from it will return its default value. - public mutating func clearEmoji() {self._emoji = nil} - - /// The user who added or removed the reaction. A client renders - /// reacted_by_self by comparing this to itself, so a reaction made on the - /// user's other device is reflected. - public var actor: Flipcash_Common_V1_UserId { - get {return _actor ?? Flipcash_Common_V1_UserId()} - set {_actor = newValue} - } - /// Returns true if `actor` has been explicitly set. - public var hasActor: Bool {return self._actor != nil} - /// Clears the value of `actor`. Subsequent reads from it will return its default value. - public mutating func clearActor() {self._actor = nil} - - public var action: Flipcash_Messaging_V1_ReactionUpdate.Action = .unknown - - /// The emoji's total reactor count after this change. 0 means no reactors - /// remain and the client should drop the entry from the summary. - public var count: UInt64 = 0 - - /// The emoji aggregate's new version after this change. Clients apply - /// last-writer-wins by this value: ignore the count if sequence <= the - /// count watermark held, and ignore the actor's reacted_by_self toggle if - /// sequence <= the per-actor watermark held. Matches EmojiReaction.sequence. - public var sequence: UInt64 = 0 - - /// When the actor reacted. On ADDED, clients record this as the actor's - /// Reactor.reacted_ts (e.g. when slotting them into sample_reactors); ignored - /// for REMOVED. This is a display timestamp, distinct from `sequence`, which - /// is the ordering key. - public var reactedTs: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _reactedTs ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_reactedTs = newValue} - } - /// Returns true if `reactedTs` has been explicitly set. - public var hasReactedTs: Bool {return self._reactedTs != nil} - /// Clears the value of `reactedTs`. Subsequent reads from it will return its default value. - public mutating func clearReactedTs() {self._reactedTs = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Action: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case added // = 1 - case removed // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .added - case 2: self = .removed - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .added: return 1 - case .removed: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_ReactionUpdate.Action] = [ - .unknown, - .added, - .removed, - ] - - } - - public init() {} - - fileprivate var _messageID: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _emoji: Flipcash_Messaging_V1_Emoji? = nil - fileprivate var _actor: Flipcash_Common_V1_UserId? = nil - fileprivate var _reactedTs: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -public struct Flipcash_Messaging_V1_ReactionUpdateBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var reactionUpdates: [Flipcash_Messaging_V1_ReactionUpdate] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Pointer in a chat indicating a user's message history state in a chat. -public struct Flipcash_Messaging_V1_Pointer: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The type of pointer indicates which user's message history state can be - /// inferred from the pointer value. It is also possible to infer cross-pointer - /// state. For example, if a chat member has a READ pointer for a message with - /// ID N, then the DELIVERED pointer must be at least N. - public var type: Flipcash_Messaging_V1_Pointer.TypeEnum = .unknown - - /// The user ID associated with the pointer - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - /// Everything at or before this message ID is considered to have the state - /// inferred by the type of pointer. - public var value: Flipcash_Messaging_V1_MessageId { - get {return _value ?? Flipcash_Messaging_V1_MessageId()} - set {_value = newValue} - } - /// Returns true if `value` has been explicitly set. - public var hasValue: Bool {return self._value != nil} - /// Clears the value of `value`. Subsequent reads from it will return its default value. - public mutating func clearValue() {self._value = nil} - - /// Timestamp the pointer was last advanced at - public var ts: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _ts ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_ts = newValue} - } - /// Returns true if `ts` has been explicitly set. - public var hasTs: Bool {return self._ts != nil} - /// Clears the value of `ts`. Subsequent reads from it will return its default value. - public mutating func clearTs() {self._ts = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum TypeEnum: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// Always inferred by OK result in SendMessageResponse or message presence in a chat - case sent // = 1 - case delivered // = 2 - case read // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .sent - case 2: self = .delivered - case 3: self = .read - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .sent: return 1 - case .delivered: return 2 - case .read: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_Pointer.TypeEnum] = [ - .unknown, - .sent, - .delivered, - .read, - ] - - } - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _value: Flipcash_Messaging_V1_MessageId? = nil - fileprivate var _ts: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -public struct Flipcash_Messaging_V1_MessageIdBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var messageIds: [Flipcash_Messaging_V1_MessageId] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Messaging_V1_MessageBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var messages: [Flipcash_Messaging_V1_Message] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Messaging_V1_PointerBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var pointers: [Flipcash_Messaging_V1_Pointer] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Event is a contiguous run of one or more durable mutations to a chat, delivered -/// atomically — the unit of the chat's event log. Newly sent messages, edits, -/// and deletions are all mutations within an event. -/// -/// Only content-bearing, non-idempotent mutations live in the log, because that is -/// what gap detection protects: missing one means missing data. Convergent state -/// such as pointer advances (last-writer-wins, monotonic) and transient signals -/// such as typing notifications are delivered out-of-band and fetched as current -/// state, NOT replayed through this log. -/// -/// Clients apply events in ascending sequence order and use the sequence/count -/// pair to detect gaps; on a gap they catch up via GetDelta. -public struct Flipcash_Messaging_V1_Event: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Per-chat event sequence valued AFTER this event applies: the END of the - /// half-open range (sequence - count, sequence] this event occupies. This is - /// a SEPARATE sequence from MessageId — edits and deletions advance it - /// without minting a new MessageId. - public var sequence: UInt64 = 0 - - /// The number of points this event consumes, equal to the number of - /// mutations it carries — each mutation is one point. The mutation at index - /// i sits at point (sequence - count + 1 + i). Clients gap-detect with - /// local + count == sequence, so a server that begins emitting count > 1 - /// (e.g. a bulk delete) needs no client change. - public var count: UInt32 = 0 - - /// Timestamp this event occurred at. - public var ts: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _ts ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_ts = newValue} - } - /// Returns true if `ts` has been explicitly set. - public var hasTs: Bool {return self._ts != nil} - /// Clears the value of `ts`. Subsequent reads from it will return its default value. - public mutating func clearTs() {self._ts = nil} - - /// The mutations in this event, ascending by point. Length must equal count. - public var mutations: [Flipcash_Messaging_V1_Mutation] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _ts: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -/// Mutation is a single point in the event log: one message sent, edited, or -/// deleted. Each carries the full materialized state of the affected message, so -/// clients apply it by inserting or replacing their cached copy without a -/// refetch. -public struct Flipcash_Messaging_V1_Mutation: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Flipcash_Messaging_V1_Mutation.OneOf_Type? = nil - - /// A newly sent message. Inserts a new message_id at the tail of the - /// chat. This is the only mutation that advances the MessageId sequence. - public var messageSent: Flipcash_Messaging_V1_Message { - get { - if case .messageSent(let v)? = type {return v} - return Flipcash_Messaging_V1_Message() - } - set {type = .messageSent(newValue)} - } - - /// An edit to an existing message (same message_id, updated content, - /// last_edited_ts set). - public var messageEdited: Flipcash_Messaging_V1_Message { - get { - if case .messageEdited(let v)? = type {return v} - return Flipcash_Messaging_V1_Message() - } - set {type = .messageEdited(newValue)} - } - - /// A deletion of an existing message (same message_id, content replaced - /// with DeletedContent). The message_id is retained as a tombstone, so - /// the MessageId sequence stays gapless. - public var messageDeleted: Flipcash_Messaging_V1_Message { - get { - if case .messageDeleted(let v)? = type {return v} - return Flipcash_Messaging_V1_Message() - } - set {type = .messageDeleted(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - /// A newly sent message. Inserts a new message_id at the tail of the - /// chat. This is the only mutation that advances the MessageId sequence. - case messageSent(Flipcash_Messaging_V1_Message) - /// An edit to an existing message (same message_id, updated content, - /// last_edited_ts set). - case messageEdited(Flipcash_Messaging_V1_Message) - /// A deletion of an existing message (same message_id, content replaced - /// with DeletedContent). The message_id is retained as a tombstone, so - /// the MessageId sequence stays gapless. - case messageDeleted(Flipcash_Messaging_V1_Message) - - } - - public init() {} -} - -public struct Flipcash_Messaging_V1_EventBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var events: [Flipcash_Messaging_V1_Event] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Messaging_V1_IsTypingNotification: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - public var state: Flipcash_Messaging_V1_IsTypingNotification.State = .unknownTypingState - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum State: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknownTypingState // = 0 - case startedTyping // = 1 - case stillTyping // = 2 - case stoppedTyping // = 3 - case typingTimedOut // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .unknownTypingState - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknownTypingState - case 1: self = .startedTyping - case 2: self = .stillTyping - case 3: self = .stoppedTyping - case 4: self = .typingTimedOut - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknownTypingState: return 0 - case .startedTyping: return 1 - case .stillTyping: return 2 - case .stoppedTyping: return 3 - case .typingTimedOut: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Messaging_V1_IsTypingNotification.State] = [ - .unknownTypingState, - .startedTyping, - .stillTyping, - .stoppedTyping, - .typingTimedOut, - ] - - } - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil -} - -public struct Flipcash_Messaging_V1_IsTypingNotificationBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var isTypingNotifications: [Flipcash_Messaging_V1_IsTypingNotification] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.messaging.v1" - -extension Flipcash_Messaging_V1_MessageId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MessageId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.value != 0 { - try visitor.visitSingularUInt64Field(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_MessageId, rhs: Flipcash_Messaging_V1_MessageId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_ClientMessageId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ClientMessageId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_ClientMessageId, rhs: Flipcash_Messaging_V1_ClientMessageId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Message" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}message_id\0\u{3}sender_id\0\u{1}content\0\u{1}ts\0\u{3}unread_seq\0\u{3}last_edited_ts\0\u{3}event_sequence\0\u{1}reactions\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._senderID) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.content) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._ts) }() - case 5: try { try decoder.decodeSingularUInt64Field(value: &self.unreadSeq) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._lastEditedTs) }() - case 7: try { try decoder.decodeSingularUInt64Field(value: &self.eventSequence) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._reactions) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._senderID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.content.isEmpty { - try visitor.visitRepeatedMessageField(value: self.content, fieldNumber: 3) - } - try { if let v = self._ts { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if self.unreadSeq != 0 { - try visitor.visitSingularUInt64Field(value: self.unreadSeq, fieldNumber: 5) - } - try { if let v = self._lastEditedTs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - if self.eventSequence != 0 { - try visitor.visitSingularUInt64Field(value: self.eventSequence, fieldNumber: 7) - } - try { if let v = self._reactions { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_Message, rhs: Flipcash_Messaging_V1_Message) -> Bool { - if lhs._messageID != rhs._messageID {return false} - if lhs._senderID != rhs._senderID {return false} - if lhs.content != rhs.content {return false} - if lhs._ts != rhs._ts {return false} - if lhs.unreadSeq != rhs.unreadSeq {return false} - if lhs._lastEditedTs != rhs._lastEditedTs {return false} - if lhs.eventSequence != rhs.eventSequence {return false} - if lhs._reactions != rhs._reactions {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_Content: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Content" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}text\0\u{1}cash\0\u{1}reply\0\u{1}media\0\u{1}system\0\u{1}deleted\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Messaging_V1_TextContent? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .text(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .text(v) - } - }() - case 2: try { - var v: Flipcash_Messaging_V1_CashContent? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .cash(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .cash(v) - } - }() - case 3: try { - var v: Flipcash_Messaging_V1_ReplyContent? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .reply(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .reply(v) - } - }() - case 4: try { - var v: Flipcash_Messaging_V1_MediaContent? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .media(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .media(v) - } - }() - case 5: try { - var v: Flipcash_Messaging_V1_SystemContent? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .system(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .system(v) - } - }() - case 6: try { - var v: Flipcash_Messaging_V1_DeletedContent? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .deleted(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .deleted(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .text?: try { - guard case .text(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .cash?: try { - guard case .cash(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .reply?: try { - guard case .reply(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .media?: try { - guard case .media(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .system?: try { - guard case .system(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case .deleted?: try { - guard case .deleted(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_Content, rhs: Flipcash_Messaging_V1_Content) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_TextContent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TextContent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}text\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.text) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.text.isEmpty { - try visitor.visitSingularStringField(value: self.text, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_TextContent, rhs: Flipcash_Messaging_V1_TextContent) -> Bool { - if lhs.text != rhs.text {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_CashContent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CashContent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}intent_id\0\u{1}amount\0\u{2}\u{2}verb\0\u{c}\u{3}\u{1}") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._intentID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._amount) }() - case 4: try { try decoder.decodeSingularEnumField(value: &self.verb) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._intentID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._amount { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.verb != .sent { - try visitor.visitSingularEnumField(value: self.verb, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_CashContent, rhs: Flipcash_Messaging_V1_CashContent) -> Bool { - if lhs._intentID != rhs._intentID {return false} - if lhs._amount != rhs._amount {return false} - if lhs.verb != rhs.verb {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_CashContent.Verb: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0SENT\0\u{1}TIPPED\0") -} - -extension Flipcash_Messaging_V1_ReplyContent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ReplyContent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}replied_message_id\0\u{1}content\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._repliedMessageID) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.content) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._repliedMessageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.content.isEmpty { - try visitor.visitRepeatedMessageField(value: self.content, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_ReplyContent, rhs: Flipcash_Messaging_V1_ReplyContent) -> Bool { - if lhs._repliedMessageID != rhs._repliedMessageID {return false} - if lhs.content != rhs.content {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_MediaContent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MediaContent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}items\0\u{1}caption\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.items) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._caption) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.items.isEmpty { - try visitor.visitRepeatedMessageField(value: self.items, fieldNumber: 1) - } - try { if let v = self._caption { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_MediaContent, rhs: Flipcash_Messaging_V1_MediaContent) -> Bool { - if lhs.items != rhs.items {return false} - if lhs._caption != rhs._caption {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_SystemContent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SystemContent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}fallback_text\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.fallbackText) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.fallbackText.isEmpty { - try visitor.visitSingularStringField(value: self.fallbackText, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_SystemContent, rhs: Flipcash_Messaging_V1_SystemContent) -> Bool { - if lhs.fallbackText != rhs.fallbackText {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_DeletedContent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DeletedContent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}deleted_ts\0\u{3}deleted_by\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._deletedTs) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._deletedBy) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._deletedTs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._deletedBy { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_DeletedContent, rhs: Flipcash_Messaging_V1_DeletedContent) -> Bool { - if lhs._deletedTs != rhs._deletedTs {return false} - if lhs._deletedBy != rhs._deletedBy {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_Emoji: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Emoji" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_Emoji, rhs: Flipcash_Messaging_V1_Emoji) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_Reactor: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Reactor" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{3}reacted_ts\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._reactedTs) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._reactedTs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_Reactor, rhs: Flipcash_Messaging_V1_Reactor) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs._reactedTs != rhs._reactedTs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_ReactionSummary: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ReactionSummary" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}message_id\0\u{1}reactions\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.reactions) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.reactions.isEmpty { - try visitor.visitRepeatedMessageField(value: self.reactions, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_ReactionSummary, rhs: Flipcash_Messaging_V1_ReactionSummary) -> Bool { - if lhs._messageID != rhs._messageID {return false} - if lhs.reactions != rhs.reactions {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_EmojiReaction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EmojiReaction" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}emoji\0\u{1}count\0\u{3}reacted_by_self\0\u{3}sample_reactors\0\u{1}sequence\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._emoji) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.count) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self.reactedBySelf) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.sampleReactors) }() - case 5: try { try decoder.decodeSingularUInt64Field(value: &self.sequence) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._emoji { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.count != 0 { - try visitor.visitSingularUInt64Field(value: self.count, fieldNumber: 2) - } - if self.reactedBySelf != false { - try visitor.visitSingularBoolField(value: self.reactedBySelf, fieldNumber: 3) - } - if !self.sampleReactors.isEmpty { - try visitor.visitRepeatedMessageField(value: self.sampleReactors, fieldNumber: 4) - } - if self.sequence != 0 { - try visitor.visitSingularUInt64Field(value: self.sequence, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_EmojiReaction, rhs: Flipcash_Messaging_V1_EmojiReaction) -> Bool { - if lhs._emoji != rhs._emoji {return false} - if lhs.count != rhs.count {return false} - if lhs.reactedBySelf != rhs.reactedBySelf {return false} - if lhs.sampleReactors != rhs.sampleReactors {return false} - if lhs.sequence != rhs.sequence {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_ReactionUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ReactionUpdate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}message_id\0\u{1}emoji\0\u{1}actor\0\u{1}action\0\u{1}count\0\u{1}sequence\0\u{3}reacted_ts\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._emoji) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._actor) }() - case 4: try { try decoder.decodeSingularEnumField(value: &self.action) }() - case 5: try { try decoder.decodeSingularUInt64Field(value: &self.count) }() - case 6: try { try decoder.decodeSingularUInt64Field(value: &self.sequence) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._reactedTs) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._emoji { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._actor { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.action != .unknown { - try visitor.visitSingularEnumField(value: self.action, fieldNumber: 4) - } - if self.count != 0 { - try visitor.visitSingularUInt64Field(value: self.count, fieldNumber: 5) - } - if self.sequence != 0 { - try visitor.visitSingularUInt64Field(value: self.sequence, fieldNumber: 6) - } - try { if let v = self._reactedTs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_ReactionUpdate, rhs: Flipcash_Messaging_V1_ReactionUpdate) -> Bool { - if lhs._messageID != rhs._messageID {return false} - if lhs._emoji != rhs._emoji {return false} - if lhs._actor != rhs._actor {return false} - if lhs.action != rhs.action {return false} - if lhs.count != rhs.count {return false} - if lhs.sequence != rhs.sequence {return false} - if lhs._reactedTs != rhs._reactedTs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_ReactionUpdate.Action: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}ADDED\0\u{1}REMOVED\0") -} - -extension Flipcash_Messaging_V1_ReactionUpdateBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ReactionUpdateBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}reaction_updates\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.reactionUpdates) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.reactionUpdates.isEmpty { - try visitor.visitRepeatedMessageField(value: self.reactionUpdates, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_ReactionUpdateBatch, rhs: Flipcash_Messaging_V1_ReactionUpdateBatch) -> Bool { - if lhs.reactionUpdates != rhs.reactionUpdates {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_Pointer: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Pointer" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{3}user_id\0\u{1}value\0\u{1}ts\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._value) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._ts) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.type != .unknown { - try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) - } - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._value { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._ts { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_Pointer, rhs: Flipcash_Messaging_V1_Pointer) -> Bool { - if lhs.type != rhs.type {return false} - if lhs._userID != rhs._userID {return false} - if lhs._value != rhs._value {return false} - if lhs._ts != rhs._ts {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_Pointer.TypeEnum: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}SENT\0\u{1}DELIVERED\0\u{1}READ\0") -} - -extension Flipcash_Messaging_V1_MessageIdBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MessageIdBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}message_ids\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.messageIds) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.messageIds.isEmpty { - try visitor.visitRepeatedMessageField(value: self.messageIds, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_MessageIdBatch, rhs: Flipcash_Messaging_V1_MessageIdBatch) -> Bool { - if lhs.messageIds != rhs.messageIds {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_MessageBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MessageBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}messages\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.messages) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.messages.isEmpty { - try visitor.visitRepeatedMessageField(value: self.messages, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_MessageBatch, rhs: Flipcash_Messaging_V1_MessageBatch) -> Bool { - if lhs.messages != rhs.messages {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_PointerBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PointerBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}pointers\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.pointers) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.pointers.isEmpty { - try visitor.visitRepeatedMessageField(value: self.pointers, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_PointerBatch, rhs: Flipcash_Messaging_V1_PointerBatch) -> Bool { - if lhs.pointers != rhs.pointers {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_Event: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Event" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}sequence\0\u{1}count\0\u{1}ts\0\u{1}mutations\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.sequence) }() - case 2: try { try decoder.decodeSingularUInt32Field(value: &self.count) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._ts) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.mutations) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.sequence != 0 { - try visitor.visitSingularUInt64Field(value: self.sequence, fieldNumber: 1) - } - if self.count != 0 { - try visitor.visitSingularUInt32Field(value: self.count, fieldNumber: 2) - } - try { if let v = self._ts { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !self.mutations.isEmpty { - try visitor.visitRepeatedMessageField(value: self.mutations, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_Event, rhs: Flipcash_Messaging_V1_Event) -> Bool { - if lhs.sequence != rhs.sequence {return false} - if lhs.count != rhs.count {return false} - if lhs._ts != rhs._ts {return false} - if lhs.mutations != rhs.mutations {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_Mutation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Mutation" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}message_sent\0\u{3}message_edited\0\u{3}message_deleted\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Messaging_V1_Message? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .messageSent(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .messageSent(v) - } - }() - case 2: try { - var v: Flipcash_Messaging_V1_Message? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .messageEdited(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .messageEdited(v) - } - }() - case 3: try { - var v: Flipcash_Messaging_V1_Message? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .messageDeleted(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .messageDeleted(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .messageSent?: try { - guard case .messageSent(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .messageEdited?: try { - guard case .messageEdited(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .messageDeleted?: try { - guard case .messageDeleted(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_Mutation, rhs: Flipcash_Messaging_V1_Mutation) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_EventBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EventBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}events\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.events) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.events.isEmpty { - try visitor.visitRepeatedMessageField(value: self.events, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_EventBatch, rhs: Flipcash_Messaging_V1_EventBatch) -> Bool { - if lhs.events != rhs.events {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_IsTypingNotification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IsTypingNotification" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{1}state\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.state) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.state != .unknownTypingState { - try visitor.visitSingularEnumField(value: self.state, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_IsTypingNotification, rhs: Flipcash_Messaging_V1_IsTypingNotification) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs.state != rhs.state {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Messaging_V1_IsTypingNotification.State: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_TYPING_STATE\0\u{1}STARTED_TYPING\0\u{1}STILL_TYPING\0\u{1}STOPPED_TYPING\0\u{1}TYPING_TIMED_OUT\0") -} - -extension Flipcash_Messaging_V1_IsTypingNotificationBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IsTypingNotificationBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}is_typing_notifications\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.isTypingNotifications) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.isTypingNotifications.isEmpty { - try visitor.visitRepeatedMessageField(value: self.isTypingNotifications, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Messaging_V1_IsTypingNotificationBatch, rhs: Flipcash_Messaging_V1_IsTypingNotificationBatch) -> Bool { - if lhs.isTypingNotifications != rhs.isTypingNotifications {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_model.pb.swift deleted file mode 100644 index e52d04ee1..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_model.pb.swift +++ /dev/null @@ -1,196 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: moderation/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public enum Flipcash_Moderation_V1_FlaggedCategory: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case none // = 0 - - /// Fallback category when flagged content does not fit into a well-defined FlaggedCategory - case other // = 1 - case nsfw // = 2 - case impersonation // = 3 - case misleading // = 4 - case spam // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .none - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .none - case 1: self = .other - case 2: self = .nsfw - case 3: self = .impersonation - case 4: self = .misleading - case 5: self = .spam - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .none: return 0 - case .other: return 1 - case .nsfw: return 2 - case .impersonation: return 3 - case .misleading: return 4 - case .spam: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Moderation_V1_FlaggedCategory] = [ - .none, - .other, - .nsfw, - .impersonation, - .misleading, - .spam, - ] - -} - -/// ModerationAttestation is a signed proof of the moderation result. -/// The signature is computed over this message without the signature field set. -public struct Flipcash_Moderation_V1_ModerationAttestation: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// SHA-256 hash of the moderated content to be allowed - public var contentHash: Data = Data() - - /// Timestamp of the moderation - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - /// The user who submitted the content - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - /// Public key of the attestor that signed this message - public var attestor: Flipcash_Common_V1_PublicKey { - get {return _attestor ?? Flipcash_Common_V1_PublicKey()} - set {_attestor = newValue} - } - /// Returns true if `attestor` has been explicitly set. - public var hasAttestor: Bool {return self._attestor != nil} - /// Clears the value of `attestor`. Subsequent reads from it will return its default value. - public mutating func clearAttestor() {self._attestor = nil} - - /// Attestor signature over this message - public var signature: Flipcash_Common_V1_Signature { - get {return _signature ?? Flipcash_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _attestor: Flipcash_Common_V1_PublicKey? = nil - fileprivate var _signature: Flipcash_Common_V1_Signature? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.moderation.v1" - -extension Flipcash_Moderation_V1_FlaggedCategory: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0NONE\0\u{1}OTHER\0\u{1}NSFW\0\u{1}IMPERSONATION\0\u{1}MISLEADING\0\u{1}SPAM\0") -} - -extension Flipcash_Moderation_V1_ModerationAttestation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ModerationAttestation" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}content_hash\0\u{1}timestamp\0\u{3}user_id\0\u{1}attestor\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.contentHash) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._attestor) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.contentHash.isEmpty { - try visitor.visitSingularBytesField(value: self.contentHash, fieldNumber: 1) - } - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._attestor { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Moderation_V1_ModerationAttestation, rhs: Flipcash_Moderation_V1_ModerationAttestation) -> Bool { - if lhs.contentHash != rhs.contentHash {return false} - if lhs._timestamp != rhs._timestamp {return false} - if lhs._userID != rhs._userID {return false} - if lhs._attestor != rhs._attestor {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_moderation_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_moderation_service.grpc.swift deleted file mode 100644 index 343f59cbd..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_moderation_service.grpc.swift +++ /dev/null @@ -1,333 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: moderation/v1/moderation_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.moderation.v1.Moderation - -/// Namespace containing generated types for the "flipcash.moderation.v1.Moderation" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Moderation_V1_Moderation { - /// Service descriptor for the "flipcash.moderation.v1.Moderation" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.moderation.v1.Moderation") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "ModerateText" metadata. - public enum ModerateText { - /// Request type for "ModerateText". - public typealias Input = Flipcash_Moderation_V1_ModerateTextRequest - /// Response type for "ModerateText". - public typealias Output = Flipcash_Moderation_V1_ModerateTextResponse - /// Descriptor for "ModerateText". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.moderation.v1.Moderation"), - method: "ModerateText" - ) - } - /// Namespace for "ModerateImage" metadata. - public enum ModerateImage { - /// Request type for "ModerateImage". - public typealias Input = Flipcash_Moderation_V1_ModerateImageRequest - /// Response type for "ModerateImage". - public typealias Output = Flipcash_Moderation_V1_ModerateImageResponse - /// Descriptor for "ModerateImage". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.moderation.v1.Moderation"), - method: "ModerateImage" - ) - } - /// Descriptors for all methods in the "flipcash.moderation.v1.Moderation" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - ModerateText.descriptor, - ModerateImage.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.moderation.v1.Moderation" service. - public static let flipcash_moderation_v1_Moderation = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.moderation.v1.Moderation") -} - -// MARK: flipcash.moderation.v1.Moderation (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Moderation_V1_Moderation { - /// Generated client protocol for the "flipcash.moderation.v1.Moderation" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "ModerateText" method. - /// - /// > Source IDL Documentation: - /// > - /// > ModerateText checks text content against moderation policies - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Moderation_V1_ModerateTextRequest` message. - /// - serializer: A serializer for `Flipcash_Moderation_V1_ModerateTextRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Moderation_V1_ModerateTextResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func moderateText( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "ModerateImage" method. - /// - /// > Source IDL Documentation: - /// > - /// > ModerateImage checks image content against moderation policies - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Moderation_V1_ModerateImageRequest` message. - /// - serializer: A serializer for `Flipcash_Moderation_V1_ModerateImageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Moderation_V1_ModerateImageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func moderateImage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.moderation.v1.Moderation" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "ModerateText" method. - /// - /// > Source IDL Documentation: - /// > - /// > ModerateText checks text content against moderation policies - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Moderation_V1_ModerateTextRequest` message. - /// - serializer: A serializer for `Flipcash_Moderation_V1_ModerateTextRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Moderation_V1_ModerateTextResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func moderateText( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Moderation_V1_Moderation.Method.ModerateText.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "ModerateImage" method. - /// - /// > Source IDL Documentation: - /// > - /// > ModerateImage checks image content against moderation policies - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Moderation_V1_ModerateImageRequest` message. - /// - serializer: A serializer for `Flipcash_Moderation_V1_ModerateImageRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Moderation_V1_ModerateImageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func moderateImage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Moderation_V1_Moderation.Method.ModerateImage.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Moderation_V1_Moderation.ClientProtocol { - /// Call the "ModerateText" method. - /// - /// > Source IDL Documentation: - /// > - /// > ModerateText checks text content against moderation policies - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Moderation_V1_ModerateTextRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func moderateText( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.moderateText( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "ModerateImage" method. - /// - /// > Source IDL Documentation: - /// > - /// > ModerateImage checks image content against moderation policies - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Moderation_V1_ModerateImageRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func moderateImage( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.moderateImage( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Moderation_V1_Moderation.ClientProtocol { - /// Call the "ModerateText" method. - /// - /// > Source IDL Documentation: - /// > - /// > ModerateText checks text content against moderation policies - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func moderateText( - _ message: Flipcash_Moderation_V1_ModerateTextRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.moderateText( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "ModerateImage" method. - /// - /// > Source IDL Documentation: - /// > - /// > ModerateImage checks image content against moderation policies - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func moderateImage( - _ message: Flipcash_Moderation_V1_ModerateImageRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.moderateImage( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_moderation_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_moderation_service.pb.swift deleted file mode 100644 index c62006de6..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/moderation_v1_moderation_service.pb.swift +++ /dev/null @@ -1,394 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: moderation/v1/moderation_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Moderation_V1_ModerateTextRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The text content to moderate - public var text: String = String() - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Moderation_V1_ModerateTextResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Moderation_V1_ModerateTextResponse.Result = .ok - - /// Whether the text content is allowed - public var isAllowed: Bool = false - - /// Signed attestation of the moderation result when content is allowed - public var attestation: Flipcash_Moderation_V1_ModerationAttestation { - get {return _attestation ?? Flipcash_Moderation_V1_ModerationAttestation()} - set {_attestation = newValue} - } - /// Returns true if `attestation` has been explicitly set. - public var hasAttestation: Bool {return self._attestation != nil} - /// Clears the value of `attestation`. Subsequent reads from it will return its default value. - public mutating func clearAttestation() {self._attestation = nil} - - /// The best fit flagged category when content is not allowed - public var flaggedCategory: Flipcash_Moderation_V1_FlaggedCategory = .none - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case unsupportedLanguage // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .unsupportedLanguage - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .unsupportedLanguage: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Moderation_V1_ModerateTextResponse.Result] = [ - .ok, - .denied, - .unsupportedLanguage, - ] - - } - - public init() {} - - fileprivate var _attestation: Flipcash_Moderation_V1_ModerationAttestation? = nil -} - -public struct Flipcash_Moderation_V1_ModerateImageRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The raw image data to moderate - public var imageData: Data = Data() - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Moderation_V1_ModerateImageResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Moderation_V1_ModerateImageResponse.Result = .ok - - /// Whether the image content is allowed - public var isAllowed: Bool = false - - /// Signed attestation of the moderation result when content is allowed - public var attestation: Flipcash_Moderation_V1_ModerationAttestation { - get {return _attestation ?? Flipcash_Moderation_V1_ModerationAttestation()} - set {_attestation = newValue} - } - /// Returns true if `attestation` has been explicitly set. - public var hasAttestation: Bool {return self._attestation != nil} - /// Clears the value of `attestation`. Subsequent reads from it will return its default value. - public mutating func clearAttestation() {self._attestation = nil} - - /// The best fit flagged category when content is not allowed - public var flaggedCategory: Flipcash_Moderation_V1_FlaggedCategory = .none - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case unsupportedFormat // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .unsupportedFormat - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .unsupportedFormat: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Moderation_V1_ModerateImageResponse.Result] = [ - .ok, - .denied, - .unsupportedFormat, - ] - - } - - public init() {} - - fileprivate var _attestation: Flipcash_Moderation_V1_ModerationAttestation? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.moderation.v1" - -extension Flipcash_Moderation_V1_ModerateTextRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ModerateTextRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}text\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.text) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.text.isEmpty { - try visitor.visitSingularStringField(value: self.text, fieldNumber: 1) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Moderation_V1_ModerateTextRequest, rhs: Flipcash_Moderation_V1_ModerateTextRequest) -> Bool { - if lhs.text != rhs.text {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Moderation_V1_ModerateTextResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ModerateTextResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}is_allowed\0\u{1}attestation\0\u{3}flagged_category\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.isAllowed) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._attestation) }() - case 4: try { try decoder.decodeSingularEnumField(value: &self.flaggedCategory) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if self.isAllowed != false { - try visitor.visitSingularBoolField(value: self.isAllowed, fieldNumber: 2) - } - try { if let v = self._attestation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.flaggedCategory != .none { - try visitor.visitSingularEnumField(value: self.flaggedCategory, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Moderation_V1_ModerateTextResponse, rhs: Flipcash_Moderation_V1_ModerateTextResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.isAllowed != rhs.isAllowed {return false} - if lhs._attestation != rhs._attestation {return false} - if lhs.flaggedCategory != rhs.flaggedCategory {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Moderation_V1_ModerateTextResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}UNSUPPORTED_LANGUAGE\0") -} - -extension Flipcash_Moderation_V1_ModerateImageRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ModerateImageRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}image_data\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.imageData) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.imageData.isEmpty { - try visitor.visitSingularBytesField(value: self.imageData, fieldNumber: 1) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Moderation_V1_ModerateImageRequest, rhs: Flipcash_Moderation_V1_ModerateImageRequest) -> Bool { - if lhs.imageData != rhs.imageData {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Moderation_V1_ModerateImageResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ModerateImageResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}is_allowed\0\u{1}attestation\0\u{3}flagged_category\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.isAllowed) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._attestation) }() - case 4: try { try decoder.decodeSingularEnumField(value: &self.flaggedCategory) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if self.isAllowed != false { - try visitor.visitSingularBoolField(value: self.isAllowed, fieldNumber: 2) - } - try { if let v = self._attestation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.flaggedCategory != .none { - try visitor.visitSingularEnumField(value: self.flaggedCategory, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Moderation_V1_ModerateImageResponse, rhs: Flipcash_Moderation_V1_ModerateImageResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.isAllowed != rhs.isAllowed {return false} - if lhs._attestation != rhs._attestation {return false} - if lhs.flaggedCategory != rhs.flaggedCategory {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Moderation_V1_ModerateImageResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}UNSUPPORTED_FORMAT\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_model.pb.swift deleted file mode 100644 index 60c6255b3..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_model.pb.swift +++ /dev/null @@ -1,68 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: phone/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// VerificationCode is a 4-10 digit numerical code for verification -public struct Flipcash_Phone_V1_VerificationCode: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.phone.v1" - -extension Flipcash_Phone_V1_VerificationCode: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerificationCode" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\u{2}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_VerificationCode, rhs: Flipcash_Phone_V1_VerificationCode) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_phone_verification_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_phone_verification_service.grpc.swift deleted file mode 100644 index 79d30dc69..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_phone_verification_service.grpc.swift +++ /dev/null @@ -1,609 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: phone/v1/phone_verification_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.phone.v1.PhoneVerification - -/// Namespace containing generated types for the "flipcash.phone.v1.PhoneVerification" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Phone_V1_PhoneVerification { - /// Service descriptor for the "flipcash.phone.v1.PhoneVerification" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.phone.v1.PhoneVerification") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "SendVerificationCode" metadata. - public enum SendVerificationCode { - /// Request type for "SendVerificationCode". - public typealias Input = Flipcash_Phone_V1_SendVerificationCodeRequest - /// Response type for "SendVerificationCode". - public typealias Output = Flipcash_Phone_V1_SendVerificationCodeResponse - /// Descriptor for "SendVerificationCode". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.phone.v1.PhoneVerification"), - method: "SendVerificationCode" - ) - } - /// Namespace for "CheckVerificationCode" metadata. - public enum CheckVerificationCode { - /// Request type for "CheckVerificationCode". - public typealias Input = Flipcash_Phone_V1_CheckVerificationCodeRequest - /// Response type for "CheckVerificationCode". - public typealias Output = Flipcash_Phone_V1_CheckVerificationCodeResponse - /// Descriptor for "CheckVerificationCode". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.phone.v1.PhoneVerification"), - method: "CheckVerificationCode" - ) - } - /// Namespace for "Unlink" metadata. - public enum Unlink { - /// Request type for "Unlink". - public typealias Input = Flipcash_Phone_V1_UnlinkRequest - /// Response type for "Unlink". - public typealias Output = Flipcash_Phone_V1_UnlinkResponse - /// Descriptor for "Unlink". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.phone.v1.PhoneVerification"), - method: "Unlink" - ) - } - /// Namespace for "LinkForPayment" metadata. - public enum LinkForPayment { - /// Request type for "LinkForPayment". - public typealias Input = Flipcash_Phone_V1_LinkForPaymentRequest - /// Response type for "LinkForPayment". - public typealias Output = Flipcash_Phone_V1_LinkForPaymentResponse - /// Descriptor for "LinkForPayment". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.phone.v1.PhoneVerification"), - method: "LinkForPayment" - ) - } - /// Descriptors for all methods in the "flipcash.phone.v1.PhoneVerification" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - SendVerificationCode.descriptor, - CheckVerificationCode.descriptor, - Unlink.descriptor, - LinkForPayment.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.phone.v1.PhoneVerification" service. - public static let flipcash_phone_v1_PhoneVerification = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.phone.v1.PhoneVerification") -} - -// MARK: flipcash.phone.v1.PhoneVerification (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Phone_V1_PhoneVerification { - /// Generated client protocol for the "flipcash.phone.v1.PhoneVerification" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "SendVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendVerificationCode sends a verification code to the provided phone number - /// > over SMS. If an active verification is already taking place, the existing code - /// > will be resent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_SendVerificationCodeRequest` message. - /// - serializer: A serializer for `Flipcash_Phone_V1_SendVerificationCodeRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Phone_V1_SendVerificationCodeResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func sendVerificationCode( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "CheckVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckVerificationCode validates a verification code. On success, the phone number - /// > is linked to the user. Any previous links are overwritten. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_CheckVerificationCodeRequest` message. - /// - serializer: A serializer for `Flipcash_Phone_V1_CheckVerificationCodeRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Phone_V1_CheckVerificationCodeResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func checkVerificationCode( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "Unlink" method. - /// - /// > Source IDL Documentation: - /// > - /// > Unlink removes the link of a phone number from a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_UnlinkRequest` message. - /// - serializer: A serializer for `Flipcash_Phone_V1_UnlinkRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Phone_V1_UnlinkResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func unlink( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "LinkForPayment" method. - /// - /// > Source IDL Documentation: - /// > - /// > LinkForPayment links the verified phone number for the requesting user for payment. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_LinkForPaymentRequest` message. - /// - serializer: A serializer for `Flipcash_Phone_V1_LinkForPaymentRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Phone_V1_LinkForPaymentResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func linkForPayment( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.phone.v1.PhoneVerification" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "SendVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendVerificationCode sends a verification code to the provided phone number - /// > over SMS. If an active verification is already taking place, the existing code - /// > will be resent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_SendVerificationCodeRequest` message. - /// - serializer: A serializer for `Flipcash_Phone_V1_SendVerificationCodeRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Phone_V1_SendVerificationCodeResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendVerificationCode( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Phone_V1_PhoneVerification.Method.SendVerificationCode.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckVerificationCode validates a verification code. On success, the phone number - /// > is linked to the user. Any previous links are overwritten. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_CheckVerificationCodeRequest` message. - /// - serializer: A serializer for `Flipcash_Phone_V1_CheckVerificationCodeRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Phone_V1_CheckVerificationCodeResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkVerificationCode( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Phone_V1_PhoneVerification.Method.CheckVerificationCode.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Unlink" method. - /// - /// > Source IDL Documentation: - /// > - /// > Unlink removes the link of a phone number from a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_UnlinkRequest` message. - /// - serializer: A serializer for `Flipcash_Phone_V1_UnlinkRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Phone_V1_UnlinkResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlink( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Phone_V1_PhoneVerification.Method.Unlink.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "LinkForPayment" method. - /// - /// > Source IDL Documentation: - /// > - /// > LinkForPayment links the verified phone number for the requesting user for payment. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_LinkForPaymentRequest` message. - /// - serializer: A serializer for `Flipcash_Phone_V1_LinkForPaymentRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Phone_V1_LinkForPaymentResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func linkForPayment( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Phone_V1_PhoneVerification.Method.LinkForPayment.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Phone_V1_PhoneVerification.ClientProtocol { - /// Call the "SendVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendVerificationCode sends a verification code to the provided phone number - /// > over SMS. If an active verification is already taking place, the existing code - /// > will be resent. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_SendVerificationCodeRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendVerificationCode( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.sendVerificationCode( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckVerificationCode validates a verification code. On success, the phone number - /// > is linked to the user. Any previous links are overwritten. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_CheckVerificationCodeRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkVerificationCode( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.checkVerificationCode( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Unlink" method. - /// - /// > Source IDL Documentation: - /// > - /// > Unlink removes the link of a phone number from a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_UnlinkRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlink( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.unlink( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "LinkForPayment" method. - /// - /// > Source IDL Documentation: - /// > - /// > LinkForPayment links the verified phone number for the requesting user for payment. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Phone_V1_LinkForPaymentRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func linkForPayment( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.linkForPayment( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Phone_V1_PhoneVerification.ClientProtocol { - /// Call the "SendVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendVerificationCode sends a verification code to the provided phone number - /// > over SMS. If an active verification is already taking place, the existing code - /// > will be resent. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendVerificationCode( - _ message: Flipcash_Phone_V1_SendVerificationCodeRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.sendVerificationCode( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckVerificationCode" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckVerificationCode validates a verification code. On success, the phone number - /// > is linked to the user. Any previous links are overwritten. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkVerificationCode( - _ message: Flipcash_Phone_V1_CheckVerificationCodeRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.checkVerificationCode( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Unlink" method. - /// - /// > Source IDL Documentation: - /// > - /// > Unlink removes the link of a phone number from a user. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlink( - _ message: Flipcash_Phone_V1_UnlinkRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.unlink( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "LinkForPayment" method. - /// - /// > Source IDL Documentation: - /// > - /// > LinkForPayment links the verified phone number for the requesting user for payment. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func linkForPayment( - _ message: Flipcash_Phone_V1_LinkForPaymentRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.linkForPayment( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_phone_verification_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_phone_verification_service.pb.swift deleted file mode 100644 index 27df06ec4..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/phone_v1_phone_verification_service.pb.swift +++ /dev/null @@ -1,702 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: phone/v1/phone_verification_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Phone_V1_SendVerificationCodeRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The phone number to send a verification code over SMS to - public var phoneNumber: Flipcash_Common_V1_PhoneNumber { - get {return _phoneNumber ?? Flipcash_Common_V1_PhoneNumber()} - set {_phoneNumber = newValue} - } - /// Returns true if `phoneNumber` has been explicitly set. - public var hasPhoneNumber: Bool {return self._phoneNumber != nil} - /// Clears the value of `phoneNumber`. Subsequent reads from it will return its default value. - public mutating func clearPhoneNumber() {self._phoneNumber = nil} - - /// The app platform that's making this request - public var platform: Flipcash_Common_V1_Platform = .unknown - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _phoneNumber: Flipcash_Common_V1_PhoneNumber? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Phone_V1_SendVerificationCodeResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Phone_V1_SendVerificationCodeResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - - /// SMS is denied - case denied // = 1 - - /// SMS is rate limited (eg. by IP, phone number, user, etc) and was not sent. - case rateLimited // = 2 - - /// The phone number is not real because it fails Twilio lookup. - case invalidPhoneNumber // = 3 - - /// The phone number is valid, but it maps to an unsupported type of phone - /// like a landline. - case unsupportedPhoneType // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .rateLimited - case 3: self = .invalidPhoneNumber - case 4: self = .unsupportedPhoneType - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .rateLimited: return 2 - case .invalidPhoneNumber: return 3 - case .unsupportedPhoneType: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Phone_V1_SendVerificationCodeResponse.Result] = [ - .ok, - .denied, - .rateLimited, - .invalidPhoneNumber, - .unsupportedPhoneType, - ] - - } - - public init() {} -} - -public struct Flipcash_Phone_V1_CheckVerificationCodeRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The phone number being verified - public var phoneNumber: Flipcash_Common_V1_PhoneNumber { - get {return _phoneNumber ?? Flipcash_Common_V1_PhoneNumber()} - set {_phoneNumber = newValue} - } - /// Returns true if `phoneNumber` has been explicitly set. - public var hasPhoneNumber: Bool {return self._phoneNumber != nil} - /// Clears the value of `phoneNumber`. Subsequent reads from it will return its default value. - public mutating func clearPhoneNumber() {self._phoneNumber = nil} - - /// The verification code received via SMS - public var code: Flipcash_Phone_V1_VerificationCode { - get {return _code ?? Flipcash_Phone_V1_VerificationCode()} - set {_code = newValue} - } - /// Returns true if `code` has been explicitly set. - public var hasCode: Bool {return self._code != nil} - /// Clears the value of `code`. Subsequent reads from it will return its default value. - public mutating func clearCode() {self._code = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _phoneNumber: Flipcash_Common_V1_PhoneNumber? = nil - fileprivate var _code: Flipcash_Phone_V1_VerificationCode? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Phone_V1_CheckVerificationCodeResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Phone_V1_CheckVerificationCodeResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// The call is rate limited (eg. by IP, phone number, etc). The code is - /// not verified. - case rateLimited // = 2 - - /// The provided verification code is invalid. The user may retry - /// enterring the code if this is received. When max attempts are - /// received, NO_VERIFICATION will be returned. - case invalidCode // = 3 - - /// There is no verification in progress for the phone number. Several - /// reasons this can occur include a verification being expired or having - /// reached a maximum check threshold. The client must initiate a new - /// verification using SendVerificationCode. - case noVerification // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .rateLimited - case 3: self = .invalidCode - case 4: self = .noVerification - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .rateLimited: return 2 - case .invalidCode: return 3 - case .noVerification: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Phone_V1_CheckVerificationCodeResponse.Result] = [ - .ok, - .denied, - .rateLimited, - .invalidCode, - .noVerification, - ] - - } - - public init() {} -} - -public struct Flipcash_Phone_V1_UnlinkRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The phone number to unlink - public var phoneNumber: Flipcash_Common_V1_PhoneNumber { - get {return _phoneNumber ?? Flipcash_Common_V1_PhoneNumber()} - set {_phoneNumber = newValue} - } - /// Returns true if `phoneNumber` has been explicitly set. - public var hasPhoneNumber: Bool {return self._phoneNumber != nil} - /// Clears the value of `phoneNumber`. Subsequent reads from it will return its default value. - public mutating func clearPhoneNumber() {self._phoneNumber = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _phoneNumber: Flipcash_Common_V1_PhoneNumber? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Phone_V1_UnlinkResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Phone_V1_UnlinkResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Phone_V1_UnlinkResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -public struct Flipcash_Phone_V1_LinkForPaymentRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The phone number to link for payment - public var phoneNumber: Flipcash_Common_V1_PhoneNumber { - get {return _phoneNumber ?? Flipcash_Common_V1_PhoneNumber()} - set {_phoneNumber = newValue} - } - /// Returns true if `phoneNumber` has been explicitly set. - public var hasPhoneNumber: Bool {return self._phoneNumber != nil} - /// Clears the value of `phoneNumber`. Subsequent reads from it will return its default value. - public mutating func clearPhoneNumber() {self._phoneNumber = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _phoneNumber: Flipcash_Common_V1_PhoneNumber? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Phone_V1_LinkForPaymentResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Phone_V1_LinkForPaymentResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case notAssociated // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .notAssociated - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .notAssociated: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Phone_V1_LinkForPaymentResponse.Result] = [ - .ok, - .denied, - .notAssociated, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.phone.v1" - -extension Flipcash_Phone_V1_SendVerificationCodeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendVerificationCodeRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}phone_number\0\u{1}platform\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._phoneNumber) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.platform) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._phoneNumber { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.platform != .unknown { - try visitor.visitSingularEnumField(value: self.platform, fieldNumber: 2) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_SendVerificationCodeRequest, rhs: Flipcash_Phone_V1_SendVerificationCodeRequest) -> Bool { - if lhs._phoneNumber != rhs._phoneNumber {return false} - if lhs.platform != rhs.platform {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Phone_V1_SendVerificationCodeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendVerificationCodeResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_SendVerificationCodeResponse, rhs: Flipcash_Phone_V1_SendVerificationCodeResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Phone_V1_SendVerificationCodeResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}RATE_LIMITED\0\u{1}INVALID_PHONE_NUMBER\0\u{1}UNSUPPORTED_PHONE_TYPE\0") -} - -extension Flipcash_Phone_V1_CheckVerificationCodeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CheckVerificationCodeRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}phone_number\0\u{1}code\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._phoneNumber) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._code) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._phoneNumber { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._code { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_CheckVerificationCodeRequest, rhs: Flipcash_Phone_V1_CheckVerificationCodeRequest) -> Bool { - if lhs._phoneNumber != rhs._phoneNumber {return false} - if lhs._code != rhs._code {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Phone_V1_CheckVerificationCodeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CheckVerificationCodeResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_CheckVerificationCodeResponse, rhs: Flipcash_Phone_V1_CheckVerificationCodeResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Phone_V1_CheckVerificationCodeResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}RATE_LIMITED\0\u{1}INVALID_CODE\0\u{1}NO_VERIFICATION\0") -} - -extension Flipcash_Phone_V1_UnlinkRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnlinkRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}phone_number\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._phoneNumber) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._phoneNumber { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_UnlinkRequest, rhs: Flipcash_Phone_V1_UnlinkRequest) -> Bool { - if lhs._phoneNumber != rhs._phoneNumber {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Phone_V1_UnlinkResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnlinkResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_UnlinkResponse, rhs: Flipcash_Phone_V1_UnlinkResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Phone_V1_UnlinkResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} - -extension Flipcash_Phone_V1_LinkForPaymentRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LinkForPaymentRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}phone_number\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._phoneNumber) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._phoneNumber { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_LinkForPaymentRequest, rhs: Flipcash_Phone_V1_LinkForPaymentRequest) -> Bool { - if lhs._phoneNumber != rhs._phoneNumber {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Phone_V1_LinkForPaymentResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LinkForPaymentResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Phone_V1_LinkForPaymentResponse, rhs: Flipcash_Phone_V1_LinkForPaymentResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Phone_V1_LinkForPaymentResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}NOT_ASSOCIATED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_model.pb.swift deleted file mode 100644 index b555f55cd..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_model.pb.swift +++ /dev/null @@ -1,473 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: profile/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Profile_V1_UserProfile: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The ID of the user this profile belongs to. Always set, so a caller that - /// looked the profile up by username learns the user's ID from the response. - public var userID: Flipcash_Common_V1_UserId { - get {return _userID ?? Flipcash_Common_V1_UserId()} - set {_userID = newValue} - } - /// Returns true if `userID` has been explicitly set. - public var hasUserID: Bool {return self._userID != nil} - /// Clears the value of `userID`. Subsequent reads from it will return its default value. - public mutating func clearUserID() {self._userID = nil} - - /// Display name is the display name of the user (if found). - public var displayName: String = String() - - /// The user's username on Flipcash. Public, so it is returned for any user, - /// not just the caller. Unset when the user hasn't claimed one yet. - public var username: Flipcash_Common_V1_Username { - get {return _username ?? Flipcash_Common_V1_Username()} - set {_username = newValue} - } - /// Returns true if `username` has been explicitly set. - public var hasUsername: Bool {return self._username != nil} - /// Clears the value of `username`. Subsequent reads from it will return its default value. - public mutating func clearUsername() {self._username = nil} - - /// Social profiles are links to external social accounts - public var socialProfiles: [Flipcash_Profile_V1_SocialProfile] = [] - - /// Phone number linked to this user. This is private and will only be returned - /// when the requesting user asks for their own profile - public var phoneNumber: Flipcash_Common_V1_PhoneNumber { - get {return _phoneNumber ?? Flipcash_Common_V1_PhoneNumber()} - set {_phoneNumber = newValue} - } - /// Returns true if `phoneNumber` has been explicitly set. - public var hasPhoneNumber: Bool {return self._phoneNumber != nil} - /// Clears the value of `phoneNumber`. Subsequent reads from it will return its default value. - public mutating func clearPhoneNumber() {self._phoneNumber = nil} - - /// Email address linked to this user. This is private and will only be returned - /// when the requesting user asks for their own profile - public var emailAddress: Flipcash_Common_V1_EmailAddress { - get {return _emailAddress ?? Flipcash_Common_V1_EmailAddress()} - set {_emailAddress = newValue} - } - /// Returns true if `emailAddress` has been explicitly set. - public var hasEmailAddress: Bool {return self._emailAddress != nil} - /// Clears the value of `emailAddress`. Subsequent reads from it will return its default value. - public mutating func clearEmailAddress() {self._emailAddress = nil} - - /// The user's profile picture, as the set of renditions it is stored as — - /// typically a DISPLAY for the profile view and a THUMBNAIL for avatars in - /// member rows and chat lists. - /// - /// Unset when the user has not set a picture. Set it with SetProfilePicture. - /// - /// To fetch the bytes of ANOTHER user's picture, the caller does not own - /// these blobs, so a GetBlobs call must carry a blob.v1.AccessContext whose - /// `profile` scope names this user. A caller reading its own needs none. - public var profilePicture: Flipcash_Blob_V1_Media { - get {return _profilePicture ?? Flipcash_Blob_V1_Media()} - set {_profilePicture = newValue} - } - /// Returns true if `profilePicture` has been explicitly set. - public var hasProfilePicture: Bool {return self._profilePicture != nil} - /// Clears the value of `profilePicture`. Subsequent reads from it will return its default value. - public mutating func clearProfilePicture() {self._profilePicture = nil} - - /// Timestamp the user joined Flipcash - public var joinTs: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _joinTs ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_joinTs = newValue} - } - /// Returns true if `joinTs` has been explicitly set. - public var hasJoinTs: Bool {return self._joinTs != nil} - /// Clears the value of `joinTs`. Subsequent reads from it will return its default value. - public mutating func clearJoinTs() {self._joinTs = nil} - - /// How the user has customized their Tip Card. Public, so it is returned for - /// any user, not just the caller. Always set — the server resolves defaults - /// for anything the user hasn't customized. Update it with UpdateTipCard. - public var tipCardCustomization: Flipcash_Profile_V1_TipCardCustomization { - get {return _tipCardCustomization ?? Flipcash_Profile_V1_TipCardCustomization()} - set {_tipCardCustomization = newValue} - } - /// Returns true if `tipCardCustomization` has been explicitly set. - public var hasTipCardCustomization: Bool {return self._tipCardCustomization != nil} - /// Clears the value of `tipCardCustomization`. Subsequent reads from it will return its default value. - public mutating func clearTipCardCustomization() {self._tipCardCustomization = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _userID: Flipcash_Common_V1_UserId? = nil - fileprivate var _username: Flipcash_Common_V1_Username? = nil - fileprivate var _phoneNumber: Flipcash_Common_V1_PhoneNumber? = nil - fileprivate var _emailAddress: Flipcash_Common_V1_EmailAddress? = nil - fileprivate var _profilePicture: Flipcash_Blob_V1_Media? = nil - fileprivate var _joinTs: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _tipCardCustomization: Flipcash_Profile_V1_TipCardCustomization? = nil -} - -public struct Flipcash_Profile_V1_SocialProfile: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Flipcash_Profile_V1_SocialProfile.OneOf_Type? = nil - - public var x: Flipcash_Profile_V1_XProfile { - get { - if case .x(let v)? = type {return v} - return Flipcash_Profile_V1_XProfile() - } - set {type = .x(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case x(Flipcash_Profile_V1_XProfile) - - } - - public init() {} -} - -public struct Flipcash_Profile_V1_XProfile: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The user's ID on X - public var id: String = String() - - /// The user's username on X - public var username: String = String() - - /// The user's friendly name on X - public var name: String = String() - - /// The user's description on X - public var description_p: String = String() - - /// URL to the user's X profile picture - public var profilePicURL: String = String() - - /// The type of X verification associated with the user - public var verifiedType: Flipcash_Profile_V1_XProfile.VerifiedType = .none - - /// The number of followers the user has on X - public var followerCount: UInt32 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum VerifiedType: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case none // = 0 - case blue // = 1 - case business // = 2 - case government // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .none - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .none - case 1: self = .blue - case 2: self = .business - case 3: self = .government - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .none: return 0 - case .blue: return 1 - case .business: return 2 - case .government: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_XProfile.VerifiedType] = [ - .none, - .blue, - .business, - .government, - ] - - } - - public init() {} -} - -/// Customization for a Tip Card -public struct Flipcash_Profile_V1_TipCardCustomization: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The colour of the Tip Card. Always set — the server falls back to the - /// default colour when the user hasn't picked one. - public var color: Flipcash_Common_V1_Color { - get {return _color ?? Flipcash_Common_V1_Color()} - set {_color = newValue} - } - /// Returns true if `color` has been explicitly set. - public var hasColor: Bool {return self._color != nil} - /// Clears the value of `color`. Subsequent reads from it will return its default value. - public mutating func clearColor() {self._color = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _color: Flipcash_Common_V1_Color? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.profile.v1" - -extension Flipcash_Profile_V1_UserProfile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UserProfile" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}display_name\0\u{3}social_profiles\0\u{3}phone_number\0\u{3}email_address\0\u{3}profile_picture\0\u{3}join_ts\0\u{3}tip_card_customization\0\u{1}username\0\u{3}user_id\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.displayName) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.socialProfiles) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._phoneNumber) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._emailAddress) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._joinTs) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._tipCardCustomization) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._username) }() - case 9: try { try decoder.decodeSingularMessageField(value: &self._userID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.displayName.isEmpty { - try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 1) - } - if !self.socialProfiles.isEmpty { - try visitor.visitRepeatedMessageField(value: self.socialProfiles, fieldNumber: 2) - } - try { if let v = self._phoneNumber { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._emailAddress { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._profilePicture { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try { if let v = self._joinTs { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - try { if let v = self._tipCardCustomization { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try { if let v = self._username { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_UserProfile, rhs: Flipcash_Profile_V1_UserProfile) -> Bool { - if lhs._userID != rhs._userID {return false} - if lhs.displayName != rhs.displayName {return false} - if lhs._username != rhs._username {return false} - if lhs.socialProfiles != rhs.socialProfiles {return false} - if lhs._phoneNumber != rhs._phoneNumber {return false} - if lhs._emailAddress != rhs._emailAddress {return false} - if lhs._profilePicture != rhs._profilePicture {return false} - if lhs._joinTs != rhs._joinTs {return false} - if lhs._tipCardCustomization != rhs._tipCardCustomization {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_SocialProfile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SocialProfile" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}x\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Profile_V1_XProfile? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .x(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .x(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .x(let v)? = self.type { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_SocialProfile, rhs: Flipcash_Profile_V1_SocialProfile) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_XProfile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".XProfile" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}username\0\u{1}name\0\u{1}description\0\u{3}profile_pic_url\0\u{3}verified_type\0\u{3}follower_count\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.id) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.username) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.description_p) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.profilePicURL) }() - case 6: try { try decoder.decodeSingularEnumField(value: &self.verifiedType) }() - case 7: try { try decoder.decodeSingularUInt32Field(value: &self.followerCount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.id.isEmpty { - try visitor.visitSingularStringField(value: self.id, fieldNumber: 1) - } - if !self.username.isEmpty { - try visitor.visitSingularStringField(value: self.username, fieldNumber: 2) - } - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) - } - if !self.description_p.isEmpty { - try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 4) - } - if !self.profilePicURL.isEmpty { - try visitor.visitSingularStringField(value: self.profilePicURL, fieldNumber: 5) - } - if self.verifiedType != .none { - try visitor.visitSingularEnumField(value: self.verifiedType, fieldNumber: 6) - } - if self.followerCount != 0 { - try visitor.visitSingularUInt32Field(value: self.followerCount, fieldNumber: 7) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_XProfile, rhs: Flipcash_Profile_V1_XProfile) -> Bool { - if lhs.id != rhs.id {return false} - if lhs.username != rhs.username {return false} - if lhs.name != rhs.name {return false} - if lhs.description_p != rhs.description_p {return false} - if lhs.profilePicURL != rhs.profilePicURL {return false} - if lhs.verifiedType != rhs.verifiedType {return false} - if lhs.followerCount != rhs.followerCount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_XProfile.VerifiedType: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0NONE\0\u{1}BLUE\0\u{1}BUSINESS\0\u{1}GOVERNMENT\0") -} - -extension Flipcash_Profile_V1_TipCardCustomization: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TipCardCustomization" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}color\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._color) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._color { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_TipCardCustomization, rhs: Flipcash_Profile_V1_TipCardCustomization) -> Bool { - if lhs._color != rhs._color {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_profile_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_profile_service.grpc.swift deleted file mode 100644 index d099b0153..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_profile_service.grpc.swift +++ /dev/null @@ -1,993 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: profile/v1/profile_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.profile.v1.Profile - -/// Namespace containing generated types for the "flipcash.profile.v1.Profile" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Profile_V1_Profile { - /// Service descriptor for the "flipcash.profile.v1.Profile" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "GetProfile" metadata. - public enum GetProfile { - /// Request type for "GetProfile". - public typealias Input = Flipcash_Profile_V1_GetProfileRequest - /// Response type for "GetProfile". - public typealias Output = Flipcash_Profile_V1_GetProfileResponse - /// Descriptor for "GetProfile". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile"), - method: "GetProfile" - ) - } - /// Namespace for "SetDisplayName" metadata. - public enum SetDisplayName { - /// Request type for "SetDisplayName". - public typealias Input = Flipcash_Profile_V1_SetDisplayNameRequest - /// Response type for "SetDisplayName". - public typealias Output = Flipcash_Profile_V1_SetDisplayNameResponse - /// Descriptor for "SetDisplayName". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile"), - method: "SetDisplayName" - ) - } - /// Namespace for "SetUsername" metadata. - public enum SetUsername { - /// Request type for "SetUsername". - public typealias Input = Flipcash_Profile_V1_SetUsernameRequest - /// Response type for "SetUsername". - public typealias Output = Flipcash_Profile_V1_SetUsernameResponse - /// Descriptor for "SetUsername". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile"), - method: "SetUsername" - ) - } - /// Namespace for "SetProfilePicture" metadata. - public enum SetProfilePicture { - /// Request type for "SetProfilePicture". - public typealias Input = Flipcash_Profile_V1_SetProfilePictureRequest - /// Response type for "SetProfilePicture". - public typealias Output = Flipcash_Profile_V1_SetProfilePictureResponse - /// Descriptor for "SetProfilePicture". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile"), - method: "SetProfilePicture" - ) - } - /// Namespace for "UpdateTipCard" metadata. - public enum UpdateTipCard { - /// Request type for "UpdateTipCard". - public typealias Input = Flipcash_Profile_V1_UpdateTipCardRequest - /// Response type for "UpdateTipCard". - public typealias Output = Flipcash_Profile_V1_UpdateTipCardResponse - /// Descriptor for "UpdateTipCard". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile"), - method: "UpdateTipCard" - ) - } - /// Namespace for "LinkSocialAccount" metadata. - public enum LinkSocialAccount { - /// Request type for "LinkSocialAccount". - public typealias Input = Flipcash_Profile_V1_LinkSocialAccountRequest - /// Response type for "LinkSocialAccount". - public typealias Output = Flipcash_Profile_V1_LinkSocialAccountResponse - /// Descriptor for "LinkSocialAccount". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile"), - method: "LinkSocialAccount" - ) - } - /// Namespace for "UnlinkSocialAccount" metadata. - public enum UnlinkSocialAccount { - /// Request type for "UnlinkSocialAccount". - public typealias Input = Flipcash_Profile_V1_UnlinkSocialAccountRequest - /// Response type for "UnlinkSocialAccount". - public typealias Output = Flipcash_Profile_V1_UnlinkSocialAccountResponse - /// Descriptor for "UnlinkSocialAccount". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile"), - method: "UnlinkSocialAccount" - ) - } - /// Descriptors for all methods in the "flipcash.profile.v1.Profile" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - GetProfile.descriptor, - SetDisplayName.descriptor, - SetUsername.descriptor, - SetProfilePicture.descriptor, - UpdateTipCard.descriptor, - LinkSocialAccount.descriptor, - UnlinkSocialAccount.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.profile.v1.Profile" service. - public static let flipcash_profile_v1_Profile = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile") -} - -// MARK: flipcash.profile.v1.Profile (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Profile_V1_Profile { - /// Generated client protocol for the "flipcash.profile.v1.Profile" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "GetProfile" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_GetProfileRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_GetProfileRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_GetProfileResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getProfile( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "SetDisplayName" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetDisplayNameRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_SetDisplayNameRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_SetDisplayNameResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func setDisplayName( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "SetUsername" method. - /// - /// > Source IDL Documentation: - /// > - /// > SetUsername sets the caller's username, replacing any username already - /// > set. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetUsernameRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_SetUsernameRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_SetUsernameResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func setUsername( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "SetProfilePicture" method. - /// - /// > Source IDL Documentation: - /// > - /// > SetProfilePicture sets the caller's profile picture to a blob they have - /// > already uploaded via BlobStorage, replacing any picture already set. - /// > - /// > The client uploads only the ORIGINAL — InitiateExternalUpload, PUT/POST - /// > the bytes, then (optionally) CompleteExternalUpload — and passes the - /// > resulting BlobId here once the blob is READY. The server derives the - /// > DISPLAY and THUMBNAIL renditions itself and returns the full set. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetProfilePictureRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_SetProfilePictureRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_SetProfilePictureResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func setProfilePicture( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "UpdateTipCard" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateTipCard updates the caller's Tip Card customization. Every field is - /// > optional; only the ones set in the request are changed. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UpdateTipCardRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_UpdateTipCardRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_UpdateTipCardResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func updateTipCard( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "LinkSocialAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > LinkSocialAccount links a social account to a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_LinkSocialAccountRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_LinkSocialAccountRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_LinkSocialAccountResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func linkSocialAccount( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "UnlinkSocialAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > UnlinkSocialAccount removes a social account link from a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UnlinkSocialAccountRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_UnlinkSocialAccountRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_UnlinkSocialAccountResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func unlinkSocialAccount( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.profile.v1.Profile" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "GetProfile" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_GetProfileRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_GetProfileRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_GetProfileResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getProfile( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Profile_V1_Profile.Method.GetProfile.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetDisplayName" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetDisplayNameRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_SetDisplayNameRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_SetDisplayNameResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setDisplayName( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Profile_V1_Profile.Method.SetDisplayName.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetUsername" method. - /// - /// > Source IDL Documentation: - /// > - /// > SetUsername sets the caller's username, replacing any username already - /// > set. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetUsernameRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_SetUsernameRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_SetUsernameResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setUsername( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Profile_V1_Profile.Method.SetUsername.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetProfilePicture" method. - /// - /// > Source IDL Documentation: - /// > - /// > SetProfilePicture sets the caller's profile picture to a blob they have - /// > already uploaded via BlobStorage, replacing any picture already set. - /// > - /// > The client uploads only the ORIGINAL — InitiateExternalUpload, PUT/POST - /// > the bytes, then (optionally) CompleteExternalUpload — and passes the - /// > resulting BlobId here once the blob is READY. The server derives the - /// > DISPLAY and THUMBNAIL renditions itself and returns the full set. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetProfilePictureRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_SetProfilePictureRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_SetProfilePictureResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setProfilePicture( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Profile_V1_Profile.Method.SetProfilePicture.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateTipCard" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateTipCard updates the caller's Tip Card customization. Every field is - /// > optional; only the ones set in the request are changed. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UpdateTipCardRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_UpdateTipCardRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_UpdateTipCardResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateTipCard( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Profile_V1_Profile.Method.UpdateTipCard.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "LinkSocialAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > LinkSocialAccount links a social account to a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_LinkSocialAccountRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_LinkSocialAccountRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_LinkSocialAccountResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func linkSocialAccount( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Profile_V1_Profile.Method.LinkSocialAccount.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UnlinkSocialAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > UnlinkSocialAccount removes a social account link from a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UnlinkSocialAccountRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_UnlinkSocialAccountRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_UnlinkSocialAccountResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlinkSocialAccount( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Profile_V1_Profile.Method.UnlinkSocialAccount.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Profile_V1_Profile.ClientProtocol { - /// Call the "GetProfile" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_GetProfileRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getProfile( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getProfile( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetDisplayName" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetDisplayNameRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setDisplayName( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.setDisplayName( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetUsername" method. - /// - /// > Source IDL Documentation: - /// > - /// > SetUsername sets the caller's username, replacing any username already - /// > set. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetUsernameRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setUsername( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.setUsername( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetProfilePicture" method. - /// - /// > Source IDL Documentation: - /// > - /// > SetProfilePicture sets the caller's profile picture to a blob they have - /// > already uploaded via BlobStorage, replacing any picture already set. - /// > - /// > The client uploads only the ORIGINAL — InitiateExternalUpload, PUT/POST - /// > the bytes, then (optionally) CompleteExternalUpload — and passes the - /// > resulting BlobId here once the blob is READY. The server derives the - /// > DISPLAY and THUMBNAIL renditions itself and returns the full set. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_SetProfilePictureRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setProfilePicture( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.setProfilePicture( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateTipCard" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateTipCard updates the caller's Tip Card customization. Every field is - /// > optional; only the ones set in the request are changed. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UpdateTipCardRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateTipCard( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.updateTipCard( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "LinkSocialAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > LinkSocialAccount links a social account to a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_LinkSocialAccountRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func linkSocialAccount( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.linkSocialAccount( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UnlinkSocialAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > UnlinkSocialAccount removes a social account link from a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UnlinkSocialAccountRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlinkSocialAccount( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.unlinkSocialAccount( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Profile_V1_Profile.ClientProtocol { - /// Call the "GetProfile" method. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getProfile( - _ message: Flipcash_Profile_V1_GetProfileRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getProfile( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetDisplayName" method. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setDisplayName( - _ message: Flipcash_Profile_V1_SetDisplayNameRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.setDisplayName( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetUsername" method. - /// - /// > Source IDL Documentation: - /// > - /// > SetUsername sets the caller's username, replacing any username already - /// > set. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setUsername( - _ message: Flipcash_Profile_V1_SetUsernameRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.setUsername( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SetProfilePicture" method. - /// - /// > Source IDL Documentation: - /// > - /// > SetProfilePicture sets the caller's profile picture to a blob they have - /// > already uploaded via BlobStorage, replacing any picture already set. - /// > - /// > The client uploads only the ORIGINAL — InitiateExternalUpload, PUT/POST - /// > the bytes, then (optionally) CompleteExternalUpload — and passes the - /// > resulting BlobId here once the blob is READY. The server derives the - /// > DISPLAY and THUMBNAIL renditions itself and returns the full set. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func setProfilePicture( - _ message: Flipcash_Profile_V1_SetProfilePictureRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.setProfilePicture( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateTipCard" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateTipCard updates the caller's Tip Card customization. Every field is - /// > optional; only the ones set in the request are changed. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateTipCard( - _ message: Flipcash_Profile_V1_UpdateTipCardRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.updateTipCard( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "LinkSocialAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > LinkSocialAccount links a social account to a user - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func linkSocialAccount( - _ message: Flipcash_Profile_V1_LinkSocialAccountRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.linkSocialAccount( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UnlinkSocialAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > UnlinkSocialAccount removes a social account link from a user - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func unlinkSocialAccount( - _ message: Flipcash_Profile_V1_UnlinkSocialAccountRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.unlinkSocialAccount( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_profile_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_profile_service.pb.swift deleted file mode 100644 index 4256fac92..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/profile_v1_profile_service.pb.swift +++ /dev/null @@ -1,1396 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: profile/v1/profile_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Profile_V1_GetProfileRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The user whose profile is being fetched, identified either by their user - /// ID or by their username. Exactly one must be set. - public var identifier: Flipcash_Profile_V1_GetProfileRequest.OneOf_Identifier? = nil - - public var userID: Flipcash_Common_V1_UserId { - get { - if case .userID(let v)? = identifier {return v} - return Flipcash_Common_V1_UserId() - } - set {identifier = .userID(newValue)} - } - - public var username: Flipcash_Common_V1_Username { - get { - if case .username(let v)? = identifier {return v} - return Flipcash_Common_V1_Username() - } - set {identifier = .username(newValue)} - } - - /// Optional auth to retrieve private profile information for self - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// The user whose profile is being fetched, identified either by their user - /// ID or by their username. Exactly one must be set. - public enum OneOf_Identifier: Equatable, Sendable { - case userID(Flipcash_Common_V1_UserId) - case username(Flipcash_Common_V1_Username) - - } - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Profile_V1_GetProfileResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Profile_V1_GetProfileResponse.Result = .ok - - /// UserProfile, if found. - /// - /// Some fields may or may not be set, depending on the scope of request - /// in the future. - public var userProfile: Flipcash_Profile_V1_UserProfile { - get {return _userProfile ?? Flipcash_Profile_V1_UserProfile()} - set {_userProfile = newValue} - } - /// Returns true if `userProfile` has been explicitly set. - public var hasUserProfile: Bool {return self._userProfile != nil} - /// Clears the value of `userProfile`. Subsequent reads from it will return its default value. - public mutating func clearUserProfile() {self._userProfile = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_GetProfileResponse.Result] = [ - .ok, - .notFound, - ] - - } - - public init() {} - - fileprivate var _userProfile: Flipcash_Profile_V1_UserProfile? = nil -} - -public struct Flipcash_Profile_V1_SetDisplayNameRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// DisplayName is the new name to set. - public var displayName: String = String() - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Profile_V1_SetDisplayNameResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Profile_V1_SetDisplayNameResponse.Result = .ok - - /// The best-fit category that tripped moderation, mirroring the Moderation - /// service's vocabulary. Set only when result == FAILED_MODERATED; NONE - /// otherwise. - public var flaggedCategory: Flipcash_Moderation_V1_FlaggedCategory = .none - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case invalidDisplayName // = 1 - case denied // = 2 - case failedModerated // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .invalidDisplayName - case 2: self = .denied - case 3: self = .failedModerated - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .invalidDisplayName: return 1 - case .denied: return 2 - case .failedModerated: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_SetDisplayNameResponse.Result] = [ - .ok, - .invalidDisplayName, - .denied, - .failedModerated, - ] - - } - - public init() {} -} - -public struct Flipcash_Profile_V1_SetUsernameRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Username is the new username to set. - public var username: Flipcash_Common_V1_Username { - get {return _username ?? Flipcash_Common_V1_Username()} - set {_username = newValue} - } - /// Returns true if `username` has been explicitly set. - public var hasUsername: Bool {return self._username != nil} - /// Clears the value of `username`. Subsequent reads from it will return its default value. - public mutating func clearUsername() {self._username = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _username: Flipcash_Common_V1_Username? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Profile_V1_SetUsernameResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Profile_V1_SetUsernameResponse.Result = .ok - - /// The best-fit category that tripped moderation, mirroring the Moderation - /// service's vocabulary. Set only when result == FAILED_MODERATED; NONE - /// otherwise. - public var flaggedCategory: Flipcash_Moderation_V1_FlaggedCategory = .none - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case invalidUsername // = 1 - case denied // = 2 - case alreadyTaken // = 3 - case failedModerated // = 4 - case insufficientBalance // = 5 - case reservedWord // = 6 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .invalidUsername - case 2: self = .denied - case 3: self = .alreadyTaken - case 4: self = .failedModerated - case 5: self = .insufficientBalance - case 6: self = .reservedWord - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .invalidUsername: return 1 - case .denied: return 2 - case .alreadyTaken: return 3 - case .failedModerated: return 4 - case .insufficientBalance: return 5 - case .reservedWord: return 6 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_SetUsernameResponse.Result] = [ - .ok, - .invalidUsername, - .denied, - .alreadyTaken, - .failedModerated, - .insufficientBalance, - .reservedWord, - ] - - } - - public init() {} -} - -public struct Flipcash_Profile_V1_SetProfilePictureRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The blob holding the ORIGINAL image the caller uploaded. It must be owned - /// by the caller and READY; the server derives the remaining renditions from - /// it. A blob may back at most one profile picture — reuse is not implied. - public var blobID: Flipcash_Blob_V1_BlobId { - get {return _blobID ?? Flipcash_Blob_V1_BlobId()} - set {_blobID = newValue} - } - /// Returns true if `blobID` has been explicitly set. - public var hasBlobID: Bool {return self._blobID != nil} - /// Clears the value of `blobID`. Subsequent reads from it will return its default value. - public mutating func clearBlobID() {self._blobID = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _blobID: Flipcash_Blob_V1_BlobId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Profile_V1_SetProfilePictureResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Profile_V1_SetProfilePictureResponse.Result = .ok - - /// The caller's new profile picture, including the renditions the server - /// derived. Set only when result == OK. - public var profilePicture: Flipcash_Blob_V1_Media { - get {return _profilePicture ?? Flipcash_Blob_V1_Media()} - set {_profilePicture = newValue} - } - /// Returns true if `profilePicture` has been explicitly set. - public var hasProfilePicture: Bool {return self._profilePicture != nil} - /// Clears the value of `profilePicture`. Subsequent reads from it will return its default value. - public mutating func clearProfilePicture() {self._profilePicture = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - - /// no such blob, or it is not owned by the caller - case blobNotFound // = 2 - - /// blob is still PENDING/PROCESSING; retry once READY - case blobNotReady // = 3 - - /// blob failed validation or moderation; terminal for this id, so the client must upload again - case blobRejected // = 4 - - /// blob is READY but unusable as a picture (e.g. not an image) - case invalidBlob // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .blobNotFound - case 3: self = .blobNotReady - case 4: self = .blobRejected - case 5: self = .invalidBlob - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .blobNotFound: return 2 - case .blobNotReady: return 3 - case .blobRejected: return 4 - case .invalidBlob: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_SetProfilePictureResponse.Result] = [ - .ok, - .denied, - .blobNotFound, - .blobNotReady, - .blobRejected, - .invalidBlob, - ] - - } - - public init() {} - - fileprivate var _profilePicture: Flipcash_Blob_V1_Media? = nil -} - -public struct Flipcash_Profile_V1_UpdateTipCardRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The new colour of the Tip Card. Left unchanged when unset. - public var color: Flipcash_Common_V1_Color { - get {return _color ?? Flipcash_Common_V1_Color()} - set {_color = newValue} - } - /// Returns true if `color` has been explicitly set. - public var hasColor: Bool {return self._color != nil} - /// Clears the value of `color`. Subsequent reads from it will return its default value. - public mutating func clearColor() {self._color = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _color: Flipcash_Common_V1_Color? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Profile_V1_UpdateTipCardResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Profile_V1_UpdateTipCardResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case invalidColor // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .invalidColor - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .invalidColor: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_UpdateTipCardResponse.Result] = [ - .ok, - .denied, - .invalidColor, - ] - - } - - public init() {} -} - -public struct Flipcash_Profile_V1_LinkSocialAccountRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var linkingToken: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken { - get {return _linkingToken ?? Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken()} - set {_linkingToken = newValue} - } - /// Returns true if `linkingToken` has been explicitly set. - public var hasLinkingToken: Bool {return self._linkingToken != nil} - /// Clears the value of `linkingToken`. Subsequent reads from it will return its default value. - public mutating func clearLinkingToken() {self._linkingToken = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public struct LinkingToken: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.OneOf_Type? = nil - - public var x: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.XLinkingToken { - get { - if case .x(let v)? = type {return v} - return Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.XLinkingToken() - } - set {type = .x(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case x(Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.XLinkingToken) - - } - - public struct XLinkingToken: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// X access token from the OAuth 2.0 flow - public var accessToken: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} - } - - public init() {} - - fileprivate var _linkingToken: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Profile_V1_LinkSocialAccountResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Profile_V1_LinkSocialAccountResponse.Result = .ok - - public var socialProfile: Flipcash_Profile_V1_SocialProfile { - get {return _socialProfile ?? Flipcash_Profile_V1_SocialProfile()} - set {_socialProfile = newValue} - } - /// Returns true if `socialProfile` has been explicitly set. - public var hasSocialProfile: Bool {return self._socialProfile != nil} - /// Clears the value of `socialProfile`. Subsequent reads from it will return its default value. - public mutating func clearSocialProfile() {self._socialProfile = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case invalidLinkingToken // = 1 - case existingLink // = 2 - case denied // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .invalidLinkingToken - case 2: self = .existingLink - case 3: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .invalidLinkingToken: return 1 - case .existingLink: return 2 - case .denied: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_LinkSocialAccountResponse.Result] = [ - .ok, - .invalidLinkingToken, - .existingLink, - .denied, - ] - - } - - public init() {} - - fileprivate var _socialProfile: Flipcash_Profile_V1_SocialProfile? = nil -} - -public struct Flipcash_Profile_V1_UnlinkSocialAccountRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var socialIdentifier: Flipcash_Profile_V1_UnlinkSocialAccountRequest.OneOf_SocialIdentifier? = nil - - public var xUserID: String { - get { - if case .xUserID(let v)? = socialIdentifier {return v} - return String() - } - set {socialIdentifier = .xUserID(newValue)} - } - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_SocialIdentifier: Equatable, Sendable { - case xUserID(String) - - } - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Profile_V1_UnlinkSocialAccountResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Profile_V1_UnlinkSocialAccountResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_UnlinkSocialAccountResponse.Result] = [ - .ok, - .denied, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.profile.v1" - -extension Flipcash_Profile_V1_GetProfileRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetProfileRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{1}auth\0\u{1}username\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Common_V1_UserId? - var hadOneofValue = false - if let current = self.identifier { - hadOneofValue = true - if case .userID(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.identifier = .userID(v) - } - }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 3: try { - var v: Flipcash_Common_V1_Username? - var hadOneofValue = false - if let current = self.identifier { - hadOneofValue = true - if case .username(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.identifier = .username(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .userID(let v)? = self.identifier { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if case .username(let v)? = self.identifier { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_GetProfileRequest, rhs: Flipcash_Profile_V1_GetProfileRequest) -> Bool { - if lhs.identifier != rhs.identifier {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_GetProfileResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetProfileResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}user_profile\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._userProfile) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._userProfile { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_GetProfileResponse, rhs: Flipcash_Profile_V1_GetProfileResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._userProfile != rhs._userProfile {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_GetProfileResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0") -} - -extension Flipcash_Profile_V1_SetDisplayNameRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetDisplayNameRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}display_name\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.displayName) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.displayName.isEmpty { - try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 1) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_SetDisplayNameRequest, rhs: Flipcash_Profile_V1_SetDisplayNameRequest) -> Bool { - if lhs.displayName != rhs.displayName {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_SetDisplayNameResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetDisplayNameResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}flagged_category\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.flaggedCategory) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if self.flaggedCategory != .none { - try visitor.visitSingularEnumField(value: self.flaggedCategory, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_SetDisplayNameResponse, rhs: Flipcash_Profile_V1_SetDisplayNameResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.flaggedCategory != rhs.flaggedCategory {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_SetDisplayNameResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}INVALID_DISPLAY_NAME\0\u{1}DENIED\0\u{1}FAILED_MODERATED\0") -} - -extension Flipcash_Profile_V1_SetUsernameRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetUsernameRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}username\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._username) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._username { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_SetUsernameRequest, rhs: Flipcash_Profile_V1_SetUsernameRequest) -> Bool { - if lhs._username != rhs._username {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_SetUsernameResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetUsernameResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}flagged_category\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.flaggedCategory) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if self.flaggedCategory != .none { - try visitor.visitSingularEnumField(value: self.flaggedCategory, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_SetUsernameResponse, rhs: Flipcash_Profile_V1_SetUsernameResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.flaggedCategory != rhs.flaggedCategory {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_SetUsernameResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}INVALID_USERNAME\0\u{1}DENIED\0\u{1}ALREADY_TAKEN\0\u{1}FAILED_MODERATED\0\u{1}INSUFFICIENT_BALANCE\0\u{1}RESERVED_WORD\0") -} - -extension Flipcash_Profile_V1_SetProfilePictureRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetProfilePictureRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}blob_id\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._blobID) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._blobID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_SetProfilePictureRequest, rhs: Flipcash_Profile_V1_SetProfilePictureRequest) -> Bool { - if lhs._blobID != rhs._blobID {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_SetProfilePictureResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetProfilePictureResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}profile_picture\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._profilePicture { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_SetProfilePictureResponse, rhs: Flipcash_Profile_V1_SetProfilePictureResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._profilePicture != rhs._profilePicture {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_SetProfilePictureResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}BLOB_NOT_FOUND\0\u{1}BLOB_NOT_READY\0\u{1}BLOB_REJECTED\0\u{1}INVALID_BLOB\0") -} - -extension Flipcash_Profile_V1_UpdateTipCardRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateTipCardRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}color\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._color) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._color { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_UpdateTipCardRequest, rhs: Flipcash_Profile_V1_UpdateTipCardRequest) -> Bool { - if lhs._color != rhs._color {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_UpdateTipCardResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateTipCardResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_UpdateTipCardResponse, rhs: Flipcash_Profile_V1_UpdateTipCardResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_UpdateTipCardResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}INVALID_COLOR\0") -} - -extension Flipcash_Profile_V1_LinkSocialAccountRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LinkSocialAccountRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}linking_token\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._linkingToken) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._linkingToken { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_LinkSocialAccountRequest, rhs: Flipcash_Profile_V1_LinkSocialAccountRequest) -> Bool { - if lhs._linkingToken != rhs._linkingToken {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Profile_V1_LinkSocialAccountRequest.protoMessageName + ".LinkingToken" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}x\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.XLinkingToken? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .x(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .x(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .x(let v)? = self.type { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken, rhs: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.XLinkingToken: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.protoMessageName + ".XLinkingToken" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}access_token\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.accessToken) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.accessToken.isEmpty { - try visitor.visitSingularStringField(value: self.accessToken, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.XLinkingToken, rhs: Flipcash_Profile_V1_LinkSocialAccountRequest.LinkingToken.XLinkingToken) -> Bool { - if lhs.accessToken != rhs.accessToken {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_LinkSocialAccountResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LinkSocialAccountResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}social_profile\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._socialProfile) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._socialProfile { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_LinkSocialAccountResponse, rhs: Flipcash_Profile_V1_LinkSocialAccountResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._socialProfile != rhs._socialProfile {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_LinkSocialAccountResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}INVALID_LINKING_TOKEN\0\u{1}EXISTING_LINK\0\u{1}DENIED\0") -} - -extension Flipcash_Profile_V1_UnlinkSocialAccountRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnlinkSocialAccountRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}x_user_id\0\u{2}\u{9}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: String? - try decoder.decodeSingularStringField(value: &v) - if let v = v { - if self.socialIdentifier != nil {try decoder.handleConflictingOneOf()} - self.socialIdentifier = .xUserID(v) - } - }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .xUserID(let v)? = self.socialIdentifier { - try visitor.visitSingularStringField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_UnlinkSocialAccountRequest, rhs: Flipcash_Profile_V1_UnlinkSocialAccountRequest) -> Bool { - if lhs.socialIdentifier != rhs.socialIdentifier {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_UnlinkSocialAccountResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnlinkSocialAccountResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Profile_V1_UnlinkSocialAccountResponse, rhs: Flipcash_Profile_V1_UnlinkSocialAccountResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Profile_V1_UnlinkSocialAccountResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_model.pb.swift deleted file mode 100644 index a2a7d608e..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_model.pb.swift +++ /dev/null @@ -1,432 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: push/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public enum Flipcash_Push_V1_TokenType: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// FCM registration token for an Android device - case fcmAndroid // = 1 - - /// FCM registration token or an iOS device - case fcmApns // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .fcmAndroid - case 2: self = .fcmApns - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .fcmAndroid: return 1 - case .fcmApns: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Push_V1_TokenType] = [ - .unknown, - .fcmAndroid, - .fcmApns, - ] - -} - -/// Payload provided as extra data in a push -public struct Flipcash_Push_V1_Payload: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// If present, where the app should navigate to after clicking the push - public var navigation: Flipcash_Push_V1_Navigation { - get {return _navigation ?? Flipcash_Push_V1_Navigation()} - set {_navigation = newValue} - } - /// Returns true if `navigation` has been explicitly set. - public var hasNavigation: Bool {return self._navigation != nil} - /// Clears the value of `navigation`. Subsequent reads from it will return its default value. - public mutating func clearNavigation() {self._navigation = nil} - - /// Ordered substitutions to apply to push title - public var titleSubstitutions: [Flipcash_Common_V1_Substitution] = [] - - /// Ordered substitutions to apply to push body - public var bodySubstitutions: [Flipcash_Common_V1_Substitution] = [] - - /// Push notification category - public var category: Flipcash_Push_V1_Payload.Category = .default - - /// Push notification key for grouping pushes. If not set, then no grouping - /// is applied. - public var groupKey: String = String() - - public var chatMetadata: Flipcash_Push_V1_ChatMetadata { - get {return _chatMetadata ?? Flipcash_Push_V1_ChatMetadata()} - set {_chatMetadata = newValue} - } - /// Returns true if `chatMetadata` has been explicitly set. - public var hasChatMetadata: Bool {return self._chatMetadata != nil} - /// Clears the value of `chatMetadata`. Subsequent reads from it will return its default value. - public mutating func clearChatMetadata() {self._chatMetadata = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Category: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case `default` // = 0 - case depositWithdrawal // = 1 - case buySell // = 2 - case gain // = 3 - case chat // = 4 - case contactJoin // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .default - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .depositWithdrawal - case 2: self = .buySell - case 3: self = .gain - case 4: self = .chat - case 5: self = .contactJoin - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .default: return 0 - case .depositWithdrawal: return 1 - case .buySell: return 2 - case .gain: return 3 - case .chat: return 4 - case .contactJoin: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Push_V1_Payload.Category] = [ - .default, - .depositWithdrawal, - .buySell, - .gain, - .chat, - .contactJoin, - ] - - } - - public init() {} - - fileprivate var _navigation: Flipcash_Push_V1_Navigation? = nil - fileprivate var _chatMetadata: Flipcash_Push_V1_ChatMetadata? = nil -} - -/// Navigation within the app upon clicking the push -public struct Flipcash_Push_V1_Navigation: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Flipcash_Push_V1_Navigation.OneOf_Type? = nil - - /// Currency info page for the provided mint - public var currencyInfo: Flipcash_Common_V1_PublicKey { - get { - if case .currencyInfo(let v)? = type {return v} - return Flipcash_Common_V1_PublicKey() - } - set {type = .currencyInfo(newValue)} - } - - /// Chat for the provided ID - public var chatID: Flipcash_Common_V1_ChatId { - get { - if case .chatID(let v)? = type {return v} - return Flipcash_Common_V1_ChatId() - } - set {type = .chatID(newValue)} - } - - /// Chat for a contact with the provided phone number - public var chatContactPhoneNumber: Flipcash_Common_V1_PhoneNumber { - get { - if case .chatContactPhoneNumber(let v)? = type {return v} - return Flipcash_Common_V1_PhoneNumber() - } - set {type = .chatContactPhoneNumber(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - /// Currency info page for the provided mint - case currencyInfo(Flipcash_Common_V1_PublicKey) - /// Chat for the provided ID - case chatID(Flipcash_Common_V1_ChatId) - /// Chat for a contact with the provided phone number - case chatContactPhoneNumber(Flipcash_Common_V1_PhoneNumber) - - } - - public init() {} -} - -/// Additional metadata provided for chat pushes -public struct Flipcash_Push_V1_ChatMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The user ID that sent a chat message - /// - /// Note: This will not be set for system messages OR for notifications that - /// don't relate to a user - public var sendingUserID: Flipcash_Common_V1_UserId { - get {return _sendingUserID ?? Flipcash_Common_V1_UserId()} - set {_sendingUserID = newValue} - } - /// Returns true if `sendingUserID` has been explicitly set. - public var hasSendingUserID: Bool {return self._sendingUserID != nil} - /// Clears the value of `sendingUserID`. Subsequent reads from it will return its default value. - public mutating func clearSendingUserID() {self._sendingUserID = nil} - - /// The type of chat - public var type: Flipcash_Chat_V1_ChatType = .unknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _sendingUserID: Flipcash_Common_V1_UserId? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.push.v1" - -extension Flipcash_Push_V1_TokenType: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}FCM_ANDROID\0\u{1}FCM_APNS\0") -} - -extension Flipcash_Push_V1_Payload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Payload" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}navigation\0\u{3}title_substitutions\0\u{3}body_substitutions\0\u{1}category\0\u{3}group_key\0\u{3}chat_metadata\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._navigation) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.titleSubstitutions) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.bodySubstitutions) }() - case 4: try { try decoder.decodeSingularEnumField(value: &self.category) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.groupKey) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._chatMetadata) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._navigation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.titleSubstitutions.isEmpty { - try visitor.visitRepeatedMessageField(value: self.titleSubstitutions, fieldNumber: 2) - } - if !self.bodySubstitutions.isEmpty { - try visitor.visitRepeatedMessageField(value: self.bodySubstitutions, fieldNumber: 3) - } - if self.category != .default { - try visitor.visitSingularEnumField(value: self.category, fieldNumber: 4) - } - if !self.groupKey.isEmpty { - try visitor.visitSingularStringField(value: self.groupKey, fieldNumber: 5) - } - try { if let v = self._chatMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Push_V1_Payload, rhs: Flipcash_Push_V1_Payload) -> Bool { - if lhs._navigation != rhs._navigation {return false} - if lhs.titleSubstitutions != rhs.titleSubstitutions {return false} - if lhs.bodySubstitutions != rhs.bodySubstitutions {return false} - if lhs.category != rhs.category {return false} - if lhs.groupKey != rhs.groupKey {return false} - if lhs._chatMetadata != rhs._chatMetadata {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Push_V1_Payload.Category: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DEFAULT\0\u{1}DEPOSIT_WITHDRAWAL\0\u{1}BUY_SELL\0\u{1}GAIN\0\u{1}CHAT\0\u{1}CONTACT_JOIN\0") -} - -extension Flipcash_Push_V1_Navigation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Navigation" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}currency_info\0\u{3}chat_id\0\u{3}chat_contact_phone_number\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Common_V1_PublicKey? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .currencyInfo(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .currencyInfo(v) - } - }() - case 2: try { - var v: Flipcash_Common_V1_ChatId? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .chatID(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .chatID(v) - } - }() - case 3: try { - var v: Flipcash_Common_V1_PhoneNumber? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .chatContactPhoneNumber(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .chatContactPhoneNumber(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .currencyInfo?: try { - guard case .currencyInfo(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .chatID?: try { - guard case .chatID(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .chatContactPhoneNumber?: try { - guard case .chatContactPhoneNumber(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Push_V1_Navigation, rhs: Flipcash_Push_V1_Navigation) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Push_V1_ChatMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ChatMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}sending_user_id\0\u{1}type\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._sendingUserID) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.type) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._sendingUserID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.type != .unknown { - try visitor.visitSingularEnumField(value: self.type, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Push_V1_ChatMetadata, rhs: Flipcash_Push_V1_ChatMetadata) -> Bool { - if lhs._sendingUserID != rhs._sendingUserID {return false} - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_push_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_push_service.grpc.swift deleted file mode 100644 index 17b5e2526..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_push_service.grpc.swift +++ /dev/null @@ -1,333 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: push/v1/push_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.push.v1.Push - -/// Namespace containing generated types for the "flipcash.push.v1.Push" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Push_V1_Push { - /// Service descriptor for the "flipcash.push.v1.Push" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.push.v1.Push") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "AddToken" metadata. - public enum AddToken { - /// Request type for "AddToken". - public typealias Input = Flipcash_Push_V1_AddTokenRequest - /// Response type for "AddToken". - public typealias Output = Flipcash_Push_V1_AddTokenResponse - /// Descriptor for "AddToken". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.push.v1.Push"), - method: "AddToken" - ) - } - /// Namespace for "DeleteTokens" metadata. - public enum DeleteTokens { - /// Request type for "DeleteTokens". - public typealias Input = Flipcash_Push_V1_DeleteTokensRequest - /// Response type for "DeleteTokens". - public typealias Output = Flipcash_Push_V1_DeleteTokensResponse - /// Descriptor for "DeleteTokens". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.push.v1.Push"), - method: "DeleteTokens" - ) - } - /// Descriptors for all methods in the "flipcash.push.v1.Push" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - AddToken.descriptor, - DeleteTokens.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.push.v1.Push" service. - public static let flipcash_push_v1_Push = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.push.v1.Push") -} - -// MARK: flipcash.push.v1.Push (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Push_V1_Push { - /// Generated client protocol for the "flipcash.push.v1.Push" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "AddToken" method. - /// - /// > Source IDL Documentation: - /// > - /// > AddToken adds a push token associated with a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Push_V1_AddTokenRequest` message. - /// - serializer: A serializer for `Flipcash_Push_V1_AddTokenRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Push_V1_AddTokenResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func addToken( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "DeleteTokens" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeleteTokens removes all push tokens within an app install for a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Push_V1_DeleteTokensRequest` message. - /// - serializer: A serializer for `Flipcash_Push_V1_DeleteTokensRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Push_V1_DeleteTokensResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func deleteTokens( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.push.v1.Push" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "AddToken" method. - /// - /// > Source IDL Documentation: - /// > - /// > AddToken adds a push token associated with a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Push_V1_AddTokenRequest` message. - /// - serializer: A serializer for `Flipcash_Push_V1_AddTokenRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Push_V1_AddTokenResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func addToken( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Push_V1_Push.Method.AddToken.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeleteTokens" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeleteTokens removes all push tokens within an app install for a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Push_V1_DeleteTokensRequest` message. - /// - serializer: A serializer for `Flipcash_Push_V1_DeleteTokensRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Push_V1_DeleteTokensResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deleteTokens( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Push_V1_Push.Method.DeleteTokens.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Push_V1_Push.ClientProtocol { - /// Call the "AddToken" method. - /// - /// > Source IDL Documentation: - /// > - /// > AddToken adds a push token associated with a user. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Push_V1_AddTokenRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func addToken( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.addToken( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeleteTokens" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeleteTokens removes all push tokens within an app install for a user - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Push_V1_DeleteTokensRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deleteTokens( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.deleteTokens( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Push_V1_Push.ClientProtocol { - /// Call the "AddToken" method. - /// - /// > Source IDL Documentation: - /// > - /// > AddToken adds a push token associated with a user. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func addToken( - _ message: Flipcash_Push_V1_AddTokenRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.addToken( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "DeleteTokens" method. - /// - /// > Source IDL Documentation: - /// > - /// > DeleteTokens removes all push tokens within an app install for a user - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func deleteTokens( - _ message: Flipcash_Push_V1_DeleteTokensRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.deleteTokens( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_push_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_push_service.pb.swift deleted file mode 100644 index 7451f2452..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/push_v1_push_service.pb.swift +++ /dev/null @@ -1,335 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: push/v1/push_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Push_V1_AddTokenRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var tokenType: Flipcash_Push_V1_TokenType = .unknown - - public var pushToken: String = String() - - public var appInstall: Flipcash_Common_V1_AppInstallId { - get {return _appInstall ?? Flipcash_Common_V1_AppInstallId()} - set {_appInstall = newValue} - } - /// Returns true if `appInstall` has been explicitly set. - public var hasAppInstall: Bool {return self._appInstall != nil} - /// Clears the value of `appInstall`. Subsequent reads from it will return its default value. - public mutating func clearAppInstall() {self._appInstall = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _appInstall: Flipcash_Common_V1_AppInstallId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Push_V1_AddTokenResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Push_V1_AddTokenResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case invalidPushToken // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .invalidPushToken - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .invalidPushToken: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Push_V1_AddTokenResponse.Result] = [ - .ok, - .invalidPushToken, - ] - - } - - public init() {} -} - -public struct Flipcash_Push_V1_DeleteTokensRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var appInstall: Flipcash_Common_V1_AppInstallId { - get {return _appInstall ?? Flipcash_Common_V1_AppInstallId()} - set {_appInstall = newValue} - } - /// Returns true if `appInstall` has been explicitly set. - public var hasAppInstall: Bool {return self._appInstall != nil} - /// Clears the value of `appInstall`. Subsequent reads from it will return its default value. - public mutating func clearAppInstall() {self._appInstall = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _appInstall: Flipcash_Common_V1_AppInstallId? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Push_V1_DeleteTokensResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Push_V1_DeleteTokensResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Push_V1_DeleteTokensResponse.Result] = [ - .ok, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.push.v1" - -extension Flipcash_Push_V1_AddTokenRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AddTokenRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}token_type\0\u{3}push_token\0\u{3}app_install\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.tokenType) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.pushToken) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._appInstall) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.tokenType != .unknown { - try visitor.visitSingularEnumField(value: self.tokenType, fieldNumber: 1) - } - if !self.pushToken.isEmpty { - try visitor.visitSingularStringField(value: self.pushToken, fieldNumber: 2) - } - try { if let v = self._appInstall { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Push_V1_AddTokenRequest, rhs: Flipcash_Push_V1_AddTokenRequest) -> Bool { - if lhs.tokenType != rhs.tokenType {return false} - if lhs.pushToken != rhs.pushToken {return false} - if lhs._appInstall != rhs._appInstall {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Push_V1_AddTokenResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AddTokenResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Push_V1_AddTokenResponse, rhs: Flipcash_Push_V1_AddTokenResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Push_V1_AddTokenResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}INVALID_PUSH_TOKEN\0") -} - -extension Flipcash_Push_V1_DeleteTokensRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DeleteTokensRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}app_install\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._appInstall) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._appInstall { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Push_V1_DeleteTokensRequest, rhs: Flipcash_Push_V1_DeleteTokensRequest) -> Bool { - if lhs._appInstall != rhs._appInstall {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Push_V1_DeleteTokensResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DeleteTokensResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Push_V1_DeleteTokensResponse, rhs: Flipcash_Push_V1_DeleteTokensResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Push_V1_DeleteTokensResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_model.pb.swift deleted file mode 100644 index 914755e28..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_model.pb.swift +++ /dev/null @@ -1,227 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: resolver/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Identifier wraps a real-world identifier that can be resolved to a -/// payment destination address. -public struct Flipcash_Resolver_V1_Identifier: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Flipcash_Resolver_V1_Identifier.OneOf_Kind? = nil - - public var phone: Flipcash_Common_V1_PhoneNumber { - get { - if case .phone(let v)? = kind {return v} - return Flipcash_Common_V1_PhoneNumber() - } - set {kind = .phone(newValue)} - } - - public var userID: Flipcash_Common_V1_UserId { - get { - if case .userID(let v)? = kind {return v} - return Flipcash_Common_V1_UserId() - } - set {kind = .userID(newValue)} - } - - public var username: Flipcash_Common_V1_Username { - get { - if case .username(let v)? = kind {return v} - return Flipcash_Common_V1_Username() - } - set {kind = .username(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case phone(Flipcash_Common_V1_PhoneNumber) - case userID(Flipcash_Common_V1_UserId) - case username(Flipcash_Common_V1_Username) - - } - - public init() {} -} - -/// Resolution contains a payment destiation address mapping for an -/// Identifier -public struct Flipcash_Resolver_V1_Resolution: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Flipcash_Resolver_V1_Resolution.OneOf_Kind? = nil - - public var address: Flipcash_Common_V1_PublicKey { - get { - if case .address(let v)? = kind {return v} - return Flipcash_Common_V1_PublicKey() - } - set {kind = .address(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case address(Flipcash_Common_V1_PublicKey) - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.resolver.v1" - -extension Flipcash_Resolver_V1_Identifier: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Identifier" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}phone\0\u{3}user_id\0\u{1}username\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Common_V1_PhoneNumber? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .phone(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .phone(v) - } - }() - case 2: try { - var v: Flipcash_Common_V1_UserId? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .userID(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .userID(v) - } - }() - case 3: try { - var v: Flipcash_Common_V1_Username? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .username(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .username(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.kind { - case .phone?: try { - guard case .phone(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .userID?: try { - guard case .userID(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .username?: try { - guard case .username(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Resolver_V1_Identifier, rhs: Flipcash_Resolver_V1_Identifier) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Resolver_V1_Resolution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Resolution" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}address\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Flipcash_Common_V1_PublicKey? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .address(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .address(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .address(let v)? = self.kind { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Resolver_V1_Resolution, rhs: Flipcash_Resolver_V1_Resolution) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_resolver_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_resolver_service.grpc.swift deleted file mode 100644 index 33f49bc8c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_resolver_service.grpc.swift +++ /dev/null @@ -1,211 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: resolver/v1/resolver_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.resolver.v1.Resolver - -/// Namespace containing generated types for the "flipcash.resolver.v1.Resolver" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Resolver_V1_Resolver { - /// Service descriptor for the "flipcash.resolver.v1.Resolver" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.resolver.v1.Resolver") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "Resolve" metadata. - public enum Resolve { - /// Request type for "Resolve". - public typealias Input = Flipcash_Resolver_V1_ResolveRequest - /// Response type for "Resolve". - public typealias Output = Flipcash_Resolver_V1_ResolveResponse - /// Descriptor for "Resolve". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.resolver.v1.Resolver"), - method: "Resolve" - ) - } - /// Descriptors for all methods in the "flipcash.resolver.v1.Resolver" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - Resolve.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.resolver.v1.Resolver" service. - public static let flipcash_resolver_v1_Resolver = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.resolver.v1.Resolver") -} - -// MARK: flipcash.resolver.v1.Resolver (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Resolver_V1_Resolver { - /// Generated client protocol for the "flipcash.resolver.v1.Resolver" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - /// - /// > Source IDL Documentation: - /// > - /// > Resolver maps a real-world identifier (phone number, etc.) to a payment - /// > destination address. - public protocol ClientProtocol: Sendable { - /// Call the "Resolve" method. - /// - /// > Source IDL Documentation: - /// > - /// > Resolve looks up the payment destination address for the given identifier. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Resolver_V1_ResolveRequest` message. - /// - serializer: A serializer for `Flipcash_Resolver_V1_ResolveRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Resolver_V1_ResolveResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func resolve( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.resolver.v1.Resolver" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - /// - /// > Source IDL Documentation: - /// > - /// > Resolver maps a real-world identifier (phone number, etc.) to a payment - /// > destination address. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "Resolve" method. - /// - /// > Source IDL Documentation: - /// > - /// > Resolve looks up the payment destination address for the given identifier. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Resolver_V1_ResolveRequest` message. - /// - serializer: A serializer for `Flipcash_Resolver_V1_ResolveRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Resolver_V1_ResolveResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func resolve( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Resolver_V1_Resolver.Method.Resolve.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Resolver_V1_Resolver.ClientProtocol { - /// Call the "Resolve" method. - /// - /// > Source IDL Documentation: - /// > - /// > Resolve looks up the payment destination address for the given identifier. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Resolver_V1_ResolveRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func resolve( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.resolve( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Resolver_V1_Resolver.ClientProtocol { - /// Call the "Resolve" method. - /// - /// > Source IDL Documentation: - /// > - /// > Resolve looks up the payment destination address for the given identifier. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func resolve( - _ message: Flipcash_Resolver_V1_ResolveRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.resolve( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_resolver_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_resolver_service.pb.swift deleted file mode 100644 index ea0b43209..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/resolver_v1_resolver_service.pb.swift +++ /dev/null @@ -1,200 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: resolver/v1/resolver_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Resolver_V1_ResolveRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var identifier: Flipcash_Resolver_V1_Identifier { - get {return _identifier ?? Flipcash_Resolver_V1_Identifier()} - set {_identifier = newValue} - } - /// Returns true if `identifier` has been explicitly set. - public var hasIdentifier: Bool {return self._identifier != nil} - /// Clears the value of `identifier`. Subsequent reads from it will return its default value. - public mutating func clearIdentifier() {self._identifier = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil - fileprivate var _identifier: Flipcash_Resolver_V1_Identifier? = nil -} - -public struct Flipcash_Resolver_V1_ResolveResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Resolver_V1_ResolveResponse.Result = .ok - - /// The resolved payment destination address. Set when result == OK. - public var resolution: Flipcash_Resolver_V1_Resolution { - get {return _resolution ?? Flipcash_Resolver_V1_Resolution()} - set {_resolution = newValue} - } - /// Returns true if `resolution` has been explicitly set. - public var hasResolution: Bool {return self._resolution != nil} - /// Clears the value of `resolution`. Subsequent reads from it will return its default value. - public mutating func clearResolution() {self._resolution = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case denied // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - case 2: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .denied: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Resolver_V1_ResolveResponse.Result] = [ - .ok, - .notFound, - .denied, - ] - - } - - public init() {} - - fileprivate var _resolution: Flipcash_Resolver_V1_Resolution? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.resolver.v1" - -extension Flipcash_Resolver_V1_ResolveRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ResolveRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}auth\0\u{1}identifier\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._identifier) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._identifier { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Resolver_V1_ResolveRequest, rhs: Flipcash_Resolver_V1_ResolveRequest) -> Bool { - if lhs._auth != rhs._auth {return false} - if lhs._identifier != rhs._identifier {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Resolver_V1_ResolveResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ResolveResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}resolution\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._resolution) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._resolution { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Resolver_V1_ResolveResponse, rhs: Flipcash_Resolver_V1_ResolveResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._resolution != rhs._resolution {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Resolver_V1_ResolveResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0\u{1}DENIED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/settings_v1_settings_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/settings_v1_settings_service.grpc.swift deleted file mode 100644 index 5ef809bb6..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/settings_v1_settings_service.grpc.swift +++ /dev/null @@ -1,185 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: settings/v1/settings_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.settings.v1.Settings - -/// Namespace containing generated types for the "flipcash.settings.v1.Settings" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Settings_V1_Settings { - /// Service descriptor for the "flipcash.settings.v1.Settings" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.settings.v1.Settings") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "UpdateSettings" metadata. - public enum UpdateSettings { - /// Request type for "UpdateSettings". - public typealias Input = Flipcash_Settings_V1_UpdateSettingsRequest - /// Response type for "UpdateSettings". - public typealias Output = Flipcash_Settings_V1_UpdateSettingsResponse - /// Descriptor for "UpdateSettings". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.settings.v1.Settings"), - method: "UpdateSettings" - ) - } - /// Descriptors for all methods in the "flipcash.settings.v1.Settings" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - UpdateSettings.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.settings.v1.Settings" service. - public static let flipcash_settings_v1_Settings = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.settings.v1.Settings") -} - -// MARK: flipcash.settings.v1.Settings (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Settings_V1_Settings { - /// Generated client protocol for the "flipcash.settings.v1.Settings" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "UpdateSettings" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Settings_V1_UpdateSettingsRequest` message. - /// - serializer: A serializer for `Flipcash_Settings_V1_UpdateSettingsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Settings_V1_UpdateSettingsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func updateSettings( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.settings.v1.Settings" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "UpdateSettings" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Settings_V1_UpdateSettingsRequest` message. - /// - serializer: A serializer for `Flipcash_Settings_V1_UpdateSettingsRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Settings_V1_UpdateSettingsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateSettings( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Settings_V1_Settings.Method.UpdateSettings.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Settings_V1_Settings.ClientProtocol { - /// Call the "UpdateSettings" method. - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Settings_V1_UpdateSettingsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateSettings( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.updateSettings( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Settings_V1_Settings.ClientProtocol { - /// Call the "UpdateSettings" method. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateSettings( - _ message: Flipcash_Settings_V1_UpdateSettingsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.updateSettings( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/settings_v1_settings_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/settings_v1_settings_service.pb.swift deleted file mode 100644 index b06ce2f19..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/settings_v1_settings_service.pb.swift +++ /dev/null @@ -1,200 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: settings/v1/settings_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Settings_V1_UpdateSettingsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Locale setting, only updated if present - public var locale: Flipcash_Common_V1_Locale { - get {return _locale ?? Flipcash_Common_V1_Locale()} - set {_locale = newValue} - } - /// Returns true if `locale` has been explicitly set. - public var hasLocale: Bool {return self._locale != nil} - /// Clears the value of `locale`. Subsequent reads from it will return its default value. - public mutating func clearLocale() {self._locale = nil} - - /// Region setting, only updated if present - public var region: Flipcash_Common_V1_Region { - get {return _region ?? Flipcash_Common_V1_Region()} - set {_region = newValue} - } - /// Returns true if `region` has been explicitly set. - public var hasRegion: Bool {return self._region != nil} - /// Clears the value of `region`. Subsequent reads from it will return its default value. - public mutating func clearRegion() {self._region = nil} - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _locale: Flipcash_Common_V1_Locale? = nil - fileprivate var _region: Flipcash_Common_V1_Region? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Settings_V1_UpdateSettingsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Settings_V1_UpdateSettingsResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case invalidLocale // = 2 - case invalidRegion // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .invalidLocale - case 3: self = .invalidRegion - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .invalidLocale: return 2 - case .invalidRegion: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Settings_V1_UpdateSettingsResponse.Result] = [ - .ok, - .denied, - .invalidLocale, - .invalidRegion, - ] - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.settings.v1" - -extension Flipcash_Settings_V1_UpdateSettingsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateSettingsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}locale\0\u{1}region\0\u{2}\u{8}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._locale) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._region) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._locale { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._region { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Settings_V1_UpdateSettingsRequest, rhs: Flipcash_Settings_V1_UpdateSettingsRequest) -> Bool { - if lhs._locale != rhs._locale {return false} - if lhs._region != rhs._region {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Settings_V1_UpdateSettingsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateSettingsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Settings_V1_UpdateSettingsResponse, rhs: Flipcash_Settings_V1_UpdateSettingsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Settings_V1_UpdateSettingsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}INVALID_LOCALE\0\u{1}INVALID_REGION\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_model.pb.swift deleted file mode 100644 index dbb0e018e..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_model.pb.swift +++ /dev/null @@ -1,154 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: thirdparty/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public enum Flipcash_Thirdparty_V1_Provider: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case coinbase // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .coinbase - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .coinbase: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Thirdparty_V1_Provider] = [ - .unknown, - .coinbase, - ] - -} - -public struct Flipcash_Thirdparty_V1_ApiKey: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var provider: Flipcash_Thirdparty_V1_Provider = .unknown - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Flipcash_Thirdparty_V1_Jwt: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.thirdparty.v1" - -extension Flipcash_Thirdparty_V1_Provider: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}COINBASE\0") -} - -extension Flipcash_Thirdparty_V1_ApiKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ApiKey" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}provider\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.provider) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.provider != .unknown { - try visitor.visitSingularEnumField(value: self.provider, fieldNumber: 1) - } - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Thirdparty_V1_ApiKey, rhs: Flipcash_Thirdparty_V1_ApiKey) -> Bool { - if lhs.provider != rhs.provider {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Thirdparty_V1_Jwt: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Jwt" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Thirdparty_V1_Jwt, rhs: Flipcash_Thirdparty_V1_Jwt) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_third_party_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_third_party_service.grpc.swift deleted file mode 100644 index e6f7c4a09..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_third_party_service.grpc.swift +++ /dev/null @@ -1,201 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: thirdparty/v1/third_party_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - flipcash.thirdparty.v1.ThirdParty - -/// Namespace containing generated types for the "flipcash.thirdparty.v1.ThirdParty" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Flipcash_Thirdparty_V1_ThirdParty { - /// Service descriptor for the "flipcash.thirdparty.v1.ThirdParty" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.thirdparty.v1.ThirdParty") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "GetJwt" metadata. - public enum GetJwt { - /// Request type for "GetJwt". - public typealias Input = Flipcash_Thirdparty_V1_GetJwtRequest - /// Response type for "GetJwt". - public typealias Output = Flipcash_Thirdparty_V1_GetJwtResponse - /// Descriptor for "GetJwt". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.thirdparty.v1.ThirdParty"), - method: "GetJwt" - ) - } - /// Descriptors for all methods in the "flipcash.thirdparty.v1.ThirdParty" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - GetJwt.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "flipcash.thirdparty.v1.ThirdParty" service. - public static let flipcash_thirdparty_v1_ThirdParty = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.thirdparty.v1.ThirdParty") -} - -// MARK: flipcash.thirdparty.v1.ThirdParty (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Thirdparty_V1_ThirdParty { - /// Generated client protocol for the "flipcash.thirdparty.v1.ThirdParty" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "GetJwt" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetJwt gets a JWT for auth against a third part - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Thirdparty_V1_GetJwtRequest` message. - /// - serializer: A serializer for `Flipcash_Thirdparty_V1_GetJwtRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Thirdparty_V1_GetJwtResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getJwt( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "flipcash.thirdparty.v1.ThirdParty" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "GetJwt" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetJwt gets a JWT for auth against a third part - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Thirdparty_V1_GetJwtRequest` message. - /// - serializer: A serializer for `Flipcash_Thirdparty_V1_GetJwtRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Thirdparty_V1_GetJwtResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getJwt( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Flipcash_Thirdparty_V1_ThirdParty.Method.GetJwt.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Thirdparty_V1_ThirdParty.ClientProtocol { - /// Call the "GetJwt" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetJwt gets a JWT for auth against a third part - /// - /// - Parameters: - /// - request: A request containing a single `Flipcash_Thirdparty_V1_GetJwtRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getJwt( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getJwt( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Flipcash_Thirdparty_V1_ThirdParty.ClientProtocol { - /// Call the "GetJwt" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetJwt gets a JWT for auth against a third part - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getJwt( - _ message: Flipcash_Thirdparty_V1_GetJwtRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getJwt( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_third_party_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_third_party_service.pb.swift deleted file mode 100644 index f82a557b0..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/Generated/thirdparty_v1_third_party_service.pb.swift +++ /dev/null @@ -1,232 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: thirdparty/v1/third_party_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Flipcash_Thirdparty_V1_GetJwtRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var apiKey: Flipcash_Thirdparty_V1_ApiKey { - get {return _apiKey ?? Flipcash_Thirdparty_V1_ApiKey()} - set {_apiKey = newValue} - } - /// Returns true if `apiKey` has been explicitly set. - public var hasApiKey: Bool {return self._apiKey != nil} - /// Clears the value of `apiKey`. Subsequent reads from it will return its default value. - public mutating func clearApiKey() {self._apiKey = nil} - - public var method: String = String() - - public var host: String = String() - - public var path: String = String() - - public var auth: Flipcash_Common_V1_Auth { - get {return _auth ?? Flipcash_Common_V1_Auth()} - set {_auth = newValue} - } - /// Returns true if `auth` has been explicitly set. - public var hasAuth: Bool {return self._auth != nil} - /// Clears the value of `auth`. Subsequent reads from it will return its default value. - public mutating func clearAuth() {self._auth = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _apiKey: Flipcash_Thirdparty_V1_ApiKey? = nil - fileprivate var _auth: Flipcash_Common_V1_Auth? = nil -} - -public struct Flipcash_Thirdparty_V1_GetJwtResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Flipcash_Thirdparty_V1_GetJwtResponse.Result = .ok - - public var jwt: Flipcash_Thirdparty_V1_Jwt { - get {return _jwt ?? Flipcash_Thirdparty_V1_Jwt()} - set {_jwt = newValue} - } - /// Returns true if `jwt` has been explicitly set. - public var hasJwt: Bool {return self._jwt != nil} - /// Clears the value of `jwt`. Subsequent reads from it will return its default value. - public mutating func clearJwt() {self._jwt = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case denied // = 1 - case unsupportedProvider // = 2 - case invalidApiKey // = 3 - case phoneVerificationRequired // = 4 - case emailVerificationRequired // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .unsupportedProvider - case 3: self = .invalidApiKey - case 4: self = .phoneVerificationRequired - case 5: self = .emailVerificationRequired - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .unsupportedProvider: return 2 - case .invalidApiKey: return 3 - case .phoneVerificationRequired: return 4 - case .emailVerificationRequired: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Thirdparty_V1_GetJwtResponse.Result] = [ - .ok, - .denied, - .unsupportedProvider, - .invalidApiKey, - .phoneVerificationRequired, - .emailVerificationRequired, - ] - - } - - public init() {} - - fileprivate var _jwt: Flipcash_Thirdparty_V1_Jwt? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.thirdparty.v1" - -extension Flipcash_Thirdparty_V1_GetJwtRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetJwtRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}api_key\0\u{1}method\0\u{1}host\0\u{1}path\0\u{1}auth\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._apiKey) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.method) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.host) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.path) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._apiKey { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.method.isEmpty { - try visitor.visitSingularStringField(value: self.method, fieldNumber: 2) - } - if !self.host.isEmpty { - try visitor.visitSingularStringField(value: self.host, fieldNumber: 3) - } - if !self.path.isEmpty { - try visitor.visitSingularStringField(value: self.path, fieldNumber: 4) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Thirdparty_V1_GetJwtRequest, rhs: Flipcash_Thirdparty_V1_GetJwtRequest) -> Bool { - if lhs._apiKey != rhs._apiKey {return false} - if lhs.method != rhs.method {return false} - if lhs.host != rhs.host {return false} - if lhs.path != rhs.path {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Thirdparty_V1_GetJwtResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetJwtResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}jwt\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._jwt) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._jwt { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Flipcash_Thirdparty_V1_GetJwtResponse, rhs: Flipcash_Thirdparty_V1_GetJwtResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._jwt != rhs._jwt {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Flipcash_Thirdparty_V1_GetJwtResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}UNSUPPORTED_PROVIDER\0\u{1}INVALID_API_KEY\0\u{1}PHONE_VERIFICATION_REQUIRED\0\u{1}EMAIL_VERIFICATION_REQUIRED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/account/v1/flipcash_account_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/account/v1/flipcash_account_service.proto deleted file mode 100644 index 387a03d35..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/account/v1/flipcash_account_service.proto +++ /dev/null @@ -1,184 +0,0 @@ -syntax = "proto3"; - -package flipcash.account.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/account/v1;acountpb"; -option java_package = "com.codeinc.flipcash.gen.account.v1"; -option objc_class_prefix = "FPBAccountV1"; - -import "common/v1/common.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -service Account { - // Register registers a new user, bound to the provided PublicKey. - // If the PublicKey is already in use, the previous user account is returned. - rpc Register(RegisterRequest) returns (RegisterResponse); - - // Login retrieves the UserId (and in the future, potentially other information) - // required for 'recovering' an account. - rpc Login(LoginRequest) returns (LoginResponse); - - // GetUserFlags gets user-specific flags. - rpc GetUserFlags(GetUserFlagsRequest) returns (GetUserFlagsResponse); - - // GetUserFlags gets user flags for unauthenticated users - rpc GetUnauthenticatedUserFlags(GetUnauthenticatedUserFlagsRequest) returns (GetUnauthenticatedUserFlagsResponse); -} - -message RegisterRequest { - // PublicKey the public key that is authorized to perform actions on the - // registered users behalf. - common.v1.PublicKey public_key = 1 [(validate.rules).message.required = true]; - - // Signature of this message (without the signature), using the provided keypair. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; -} -message RegisterResponse { - Result result = 1; - enum Result { - OK = 0; - INVALID_SIGNATURE = 1; - DENIED = 2; - } - - // The UserId associated with the account. - common.v1.UserId user_id = 2; -} - -message LoginRequest { - // Timestamp is the timestamp the request was generated - // - // The server may reject the request if the timestamp is too far off - // the current (server) time. This is to prevent replay attacks. - google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; -} -message LoginResponse { - Result result = 1; - enum Result { - OK = 0; - INVALID_TIMESTAMP = 1; - DENIED = 2; - } - - common.v1.UserId user_id = 2; -} - -message GetUserFlagsRequest { - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; - - common.v1.Platform platform = 3; - - common.v1.CountryCode country_code = 4; -} -message GetUserFlagsResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - UserFlags user_flags = 2; -} - -message GetUnauthenticatedUserFlagsRequest { - common.v1.Platform platform = 1; - - common.v1.CountryCode country_code = 2; -} -message GetUnauthenticatedUserFlagsResponse { - Result result = 1; - enum Result { - OK = 0; - } - - UserFlags user_flags = 2; -} - -message UserFlags { - // Is this a fully registered account using IAP for account creation? - bool is_registered_account = 1; - - // Is this user associated with a Flipcash staff member? - bool is_staff = 2; - - // Does this user require IAP for registration in the account creation flow? - bool requires_iap_for_registration = 3; - - enum OnRampProvider { - UNKNOWN_ON_RAMP_PROVIDER = 0; - COINBASE_VIRTUAL = 1; - COINBASE_PHYSICAL_DEBIT = 2; - COINBASE_PHYSICAL_CREDIT = 3; - MANUAL_DEPOSIT = 4; - PHANTOM = 5; - SOLFLARE = 6; - BACKPACK = 7; - BASE = 8; - } - - // The set of supported on ramp providers for the user, based on their platform - // and locale if provided - repeated OnRampProvider supported_on_ramp_providers = 4 [(validate.rules).repeated = { - min_items: 0 - max_items: 256 - }]; - - // The preferred on ramp provider for this user. If the value is UNKNOWN, client - // should show the list of all supported providers. - OnRampProvider preferred_on_ramp_provider = 5; - - // The minumum build number for this user. If their build number is less than the - // provided value, client should show a forced upgrade screen. - uint32 min_build_number = 6; - - // Exchange data timeout for sequential give/grabs for bills - google.protobuf.Duration bill_exchange_data_timeout = 7; - - // USDF amount, in quarks, that must be purchased when launching a new currency - uint64 new_currency_purchase_amount = 8; - - // USDF amount, in quarks, that must be paid in a fee when launching a new currency - uint64 new_currency_fee_amount = 9; - - // USDF amount, in quarks, that must be paid when doing a withdrawal - uint64 withdrawal_fee_amount = 10; - - enum UsdcLiquidityPool { - UNKNOWN_USDC_LIQUIDITY_POOL = 0; - FLIPCASH = 1; - COINBASE_STABLE_SWAPPER = 2; - } - - // The preferred USDC liquidity pool for external wallet on ramp flows - UsdcLiquidityPool preferred_on_ramp_usdc_liquidity_pool = 11; - - // Whether the send by phone number feature is enabled - bool enable_phone_number_send = 12; - - // USDF amount, in quarks, that a user must hold to be counted as a holder on the leaderboard - uint64 minimum_holder_value = 13; - - // Whether email verification is required for Coinbase purchase flows - bool require_coinbase_email_verification = 14; - - // Tip presets for all currencies - repeated TipPresets tip_presets = 15; - - // USDF amount, in quarks, that must be held across all currencies in order to set a username - uint64 username_min_balance = 16; -} - -message TipPresets { - common.v1.Region region = 1 [(validate.rules).message.required = true]; - - double minimum = 2; - double low = 3; - double medium = 4; - double high = 5; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/activity/v1/activity_feed_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/activity/v1/activity_feed_service.proto deleted file mode 100644 index 8d847d9d8..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/activity/v1/activity_feed_service.proto +++ /dev/null @@ -1,88 +0,0 @@ -syntax = "proto3"; - -package flipcash.activity.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/activity/v1;activitypb"; -option java_package = "com.codeinc.flipcash.gen.activity.v1"; -option objc_class_prefix = "FPBActivityV1"; - -import "activity/v1/model.proto"; -import "common/v1/common.proto"; -import "validate/validate.proto"; - -service ActivityFeed { - // GetLatestNotifications gets the latest N notifications in a user's - // activity feed. Results will be ordered by descending timestamp. - rpc GetLatestNotifications(GetLatestNotificationsRequest) returns (GetLatestNotificationsResponse); - - // GetPagedNotifications gets all notifications using a paging API. - rpc GetPagedNotifications(GetPagedNotificationsRequest) returns (GetPagedNotificationsResponse); - - // GetBatchNotifications gets a batch of notifications by ID. - rpc GetBatchNotifications(GetBatchNotificationsRequest) returns (GetBatchNotificationsResponse); -} - -message GetLatestNotificationsRequest { - // The activity feed to fetch notifications from - ActivityFeedType type = 1 [(validate.rules).enum.in = 1]; - - // Maximum number of notifications to return. If <= 0, the server default is used - int32 max_items = 2 [(validate.rules).int32.lte = 1024]; - - common.v1.Auth auth = 3 [(validate.rules).message.required = true]; -} - -message GetLatestNotificationsResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - repeated Notification notifications = 2 [(validate.rules).repeated = { - max_items: 1024 - }]; -} - -message GetPagedNotificationsRequest { - // The activity feed to fetch notifications from - ActivityFeedType type = 1 [(validate.rules).enum.in = 1]; - - common.v1.QueryOptions query_options = 2 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 3 [(validate.rules).message.required = true]; -} - -message GetPagedNotificationsResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - repeated Notification notifications = 2 [(validate.rules).repeated = { - max_items: 1024 - }]; -} - -message GetBatchNotificationsRequest { - repeated NotificationId ids = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 - }]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; -} - -message GetBatchNotificationsResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - NOT_FOUND = 2; - } - - repeated Notification notifications = 2 [(validate.rules).repeated = { - max_items: 1024 - }]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/activity/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/activity/v1/model.proto deleted file mode 100644 index 1b92ef18b..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/activity/v1/model.proto +++ /dev/null @@ -1,158 +0,0 @@ -syntax = "proto3"; - -package flipcash.activity.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/activity/v1;activitypb"; -option java_package = "com.codeinc.flipcash.gen.activity.v1"; -option objc_class_prefix = "FCPBActivityV1"; - -import "common/v1/common.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -// The ID of the notification -message NotificationId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// Notification is a message that is displayed in an activity feed -message Notification { - // The ID of this notification - NotificationId id = 1 [(validate.rules).message.required = true]; - - // The localized title text for the notification - string localized_text = 2 [(validate.rules).string = { - min_len: 1 - max_len: 256 - }]; - - // If a payment applies, the amount that was paid - // - // Note: For multi-mint operations, amounts are carried in additional_metadata - // (eg. swapped_crypto). - common.v1.CryptoPaymentAmount payment_amount = 3; - - // The timestamp of this notification - google.protobuf.Timestamp ts = 4 [(validate.rules).timestamp.required = true]; - - // The state of this notification - NotificationState state = 5 [(validate.rules).enum.not_in = 0]; - - // Additional metadata for this notification specific to the notification - oneof additional_metadata { - DirectlySentCryptoNotificationMetadata directly_sent_crypto = 7; - ReceivedCryptoNotificationMetadata received_crypto = 8; - WithdrewCryptoNotificationMetadata withdrew_crypto = 9; - IndirectlySentCryptoNotificationMetadata indirectly_sent_crypto = 10; - DepositedCryptoNotificationMetadata deposited_crypto = 11; - BoughtCryptoNotificationMetadata bought_crypto = 12 [deprecated = true]; - SoldCryptoNotificationMetadata sold_crypto = 13 [deprecated = true]; - SwappedCryptoNotificationMetadata swapped_crypto = 14; - } - - reserved 6; // Deprecated WelcomeBonusNotificationMetadata - - // Ordered substitutions to apply to localized_text - repeated common.v1.Substitution text_substitutions = 100; -} - -message DirectlySentCryptoNotificationMetadata { - oneof destination_identifier { - common.v1.PhoneNumber phone = 1; - common.v1.UserId user_id = 2; - } -} - -message ReceivedCryptoNotificationMetadata { - oneof source_identifier { - common.v1.PhoneNumber phone = 1; - common.v1.UserId user_id = 2; - } -} - -message WithdrewCryptoNotificationMetadata { - // Deprecated in favour of swap_metadata - SwapState swap_state = 1 [(validate.rules).enum.not_in = 0]; - - // When a withdraw is a swap, the metadata for that swap - SwappedCryptoNotificationMetadata swap_metadata = 2; -} - -message IndirectlySentCryptoNotificationMetadata { - // The vault of the gift card account that was created for the cash link - common.v1.PublicKey vault = 1 [(validate.rules).message.required = true]; - - // Whether the cancel action can be initiated by the user - bool can_initiate_cancel_action = 2; -} - -message DepositedCryptoNotificationMetadata { -} - -// Deprecated: Use SwappedCryptoNotificationMetadata, which models both halves -// of the swap in a single notification. -message BoughtCryptoNotificationMetadata { - SwapState swap_state = 1 [(validate.rules).enum.not_in = 0]; -} - -// Deprecated: Use SwappedCryptoNotificationMetadata, which models both halves -// of the swap in a single notification. -message SoldCryptoNotificationMetadata { - SwapState swap_state = 1 [(validate.rules).enum.not_in = 0]; -} - -// SwappedCryptoNotificationMetadata represents a swap between two mints as a -// single notification. It supersedes BoughtCryptoNotificationMetadata and -// SoldCryptoNotificationMetadata, which modelled the two halves of a swap as -// separate notifications. -message SwappedCryptoNotificationMetadata { - // The amount the user gave up in the source mint - common.v1.CryptoPaymentAmount from = 1 [(validate.rules).message.required = true]; - - // What the user received in the destination mint. The mint is always known, - // but the amount is only known once the swap has executed. - oneof to { - option (validate.required) = true; - - // The destination mint, when the amount isn't yet known - common.v1.PublicKey to_mint = 2; - - // The amount the user received in the destination mint - common.v1.CryptoPaymentAmount to_amount = 3; - } - - // The fee charged for the swap, which is known upfront and is set regardless - // of the state of the swap - common.v1.FiatPaymentAmount fee = 4 [(validate.rules).message.required = true]; - - // The state of the swap as a whole - SwapState swap_state = 5 [(validate.rules).enum.not_in = 0]; -} - -// ActivityFeedType enables multiple activity feeds, where notifications may be -// split across different parts of the app -enum ActivityFeedType { - UNKNOWN = 0; - TRANSACTION_HISTORY = 1; // Activity feed displayed under the Balance tab -} - -// NotificationState determines the mutability of a notification, and whether -// client should attempt to refetch state. -enum NotificationState { - NOTIFICATION_STATE_UNKNOWN = 0; - // Notification state will change based on some app action in the future - NOTIFICATION_STATE_PENDING = 1; - // Notification state will not change - NOTIFICATION_STATE_COMPLETED = 2; -} - -enum SwapState { - SWAP_STATE_UNKNOWN = 0; - SWAP_STATE_PENDING = 1; - SWAP_STATE_SUCCEEDED = 2; - SWAP_STATE_FAILED = 3; - SWAP_STATE_NONE = 4; -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blob/v1/blob_storage_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blob/v1/blob_storage_service.proto deleted file mode 100644 index 7e64f23cd..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blob/v1/blob_storage_service.proto +++ /dev/null @@ -1,152 +0,0 @@ -syntax = "proto3"; - -package flipcash.blob.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/blob/v1;blobpb"; -option java_package = "com.codeinc.flipcash.gen.blob.v1"; -option objc_class_prefix = "FPBBlobV1"; - -import "blob/v1/model.proto"; -import "common/v1/common.proto"; -import "validate/validate.proto"; - -// BlobStorage manages direct-to-storage uploads and authorized, time-limited reads -// of the bytes behind MediaItem renditions (and other blobs). Clients upload bytes -// straight to object storage via a presigned target — the server never proxies -// them — and all blob metadata is server-derived from the stored bytes. -service BlobStorage { - // GetUploadPolicy returns the current upload constraints — which MIME types - // are accepted and the per-type ceilings the server enforces — so the client - // can validate (and resize/transcode) BEFORE reserving an upload. The policy - // is advisory and cacheable; InitiateExternalUpload remains authoritative and - // may still deny. Clients re-fetch when version changes or ttl lapses. - rpc GetUploadPolicy(GetUploadPolicyRequest) returns (GetUploadPolicyResponse); - - // InitiateExternalUpload reserves a BlobId and returns a short-lived presigned - // target the client uploads the bytes to directly. Clients only ever upload - // ORIGINALs; the server derives any additional renditions itself. - rpc InitiateExternalUpload(InitiateExternalUploadRequest) returns (InitiateExternalUploadResponse); - - // CompleteExternalUpload is an ADVISORY signal that the client finished uploading, - // letting the server finalize (validate, derive metadata, transcode - // renditions, moderate) without waiting for the storage-completion event. - // It is idempotent; if never called, the storage event finalizes the blob - // anyway. Clients must not depend on it for correctness. - rpc CompleteExternalUpload(CompleteExternalUploadRequest) returns (CompleteExternalUploadResponse); - - // GetBlobs resolves known BlobIds to their current status and metadata, - // minting a FRESH, short-lived download_url for each READY blob. Clients - // call it to reissue a URL that has expired — the BlobId is the durable - // handle; the URL is disposable. A caller must set GetBlobsRequest.context - // to the surface it is reading from (e.g. a chat) to authorize blobs it - // does not own. - rpc GetBlobs(GetBlobsRequest) returns (GetBlobsResponse); -} - -message GetUploadPolicyRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; -} - -message GetUploadPolicyResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - // The constraints in force for the caller. Set when result == OK. - UploadPolicy policy = 2; -} - -message InitiateExternalUploadRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - // Declared MIME type of the bytes the client intends to upload. The server - // pins it into the signed upload policy (storage rejects a mismatched - // Content-Type) and re-derives it authoritatively from the bytes after - // upload. A hint that constrains the upload, never blindly trusted. - string mime_type = 2 [(validate.rules).string = { - min_len: 1 - max_len: 255 - }]; - - // Declared byte size. The server bakes it into the policy's - // content-length-range so storage rejects an upload that exceeds it. - uint64 size_bytes = 3 [(validate.rules).uint64.gte = 1]; -} - -message InitiateExternalUploadResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - UNSUPPORTED_TYPE = 2; // MIME type not accepted - TOO_LARGE = 3; // declared size over the per-type ceiling - QUOTA_EXCEEDED = 4; // caller is over their storage/upload quota - } - - // Server-assigned handle. On OK the client references this as the ORIGINAL - // rendition's blob_id on SendMessage. - BlobId blob_id = 2; - - // Where and how to upload the bytes. Set only when result == OK. - UploadTarget upload_target = 3; - - // On a policy-driven denial (UNSUPPORTED_TYPE / TOO_LARGE), the UploadPolicy - // version in force, so the client can detect a stale cached policy and - // re-fetch. Unset otherwise. - PolicyVersion policy_version = 4; -} - -message CompleteExternalUploadRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - // The blob whose upload just finished. - BlobId blob_id = 2 [(validate.rules).message.required = true]; -} - -message CompleteExternalUploadResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; // no pending blob with this id for the caller - NOT_UPLOADED = 2; // bytes not present / upload incomplete - } - - // Blob state after this call (often still PROCESSING). - BlobStatus status = 2; - - // Why the blob was rejected. Set only when status == REJECTED. - RejectionMetadata rejection_metadata = 3; -} - -message GetBlobsRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - // The blobs to resolve. - BlobIdBatch blob_ids = 2 [(validate.rules).message.required = true]; - - // The surface the caller is accessing these blobs from. When set, the - // server authorizes the entire batch through this single context, turning - // the read into a direct membership check instead of a search across the - // blob's grants. - // - // OPTIONAL on the wire, but REQUIRED in practice for any blob the caller - // does not OWN: blobs the caller owns resolve without a context, while a - // non-owned id is treated as unauthorized (and omitted from the response) - // unless a context that authorizes it is supplied. A caller reading only - // its own blobs may omit it, so existing owner-only clients are unaffected. - AccessContext context = 3; -} - -message GetBlobsResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - // The resolved blobs. Unknown or unauthorized ids are omitted; the batch - // is left unset (not empty) when none resolve. - BlobBatch blobs = 2; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blob/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blob/v1/model.proto deleted file mode 100644 index af8c41c18..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blob/v1/model.proto +++ /dev/null @@ -1,326 +0,0 @@ -syntax = "proto3"; - -package flipcash.blob.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/blob/v1;blobpb"; -option java_package = "com.codeinc.flipcash.gen.blob.v1"; -option objc_class_prefix = "FPBBlobV1"; - -import "common/v1/common.proto"; -import "moderation/v1/model.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -// Opaque, client-held handle to a stored blob. This is the durable identity for -// the bytes; the bytes it points at are immutable once the upload is finalized. -message BlobId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 16 - max_len: 16 - }]; -} - -// A batch of BlobIds -message BlobIdBatch { - repeated BlobId blob_ids = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 - }]; -} - -// Lifecycle state of a blob. -enum BlobStatus { - BLOB_STATUS_UNKNOWN = 0; - BLOB_STATUS_PENDING = 1; // reserved; awaiting the client's upload - BLOB_STATUS_PROCESSING = 2; // bytes present; deriving metadata / transcoding / moderating - BLOB_STATUS_READY = 3; // available; metadata populated and moderation passed - BLOB_STATUS_REJECTED = 4; // failed validation or moderation; not servable -} - -// A blob's current status, plus its metadata once READY — or, once REJECTED, -// the reason it was rejected. -message Blob { - BlobId id = 1 [(validate.rules).message.required = true]; - - BlobStatus status = 2; - - // Server-authoritative metadata, including a freshly minted download_url. - // Set only when status == READY. - BlobMetadata metadata = 3; - - // Why the blob was rejected. Set only when status == REJECTED. - RejectionMetadata rejection = 4; -} - -// A batch of Blobs. -message BlobBatch { - repeated Blob blobs = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 - }]; -} - -// Server-authoritative metadata describing a stored blob. Never set by clients. -// With the exception of download_url, every field is intrinsic to the stored -// bytes and immutable, derived once by the server. -message BlobMetadata { - // MIME type (e.g. "image/jpeg"). - string mime_type = 1 [(validate.rules).string = { - min_len: 1 - max_len: 255 - }]; - - // Total size of the blob in bytes. - uint64 size_bytes = 2 [(validate.rules).uint64.gte = 1]; - - // Ephemeral, server-minted URL for fetching the blob bytes, together with - // the instant it expires. Re-issued on every fetch — see DownloadUrl. - DownloadUrl download_url = 3 [(validate.rules).message.required = true]; - - // Kind-specific metadata the server derived from the bytes. Exactly one - // variant is set for a recognized media kind; left unset for opaque blobs. - // Only images are supported today; video/audio/etc. will be added as new - // variants. - oneof kind { - ImageMetadata image = 4; - } -} - -// Intrinsic descriptors for a still image. -message ImageMetadata { - // Pixel dimensions, for reserving layout before the bytes arrive. - uint32 width = 1 [(validate.rules).uint32.gte = 1]; - uint32 height = 2 [(validate.rules).uint32.gte = 1]; - - // Compact preview shown while the full image downloads (BlurHash string). - string blurhash = 3 [(validate.rules).string.max_len = 64]; -} - -// One logical piece of media — a chat image, a profile picture — carried as the -// set of renditions it is stored as. Distinct from Blob: a Blob is ONE stored -// object, while a Media is the several stored objects that together represent -// the same content at different qualities/sizes. -// -// Wherever a surface attaches media, it embeds this type: the client uploads a -// single ORIGINAL and the server derives the rest, identically everywhere. -message Media { - // The renditions of this media, each an independently-stored blob. When a - // client attaches media (e.g. SendMessage, SetProfilePicture) it supplies - // exactly one ORIGINAL rendition (its blob_id); the server fills that - // rendition's metadata and appends any derived renditions (e.g. a - // downscaled DISPLAY and a THUMBNAIL). - repeated Rendition renditions = 1 [(validate.rules).repeated = { - min_items: 1 - }]; -} - -// A single stored variant of a Media. -message Rendition { - // The intended use of this rendition within the media. - Role role = 1 [(validate.rules).enum = { - not_in: [0] - }]; - enum Role { - UNKNOWN = 0; - ORIGINAL = 1; // full-quality source the client uploaded - DISPLAY = 2; // downscaled/compressed for inline display - THUMBNAIL = 3; // tiny preview (grid cell, avatar, ...) - } - - // Handle to the blob holding this rendition's bytes. Client-set on the - // ORIGINAL when attaching the media; server-set for derived renditions. - BlobId blob_id = 2 [(validate.rules).message.required = true]; - - // Server-authoritative blob metadata (mime type, size, download URL, and - // the image dimensions/preview), resolved from the blob record. Omitted on - // the request that attaches the media and populated on returned copies. - // - // If unavailable at the time the media is retrieved, the client can use - // GetBlobs to query for the blob metadata. - BlobMetadata blob = 3; -} - -// The constraints the server enforces on uploads, surfaced so clients can -// validate and resize/transcode before reserving an upload. Advisory and -// cacheable; InitiateExternalUpload remains authoritative. Constraints can -// depend on the caller (quota, tier), so this is fetched per-user, not static. -message UploadPolicy { - // Opaque generation token for this policy. Clients cache the policy under it - // and re-fetch when they observe a different version — including one echoed - // on a denied upload. - PolicyVersion version = 1 [(validate.rules).message.required = true]; - - // How long the client may rely on this policy before re-fetching. The client - // should also refresh on any version mismatch, whichever comes first. - google.protobuf.Duration ttl = 2 [(validate.rules).duration.required = true]; - - // Per-MIME-type constraints, ordered MOST SPECIFIC FIRST. The client picks - // the FIRST entry whose mime_type_pattern matches the bytes' declared MIME - // type; later entries (e.g. "image/*", then "*/*") act as fallbacks. An - // upload whose type matches no entry is not accepted. - repeated MimeTypeConstraints mime_type_constraints = 3 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 - }]; -} - -// Opaque generation token identifying a snapshot of an UploadPolicy. Compared -// by equality, never parsed; clients cache the policy under it and re-fetch when -// they observe a different value (including one echoed on a denied upload). -message PolicyVersion { - string value = 1 [(validate.rules).string = { - min_len: 1 - max_len: 256 - }]; -} - -// Upload constraints for one MIME-type matcher. -message MimeTypeConstraints { - // The MIME type(s) this entry governs: an exact type ("image/jpeg"), a - // subtype wildcard ("image/*"), or the catch-all "*/*". - string mime_type_pattern = 1 [(validate.rules).string = { - min_len: 3 - max_len: 255 - }]; - - // Hard ceiling on a matching blob's byte size. - uint64 max_size_bytes = 2 [(validate.rules).uint64.gte = 1]; - - // Kind-specific bounds, mirroring BlobMetadata.kind. Set the variant for the - // pattern's media kind; left unset for opaque blobs. - oneof kind { - ImageConstraints image = 3; - } -} - -// Bounds on a still image, mirroring ImageMetadata. -message ImageConstraints { - // Max pixel dimensions the server will accept (or downscale to). - uint32 max_width = 1 [(validate.rules).uint32.gte = 1]; - uint32 max_height = 2 [(validate.rules).uint32.gte = 1]; - - // Max total pixel count (width * height), guarding against decompression - // bombs that slip under the per-axis caps. - uint64 max_pixels = 3 [(validate.rules).uint64.gte = 1]; -} - -// A short-lived, presigned target for a direct-to-storage upload. Bearer -// credential: anyone holding it can upload to the reserved key until it expires -// — the client must not share or persist it. -// -// Provider-agnostic by design: it describes the HTTP request the client must -// make, with all signed material opaque to the client. Today the server mints -// S3 POST policies (method POST with form_fields); the same shape also -// expresses presigned PUT (S3/GCS) and Azure SAS without a contract change. -message UploadTarget { - // How the client issues the upload request. - Method method = 1 [(validate.rules).enum = { - not_in: [0] - }]; - enum Method { - UNKNOWN = 0; - PUT = 1; // raw-body upload - POST = 2; // multipart/form-data carrying form_fields - } - - // Signed URL to send the request to. For PUT-style uploads this often - // already carries the signature in its query string (presigned PUT, SAS). - string url = 2 [(validate.rules).string = { - uri: true - max_len: 2048 - }]; - - // Headers the client MUST send verbatim (e.g. Content-Type, x-ms-blob-type, - // and any signed headers the presign requires). - map headers = 3; - - // For method == POST: multipart/form-data fields sent before the file part, - // carrying the server-chosen key and the SIGNED policy that storage enforces - // (Content-Type, content-length-range, key prefix, ...). The client cannot - // alter them without invalidating the signature. Empty for PUT uploads. - map form_fields = 4; - - // When the target expires; after this the client must call InitiateUpload - // again for a fresh one. - google.protobuf.Timestamp expires_at = 5 [(validate.rules).timestamp.required = true]; -} - -// An ephemeral, server-minted URL for fetching the blob bytes, paired with the -// instant it expires. Unlike the intrinsic blob metadata, the URL is NOT a -// property of the bytes: it is re-issued on every fetch, expires (signed URL -// with a short TTL), and is authorized at mint time, not at fetch time. Clients -// MUST NOT persist or cache it across fetches; treat the BlobId as the durable -// handle and this as disposable. -message DownloadUrl { - // Signed URL for fetching the blob bytes. - string url = 1 [(validate.rules).string = { - uri: true - max_len: 2048 - }]; - - // When the URL expires; after this the client must call GetBlobs again to - // mint a fresh one. - google.protobuf.Timestamp expires_at = 2 [(validate.rules).timestamp.required = true]; -} - -// Explains why a blob was rejected during finalization. Set on a Blob only when -// status == REJECTED. Rejection is TERMINAL: the bytes behind a BlobId are -// immutable, so this id will never become READY — to try again the client must -// reserve a fresh upload via InitiateExternalUpload. -message RejectionMetadata { - // The top-level reason finalization failed. - RejectionReason reason = 1 [(validate.rules).enum = { - not_in: [0] - }]; - - // The best-fit category that tripped moderation, mirroring the Moderation - // service's vocabulary. Set only when reason == REJECTION_REASON_MODERATION; - // NONE otherwise. - moderation.v1.FlaggedCategory flagged_category = 2; -} - -// Why a blob failed finalization, after its bytes were uploaded. Distinct from -// the pre-upload denials in InitiateExternalUploadResponse.Result, which reject -// before any bytes are stored. -enum RejectionReason { - REJECTION_REASON_UNKNOWN = 0; - REJECTION_REASON_MODERATION = 1; // tripped content moderation; see flagged_category - REJECTION_REASON_UNSUPPORTED_TYPE = 2; // MIME type derived from the bytes is not accepted - REJECTION_REASON_MISMATCHED_TYPE = 3; // derived type didn't match the declared mime_type - REJECTION_REASON_TOO_LARGE = 4; // stored bytes exceeded the per-type ceiling - REJECTION_REASON_CORRUPT = 5; // bytes unreadable; failed to decode or transcode - REJECTION_REASON_INTERNAL = 6; // server-side processing error - REJECTION_REASON_PRIVACY_METADATA = 7; // blob contains privacy metadata that was not stripped -} - -// AccessContext names the surface a caller is accessing blobs THROUGH on a -// request — the "place" the read is happening from. It is the extension point -// for blob authorization contexts: each scope maps to a server-side membership -// check (e.g. a chat scope authorizes the caller iff they belong to that chat -// AND the blob was shared into it). -// -// It is a hint that can only ever NARROW a read, never widen it: the server -// still independently verifies both that the blob is granted to the named scope -// and that the caller belongs to it. A caller never needs a context to read -// blobs it OWNS, but does need one for any blob it does not own. New surfaces (a -// feed, a profile, a public link) are added as new arms of `scope` without -// changing any request plumbing. -message AccessContext { - oneof scope { - option (validate.required) = true; - - // The caller is accessing these blobs from within this chat. Authorized - // iff the caller is a member of the chat and the blob was shared into it. - common.v1.ChatId chat = 1 [(validate.rules).message.required = true]; - - // The caller is accessing these blobs from this user's public profile. - // Authorized iff the blob is a rendition of that user's CURRENT profile - // picture — a profile grants nothing else, and a superseded picture's - // renditions stop resolving through it. - // - // A caller never needs this for its OWN profile picture, since it owns - // those blobs. - common.v1.UserId profile = 2 [(validate.rules).message.required = true]; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blocklist/v1/blocklist_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blocklist/v1/blocklist_service.proto deleted file mode 100644 index c0ed1ba46..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blocklist/v1/blocklist_service.proto +++ /dev/null @@ -1,116 +0,0 @@ -syntax = "proto3"; - -package flipcash.blocklist.v1; - -import "blocklist/v1/model.proto"; -import "common/v1/common.proto"; -import "validate/validate.proto"; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/blocklist/v1;blocklistpb"; -option java_package = "com.codeinc.flipcash.gen.blocklist.v1"; -option objc_class_prefix = "FPBBlocklistV1"; - -// Blocklist manages the set of users a user has blocked. -service Blocklist { - // BlockUser adds a user to the caller's blocklist. Blocking a user that - // is already blocked is a no-op and returns OK. - rpc BlockUser(BlockUserRequest) returns (BlockUserResponse); - - // UnblockUser removes a user from the caller's blocklist. Unblocking a - // user that isn't blocked is a no-op and returns OK. - rpc UnblockUser(UnblockUserRequest) returns (UnblockUserResponse); - - // IsBlocked checks whether a user is on the caller's blocklist. - rpc IsBlocked(IsBlockedRequest) returns (IsBlockedResponse); - - // GetBlocklist gets the caller's blocklist using a paged API, ordered by - // most recently blocked first. - rpc GetBlocklist(GetBlocklistRequest) returns (GetBlocklistResponse); -} - -message BlockUserRequest { - // The user to block - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message BlockUserResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - // The user to block doesn't exist - USER_NOT_FOUND = 2; - // Users cannot block themselves - CANNOT_BLOCK_SELF = 3; - } -} - -message UnblockUserRequest { - // The user to unblock - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message UnblockUserResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } -} - -message IsBlockedRequest { - // The user to check against the caller's blocklist - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message IsBlockedResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - // Whether the user is on the caller's blocklist. Set when result is OK. - bool is_blocked = 2; -} - -message GetBlocklistRequest { - // QueryOptions controls page_size. Ordering is fixed to most recently - // blocked first and is not client-selectable. - // - // Leave query_options.paging_token unset on the first request. On every - // subsequent request, set query_options.paging_token to the paging_token - // from the most recent response to advance to the next page. The token is - // opaque and server-generated; do not construct it. - common.v1.QueryOptions query_options = 1; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message GetBlocklistResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - repeated BlockedUser blocked_users = 2 [(validate.rules).repeated = { - min_items: 0 - max_items: 100 - }]; - - // PagingToken is the server-generated cursor for this paginated read. The - // client MUST send the most recent value back in query_options.paging_token - // on the next GetBlocklistRequest. Set when result is OK. - common.v1.PagingToken paging_token = 3; - - // HasMore indicates whether further pages remain. When true, the client - // should issue another GetBlocklistRequest with the returned paging_token. - bool has_more = 4; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blocklist/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blocklist/v1/model.proto deleted file mode 100644 index d3a76426e..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/blocklist/v1/model.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package flipcash.blocklist.v1; - -import "common/v1/common.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/blocklist/v1;blocklistpb"; -option java_package = "com.codeinc.flipcash.gen.blocklist.v1"; -option objc_class_prefix = "FPBBlocklistV1"; - -// BlockedUser is a single entry in a user's blocklist -message BlockedUser { - // The user that is blocked - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - // Timestamp when the user was blocked - google.protobuf.Timestamp blocked_at = 2 [(validate.rules).timestamp.required = true]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/chat/v1/chat_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/chat/v1/chat_service.proto deleted file mode 100644 index eb8ea8019..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/chat/v1/chat_service.proto +++ /dev/null @@ -1,106 +0,0 @@ -syntax = "proto3"; - -package flipcash.chat.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/chat/v1;chatpb"; -option java_package = "com.codeinc.flipcash.gen.chat.v1"; -option objc_class_prefix = "FPBChatV1"; - -import "chat/v1/model.proto"; -import "common/v1/common.proto"; -import "validate/validate.proto"; - -service Chat { - // GetChat returns the metadata for a specific chat - rpc GetChat(GetChatRequest) returns (GetChatResponse); - - // GetDmChatFeed gets the set of DM chats for an owner account using - // a paged API, ordered by last activity with the most recent first. - // - // Chats are ordered by a mutable key (last_activity), so pagination alone - // cannot guarantee a complete read: a chat can receive new activity and - // move into a region the client has already paged past. To get the full - // list, the client MUST combine this RPC with the event stream: - // - // 1. Open the event stream to receive ChatUpdate and begin buffering updates - // BEFORE the first GetDmChatFeed call. This ordering is the contract that - // closes the gap; subscribing after pagination starts can drop chats. - // 2. Page through GetDmChatFeed to exhaustion (until has_more is false), - // always echoing back the paging token returned by the prior response. - // All pages are served against a single snapshot pinned by that token, - // so the set is read consistently. - // 3. Merge the buffered and ongoing stream updates onto the paginated - // set. Any chat whose activity changed after the snapshot watermark - // is delivered via the stream rather than via pagination. - // - // Read together, pagination guarantees the set (every chat exactly once) - // and the stream guarantees freshness and ordering. The local last_activity - // sort is maintained by the client from the stream after the initial read. - rpc GetDmChatFeed(GetDmChatFeedRequest) returns (GetDmChatFeedResponse); -} - -message GetChatRequest { - common.v1.ChatId chat_id = 1; - - common.v1.Auth auth = 10; -} - -message GetChatResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - NOT_FOUND = 2; - } - - Metadata metadata = 2; -} - -message GetDmChatFeedRequest { - // QueryOptions controls page_size. Ordering is fixed to most-recent - // activity first and is not client-selectable. - // - // Leave query_options.paging_token unset on the first request: the server - // mints a token that pins a new snapshot and returns it in the response. On - // every subsequent request, set query_options.paging_token to the - // paging_token from the most recent response to advance within the same - // snapshot. The token is opaque and server-generated; do not construct it. - common.v1.QueryOptions query_options = 1; - - // The type of DM chat to filter for - // - // For backwards compatiblity, UNKNOWN maps to CONTACT_DM for legacy clients - ChatType dm_chat_type = 2 [(validate.rules).enum = { - in: [0, 1, 2] // UNKNOWN, CONTACT_DM, TIP_DM - }]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message GetDmChatFeedResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - NOT_FOUND = 2; - } - - repeated Metadata chats = 2 [(validate.rules).repeated = { - min_items: 0 - max_items: 100 - }]; - - // PagingToken is the server-generated token for this paginated read. On the - // first response it pins a new snapshot; on later responses it carries the - // advanced cursor over (last_activity, chat_id). The client MUST send the - // most recent value back in query_options.paging_token on the next - // GetDmChatFeedRequest. Set when result is OK. - common.v1.PagingToken paging_token = 3; - - // HasMore indicates whether further pages remain in this snapshot. When - // false, the paginated set has been fully read; the complete chat list is - // this set reconciled with the event stream (see GetDmChatFeed). When true, the - // client should issue another GetDmChatFeedRequest with the returned - // paging_token. - bool has_more = 4; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/chat/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/chat/v1/model.proto deleted file mode 100644 index d654e684b..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/chat/v1/model.proto +++ /dev/null @@ -1,98 +0,0 @@ -syntax = "proto3"; - -package flipcash.chat.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/chat/v1;chatpb"; -option java_package = "com.codeinc.flipcash.gen.chat.v1"; -option objc_class_prefix = "FPBChatV1"; - -import "common/v1/common.proto"; -import "profile/v1/model.proto"; -import "messaging/v1/model.proto"; -import "validate/validate.proto"; -import "google/protobuf/timestamp.proto"; - -enum ChatType { - UNKNOWN = 0; - CONTACT_DM = 1; - TIP_DM = 2; - GROUP = 3; -} - -message Metadata { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - // The type of chat - ChatType type = 2 [(validate.rules).enum = { - not_in: [0] // UNKNOWN - }]; - - // Members of this chat - // - // For large group chats, this is a subset of all members. - repeated Member members = 3; - - // The last message in this chat - messaging.v1.Message last_message = 4; - - // The timestamp of the last activity in this chat - google.protobuf.Timestamp last_activity = 5 [(validate.rules).timestamp.required = true]; - - // The chat's head event sequence — the value of the most recent event in its - // event log. A client compares this against its locally stored cursor for - // the chat to decide whether catch-up is needed: if its cursor is behind, it - // calls Messaging.GetDelta; if equal, it is current and can skip it. - // - // This is NOT derivable from last_message: an edit or deletion of an older - // message advances the head without changing last_message, so this value can - // exceed last_message.event_sequence. It is the same head reported by - // GetDeltaResponse.latest_sequence. - uint64 latest_event_sequence = 6; - - // Whether this chat is hidden from the requesting owner's chat list. - // Per-viewer and server-computed (e.g. the chat's peer is on the caller's - // blocklist). Clients should exclude hidden chats from the primary DM list. - bool is_hidden = 7; - - // Title for this chat. Only supported for group chats - string title = 8 [(validate.rules).string = { - min_len: 0 - max_len: 64 - }]; -} - -message Member { - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - // The user profile for this member. It contains a subset of identifiers - // that can be publicly viewed within the chat. - profile.v1.UserProfile user_profile = 2 [(validate.rules).message.required = true]; - - // Chat message state for this member. - // - // If set, the list may contain DELIVERED and READ pointers. SENT pointers - // are only shared between the sender and server, to indicate persistence. - repeated messaging.v1.Pointer pointers = 3 [(validate.rules).repeated = { - min_items: 0 - max_items: 2 - }]; -} - -message MetadataUpdate { - oneof kind { - option (validate.required) = true; - - FullRefresh full_refresh = 1; - LastActivityChanged last_activity_changed = 2; - } - - // Refreshes the entire chat metadata - message FullRefresh { - Metadata metadata = 1 [(validate.rules).message.required = true]; - } - - // The last activity timestamp has changed to a newer value - message LastActivityChanged { - google.protobuf.Timestamp new_last_activity = 1 [(validate.rules).timestamp.required = true]; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/common/v1/common.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/common/v1/common.proto deleted file mode 100644 index 21d46b01a..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/common/v1/common.proto +++ /dev/null @@ -1,235 +0,0 @@ -syntax = "proto3"; - -package flipcash.common.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/common/v1;commonpb"; -option java_package = "com.codeinc.flipcash.gen.common.v1"; -option objc_class_prefix = "FPBCommonV1"; - -// Note: common/v1 is imported by every other domain, so it must remain a leaf -// package. Importing another flipcash domain here creates a Go import cycle, -// since that domain's service protos import common/v1 in turn. -import "validate/validate.proto"; - -message PublicKey { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -message Signature { - bytes value = 1 [(validate.rules).bytes = { - min_len: 64 - max_len: 64 - }]; -} - -message Hash { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// Auth provides an authentication information for RPCs/messages. -// -// Currently, only a single form is supported, but it may be useful in -// the future to rely on session tokens instead. -message Auth { - oneof kind { - option (validate.required) = true; - - // KeyPair uses pub key cryptography to verify. - KeyPair key_pair = 1; - } - - // KeyPair uses a keypair to verify a message. - // - // The signature should be of the encapsulating proto message, - // _without_ the Auth section being set. - message KeyPair { - PublicKey pub_key = 1 [(validate.rules).message.required = true]; - Signature signature = 2 [(validate.rules).message.required = true]; - } -} - -message UserId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 1 - max_len: 32 - }]; -} - -// Username is a user's unique handle on Flipcash. It uses the same character -// set as X — letters, digits and underscores — with the exception that it must -// be lowercase. -message Username { - string value = 1 [(validate.rules).string.pattern = "^[a-z0-9_]{2,15}$"]; -} - -message ChatId { - // value has the following structure: - // - 32 byte hash for DMs - // - 16 byte UUID for group chats - bytes value = 1 [(validate.rules).bytes = { - min_len: 16 - max_len: 32 - }]; -} - -message IntentId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// AppInstallId is a unque ID tied to a client app installation. It does not -// identify a device. Value should remain private and not be shared across -// installs. -message AppInstallId { - string value = 1 [(validate.rules).string = { - min_len: 1 - max_len: 256 // todo: What's a reasonable size - }]; -} - -// PhoneNumber is an E.164 phone number -message PhoneNumber { - // Regex provided by Twilio here: https://www.twilio.com/docs/glossary/what-e164#regex-matching-for-e164 - string value = 1 [(validate.rules).string.pattern = "^\\+[1-9]\\d{1,14}$"]; -} - -// EmailAddress is an email address -message EmailAddress { - string value = 1 [(validate.rules).string.pattern = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"]; -} - -enum Platform { - UNKNOWN = 0; - APPLE = 1; - GOOGLE = 2; -} - -// CryptoPaymentAmount defines an amount of crypto with currency exchange data -message CryptoPaymentAmount { - // ISO 4217 alpha-3 currency code the payment was made in - string currency = 1 [(validate.rules).string = { pattern: "^[a-z]{3,4}$" }]; - - // The amount in the native currency that was paid - double native_amount = 2 [(validate.rules).double.gte = 0]; - - // The amount in quarks of crypto that was paid - uint64 quarks = 3; - - // The crypto mint that was paid - PublicKey mint = 4 [(validate.rules).message.required = true]; -} - -// FiatPaymentAmount defines an amount of fiat -message FiatPaymentAmount { - // ISO 4217 alpha-3 currency code the payment was made in - string currency = 1 [(validate.rules).string = { pattern: "^[a-z]{3,4}$" }]; - - // The amount in the native currency that was paid - double native_amount = 2 [(validate.rules).double.gte = 0]; -} - -message PagingToken { - bytes value = 1 [(validate.rules).bytes = { - min_len: 1 - max_len: 128 - }]; -} - -message QueryOptions { - // PageSize limits the maximum page size of a response. - // - // Server may choose to return less items. If <= 0, - // server may select an arbitrary default page size. - int32 page_size = 1 [(validate.rules).int32.lte = 1024]; - - // PagingToken is a token that can be extracted from the - // identifier of a collection. - PagingToken paging_token = 2; - - // Order is the order of elements, if applicable. - Order order = 3; - enum Order { - ASC = 0; - DESC = 1; - } -} - -// Request is a generic wrapper for gRPC requests -message Request { - string version = 1; - string service = 2; - string method = 3; - bytes body = 4; -} - -// Response is a generic wrapper for gRPC responses -message Response { - Result result = 1; - - bytes body = 2; - string message = 3; - - enum Result { - OK = 0; - ERROR = 1; - } -} - -message CountryCode { - // ISO 3166-1 Alpha-2 - string value = 1 [(validate.rules).string = { - min_len: 2 - max_len: 2 - }]; -} - -// Locale represents an IETF BCP 47 language tag (e.g. "en", "en-US", "zh-Hans-CN") -message Locale { - string value = 1 [(validate.rules).string = { - pattern: "^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{1,8})*$" - min_len: 2 - max_len: 35 - }]; -} - -// Region represents a fiat currency region identified by its ISO 4217 alpha-3 currency code (e.g. "usd", "eur") -message Region { - string value = 1 [(validate.rules).string = { - pattern: "^[a-z]{3,4}$" - }]; -} - -// Color represents an RGB colour -message Color { - // Hex colour value (e.g. "#19191A") - string hex = 1 [(validate.rules).string = { - pattern: "^#[0-9a-fA-F]{6}$" - }]; -} - -// Substitution is a text subsitution -message Substitution { - // Fallback string for forwards compatibility - string fallback = 1 [(validate.rules).string = { - min_len: 1 - max_len: 4096 // Arbitrary - }]; - - oneof kind { - option (validate.required) = true; - - // Phone number -> contact name or formatted phone number - common.v1.PhoneNumber phone_number_to_contact_name = 2; - - // User ID -> display name - common.v1.UserId user_id_to_display_name = 3; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/contact/v1/contact_list_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/contact/v1/contact_list_service.proto deleted file mode 100644 index 5ed665c40..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/contact/v1/contact_list_service.proto +++ /dev/null @@ -1,134 +0,0 @@ -syntax = "proto3"; - -package flipcash.contact.v1; - -import "contact/v1/model.proto"; -import "common/v1/common.proto"; -import "validate/validate.proto"; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/contact/v1;contactpb"; -option java_package = "com.codeinc.flipcash.gen.contact.v1"; -option objc_class_prefix = "FPBContactV1"; - -// ContactList manages a user's contact list and surfaces which contacts are -// Flipcash users. -// -// Sync model: -// - The client maintains a 32-byte XOR-of-SHA256 checksum over its current -// contact set, and an OS-specific cursor for incremental change discovery. -// The cursor is local-only and never leaves the device. -// - Steady state: client computes a delta from the OS cursor, sends it via -// DeltaUpload with old/new checksums for compare-and-swap. -// - Recovery: on first install, after OS history truncation, or after -// CHECKSUM_DRIFT, the client uses FullUpload to replace the server's state -// wholesale. -service ContactList { - // CheckSync compares the client's checksum to the server's. Cheap, used - // on app foreground to decide whether any upload is needed. - rpc CheckSync(CheckSyncRequest) returns (CheckSyncResponse); - - // DeltaUpload applies a delta under compare-and-swap on the checksum. - // Safe to retry indefinitely with the same payload. - rpc DeltaUpload(DeltaUploadRequest) returns (DeltaUploadResponse); - - // FullUpload replaces the user's contact set entirely. Used when - // a delta cannot be constructed or CHECKSUM_DRIFT was returned. - rpc FullUpload(stream FullUploadRequest) returns (FullUploadResponse); - - // GetFlipcashContacts gets the set of contacts that are on Flipcash - rpc GetFlipcashContacts(GetFlipcashContactsRequest) returns (stream GetFlipcashContactsResponse); -} - - -message CheckSyncRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - // XOR-of-SHA256 over the client's current set of normalized E.164 phones. - common.v1.Hash client_checksum = 2 [(validate.rules).message.required = true]; -} - -message CheckSyncResponse { - enum Result { - OK = 0; - DENIED = 1; - OUT_OF_SYNC = 2; - } - Result result = 1; - - // Authoritative server-side checksum. Clients persist this and use it - // as the basis for the next DeltaUpload.old_checksum. - common.v1.Hash server_checksum = 2; -} - -message DeltaUploadRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - repeated common.v1.PhoneNumber adds = 2 [(validate.rules).repeated.max_items = 1000]; - - repeated common.v1.PhoneNumber removes = 3 [(validate.rules).repeated.max_items = 1000]; - - // The checksum the client expected the server to have *before* applying - // this delta. Server applies only if stored == old_checksum. - common.v1.Hash old_checksum = 4 [(validate.rules).message.required = true]; - - // The checksum the client computes for the state *after* applying this - // delta. Server persists this on success. Used to detect retries: if - // stored == new_checksum, the server treats the request as a no-op. - common.v1.Hash new_checksum = 5 [(validate.rules).message.required = true]; -} - -message DeltaUploadResponse { - enum Result { - OK = 0; - DENIED = 1; - // Server's recomputed checksum did not match expected_checksum. - CHECKSUM_MISMATCH = 2; - // Stored checksum matched neither old_checksum nor new_checksum. - // Client should call FullUpload to reconcile. - CHECKSUM_DRIFT = 3; - TOO_MANY_CONTACTS = 4; - } - Result result = 1; -} - -message FullUploadRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - // The complete current contact set. Server replaces stored state with - // this list in one transaction. - repeated common.v1.PhoneNumber phones = 2 [(validate.rules).repeated.max_items = 1000]; - - // XOR-of-SHA256 over the client's current set of normalized E.164 phones. - // Sent on the last streamed request to indicate the end of the upload. - common.v1.Hash expected_checksum = 3 [(validate.rules).message.required = true]; -} - -message FullUploadResponse { - enum Result { - OK = 0; - DENIED = 1; - // Server's recomputed checksum did not match expected_checksum. - CHECKSUM_MISMATCH = 2; - TOO_MANY_CONTACTS = 3; - } - Result result = 1; -} - -message GetFlipcashContactsRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - common.v1.Hash checksum = 2 [(validate.rules).message.required = true]; -} - -message GetFlipcashContactsResponse { - enum Result { - OK = 0; - DENIED = 1; - NOT_FOUND = 2; - // Server checksum doesn't match client checksum. - CHECKSUM_DRIFT = 3; - } - Result result = 1; - - repeated FlipcashContact contacts = 2 [(validate.rules).repeated.max_items = 1000]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/contact/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/contact/v1/model.proto deleted file mode 100644 index 32d89ae59..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/contact/v1/model.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; - -package flipcash.contact.v1; - -import "common/v1/common.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/contact/v1;contactpb"; -option java_package = "com.codeinc.flipcash.gen.contact.v1"; -option objc_class_prefix = "FPBContactV1"; - -message FlipcashContact { - common.v1.PhoneNumber phone = 1 [(validate.rules).message.required = true]; - - // The DM chat ID for the Flipcash contact. If the chat doesn't exist, it needs - // to be initiated with a cash send to initialize it - common.v1.ChatId dm_chat_id = 2 [(validate.rules).message.required = true]; - - // Timestamp the contact joined Flipcash - google.protobuf.Timestamp join_ts = 3 [(validate.rules).timestamp.required = true]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/email/v1/email_verification_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/email/v1/email_verification_service.proto deleted file mode 100644 index 9e4662f6b..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/email/v1/email_verification_service.proto +++ /dev/null @@ -1,95 +0,0 @@ -syntax = "proto3"; - -package flipcash.email.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/email/v1;emailpb"; -option java_package = "com.codeinc.flipcash.gen.email.v1"; -option objc_class_prefix = "FPBEmailV1"; - -import "common/v1/common.proto"; -import "email/v1/model.proto"; -import "validate/validate.proto"; - -service EmailVerification { - // SendVerificationCode sends a verification code to the provided email address. - // If an active verification is already taking place, the existing code will be - // resent. - rpc SendVerificationCode(SendVerificationCodeRequest) returns (SendVerificationCodeResponse); - - // CheckVerificationCode validates a verification code. On success, the email - // address is linked to the user. Any previous links are overwritten. - rpc CheckVerificationCode(CheckVerificationCodeRequest) returns (CheckVerificationCodeResponse); - - // Unlink removes the link of an email address from a user. - rpc Unlink(UnlinkRequest) returns (UnlinkResponse); -} - -message SendVerificationCodeRequest { - // The email address to send a verification code to - common.v1.EmailAddress email_address = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; - - // Additional client data that is sent in the deep link - string client_data = 3 [(validate.rules).string = { - max_len: 1024 - }]; -} - -message SendVerificationCodeResponse { - Result result = 1; - enum Result { - OK = 0; - // Email is denied - DENIED = 1; - // Email is rate limited (eg. by IP, email address, user, etc) and was not sent. - RATE_LIMITED = 2; - // The email address is not real - INVALID_EMAIL_ADDRESS = 3; - } -} - -message CheckVerificationCodeRequest { - // The email address being verified - common.v1.EmailAddress email_address = 1 [(validate.rules).message.required = true]; - - // The verification code received via email - VerificationCode code = 2 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 3 [(validate.rules).message.required = true]; -} - -message CheckVerificationCodeResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - // The call is rate limited (eg. by IP, email address, etc). The code is - // not verified. - RATE_LIMITED = 2; - // The provided verification code is invalid. The user may retry - // enterring the code if this is received. When max attempts are - // received, NO_VERIFICATION will be returned. - INVALID_CODE = 3; - // There is no verification in progress for the email address. Several - // reasons this can occur include a verification being expired or having - // reached a maximum check threshold. The client must initiate a new - // verification using SendVerificationCode. - NO_VERIFICATION = 4; - } -} - -message UnlinkRequest { - // The email address to unlink - common.v1.EmailAddress email_address = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; -} - -message UnlinkResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/email/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/email/v1/model.proto deleted file mode 100644 index 71aa2c305..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/email/v1/model.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package flipcash.email.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/email/v1;emailpb"; -option java_package = "com.codeinc.flipcash.gen.email.v1"; -option objc_class_prefix = "FPBEmailV1"; - -import "validate/validate.proto"; - -// VerificationCode is a 4-10 digit numerical code for verification -message VerificationCode { - string value = 2 [(validate.rules).string = { - pattern: "^[0-9]{4,10}$" - }]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/event/v1/event_streaming_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/event/v1/event_streaming_service.proto deleted file mode 100644 index bc7f0ed2f..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/event/v1/event_streaming_service.proto +++ /dev/null @@ -1,69 +0,0 @@ -syntax = "proto3"; - -package flipcash.event.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/event/v1;eventpb"; -option java_package = "com.codeinc.flipcash.gen.events.v1"; -option objc_class_prefix = "FPBEventV1"; - -import "event/v1/model.proto"; -import "common/v1/common.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -service EventStreaming { - // StreamEvents streams events for the requesting user. - rpc StreamEvents(stream StreamEventsRequest) returns (stream StreamEventsResponse); - - // ForwardEvents is an internal RPC for forwarding events to another server. - rpc ForwardEvents(ForwardEventsRequest) returns (ForwardEventsResponse); -} - -message StreamEventsRequest { - oneof type { - option (validate.required) = true; - - Params params = 1; - ClientPong pong = 2; - } - - message Params { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - // ts contains the time for stream open. - // - // It is used primarily as a nonce for auth. Server may reject - // timestamps that are too far in the future or past. - google.protobuf.Timestamp ts = 2 [(validate.rules).timestamp.required = true]; - } -} - -message StreamEventsResponse { - oneof type { - option (validate.required) = true; - - ServerPing ping = 1; - StreamError error = 2; - EventBatch events = 3; - } - - message StreamError { - Code code = 1; - enum Code { - DENIED = 0; - INVALID_TIMESTAMP = 1; - } - } -} - -message ForwardEventsRequest { - UserEventBatch user_events = 1 [(validate.rules).message.required = true]; -} - -message ForwardEventsResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/event/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/event/v1/model.proto deleted file mode 100644 index be33a880d..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/event/v1/model.proto +++ /dev/null @@ -1,132 +0,0 @@ -syntax = "proto3"; - -package flipcash.event.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/event/v1;eventpb"; -option java_package = "com.codeinc.flipcash.gen.events.v1"; -option objc_class_prefix = "FPBEventV1"; - -import "blob/v1/model.proto"; -import "chat/v1/model.proto"; -import "common/v1/common.proto"; -import "messaging/v1/model.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -message EventId { - bytes id = 1 [(validate.rules).bytes = { - min_len: 16 - max_len: 16 - }]; -} - - // todo: define additional events -message Event { - EventId id = 1 [(validate.rules).message.required = true]; - - google.protobuf.Timestamp ts = 2 [(validate.rules).timestamp.required = true];; - - oneof type { - option (validate.required) = true; - - TestEvent test = 3; - ChatUpdate chat_update = 4; - BlobUpdate blob_update = 5; - } -} - -message EventBatch { - repeated Event events = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 // Arbitrary - }]; -} - -message UserEvent { - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - Event event = 2 [(validate.rules).message.required = true]; -} - -message UserEventBatch { - repeated UserEvent events = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 // Arbitrary - }]; -} - -message TestEvent { - repeated string hops = 1; - - uint64 nonce = 2; -} - -message ServerPing { - // Timestamp the ping was sent on the stream, for client to get a sense - // of potential network latency - google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true]; - - // The delay server will apply before sending the next ping - google.protobuf.Duration ping_delay = 2 [(validate.rules).duration.required = true]; -} - -message ClientPong { - // Timestamp the Pong was sent on the stream, for server to get a sense - // of potential network latency - google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true]; -} - -message ChatUpdate { - // The chat that this update is for - common.v1.ChatId chat = 1 [(validate.rules).message.required = true]; - - // If present, new real-time messages sent on the chat. - // - // Deprecated: superseded by `events` (Event.message_sent), which is - // sequenced and gap-detectable. New messages now arrive as events. - messaging.v1.MessageBatch new_messages = 2 [deprecated = true]; - - // If present, message pointer updates for members in the chat. Pointers are - // convergent (monotonic, last-writer-wins), so they ride the stream as a - // best-effort overlay and are reconciled from current state on reconnect — - // they are intentionally NOT part of the gap-detected event log. - messaging.v1.PointerBatch pointer_updates = 3; - - // If present, message typing notification state changes for members in the - // chat. Transient and best-effort — not part of the event log. - messaging.v1.IsTypingNotificationBatch is_typing_notifications = 4; - - // If present, updates to the chat metadata - repeated chat.v1.MetadataUpdate metadata_updates = 5 [(validate.rules).repeated = { - max_items: 1024 // Arbitrary - }]; - - // If present, durable event-log events for the chat (messages sent, edited, - // and deleted). These are contiguous and ordered: clients apply them by - // ascending Event.sequence and gap-detect via Event.sequence/count, catching - // up with Messaging.GetDelta on a gap. This supersedes new_messages. - messaging.v1.EventBatch events = 6; - - // If present, best-effort real-time reaction changes for messages in the - // chat. Like pointer_updates, reactions are a convergent overlay — NOT part - // of the gap-detected event log; clients apply them last-writer-wins by - // ReactionUpdate.sequence and reconcile any misses by refreshing a message's - // ReactionSummary on view. - messaging.v1.ReactionUpdateBatch reaction_updates = 7; -} - -// BlobUpdate notifies the recipient in real time that blobs they uploaded have -// transitioned to a new lifecycle state — e.g. PROCESSING → READY once the -// server finishes validating, transcoding, and moderating, or → REJECTED on -// failure. It lets clients react to upload completion via the event stream -// instead of polling BlobStorage.GetBlobs. -// -// Best-effort: a client that misses an update reconciles by calling -// BlobStorage.GetBlobs. The BlobId is the durable handle; any download_url -// carried here is ephemeral and may be re-minted via GetBlobs. -message BlobUpdate { - // The blobs that transitioned, each carrying its new status and, when READY, - // its resolved metadata (including a freshly minted download_url). - blob.v1.BlobBatch blobs = 1 [(validate.rules).message.required = true]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/iap/v1/iap_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/iap/v1/iap_service.proto deleted file mode 100644 index fbd0b99cc..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/iap/v1/iap_service.proto +++ /dev/null @@ -1,57 +0,0 @@ -syntax = "proto3"; - -package flipcash.iap.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/iap/v1;iappb"; -option java_package = "com.codeinc.flipcash.gen.iap.v1"; -option objc_class_prefix = "FPBIapV1"; - -import "common/v1/common.proto"; -import "validate/validate.proto"; - -service Iap { - // OnPurchaseCompleted is called when an IAP has been completed - rpc OnPurchaseCompleted(OnPurchaseCompletedRequest) returns (OnPurchaseCompletedResponse); -} - -message OnPurchaseCompletedRequest { - common.v1.Platform platform = 1 [(validate.rules).enum = {in: [1,2]}]; - - Receipt receipt = 2 [(validate.rules).message.required = true]; - - Metadata metadata = 3 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 4 [(validate.rules).message.required = true]; -} - -message OnPurchaseCompletedResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - INVALID_RECEIPT = 2; // Returned if the receipt is invalid, or not in a completed payment state - INVALID_METADATA = 3; // Returned if the at least one field in the payment metadata is invalid - } -} - -message Receipt { - string value = 1 [(validate.rules).string = { - min_len: 1 - // todo: what's a reasonable max length? - }]; -} - -// Additional IAP metadata, which can be trusted given a verified receipt (they can -// only be generated by production-signed apps). -message Metadata { - string product = 1 [(validate.rules).string = { - min_len: 1 - max_len: 128 - }]; - - string currency = 2 [(validate.rules).string = { - pattern: "^[a-z]{3}$" - }]; - - double amount = 3 [(validate.rules).double.gt = 0]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/intent/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/intent/v1/model.proto deleted file mode 100644 index 6cd69bcdf..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/intent/v1/model.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; - -package flipcash.intent.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/intent/v1;intentpb"; -option java_package = "com.codeinc.flipcash.gen.intent.v1"; -option objc_class_prefix = "FPBIntentV1"; - -import "common/v1/common.proto"; -import "validate/validate.proto"; - -message AppMetadata { - oneof domain { - option (validate.required) = true; - - ChatMetadata chat = 1; - } -} - -// Additional metadata provided to SubmitIntent when doing payments in a chat -message ChatMetadata { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - oneof type { - option (validate.required) = true; - - ContactDmPayment contact_dm_payment = 2; - TipDmPayment tip_dm_payment = 3; - } - - // For sending a payment to a contact in a DM - message ContactDmPayment { - // Source phone number that is paying. This is validated to be linked to the sender. - common.v1.PhoneNumber source = 1 [(validate.rules).message.required = true]; - - // Destination phone number that is being paid. This is validated to be linked to the receiver. - common.v1.PhoneNumber destination = 2 [(validate.rules).message.required = true]; - } - - // For sending a DM payment to someone using their user ID, which maps - // directly to/from a public key. - message TipDmPayment { - // Location in the app the payment was sent from - enum Location { - TIPCARD = 0; - CHAT = 1; - } - Location location = 1; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/messaging/v1/messaging_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/messaging/v1/messaging_service.proto deleted file mode 100644 index c392a8d13..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/messaging/v1/messaging_service.proto +++ /dev/null @@ -1,484 +0,0 @@ -syntax = "proto3"; - -package flipcash.messaging.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/messaging/v1;messagingpb"; -option java_package = "com.codeinc.flipcash.gen.messaging.v1"; -option objc_class_prefix = "FPBMessagingV1"; - -import "common/v1/common.proto"; -import "messaging/v1/model.proto"; -import "validate/validate.proto"; - -service Messaging { - // GetMessage gets a single message in a chat - rpc GetMessage(GetMessageRequest) returns (GetMessageResponse); - - // GetMessages gets the set of messages for a chat using paged and batched APIs - rpc GetMessages(GetMessagesRequest) returns (GetMessagesResponse); - - // GetDelta returns, for cold-boot and reconnect catch-up, the current state - // of every message changed since the client's cursor, up to the chat's - // current head. It is a state delta, not a contiguous replay: each changed - // message appears once in its latest state and the client applies it - // last-writer-wins. Transient signals (typing) and convergent state - // (pointers, reactions) are fetched separately, not returned here. - // - // GetDelta always catches up to the head; there is no caller-specified - // upper bound. An online client that detects a gap while already receiving - // live updates does NOT bound the fetch: it calls GetDelta to the head and - // lets last-writer-wins (Message.event_sequence) absorb the overlap with - // live events buffered during the call — a message delivered by both paths - // is applied once, newest wins. A client may also wait briefly for an - // out-of-order live update to close a small gap before calling at all. - // - // On stream completion the client advances its cursor to the highest - // checkpoint_sequence it received, which equals latest_sequence — the client - // is now at the head. When the client is already current the server sends a - // single response with messages omitted (and checkpoint_sequence unset), - // leaving the cursor unchanged; latest_sequence still reports the head. - // - // This is a BOUNDED server stream: the server emits one or more batches and - // then completes once the delta up to the head (as of stream open) is - // exhausted. Unlike StreamEvents it does NOT stay open for live updates. - // Streaming the delta in batches avoids a per-page round trip; the server may - // currently send the whole delta as a single response, so clients must handle - // any number of batches and treat stream completion as "caught up." - // - // The Result field is meaningful on the first response and is OK for - // subsequent data batches; a terminal DENIED or RESET_REQUIRED is delivered - // as a single response that ends the stream. - rpc GetDelta(GetDeltaRequest) returns (stream GetDeltaResponse); - - // SendMessage sends a message to a chat. - rpc SendMessage(SendMessageRequest) returns (SendMessageResponse); - - // EditMessage edits the content of a message the caller previously sent. - rpc EditMessage(EditMessageRequest) returns (EditMessageResponse); - - // DeleteMessage deletes a message the caller previously sent. The message is - // tombstoned (content replaced with DeletedContent), not removed, so the - // per-chat MessageId sequence stays gapless. - rpc DeleteMessage(DeleteMessageRequest) returns (DeleteMessageResponse); - - // AddReaction adds the caller's reaction with a given emoji to a message. - // Idempotent: re-adding the same emoji the caller already reacted with is a - // no-op success. - rpc AddReaction(AddReactionRequest) returns (AddReactionResponse); - - // RemoveReaction removes the caller's reaction with a given emoji from a - // message. Idempotent: removing a reaction the caller does not have is a - // no-op success. - rpc RemoveReaction(RemoveReactionRequest) returns (RemoveReactionResponse); - - // GetReactors returns the paged list of users who reacted to a message with - // a given emoji — the on-demand drill-down behind EmojiReaction.count, which - // never inlines the full reactor list. - rpc GetReactors(GetReactorsRequest) returns (GetReactorsResponse); - - // GetReactionSummary fetches the current aggregate reaction state for a - // single message. - rpc GetReactionSummary(GetReactionSummaryRequest) returns (GetReactionSummaryResponse); - - // GetReactionSummaries fetches the current aggregate reaction state using - // paged and batched APIs - rpc GetReactionSummaries(GetReactionSummariesRequest) returns (GetReactionSummariesResponse); - - // AdvancePointer advances a pointer in message history for a chat member. - rpc AdvancePointer(AdvancePointerRequest) returns (AdvancePointerResponse); - - // NotifyIsTypingRequest notifies a chat that the sending member is typing. - // - // These requests are transient, and may be dropped at any point. - rpc NotifyIsTyping(NotifyIsTypingRequest) returns (NotifyIsTypingResponse); -} - -message GetMessageRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - MessageId message_id = 2 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10; -} - -message GetMessageResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - NOT_FOUND = 2; - } - - Message message = 2; -} - -message GetMessagesRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - oneof query { - option (validate.required) = true; - - common.v1.QueryOptions options = 2; - MessageIdBatch message_ids = 3; - } - - common.v1.Auth auth = 10; -} - -message GetMessagesResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - NOT_FOUND = 2; - } - - MessageBatch messages = 2; -} - -message GetDeltaRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - // The latest event sequence the client has already applied. The server - // returns the current state of messages whose event_sequence is greater than - // this value, up to the current head. Use 0 to fetch from the beginning of - // the retained log. - uint64 after_sequence = 2; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message GetDeltaResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - // after_sequence is older than the oldest state the server can still - // resolve a delta for. The client must discard its cursor and re-sync - // chat history from GetMessages before resuming the event stream. - RESET_REQUIRED = 2; - } - - // A batch of changed messages in STRICTLY ASCENDING event_sequence order, - // continuing in order across batches (every sequence in a batch is higher - // than every sequence in the prior batch). Across the whole stream this is - // the current state of every message changed since after_sequence, up to the - // head; a message normally appears once in its latest state, but one - // re-edited mid-stream may reappear at its new, higher sequence (apply - // last-writer-wins). Omitted (not an empty batch) when there are no changes - // to report — e.g. when the client is already current; the server still - // sets latest_sequence and the stream then completes. Note MessageBatch - // itself requires at least one message, so "no changes" is signaled by - // leaving this field unset, never by an empty batch. - MessageBatch messages = 2; - - // The chat's latest event sequence (head) as of stream open — the target this - // catch-up converges to. Informational while streaming: it tells the client - // how far the chat has advanced before the final batch arrives. Once the - // stream completes, the client's cursor equals this; it does not need - // contiguous coverage of the intervening points, only the resulting state. - uint64 latest_sequence = 3; - - // Resume checkpoint: the event_sequence through which the delta is complete - // as of this batch — the batch's high-water mark, monotonically increasing - // across the stream toward latest_sequence. Persist it AFTER fully applying - // the batch. If the stream drops mid-catch-up, resume by calling GetDelta - // again with after_sequence set to the last checkpoint_sequence received. - // Because event_sequence only ever increases, this resumes exactly where you - // left off with no skipped messages (and at worst a harmless last-writer-wins - // re-apply of the boundary). - uint64 checkpoint_sequence = 4; -} - -message SendMessageRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - // Allowed content types that can be sent by client: - // - TextContent - // - ReplyContent - // - MediaContent - repeated Content content = 2 [(validate.rules).repeated = { - min_items: 1 - max_items: 1 - }]; - - // Client-generated idempotency token for this send. Used to dedup retried - // sends and to correlate the optimistic local echo with the server-assigned - // message returned in the response. - ClientMessageId client_message_id = 3 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message SendMessageResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - // The chat message that was sent if the RPC was succesful, which includes - // server-side metadata like the generated message ID and official timestamp - Message message = 2; -} - -message EditMessageRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - MessageId message_id = 2 [(validate.rules).message.required = true]; - - // The new content for the message. Allowed content types match SendMessage: - // - TextContent - // - ReplyContent - // - MediaContent - repeated Content content = 3 [(validate.rules).repeated = { - min_items: 1 - max_items: 1 - }]; - - // Required optimistic-concurrency guard: the message's event_sequence as the - // client last observed it. The server applies the edit only if the message's - // current event_sequence still equals this value, and returns CONFLICT - // otherwise — so an edit based on a stale version (e.g. a concurrent - // edit/delete from the sender's other device) is rejected rather than - // clobbering the newer state. There is no last-writer-wins path. - uint64 expected_event_sequence = 4 [(validate.rules).uint64.gte = 1]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message EditMessageResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - MESSAGE_NOT_FOUND = 2; - CANNOT_EDIT = 3; - // The message changed since expected_event_sequence (a concurrent - // edit/delete won). The edit was not applied; `message` carries the - // current state for the client to reconcile against and retry. - CONFLICT = 4; - } - - // On OK, the updated materialized message (advanced event_sequence, - // last_edited_ts set). On CONFLICT, the message's current state. - Message message = 2; -} - -message DeleteMessageRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - MessageId message_id = 2 [(validate.rules).message.required = true]; - - // Required optimistic-concurrency guard: the message's event_sequence as the - // client last observed it. The server applies the delete only if the - // message's current event_sequence still equals this value, and returns - // CONFLICT otherwise — so a delete based on a stale version is rejected - // rather than racing a concurrent edit/delete. There is no - // last-writer-wins path. - uint64 expected_event_sequence = 3 [(validate.rules).uint64.gte = 1]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message DeleteMessageResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - MESSAGE_NOT_FOUND = 2; - CANNOT_DELETE = 3; - // The message changed since expected_event_sequence (a concurrent - // edit/delete won). The delete was not applied; `message` carries the - // current state for the client to reconcile against and retry. - CONFLICT = 4; - } - - // On OK, the tombstoned materialized message (content replaced with - // DeletedContent, event_sequence advanced). On CONFLICT, the current state. - Message message = 2; -} - -message AddReactionRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - MessageId message_id = 2 [(validate.rules).message.required = true]; - - // The emoji to react with. - Emoji emoji = 3 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message AddReactionResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - MESSAGE_NOT_FOUND = 2; - CANNOT_REACT = 3; - // Adding this emoji would exceed the per-message distinct reaction-type - // cap. Reactions to emojis already present on the message are unaffected. - TOO_MANY_REACTION_TYPES = 4; - } - - // The affected emoji's aggregate after the add (count, reacted_by_self true). - EmojiReaction reaction = 2; -} - -message RemoveReactionRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - MessageId message_id = 2 [(validate.rules).message.required = true]; - - // The emoji whose reaction to remove for the caller. - Emoji emoji = 3 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message RemoveReactionResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - MESSAGE_NOT_FOUND = 2; - } - - // The affected emoji's aggregate after the removal - EmojiReaction reaction = 2; -} - -message GetReactorsRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - MessageId message_id = 2 [(validate.rules).message.required = true]; - - // The emoji whose reactors to list. - Emoji emoji = 3 [(validate.rules).message.required = true]; - - // Paging over the reactor list (server-ordered, typically most-recent - // first). Leave options.paging_token unset on the first request; on every - // subsequent request, set it to the paging_token from the most recent - // response to advance through the list. The token is opaque and - // server-generated; do not construct it. - common.v1.QueryOptions options = 4; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message GetReactorsResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - MESSAGE_NOT_FOUND = 2; - } - - // A page of users who reacted with the requested emoji, with their reaction - // timestamps. Empty when the message exists but has no reactors for the emoji. - repeated Reactor reactors = 2 [(validate.rules).repeated = { - max_items: 100 - }]; - - // The server-generated cursor advanced past this page. The client MUST send - // the most recent value back in options.paging_token on the next - // GetReactorsRequest to fetch the following page. Set when result is OK and - // has_more is true. - common.v1.PagingToken paging_token = 3; - - // HasMore indicates whether further pages of reactors remain. When false, - // the reactor list has been fully read. When true, the client should issue - // another GetReactorsRequest with the returned paging_token. - bool has_more = 4; -} - -message GetReactionSummaryRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - MessageId message_id = 2 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message GetReactionSummaryResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - MESSAGE_NOT_FOUND = 2; - } - - // The aggregate reaction state for the message. reacted_by_self is computed - // for the caller; clients still apply per (message, emoji) by - // EmojiReaction.sequence, so a summary that is slightly behind a live update - // is harmlessly ignored rather than regressing state. - ReactionSummary summary = 2; -} - -message GetReactionSummariesRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - oneof query { - option (validate.required) = true; - - common.v1.QueryOptions options = 2; - MessageIdBatch message_ids = 3; - } - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message GetReactionSummariesResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } - - // One summary per requested message, keyed by ReactionSummary.message_id. - // reacted_by_self in each summary is computed for the caller; clients still - // apply per (message, emoji) by EmojiReaction.sequence, so a summary that - // is slightly behind a live update is harmlessly ignored rather than regressing - // state. - repeated ReactionSummary summaries = 2 [(validate.rules).repeated = { - max_items: 100 - }]; -} - -message AdvancePointerRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - Pointer.Type pointer_type = 2 [(validate.rules).enum = { - in: [2, 3] // DELIVERED, READ - }]; - - MessageId new_value = 3 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message AdvancePointerResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - MESSAGE_NOT_FOUND = 2; - } -} - -message NotifyIsTypingRequest { - common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; - - IsTypingNotification.State state = 2; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message NotifyIsTypingResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/messaging/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/messaging/v1/model.proto deleted file mode 100644 index ea30fa8ce..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/messaging/v1/model.proto +++ /dev/null @@ -1,449 +0,0 @@ -syntax = "proto3"; - -package flipcash.messaging.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/messaging/v1;messagingpb"; -option java_package = "com.codeinc.flipcash.gen.messaging.v1"; -option objc_class_prefix = "FPBMessagingV1"; - -import "blob/v1/model.proto"; -import "common/v1/common.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -message MessageId { - // Per-chat, server-assigned, gapless sequence number. Together with the - // chat ID this is the message's canonical identity, sort key, and - // pagination cursor. Gapless ordering lets clients trivially detect missing - // messages: a complete history has no gaps between consecutive numbers. - uint64 value = 1 [(validate.rules).uint64.gte = 1]; -} - -// ClientMessageId is a client-generated identifier for a message send. -// -// It serves two purposes: -// - Idempotency: the server dedups on this value, so a retried SendMessage -// (e.g. after a network failure) returns the originally created message -// instead of assigning a new sequence number and creating a duplicate. -// - Correlation: clients use it to match an optimistic local echo to the -// server-assigned Message returned in the response. -// -// Unlike MessageId, this is owned by the client and is not the message's -// canonical identity; it is typically a randomly generated UUID. -message ClientMessageId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 16 - max_len: 16 - }]; -} - -// A message in a chat -message Message { - // Per-chat sequence number identifying this message - MessageId message_id = 1 [(validate.rules).message.required = true]; - - // The chat member that sent the message. For system-level messages, - // this will be ommitted. - common.v1.UserId sender_id = 2; - - // Message content, which is currently guaranteed to have exactly one item. - repeated Content content = 3 [(validate.rules).repeated = { - min_items: 1 - max_items: 1 - }]; - - // Timestamp this message was generated at. - google.protobuf.Timestamp ts = 4 [(validate.rules).timestamp.required = true]; - - // The number of unread-eligible messages in this chat up to and including - // this message. This is a SEPARATE sequence from message_id: messages that - // don't count toward unread keep their message_id but do NOT advance this - // value — they carry the previous count forward, so every message reports - // the running total. A member's unread count is computed entirely on the - // client as the difference between the latest message's unread_seq and the - // unread_seq of the message at their READ pointer. - uint64 unread_seq = 5; - - // If set, the timestamp this message was last edited at. Absent on messages - // that have never been edited. The content above always reflects the - // current (materialized) state, so clients render it directly; this field - // only drives an "edited" affordance. Deletions are represented in content - // via DeletedContent, not here. - google.protobuf.Timestamp last_edited_ts = 6; - - // The event-log sequence at which this message reached its current state: - // the point of the most recent mutation (send, edit, or delete) affecting - // it. A per-message VERSION stamp — distinct from message_id (fixed - // identity/order) and unread_seq (unread accounting) — that advances on - // every edit/delete while message_id stays fixed. - // - // It makes a Message self-locating regardless of how it was obtained (event - // stream, GetMessages, SendMessage echo, last_message, push). Clients apply - // last-writer-wins by this value: ignore a copy whose event_sequence is <= - // the version already held, otherwise insert/replace. Cross-message gap - // detection is separate, via the live event log's Event.sequence/count and - // GetDelta catch-up. - uint64 event_sequence = 7 [(validate.rules).uint64.gte = 1]; - - // Aggregate reaction state for this message, current as of the time it was - // read. This is a convergent overlay, NOT part of the content versioned by - // event_sequence: reactions change without advancing event_sequence, so - // clients refresh it on view and via live reaction updates rather than - // through the event log. - ReactionSummary reactions = 8; -} - -// Content for a chat message -message Content { - oneof type { - option (validate.required) = true; - - TextContent text = 1; - CashContent cash = 2; - ReplyContent reply = 3; - MediaContent media = 4; - SystemContent system = 5; - DeletedContent deleted = 6; - } -} - -// Raw text content -message TextContent { - string text = 1 [(validate.rules).string = { - min_len: 1 - max_len: 4096 - }]; -} - -// Cash content -message CashContent { - // Intent ID identifying the cash transaction at the OCP layer - common.v1.IntentId intent_id = 1 [(validate.rules).message.required = true]; - - // The amount of cash that was sent - common.v1.CryptoPaymentAmount amount = 2 [(validate.rules).message.required = true]; - - // Reserved for receiver, which will is required for group chats - reserved 3; - - // Verb for how the cash was sent. Clietns should always show SENT as a - // fallback. - enum Verb { - SENT = 0; - TIPPED = 1; - } - Verb verb = 4; -} - -// Reply content -message ReplyContent { - // ID of the message being replied to - MessageId replied_message_id = 1 [(validate.rules).message.required = true]; - - // Reply message content. Allowed content types are: - // - TextContent - // - MediaContent - repeated Content content = 2 [(validate.rules).repeated = { - min_items: 1 - max_items: 1 - }]; -} - -// Media content from blobs the user has already uploaded. The following media -// types are supported: -// - Images -message MediaContent { - // The media items attached to this message. A single item today; raising - // this cap later enables albums (each item self-describes its kind). - // - // On SendMessage the client supplies exactly one ORIGINAL rendition per - // item; the server fills its metadata and appends the derived renditions. - repeated blob.v1.Media items = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1 - }]; - - // Optional caption rendered alongside the media - TextContent caption = 2; -} - -// System message content -message SystemContent { - // Best-effort, server-rendered text in the user's locale setting. Today this - // is the only way to display a system message; once the structured `event` - // oneof exists it becomes a fallback, rendered ONLY when the client does not - // recognize the variant (old client, new server). It is not localized per - // viewer — clients that know a variant render their own localized string. - string fallback_text = 1 [(validate.rules).string = { - min_len: 1 - max_len: 256 - }]; - - // todo: Define events once we have them -} - -// Deleted message content -message DeletedContent { - // Timestamp the message was deleted. Set whenever a message is tombstoned; - // clients can surface it as a "deleted" affordance. This is the deletion - // analog of Message.last_edited_ts, kept here so all deletion state lives in - // the content rather than as a separate flag on Message. - google.protobuf.Timestamp deleted_ts = 1 [(validate.rules).timestamp.required = true]; - - // When present, the user that deleted the message. If not present, a it is - // a system-level deletion (eg. moderation check). - common.v1.UserId deleted_by = 2; -} - -// Emoji identifies an emoji used in a reaction. The value is a unicode emoji -// sequence — a single grapheme cluster, which may include modifiers such as a -// skin-tone selector or ZWJ joins — or a custom emoji identifier where -// supported. -message Emoji { - // Structural bounds only — these bound size as defense-in-depth (min_len/ - // max_len count code points, max_bytes counts bytes; a complex ZWJ or - // tag-flag sequence is ~8 code points but ~32 bytes, so both earn their - // keep). True emoji validity (a real grapheme, normalization, any supported - // set) is enforced in server code, not here. - string value = 1 [(validate.rules).string = { - min_len: 1 - max_len: 32 - max_bytes: 128 - }]; -} - -// Reactor identifies a user who reacted to a message and when they did so. -message Reactor { - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - // Timestamp the user added this reaction. - google.protobuf.Timestamp reacted_ts = 2 [(validate.rules).timestamp.required = true]; -} - -// ReactionSummary is the aggregate reaction state attached to a message. It is -// bounded: the number of distinct reaction types per message is capped, so the -// summary stays small no matter how many users reacted. The full reactor list -// for any emoji is fetched on demand (paged), never inlined here. -message ReactionSummary { - // The message these reactions belong to. - MessageId message_id = 1 [(validate.rules).message.required = true]; - - // One entry per distinct emoji reacted to this message - repeated EmojiReaction reactions = 2; -} - -// EmojiReaction aggregates all reactions of a single emoji on a message. -message EmojiReaction { - // The emoji reacted with. - Emoji emoji = 1 [(validate.rules).message.required = true]; - - // Total number of users who reacted with this emoji. Authoritative and may - // be arbitrarily large; the individual reactor identities are not all - // returned here. - uint64 count = 2; - - // Whether the requesting user reacted with this emoji. Per-viewer: count and - // sample_reactors are shareable across users, but this bit is computed for - // the caller. - bool reacted_by_self = 3; - - // A small sample of reactors, with their reaction timestamps (e.g. for - // rendering a few avatars), capped well below count. The complete, paged - // reactor list is fetched on demand via GetReactors. - repeated Reactor sample_reactors = 4 [(validate.rules).repeated = { - max_items: 8 // Sample only; not the full list - }]; - - // Monotonic version of this emoji's aggregate on the message, assigned by - // the server and advanced on every change to it. Ordering only: clients - // apply reaction updates last-writer-wins by this value per (message, emoji) - // — and per actor for reacted_by_self — and treat a loaded summary as stale - // when a higher sequence arrives. It is NOT the chat event sequence - // (reactions never advance that), and it is NOT gapless: it carries no - // gap-detection meaning. - uint64 sequence = 5 [(validate.rules).uint64.gte = 1]; -} - -// ReactionUpdate is a best-effort, real-time reaction change for a single -// (message, emoji) cell. Reactions are a convergent overlay, so these ride the -// event stream OUTSIDE the gap-detected event log — a missed update is not -// caught up via GetDelta but reconciled by refreshing the message's -// ReactionSummary on view. -message ReactionUpdate { - // The message whose reactions changed. - MessageId message_id = 1 [(validate.rules).message.required = true]; - - // The emoji that was added or removed. - Emoji emoji = 2 [(validate.rules).message.required = true]; - - // The user who added or removed the reaction. A client renders - // reacted_by_self by comparing this to itself, so a reaction made on the - // user's other device is reflected. - common.v1.UserId actor = 3 [(validate.rules).message.required = true]; - - Action action = 4 [(validate.rules).enum = { - not_in: [0] - }]; - enum Action { - UNKNOWN = 0; - ADDED = 1; - REMOVED = 2; - } - - // The emoji's total reactor count after this change. 0 means no reactors - // remain and the client should drop the entry from the summary. - uint64 count = 5; - - // The emoji aggregate's new version after this change. Clients apply - // last-writer-wins by this value: ignore the count if sequence <= the - // count watermark held, and ignore the actor's reacted_by_self toggle if - // sequence <= the per-actor watermark held. Matches EmojiReaction.sequence. - uint64 sequence = 6 [(validate.rules).uint64.gte = 1]; - - // When the actor reacted. On ADDED, clients record this as the actor's - // Reactor.reacted_ts (e.g. when slotting them into sample_reactors); ignored - // for REMOVED. This is a display timestamp, distinct from `sequence`, which - // is the ordering key. - google.protobuf.Timestamp reacted_ts = 7 [(validate.rules).timestamp.required = true]; -} - -message ReactionUpdateBatch { - repeated ReactionUpdate reaction_updates = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 - }]; -} - -// Pointer in a chat indicating a user's message history state in a chat. -message Pointer { - // The type of pointer indicates which user's message history state can be - // inferred from the pointer value. It is also possible to infer cross-pointer - // state. For example, if a chat member has a READ pointer for a message with - // ID N, then the DELIVERED pointer must be at least N. - Type type = 1 [(validate.rules).enum = { - not_in: [0] - }]; - enum Type { - UNKNOWN = 0; - SENT = 1; // Always inferred by OK result in SendMessageResponse or message presence in a chat - DELIVERED = 2; - READ = 3; - } - - // The user ID associated with the pointer - common.v1.UserId user_id = 2 [(validate.rules).message.required = true]; - - // Everything at or before this message ID is considered to have the state - // inferred by the type of pointer. - MessageId value = 3 [(validate.rules).message.required = true]; - - // Timestamp the pointer was last advanced at - google.protobuf.Timestamp ts = 4 [(validate.rules).timestamp.required = true]; -} - -message MessageIdBatch { - repeated MessageId message_ids = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 - }]; -} - -message MessageBatch { - repeated Message messages = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 - }]; -} - -message PointerBatch { - repeated Pointer pointers = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 - }]; -} - -// Event is a contiguous run of one or more durable mutations to a chat, delivered -// atomically — the unit of the chat's event log. Newly sent messages, edits, -// and deletions are all mutations within an event. -// -// Only content-bearing, non-idempotent mutations live in the log, because that is -// what gap detection protects: missing one means missing data. Convergent state -// such as pointer advances (last-writer-wins, monotonic) and transient signals -// such as typing notifications are delivered out-of-band and fetched as current -// state, NOT replayed through this log. -// -// Clients apply events in ascending sequence order and use the sequence/count -// pair to detect gaps; on a gap they catch up via GetDelta. -message Event { - // Per-chat event sequence valued AFTER this event applies: the END of the - // half-open range (sequence - count, sequence] this event occupies. This is - // a SEPARATE sequence from MessageId — edits and deletions advance it - // without minting a new MessageId. - uint64 sequence = 1 [(validate.rules).uint64.gte = 1]; - - // The number of points this event consumes, equal to the number of - // mutations it carries — each mutation is one point. The mutation at index - // i sits at point (sequence - count + 1 + i). Clients gap-detect with - // local + count == sequence, so a server that begins emitting count > 1 - // (e.g. a bulk delete) needs no client change. - uint32 count = 2 [(validate.rules).uint32.gte = 1]; - - // Timestamp this event occurred at. - google.protobuf.Timestamp ts = 3 [(validate.rules).timestamp.required = true]; - - // The mutations in this event, ascending by point. Length must equal count. - repeated Mutation mutations = 4 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 - }]; -} - -// Mutation is a single point in the event log: one message sent, edited, or -// deleted. Each carries the full materialized state of the affected message, so -// clients apply it by inserting or replacing their cached copy without a -// refetch. -message Mutation { - oneof type { - option (validate.required) = true; - - // A newly sent message. Inserts a new message_id at the tail of the - // chat. This is the only mutation that advances the MessageId sequence. - Message message_sent = 1; - - // An edit to an existing message (same message_id, updated content, - // last_edited_ts set). - Message message_edited = 2; - - // A deletion of an existing message (same message_id, content replaced - // with DeletedContent). The message_id is retained as a tombstone, so - // the MessageId sequence stays gapless. - Message message_deleted = 3; - } -} - -message EventBatch { - repeated Event events = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 - }]; -} - -message IsTypingNotification { - common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; - - State state = 2; - enum State { - UNKNOWN_TYPING_STATE = 0; - STARTED_TYPING = 1; - STILL_TYPING = 2; - STOPPED_TYPING = 3; - TYPING_TIMED_OUT = 4; - } -} - -message IsTypingNotificationBatch { - repeated IsTypingNotification is_typing_notifications = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 100 // Arbitrary - }]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/moderation/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/moderation/v1/model.proto deleted file mode 100644 index 9614d60f1..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/moderation/v1/model.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; - -package flipcash.moderation.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/moderation/v1;moderationpb"; -option java_package = "com.codeinc.flipcash.gen.moderation.v1"; -option objc_class_prefix = "FPBModerationV1"; - -import "common/v1/common.proto"; -import "google/protobuf/timestamp.proto"; - -// ModerationAttestation is a signed proof of the moderation result. -// The signature is computed over this message without the signature field set. -message ModerationAttestation { - // SHA-256 hash of the moderated content to be allowed - bytes content_hash = 1; - - // Timestamp of the moderation - google.protobuf.Timestamp timestamp = 2; - - // The user who submitted the content - common.v1.UserId user_id = 3; - - // Public key of the attestor that signed this message - common.v1.PublicKey attestor = 4; - - // Attestor signature over this message - common.v1.Signature signature = 5; -} - -enum FlaggedCategory { - NONE = 0; - OTHER = 1; // Fallback category when flagged content does not fit into a well-defined FlaggedCategory - NSFW = 2; - IMPERSONATION = 3; - MISLEADING = 4; - SPAM = 5; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/moderation/v1/moderation_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/moderation/v1/moderation_service.proto deleted file mode 100644 index a8e0f51ee..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/moderation/v1/moderation_service.proto +++ /dev/null @@ -1,75 +0,0 @@ -syntax = "proto3"; - -package flipcash.moderation.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/moderation/v1;moderationpb"; -option java_package = "com.codeinc.flipcash.gen.moderation.v1"; -option objc_class_prefix = "FPBModerationV1"; - -import "common/v1/common.proto"; -import "moderation/v1/model.proto"; -import "validate/validate.proto"; - -service Moderation { - // ModerateText checks text content against moderation policies - rpc ModerateText(ModerateTextRequest) returns (ModerateTextResponse); - - // ModerateImage checks image content against moderation policies - rpc ModerateImage(ModerateImageRequest) returns (ModerateImageResponse); -} - -message ModerateTextRequest { - // The text content to moderate - string text = 1 [(validate.rules).string = { - min_len: 1 - max_len: 4096 - }]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; -} - -message ModerateTextResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - UNSUPPORTED_LANGUAGE = 2; - } - - // Whether the text content is allowed - bool is_allowed = 2; - - // Signed attestation of the moderation result when content is allowed - ModerationAttestation attestation = 3; - - // The best fit flagged category when content is not allowed - FlaggedCategory flagged_category = 4; -} - -message ModerateImageRequest { - // The raw image data to moderate - bytes image_data = 1 [(validate.rules).bytes = { - min_len: 1 - max_len: 1048576 // 1 MB - }]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; -} - -message ModerateImageResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - UNSUPPORTED_FORMAT = 2; - } - - // Whether the image content is allowed - bool is_allowed = 2; - - // Signed attestation of the moderation result when content is allowed - ModerationAttestation attestation = 3; - - // The best fit flagged category when content is not allowed - FlaggedCategory flagged_category = 4; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/phone/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/phone/v1/model.proto deleted file mode 100644 index 3c8247c2a..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/phone/v1/model.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package flipcash.phone.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/phone/v1;phonepb"; -option java_package = "com.codeinc.flipcash.gen.phone.v1"; -option objc_class_prefix = "FPBPhoneV1"; - -import "validate/validate.proto"; - -// VerificationCode is a 4-10 digit numerical code for verification -message VerificationCode { - string value = 2 [(validate.rules).string = { - pattern: "^[0-9]{4,10}$" - }]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/phone/v1/phone_verification_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/phone/v1/phone_verification_service.proto deleted file mode 100644 index f5338660c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/phone/v1/phone_verification_service.proto +++ /dev/null @@ -1,116 +0,0 @@ -syntax = "proto3"; - -package flipcash.phone.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/phone/v1;phonepb"; -option java_package = "com.codeinc.flipcash.gen.phone.v1"; -option objc_class_prefix = "FPBPhoneV1"; - -import "common/v1/common.proto"; -import "phone/v1/model.proto"; -import "validate/validate.proto"; - -service PhoneVerification { - // SendVerificationCode sends a verification code to the provided phone number - // over SMS. If an active verification is already taking place, the existing code - // will be resent. - rpc SendVerificationCode(SendVerificationCodeRequest) returns (SendVerificationCodeResponse); - - // CheckVerificationCode validates a verification code. On success, the phone number - // is linked to the user. Any previous links are overwritten. - rpc CheckVerificationCode(CheckVerificationCodeRequest) returns (CheckVerificationCodeResponse); - - // Unlink removes the link of a phone number from a user. - rpc Unlink(UnlinkRequest) returns (UnlinkResponse); - - // LinkForPayment links the verified phone number for the requesting user for payment. - rpc LinkForPayment(LinkForPaymentRequest) returns (LinkForPaymentResponse); -} - -message SendVerificationCodeRequest { - // The phone number to send a verification code over SMS to - common.v1.PhoneNumber phone_number = 1 [(validate.rules).message.required = true]; - - // The app platform that's making this request - common.v1.Platform platform = 2 [(validate.rules).enum = {in: [1,2]}]; - - common.v1.Auth auth = 3 [(validate.rules).message.required = true]; -} - -message SendVerificationCodeResponse { - Result result = 1; - enum Result { - OK = 0; - // SMS is denied - DENIED = 1; - // SMS is rate limited (eg. by IP, phone number, user, etc) and was not sent. - RATE_LIMITED = 2; - // The phone number is not real because it fails Twilio lookup. - INVALID_PHONE_NUMBER = 3; - // The phone number is valid, but it maps to an unsupported type of phone - // like a landline. - UNSUPPORTED_PHONE_TYPE = 4; - } -} - -message CheckVerificationCodeRequest { - // The phone number being verified - common.v1.PhoneNumber phone_number = 1 [(validate.rules).message.required = true]; - - // The verification code received via SMS - VerificationCode code = 2 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 3 [(validate.rules).message.required = true]; -} - -message CheckVerificationCodeResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - // The call is rate limited (eg. by IP, phone number, etc). The code is - // not verified. - RATE_LIMITED = 2; - // The provided verification code is invalid. The user may retry - // enterring the code if this is received. When max attempts are - // received, NO_VERIFICATION will be returned. - INVALID_CODE = 3; - // There is no verification in progress for the phone number. Several - // reasons this can occur include a verification being expired or having - // reached a maximum check threshold. The client must initiate a new - // verification using SendVerificationCode. - NO_VERIFICATION = 4; - } -} - -message UnlinkRequest { - // The phone number to unlink - common.v1.PhoneNumber phone_number = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; -} - -message UnlinkResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } -} - - -message LinkForPaymentRequest { - // The phone number to link for payment - common.v1.PhoneNumber phone_number = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; -} - -message LinkForPaymentResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - NOT_ASSOCIATED = 2; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/profile/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/profile/v1/model.proto deleted file mode 100644 index c02c0bb75..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/profile/v1/model.proto +++ /dev/null @@ -1,119 +0,0 @@ -syntax = "proto3"; - -package flipcash.profile.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/profile/v1;profilepb"; -option java_package = "com.codeinc.flipcash.gen.profile.v1"; -option objc_class_prefix = "FPBProfileV1"; - -import "blob/v1/model.proto"; -import "common/v1/common.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -message UserProfile { - // The ID of the user this profile belongs to. Always set, so a caller that - // looked the profile up by username learns the user's ID from the response. - common.v1.UserId user_id = 9 [(validate.rules).message.required = true]; - - // Display name is the display name of the user (if found). - string display_name = 1 [(validate.rules).string = { - min_len: 0 - max_len: 64 - }]; - - // The user's username on Flipcash. Public, so it is returned for any user, - // not just the caller. Unset when the user hasn't claimed one yet. - common.v1.Username username = 8; - - // Social profiles are links to external social accounts - repeated SocialProfile social_profiles = 2 [(validate.rules).repeated = { - min_items: 0 - max_items: 1 - }]; - - - // Phone number linked to this user. This is private and will only be returned - // when the requesting user asks for their own profile - common.v1.PhoneNumber phone_number = 3; - - // Email address linked to this user. This is private and will only be returned - // when the requesting user asks for their own profile - common.v1.EmailAddress email_address = 4; - - // The user's profile picture, as the set of renditions it is stored as — - // typically a DISPLAY for the profile view and a THUMBNAIL for avatars in - // member rows and chat lists. - // - // Unset when the user has not set a picture. Set it with SetProfilePicture. - // - // To fetch the bytes of ANOTHER user's picture, the caller does not own - // these blobs, so a GetBlobs call must carry a blob.v1.AccessContext whose - // `profile` scope names this user. A caller reading its own needs none. - blob.v1.Media profile_picture = 5; - - // Timestamp the user joined Flipcash - google.protobuf.Timestamp join_ts = 6 [(validate.rules).timestamp.required = true]; - - // How the user has customized their Tip Card. Public, so it is returned for - // any user, not just the caller. Always set — the server resolves defaults - // for anything the user hasn't customized. Update it with UpdateTipCard. - TipCardCustomization tip_card_customization = 7 [(validate.rules).message.required = true]; -} - -message SocialProfile { - oneof type { - option (validate.required) = true; - - XProfile x = 1; - } -} - -message XProfile { - // The user's ID on X - string id = 1 [(validate.rules).string = { - min_len: 1 - max_len: 32 - }]; - - // The user's username on X - string username = 2 [(validate.rules).string = { - min_len: 1 - max_len: 15 - }]; - - // The user's friendly name on X - string name = 3 [(validate.rules).string = { - max_len: 256 - }]; - - // The user's description on X - string description = 4 [(validate.rules).string = { - max_len: 4096 // todo: arbitrary - }]; - - // URL to the user's X profile picture - string profile_pic_url = 5 [(validate.rules).string = { - min_len: 1 - max_len: 2048 // todo: arbitrary - }]; - - // The type of X verification associated with the user - VerifiedType verified_type = 6; - enum VerifiedType { - NONE = 0; - BLUE = 1; - BUSINESS = 2; - GOVERNMENT = 3; - } - - // The number of followers the user has on X - uint32 follower_count = 7; -} - -// Customization for a Tip Card -message TipCardCustomization { - // The colour of the Tip Card. Always set — the server falls back to the - // default colour when the user hasn't picked one. - common.v1.Color color = 1 [(validate.rules).message.required = true]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/profile/v1/profile_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/profile/v1/profile_service.proto deleted file mode 100644 index fb9be2f19..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/profile/v1/profile_service.proto +++ /dev/null @@ -1,215 +0,0 @@ -syntax = "proto3"; - -package flipcash.profile.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/profile/v1;profilepb"; -option java_package = "com.codeinc.flipcash.gen.profile.v1"; -option objc_class_prefix = "FPBProfileV1"; - -import "blob/v1/model.proto"; -import "common/v1/common.proto"; -import "moderation/v1/model.proto"; -import "profile/v1/model.proto"; -import "validate/validate.proto"; - -service Profile { - rpc GetProfile(GetProfileRequest) returns (GetProfileResponse); - - rpc SetDisplayName(SetDisplayNameRequest) returns (SetDisplayNameResponse); - - // SetUsername sets the caller's username, replacing any username already - // set. - rpc SetUsername(SetUsernameRequest) returns (SetUsernameResponse); - - // SetProfilePicture sets the caller's profile picture to a blob they have - // already uploaded via BlobStorage, replacing any picture already set. - // - // The client uploads only the ORIGINAL — InitiateExternalUpload, PUT/POST - // the bytes, then (optionally) CompleteExternalUpload — and passes the - // resulting BlobId here once the blob is READY. The server derives the - // DISPLAY and THUMBNAIL renditions itself and returns the full set. - rpc SetProfilePicture(SetProfilePictureRequest) returns (SetProfilePictureResponse); - - // UpdateTipCard updates the caller's Tip Card customization. Every field is - // optional; only the ones set in the request are changed. - rpc UpdateTipCard(UpdateTipCardRequest) returns (UpdateTipCardResponse); - - // LinkSocialAccount links a social account to a user - rpc LinkSocialAccount(LinkSocialAccountRequest) returns (LinkSocialAccountResponse); - - // UnlinkSocialAccount removes a social account link from a user - rpc UnlinkSocialAccount(UnlinkSocialAccountRequest) returns (UnlinkSocialAccountResponse); -} - -message GetProfileRequest { - // The user whose profile is being fetched, identified either by their user - // ID or by their username. Exactly one must be set. - oneof identifier { - option (validate.required) = true; - - common.v1.UserId user_id = 1; - common.v1.Username username = 3; - } - - // Optional auth to retrieve private profile information for self - common.v1.Auth auth = 2; -} - -message GetProfileResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - } - - // UserProfile, if found. - // - // Some fields may or may not be set, depending on the scope of request - // in the future. - UserProfile user_profile = 2; -} - -message SetDisplayNameRequest { - // DisplayName is the new name to set. - string display_name = 1 [(validate.rules).string = { - min_len: 1 - max_len: 64 - }]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message SetDisplayNameResponse { - Result result = 1; - enum Result { - OK = 0; - INVALID_DISPLAY_NAME = 1; - DENIED = 2; - FAILED_MODERATED = 3; - } - - // The best-fit category that tripped moderation, mirroring the Moderation - // service's vocabulary. Set only when result == FAILED_MODERATED; NONE - // otherwise. - moderation.v1.FlaggedCategory flagged_category = 2; -} - -message SetUsernameRequest { - // Username is the new username to set. - common.v1.Username username = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message SetUsernameResponse { - Result result = 1; - enum Result { - OK = 0; - INVALID_USERNAME = 1; - DENIED = 2; - ALREADY_TAKEN = 3; - FAILED_MODERATED = 4; - INSUFFICIENT_BALANCE = 5; - RESERVED_WORD = 6; - } - - // The best-fit category that tripped moderation, mirroring the Moderation - // service's vocabulary. Set only when result == FAILED_MODERATED; NONE - // otherwise. - moderation.v1.FlaggedCategory flagged_category = 2; -} - -message SetProfilePictureRequest { - // The blob holding the ORIGINAL image the caller uploaded. It must be owned - // by the caller and READY; the server derives the remaining renditions from - // it. A blob may back at most one profile picture — reuse is not implied. - blob.v1.BlobId blob_id = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message SetProfilePictureResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - BLOB_NOT_FOUND = 2; // no such blob, or it is not owned by the caller - BLOB_NOT_READY = 3; // blob is still PENDING/PROCESSING; retry once READY - BLOB_REJECTED = 4; // blob failed validation or moderation; terminal for this id, so the client must upload again - INVALID_BLOB = 5; // blob is READY but unusable as a picture (e.g. not an image) - } - - // The caller's new profile picture, including the renditions the server - // derived. Set only when result == OK. - blob.v1.Media profile_picture = 2; -} - -message UpdateTipCardRequest { - // The new colour of the Tip Card. Left unchanged when unset. - common.v1.Color color = 1; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message UpdateTipCardResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - INVALID_COLOR = 2; - } -} - -message LinkSocialAccountRequest { - LinkingToken linking_token = 1 [(validate.rules).message.required = true]; - - message LinkingToken { - oneof type { - option (validate.required) = true; - - XLinkingToken x = 1; - } - - message XLinkingToken { - // X access token from the OAuth 2.0 flow - string access_token = 1[(validate.rules).string = { - min_len: 1 - max_len: 4096 // todo: arbitrary - }]; - } - } - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message LinkSocialAccountResponse { - Result result = 1; - enum Result { - OK = 0; - INVALID_LINKING_TOKEN = 1; - EXISTING_LINK = 2; - DENIED = 3; - } - - SocialProfile social_profile = 2; -} - -message UnlinkSocialAccountRequest { - oneof social_identifier { - option (validate.required) = true; - - string x_user_id = 1 [(validate.rules).string = { - max_len: 32 - }]; - } - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message UnlinkSocialAccountResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/push/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/push/v1/model.proto deleted file mode 100644 index 2ccc16e01..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/push/v1/model.proto +++ /dev/null @@ -1,79 +0,0 @@ -syntax = "proto3"; - -package flipcash.push.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/push/v1;pushpb"; -option java_package = "com.codeinc.flipcash.gen.push.v1"; -option objc_class_prefix = "FPBPushV1"; - -import "chat/v1/model.proto"; -import "common/v1/common.proto"; -import "validate/validate.proto"; - -enum TokenType { - UNKNOWN = 0; - // FCM registration token for an Android device - FCM_ANDROID = 1; - // FCM registration token or an iOS device - FCM_APNS = 2; -} - -// Payload provided as extra data in a push -message Payload { - // If present, where the app should navigate to after clicking the push - Navigation navigation = 1; - - // Ordered substitutions to apply to push title - repeated common.v1.Substitution title_substitutions = 2; - - // Ordered substitutions to apply to push body - repeated common.v1.Substitution body_substitutions = 3; - - // Push notification category - Category category = 4; - enum Category { - DEFAULT = 0; - DEPOSIT_WITHDRAWAL = 1; - BUY_SELL = 2; - GAIN = 3; - CHAT = 4; - CONTACT_JOIN = 5; - } - - // Push notification key for grouping pushes. If not set, then no grouping - // is applied. - string group_key = 5 [(validate.rules).string = { - max_len: 4096 // Arbitrary - }]; - - ChatMetadata chat_metadata = 6; -} - -// Navigation within the app upon clicking the push -message Navigation { - oneof type { - option (validate.required) = true; - - // Currency info page for the provided mint - common.v1.PublicKey currency_info = 1; - - // Chat for the provided ID - common.v1.ChatId chat_id = 2; - - // Chat for a contact with the provided phone number - common.v1.PhoneNumber chat_contact_phone_number = 3; - } -} -// Additional metadata provided for chat pushes -message ChatMetadata { - // The user ID that sent a chat message - // - // Note: This will not be set for system messages OR for notifications that - // don't relate to a user - common.v1.UserId sending_user_id = 1; - - // The type of chat - chat.v1.ChatType type = 2 [(validate.rules).enum = { - not_in: [0] // UNKNOWN - }]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/push/v1/push_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/push/v1/push_service.proto deleted file mode 100644 index fa1b9597e..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/push/v1/push_service.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; - -package flipcash.push.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/push/v1;pushpb"; -option java_package = "com.codeinc.flipcash.gen.push.v1"; -option objc_class_prefix = "FPBPushV1"; - -import "common/v1/common.proto"; -import "push/v1/model.proto"; -import "validate/validate.proto"; - -service Push { - // AddToken adds a push token associated with a user. - rpc AddToken(AddTokenRequest) returns (AddTokenResponse); - - // DeleteTokens removes all push tokens within an app install for a user - rpc DeleteTokens(DeleteTokensRequest) returns (DeleteTokensResponse); -} - -message AddTokenRequest { - TokenType token_type = 1 [(validate.rules).enum = {in: [1,2]}]; - - string push_token = 2 [(validate.rules).string = { - min_len: 1 - max_len: 4096 - }]; - - common.v1.AppInstallId app_install = 3 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 4 [(validate.rules).message.required = true]; -} - -message AddTokenResponse { - Result result = 1; - enum Result { - OK = 0; - INVALID_PUSH_TOKEN = 1; - } -} - -message DeleteTokensRequest { - common.v1.AppInstallId app_install = 1 [(validate.rules).message.required = true]; - - common.v1.Auth auth = 2 [(validate.rules).message.required = true]; -} - -message DeleteTokensResponse { - Result result = 1; - enum Result { - OK = 0; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/resolver/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/resolver/v1/model.proto deleted file mode 100644 index 5c77a739c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/resolver/v1/model.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; - -package flipcash.resolver.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/resolver/v1;resolverpb"; -option java_package = "com.codeinc.flipcash.gen.resolver.v1"; -option objc_class_prefix = "FPBResolverV1"; - -import "common/v1/common.proto"; -import "validate/validate.proto"; - -// Identifier wraps a real-world identifier that can be resolved to a -// payment destination address. -message Identifier { - oneof kind { - option (validate.required) = true; - - common.v1.PhoneNumber phone = 1; - common.v1.UserId user_id = 2; - common.v1.Username username = 3; - } -} - -// Resolution contains a payment destiation address mapping for an -// Identifier -message Resolution { - oneof kind { - option (validate.required) = true; - - common.v1.PublicKey address = 1; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/resolver/v1/resolver_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/resolver/v1/resolver_service.proto deleted file mode 100644 index ac7034778..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/resolver/v1/resolver_service.proto +++ /dev/null @@ -1,36 +0,0 @@ -syntax = "proto3"; - -package flipcash.resolver.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/resolver/v1;resolverpb"; -option java_package = "com.codeinc.flipcash.gen.resolver.v1"; -option objc_class_prefix = "FPBResolverV1"; - -import "common/v1/common.proto"; -import "resolver/v1/model.proto"; -import "validate/validate.proto"; - -// Resolver maps a real-world identifier (phone number, etc.) to a payment -// destination address. -service Resolver { - // Resolve looks up the payment destination address for the given identifier. - rpc Resolve(ResolveRequest) returns (ResolveResponse); -} - -message ResolveRequest { - common.v1.Auth auth = 1 [(validate.rules).message.required = true]; - - Identifier identifier = 2 [(validate.rules).message.required = true]; -} - -message ResolveResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - DENIED = 2; - } - - // The resolved payment destination address. Set when result == OK. - Resolution resolution = 2; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/settings/v1/settings_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/settings/v1/settings_service.proto deleted file mode 100644 index 3fdf614da..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/settings/v1/settings_service.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; - -package flipcash.settings.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/settings/v1;settingspb"; -option java_package = "com.codeinc.flipcash.gen.settings.v1"; -option objc_class_prefix = "FPBSettingsV1"; - -import "common/v1/common.proto"; -import "validate/validate.proto"; - -service Settings { - rpc UpdateSettings(UpdateSettingsRequest) returns (UpdateSettingsResponse); -} - -message UpdateSettingsRequest { - // Locale setting, only updated if present - common.v1.Locale locale = 1; - - // Region setting, only updated if present - common.v1.Region region = 2; - - common.v1.Auth auth = 10 [(validate.rules).message.required = true]; -} - -message UpdateSettingsResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - INVALID_LOCALE = 2; - INVALID_REGION = 3; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/thirdparty/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/thirdparty/v1/model.proto deleted file mode 100644 index 5eab691fb..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/thirdparty/v1/model.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; - -package flipcash.thirdparty.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/thirdparty/v1;thirdpartypb"; -option java_package = "com.codeinc.flipcash.gen.thirdparty.v1"; -option objc_class_prefix = "FPBThirdPartyV1"; - -import "validate/validate.proto"; - -enum Provider { - UNKNOWN = 0; - COINBASE = 1; -} - -message ApiKey { - Provider provider = 1 [(validate.rules).enum = {in: [1]}]; - - string value = 2 [(validate.rules).string = { - min_len: 36 - max_len: 36 - }]; -} - -message Jwt { - string value = 1 [(validate.rules).string = { - min_len: 1 - max_len: 1024 // Arbitrary - }]; -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/thirdparty/v1/third_party_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/thirdparty/v1/third_party_service.proto deleted file mode 100644 index ee3144263..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/thirdparty/v1/third_party_service.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -package flipcash.thirdparty.v1; - -option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/thirdparty/v1;thirdpartypb"; -option java_package = "com.codeinc.flipcash.gen.thirdparty.v1"; -option objc_class_prefix = "FPBThirdPartyV1"; - -import "common/v1/common.proto"; -import "thirdparty/v1/model.proto"; -import "validate/validate.proto"; - -service ThirdParty { - // GetJwt gets a JWT for auth against a third part - rpc GetJwt(GetJwtRequest) returns (GetJwtResponse); -} - -message GetJwtRequest { - ApiKey api_key = 1 [(validate.rules).message.required = true]; - - string method = 2 [(validate.rules).string = { - min_len: 3 - max_len: 4 - }]; - - string host = 3 [(validate.rules).string = { - min_len: 1 - max_len: 1024 - }]; - - string path = 4 [(validate.rules).string = { - min_len: 1 - max_len: 1024 - }]; - - common.v1.Auth auth = 5 [(validate.rules).message.required = true]; -} - -message GetJwtResponse { - Result result = 1; - enum Result { - OK = 0; - DENIED = 1; - UNSUPPORTED_PROVIDER = 2; - INVALID_API_KEY = 3; - PHONE_VERIFICATION_REQUIRED = 4; - EMAIL_VERIFICATION_REQUIRED = 5; - } - - Jwt jwt = 2; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/validate/validate.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto/validate/validate.proto deleted file mode 100644 index 4195ecf9c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto/validate/validate.proto +++ /dev/null @@ -1,863 +0,0 @@ -syntax = "proto2"; -package validate; - -option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; -option java_package = "io.envoyproxy.pgv.validate"; - -import "google/protobuf/descriptor.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// Validation rules applied at the message level -extend google.protobuf.MessageOptions { - // Disabled nullifies any validation rules for this message, including any - // message fields associated with it that do support validation. - optional bool disabled = 1071; - // Ignore skips generation of validation methods for this message. - optional bool ignored = 1072; -} - -// Validation rules applied at the oneof level -extend google.protobuf.OneofOptions { - // Required ensures that exactly one the field options in a oneof is set; - // validation fails if no fields in the oneof are set. - optional bool required = 1071; -} - -// Validation rules applied at the field level -extend google.protobuf.FieldOptions { - // Rules specify the validations to be performed on this field. By default, - // no validation is performed against a field. - optional FieldRules rules = 1071; -} - -// FieldRules encapsulates the rules for each type of field. Depending on the -// field, the correct set should be used to ensure proper validations. -message FieldRules { - optional MessageRules message = 17; - oneof type { - // Scalar Field Types - FloatRules float = 1; - DoubleRules double = 2; - Int32Rules int32 = 3; - Int64Rules int64 = 4; - UInt32Rules uint32 = 5; - UInt64Rules uint64 = 6; - SInt32Rules sint32 = 7; - SInt64Rules sint64 = 8; - Fixed32Rules fixed32 = 9; - Fixed64Rules fixed64 = 10; - SFixed32Rules sfixed32 = 11; - SFixed64Rules sfixed64 = 12; - BoolRules bool = 13; - StringRules string = 14; - BytesRules bytes = 15; - - // Complex Field Types - EnumRules enum = 16; - RepeatedRules repeated = 18; - MapRules map = 19; - - // Well-Known Field Types - AnyRules any = 20; - DurationRules duration = 21; - TimestampRules timestamp = 22; - } -} - -// FloatRules describes the constraints applied to `float` values -message FloatRules { - // Const specifies that this field must be exactly the specified value - optional float const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional float lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional float lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional float gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional float gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated float in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated float not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// DoubleRules describes the constraints applied to `double` values -message DoubleRules { - // Const specifies that this field must be exactly the specified value - optional double const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional double lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional double lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional double gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional double gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated double in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated double not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int32Rules describes the constraints applied to `int32` values -message Int32Rules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int64Rules describes the constraints applied to `int64` values -message Int64Rules { - // Const specifies that this field must be exactly the specified value - optional int64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt32Rules describes the constraints applied to `uint32` values -message UInt32Rules { - // Const specifies that this field must be exactly the specified value - optional uint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt64Rules describes the constraints applied to `uint64` values -message UInt64Rules { - // Const specifies that this field must be exactly the specified value - optional uint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt32Rules describes the constraints applied to `sint32` values -message SInt32Rules { - // Const specifies that this field must be exactly the specified value - optional sint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt64Rules describes the constraints applied to `sint64` values -message SInt64Rules { - // Const specifies that this field must be exactly the specified value - optional sint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed32Rules describes the constraints applied to `fixed32` values -message Fixed32Rules { - // Const specifies that this field must be exactly the specified value - optional fixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed64Rules describes the constraints applied to `fixed64` values -message Fixed64Rules { - // Const specifies that this field must be exactly the specified value - optional fixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed32Rules describes the constraints applied to `sfixed32` values -message SFixed32Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed64Rules describes the constraints applied to `sfixed64` values -message SFixed64Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// BoolRules describes the constraints applied to `bool` values -message BoolRules { - // Const specifies that this field must be exactly the specified value - optional bool const = 1; -} - -// StringRules describe the constraints applied to `string` values -message StringRules { - // Const specifies that this field must be exactly the specified value - optional string const = 1; - - // Len specifies that this field must be the specified number of - // characters (Unicode code points). Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 len = 19; - - // MinLen specifies that this field must be the specified number of - // characters (Unicode code points) at a minimum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of - // characters (Unicode code points) at a maximum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 max_len = 3; - - // LenBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 len_bytes = 20; - - // MinBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_bytes = 4; - - // MaxBytes specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_bytes = 5; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 6; - - // Prefix specifies that this field must have the specified substring at - // the beginning of the string. - optional string prefix = 7; - - // Suffix specifies that this field must have the specified substring at - // the end of the string. - optional string suffix = 8; - - // Contains specifies that this field must have the specified substring - // anywhere in the string. - optional string contains = 9; - - // NotContains specifies that this field cannot have the specified substring - // anywhere in the string. - optional string not_contains = 23; - - // In specifies that this field must be equal to one of the specified - // values - repeated string in = 10; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated string not_in = 11; - - // WellKnown rules provide advanced constraints against common string - // patterns - oneof well_known { - // Email specifies that the field must be a valid email address as - // defined by RFC 5322 - bool email = 12; - - // Hostname specifies that the field must be a valid hostname as - // defined by RFC 1034. This constraint does not support - // internationalized domain names (IDNs). - bool hostname = 13; - - // Ip specifies that the field must be a valid IP (v4 or v6) address. - // Valid IPv6 addresses should not include surrounding square brackets. - bool ip = 14; - - // Ipv4 specifies that the field must be a valid IPv4 address. - bool ipv4 = 15; - - // Ipv6 specifies that the field must be a valid IPv6 address. Valid - // IPv6 addresses should not include surrounding square brackets. - bool ipv6 = 16; - - // Uri specifies that the field must be a valid, absolute URI as defined - // by RFC 3986 - bool uri = 17; - - // UriRef specifies that the field must be a valid URI as defined by RFC - // 3986 and may be relative or absolute. - bool uri_ref = 18; - - // Address specifies that the field must be either a valid hostname as - // defined by RFC 1034 (which does not support internationalized domain - // names or IDNs), or it can be a valid IP (v4 or v6). - bool address = 21; - - // Uuid specifies that the field must be a valid UUID as defined by - // RFC 4122 - bool uuid = 22; - - // WellKnownRegex specifies a common well known pattern defined as a regex. - KnownRegex well_known_regex = 24; - } - - // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - // strict header validation. - // By default, this is true, and HTTP header validations are RFC-compliant. - // Setting to false will enable a looser validations that only disallows - // \r\n\0 characters, which can be used to bypass header matching rules. - optional bool strict = 25 [default = true]; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 26; -} - -// WellKnownRegex contain some well-known patterns. -enum KnownRegex { - UNKNOWN = 0; - - // HTTP header name as defined by RFC 7230. - HTTP_HEADER_NAME = 1; - - // HTTP header value as defined by RFC 7230. - HTTP_HEADER_VALUE = 2; -} - -// BytesRules describe the constraints applied to `bytes` values -message BytesRules { - // Const specifies that this field must be exactly the specified value - optional bytes const = 1; - - // Len specifies that this field must be the specified number of bytes - optional uint64 len = 13; - - // MinLen specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_len = 3; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 4; - - // Prefix specifies that this field must have the specified bytes at the - // beginning of the string. - optional bytes prefix = 5; - - // Suffix specifies that this field must have the specified bytes at the - // end of the string. - optional bytes suffix = 6; - - // Contains specifies that this field must have the specified bytes - // anywhere in the string. - optional bytes contains = 7; - - // In specifies that this field must be equal to one of the specified - // values - repeated bytes in = 8; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated bytes not_in = 9; - - // WellKnown rules provide advanced constraints against common byte - // patterns - oneof well_known { - // Ip specifies that the field must be a valid IP (v4 or v6) address in - // byte format - bool ip = 10; - - // Ipv4 specifies that the field must be a valid IPv4 address in byte - // format - bool ipv4 = 11; - - // Ipv6 specifies that the field must be a valid IPv6 address in byte - // format - bool ipv6 = 12; - } - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 14; -} - -// EnumRules describe the constraints applied to enum values -message EnumRules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // DefinedOnly specifies that this field must be only one of the defined - // values for this enum, failing on any undefined value. - optional bool defined_only = 2; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 3; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 4; -} - -// MessageRules describe the constraints applied to embedded message values. -// For message-type fields, validation is performed recursively. -message MessageRules { - // Skip specifies that the validation rules of this field should not be - // evaluated - optional bool skip = 1; - - // Required specifies that this field must be set - optional bool required = 2; -} - -// RepeatedRules describe the constraints applied to `repeated` values -message RepeatedRules { - // MinItems specifies that this field must have the specified number of - // items at a minimum - optional uint64 min_items = 1; - - // MaxItems specifies that this field must have the specified number of - // items at a maximum - optional uint64 max_items = 2; - - // Unique specifies that all elements in this field must be unique. This - // contraint is only applicable to scalar and enum types (messages are not - // supported). - optional bool unique = 3; - - // Items specifies the contraints to be applied to each item in the field. - // Repeated message fields will still execute validation against each item - // unless skip is specified here. - optional FieldRules items = 4; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 5; -} - -// MapRules describe the constraints applied to `map` values -message MapRules { - // MinPairs specifies that this field must have the specified number of - // KVs at a minimum - optional uint64 min_pairs = 1; - - // MaxPairs specifies that this field must have the specified number of - // KVs at a maximum - optional uint64 max_pairs = 2; - - // NoSparse specifies values in this field cannot be unset. This only - // applies to map's with message value types. - optional bool no_sparse = 3; - - // Keys specifies the constraints to be applied to each key in the field. - optional FieldRules keys = 4; - - // Values specifies the constraints to be applied to the value of each key - // in the field. Message values will still have their validations evaluated - // unless skip is specified here. - optional FieldRules values = 5; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 6; -} - -// AnyRules describe constraints applied exclusively to the -// `google.protobuf.Any` well-known type -message AnyRules { - // Required specifies that this field must be set - optional bool required = 1; - - // In specifies that this field's `type_url` must be equal to one of the - // specified values. - repeated string in = 2; - - // NotIn specifies that this field's `type_url` must not be equal to any of - // the specified values. - repeated string not_in = 3; -} - -// DurationRules describe the constraints applied exclusively to the -// `google.protobuf.Duration` well-known type -message DurationRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Duration const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Duration lt = 3; - - // Lt specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Duration lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Duration gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Duration gte = 6; - - // In specifies that this field must be equal to one of the specified - // values - repeated google.protobuf.Duration in = 7; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated google.protobuf.Duration not_in = 8; -} - -// TimestampRules describe the constraints applied exclusively to the -// `google.protobuf.Timestamp` well-known type -message TimestampRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Timestamp const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Timestamp lt = 3; - - // Lte specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Timestamp lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Timestamp gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Timestamp gte = 6; - - // LtNow specifies that this must be less than the current time. LtNow - // can only be used with the Within rule. - optional bool lt_now = 7; - - // GtNow specifies that this must be greater than the current time. GtNow - // can only be used with the Within rule. - optional bool gt_now = 8; - - // Within specifies that this field must be within this duration of the - // current time. This constraint can be used alone or with the LtNow and - // GtNow rules. - optional google.protobuf.Duration within = 9; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Core/proto_deps/validate/validate.proto b/FlipcashAPI/Sources/FlipcashAPI/Core/proto_deps/validate/validate.proto deleted file mode 100644 index 4195ecf9c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Core/proto_deps/validate/validate.proto +++ /dev/null @@ -1,863 +0,0 @@ -syntax = "proto2"; -package validate; - -option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; -option java_package = "io.envoyproxy.pgv.validate"; - -import "google/protobuf/descriptor.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// Validation rules applied at the message level -extend google.protobuf.MessageOptions { - // Disabled nullifies any validation rules for this message, including any - // message fields associated with it that do support validation. - optional bool disabled = 1071; - // Ignore skips generation of validation methods for this message. - optional bool ignored = 1072; -} - -// Validation rules applied at the oneof level -extend google.protobuf.OneofOptions { - // Required ensures that exactly one the field options in a oneof is set; - // validation fails if no fields in the oneof are set. - optional bool required = 1071; -} - -// Validation rules applied at the field level -extend google.protobuf.FieldOptions { - // Rules specify the validations to be performed on this field. By default, - // no validation is performed against a field. - optional FieldRules rules = 1071; -} - -// FieldRules encapsulates the rules for each type of field. Depending on the -// field, the correct set should be used to ensure proper validations. -message FieldRules { - optional MessageRules message = 17; - oneof type { - // Scalar Field Types - FloatRules float = 1; - DoubleRules double = 2; - Int32Rules int32 = 3; - Int64Rules int64 = 4; - UInt32Rules uint32 = 5; - UInt64Rules uint64 = 6; - SInt32Rules sint32 = 7; - SInt64Rules sint64 = 8; - Fixed32Rules fixed32 = 9; - Fixed64Rules fixed64 = 10; - SFixed32Rules sfixed32 = 11; - SFixed64Rules sfixed64 = 12; - BoolRules bool = 13; - StringRules string = 14; - BytesRules bytes = 15; - - // Complex Field Types - EnumRules enum = 16; - RepeatedRules repeated = 18; - MapRules map = 19; - - // Well-Known Field Types - AnyRules any = 20; - DurationRules duration = 21; - TimestampRules timestamp = 22; - } -} - -// FloatRules describes the constraints applied to `float` values -message FloatRules { - // Const specifies that this field must be exactly the specified value - optional float const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional float lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional float lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional float gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional float gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated float in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated float not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// DoubleRules describes the constraints applied to `double` values -message DoubleRules { - // Const specifies that this field must be exactly the specified value - optional double const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional double lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional double lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional double gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional double gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated double in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated double not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int32Rules describes the constraints applied to `int32` values -message Int32Rules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int64Rules describes the constraints applied to `int64` values -message Int64Rules { - // Const specifies that this field must be exactly the specified value - optional int64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt32Rules describes the constraints applied to `uint32` values -message UInt32Rules { - // Const specifies that this field must be exactly the specified value - optional uint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt64Rules describes the constraints applied to `uint64` values -message UInt64Rules { - // Const specifies that this field must be exactly the specified value - optional uint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt32Rules describes the constraints applied to `sint32` values -message SInt32Rules { - // Const specifies that this field must be exactly the specified value - optional sint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt64Rules describes the constraints applied to `sint64` values -message SInt64Rules { - // Const specifies that this field must be exactly the specified value - optional sint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed32Rules describes the constraints applied to `fixed32` values -message Fixed32Rules { - // Const specifies that this field must be exactly the specified value - optional fixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed64Rules describes the constraints applied to `fixed64` values -message Fixed64Rules { - // Const specifies that this field must be exactly the specified value - optional fixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed32Rules describes the constraints applied to `sfixed32` values -message SFixed32Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed64Rules describes the constraints applied to `sfixed64` values -message SFixed64Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// BoolRules describes the constraints applied to `bool` values -message BoolRules { - // Const specifies that this field must be exactly the specified value - optional bool const = 1; -} - -// StringRules describe the constraints applied to `string` values -message StringRules { - // Const specifies that this field must be exactly the specified value - optional string const = 1; - - // Len specifies that this field must be the specified number of - // characters (Unicode code points). Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 len = 19; - - // MinLen specifies that this field must be the specified number of - // characters (Unicode code points) at a minimum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of - // characters (Unicode code points) at a maximum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 max_len = 3; - - // LenBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 len_bytes = 20; - - // MinBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_bytes = 4; - - // MaxBytes specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_bytes = 5; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 6; - - // Prefix specifies that this field must have the specified substring at - // the beginning of the string. - optional string prefix = 7; - - // Suffix specifies that this field must have the specified substring at - // the end of the string. - optional string suffix = 8; - - // Contains specifies that this field must have the specified substring - // anywhere in the string. - optional string contains = 9; - - // NotContains specifies that this field cannot have the specified substring - // anywhere in the string. - optional string not_contains = 23; - - // In specifies that this field must be equal to one of the specified - // values - repeated string in = 10; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated string not_in = 11; - - // WellKnown rules provide advanced constraints against common string - // patterns - oneof well_known { - // Email specifies that the field must be a valid email address as - // defined by RFC 5322 - bool email = 12; - - // Hostname specifies that the field must be a valid hostname as - // defined by RFC 1034. This constraint does not support - // internationalized domain names (IDNs). - bool hostname = 13; - - // Ip specifies that the field must be a valid IP (v4 or v6) address. - // Valid IPv6 addresses should not include surrounding square brackets. - bool ip = 14; - - // Ipv4 specifies that the field must be a valid IPv4 address. - bool ipv4 = 15; - - // Ipv6 specifies that the field must be a valid IPv6 address. Valid - // IPv6 addresses should not include surrounding square brackets. - bool ipv6 = 16; - - // Uri specifies that the field must be a valid, absolute URI as defined - // by RFC 3986 - bool uri = 17; - - // UriRef specifies that the field must be a valid URI as defined by RFC - // 3986 and may be relative or absolute. - bool uri_ref = 18; - - // Address specifies that the field must be either a valid hostname as - // defined by RFC 1034 (which does not support internationalized domain - // names or IDNs), or it can be a valid IP (v4 or v6). - bool address = 21; - - // Uuid specifies that the field must be a valid UUID as defined by - // RFC 4122 - bool uuid = 22; - - // WellKnownRegex specifies a common well known pattern defined as a regex. - KnownRegex well_known_regex = 24; - } - - // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - // strict header validation. - // By default, this is true, and HTTP header validations are RFC-compliant. - // Setting to false will enable a looser validations that only disallows - // \r\n\0 characters, which can be used to bypass header matching rules. - optional bool strict = 25 [default = true]; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 26; -} - -// WellKnownRegex contain some well-known patterns. -enum KnownRegex { - UNKNOWN = 0; - - // HTTP header name as defined by RFC 7230. - HTTP_HEADER_NAME = 1; - - // HTTP header value as defined by RFC 7230. - HTTP_HEADER_VALUE = 2; -} - -// BytesRules describe the constraints applied to `bytes` values -message BytesRules { - // Const specifies that this field must be exactly the specified value - optional bytes const = 1; - - // Len specifies that this field must be the specified number of bytes - optional uint64 len = 13; - - // MinLen specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_len = 3; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 4; - - // Prefix specifies that this field must have the specified bytes at the - // beginning of the string. - optional bytes prefix = 5; - - // Suffix specifies that this field must have the specified bytes at the - // end of the string. - optional bytes suffix = 6; - - // Contains specifies that this field must have the specified bytes - // anywhere in the string. - optional bytes contains = 7; - - // In specifies that this field must be equal to one of the specified - // values - repeated bytes in = 8; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated bytes not_in = 9; - - // WellKnown rules provide advanced constraints against common byte - // patterns - oneof well_known { - // Ip specifies that the field must be a valid IP (v4 or v6) address in - // byte format - bool ip = 10; - - // Ipv4 specifies that the field must be a valid IPv4 address in byte - // format - bool ipv4 = 11; - - // Ipv6 specifies that the field must be a valid IPv6 address in byte - // format - bool ipv6 = 12; - } - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 14; -} - -// EnumRules describe the constraints applied to enum values -message EnumRules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // DefinedOnly specifies that this field must be only one of the defined - // values for this enum, failing on any undefined value. - optional bool defined_only = 2; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 3; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 4; -} - -// MessageRules describe the constraints applied to embedded message values. -// For message-type fields, validation is performed recursively. -message MessageRules { - // Skip specifies that the validation rules of this field should not be - // evaluated - optional bool skip = 1; - - // Required specifies that this field must be set - optional bool required = 2; -} - -// RepeatedRules describe the constraints applied to `repeated` values -message RepeatedRules { - // MinItems specifies that this field must have the specified number of - // items at a minimum - optional uint64 min_items = 1; - - // MaxItems specifies that this field must have the specified number of - // items at a maximum - optional uint64 max_items = 2; - - // Unique specifies that all elements in this field must be unique. This - // contraint is only applicable to scalar and enum types (messages are not - // supported). - optional bool unique = 3; - - // Items specifies the contraints to be applied to each item in the field. - // Repeated message fields will still execute validation against each item - // unless skip is specified here. - optional FieldRules items = 4; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 5; -} - -// MapRules describe the constraints applied to `map` values -message MapRules { - // MinPairs specifies that this field must have the specified number of - // KVs at a minimum - optional uint64 min_pairs = 1; - - // MaxPairs specifies that this field must have the specified number of - // KVs at a maximum - optional uint64 max_pairs = 2; - - // NoSparse specifies values in this field cannot be unset. This only - // applies to map's with message value types. - optional bool no_sparse = 3; - - // Keys specifies the constraints to be applied to each key in the field. - optional FieldRules keys = 4; - - // Values specifies the constraints to be applied to the value of each key - // in the field. Message values will still have their validations evaluated - // unless skip is specified here. - optional FieldRules values = 5; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 6; -} - -// AnyRules describe constraints applied exclusively to the -// `google.protobuf.Any` well-known type -message AnyRules { - // Required specifies that this field must be set - optional bool required = 1; - - // In specifies that this field's `type_url` must be equal to one of the - // specified values. - repeated string in = 2; - - // NotIn specifies that this field's `type_url` must not be equal to any of - // the specified values. - repeated string not_in = 3; -} - -// DurationRules describe the constraints applied exclusively to the -// `google.protobuf.Duration` well-known type -message DurationRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Duration const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Duration lt = 3; - - // Lt specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Duration lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Duration gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Duration gte = 6; - - // In specifies that this field must be equal to one of the specified - // values - repeated google.protobuf.Duration in = 7; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated google.protobuf.Duration not_in = 8; -} - -// TimestampRules describe the constraints applied exclusively to the -// `google.protobuf.Timestamp` well-known type -message TimestampRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Timestamp const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Timestamp lt = 3; - - // Lte specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Timestamp lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Timestamp gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Timestamp gte = 6; - - // LtNow specifies that this must be less than the current time. LtNow - // can only be used with the Within rule. - optional bool lt_now = 7; - - // GtNow specifies that this must be greater than the current time. GtNow - // can only be used with the Within rule. - optional bool gt_now = 8; - - // Within specifies that this field must be within this duration of the - // current time. This constraint can be used alone or with the LtNow and - // GtNow rules. - optional google.protobuf.Duration within = 9; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Exports.swift b/FlipcashAPI/Sources/FlipcashAPI/Exports.swift new file mode 100644 index 000000000..f0eb49a45 --- /dev/null +++ b/FlipcashAPI/Sources/FlipcashAPI/Exports.swift @@ -0,0 +1,12 @@ +// FlipcashAPI is an umbrella over the two published contract packages. +// +// The generated code used to live here, vendored alongside a copy of the .proto files. It now +// ships from code-payments/ocp-client-protocol and code-payments/flipcash2-client-protocol, +// which generate from the same upstream contracts this package used to pull with +// Scripts/pull_protos. +// +// Re-exporting rather than asking callers to import the two modules directly keeps `import +// FlipcashAPI` working unchanged, which is what every consumer in this repo already writes. + +@_exported import OCPClientProtocol +@_exported import Flipcash2ClientProtocol diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/account_v1_ocp_account_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/account_v1_ocp_account_service.grpc.swift deleted file mode 100644 index 3dd1c4bdc..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/account_v1_ocp_account_service.grpc.swift +++ /dev/null @@ -1,345 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: account/v1/ocp_account_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - ocp.account.v1.Account - -/// Namespace containing generated types for the "ocp.account.v1.Account" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Ocp_Account_V1_Account { - /// Service descriptor for the "ocp.account.v1.Account" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.account.v1.Account") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "IsOcpAccount" metadata. - public enum IsOcpAccount { - /// Request type for "IsOcpAccount". - public typealias Input = Ocp_Account_V1_IsOcpAccountRequest - /// Response type for "IsOcpAccount". - public typealias Output = Ocp_Account_V1_IsOcpAccountResponse - /// Descriptor for "IsOcpAccount". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.account.v1.Account"), - method: "IsOcpAccount" - ) - } - /// Namespace for "GetTokenAccountInfos" metadata. - public enum GetTokenAccountInfos { - /// Request type for "GetTokenAccountInfos". - public typealias Input = Ocp_Account_V1_GetTokenAccountInfosRequest - /// Response type for "GetTokenAccountInfos". - public typealias Output = Ocp_Account_V1_GetTokenAccountInfosResponse - /// Descriptor for "GetTokenAccountInfos". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.account.v1.Account"), - method: "GetTokenAccountInfos" - ) - } - /// Descriptors for all methods in the "ocp.account.v1.Account" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - IsOcpAccount.descriptor, - GetTokenAccountInfos.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "ocp.account.v1.Account" service. - public static let ocp_account_v1_Account = GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.account.v1.Account") -} - -// MARK: ocp.account.v1.Account (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Account_V1_Account { - /// Generated client protocol for the "ocp.account.v1.Account" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "IsOcpAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > IsOcpAccount returns whether an owner account is a OCP account. This hints - /// > to the client whether the account can be logged in, used for making payments, - /// > etc. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Account_V1_IsOcpAccountRequest` message. - /// - serializer: A serializer for `Ocp_Account_V1_IsOcpAccountRequest` messages. - /// - deserializer: A deserializer for `Ocp_Account_V1_IsOcpAccountResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func isOcpAccount( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetTokenAccountInfos" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetTokenAccountInfos returns token account metadata relevant to the OCP owner - /// > account. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Account_V1_GetTokenAccountInfosRequest` message. - /// - serializer: A serializer for `Ocp_Account_V1_GetTokenAccountInfosRequest` messages. - /// - deserializer: A deserializer for `Ocp_Account_V1_GetTokenAccountInfosResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getTokenAccountInfos( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "ocp.account.v1.Account" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "IsOcpAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > IsOcpAccount returns whether an owner account is a OCP account. This hints - /// > to the client whether the account can be logged in, used for making payments, - /// > etc. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Account_V1_IsOcpAccountRequest` message. - /// - serializer: A serializer for `Ocp_Account_V1_IsOcpAccountRequest` messages. - /// - deserializer: A deserializer for `Ocp_Account_V1_IsOcpAccountResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func isOcpAccount( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Account_V1_Account.Method.IsOcpAccount.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetTokenAccountInfos" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetTokenAccountInfos returns token account metadata relevant to the OCP owner - /// > account. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Account_V1_GetTokenAccountInfosRequest` message. - /// - serializer: A serializer for `Ocp_Account_V1_GetTokenAccountInfosRequest` messages. - /// - deserializer: A deserializer for `Ocp_Account_V1_GetTokenAccountInfosResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getTokenAccountInfos( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Account_V1_Account.Method.GetTokenAccountInfos.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Account_V1_Account.ClientProtocol { - /// Call the "IsOcpAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > IsOcpAccount returns whether an owner account is a OCP account. This hints - /// > to the client whether the account can be logged in, used for making payments, - /// > etc. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Account_V1_IsOcpAccountRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func isOcpAccount( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.isOcpAccount( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetTokenAccountInfos" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetTokenAccountInfos returns token account metadata relevant to the OCP owner - /// > account. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Account_V1_GetTokenAccountInfosRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getTokenAccountInfos( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getTokenAccountInfos( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Account_V1_Account.ClientProtocol { - /// Call the "IsOcpAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > IsOcpAccount returns whether an owner account is a OCP account. This hints - /// > to the client whether the account can be logged in, used for making payments, - /// > etc. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func isOcpAccount( - _ message: Ocp_Account_V1_IsOcpAccountRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.isOcpAccount( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetTokenAccountInfos" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetTokenAccountInfos returns token account metadata relevant to the OCP owner - /// > account. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getTokenAccountInfos( - _ message: Ocp_Account_V1_GetTokenAccountInfosRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getTokenAccountInfos( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/account_v1_ocp_account_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/account_v1_ocp_account_service.pb.swift deleted file mode 100644 index 067973737..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/account_v1_ocp_account_service.pb.swift +++ /dev/null @@ -1,1062 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: account/v1/ocp_account_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Ocp_Account_V1_IsOcpAccountRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The owner account to check against. - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(IsOcpAccountRequest) without this field set - /// using the private key of the owner account. This provides an authentication - /// mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Account_V1_IsOcpAccountResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Account_V1_IsOcpAccountResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// The account is an OCP account. - case ok // = 0 - - /// The account is not an OCP account. - case notFound // = 1 - - /// The account exists, but at least one timelock account is unlocked. - case unlockedTimelockAccount // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - case 2: self = .unlockedTimelockAccount - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .unlockedTimelockAccount: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Account_V1_IsOcpAccountResponse.Result] = [ - .ok, - .notFound, - .unlockedTimelockAccount, - ] - - } - - public init() {} -} - -public struct Ocp_Account_V1_GetTokenAccountInfosRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The owner account to fetch balances for, which can also be thought of as a - /// parent account for this RPC that links to one or more token accounts. - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(GetTokenAccountInfosRequest) without signature - /// fields set using the private key of the owner account. This provides - /// an authentication mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - /// A requesting owner account that is requesting the balance for owner. Additional - /// metadata that is considered private will be provided, if applicable. An example - /// use case includes a user owner account requesting account info for a gift card - /// owner account. - public var requestingOwner: Ocp_Common_V1_SolanaAccountId { - get {return _requestingOwner ?? Ocp_Common_V1_SolanaAccountId()} - set {_requestingOwner = newValue} - } - /// Returns true if `requestingOwner` has been explicitly set. - public var hasRequestingOwner: Bool {return self._requestingOwner != nil} - /// Clears the value of `requestingOwner`. Subsequent reads from it will return its default value. - public mutating func clearRequestingOwner() {self._requestingOwner = nil} - - /// The signature is of serialize(GetTokenAccountInfosRequest) without signature - /// fields set using the private key of the requesting_owner_signature account. - /// This provides an authentication mechanism to the RPC when requesting_owner is - /// present. - /// - /// This must be set when requesting_owner is present. - public var requestingOwnerSignature: Ocp_Common_V1_Signature { - get {return _requestingOwnerSignature ?? Ocp_Common_V1_Signature()} - set {_requestingOwnerSignature = newValue} - } - /// Returns true if `requestingOwnerSignature` has been explicitly set. - public var hasRequestingOwnerSignature: Bool {return self._requestingOwnerSignature != nil} - /// Clears the value of `requestingOwnerSignature`. Subsequent reads from it will return its default value. - public mutating func clearRequestingOwnerSignature() {self._requestingOwnerSignature = nil} - - /// Filter to apply to limit response sizes - public var filter: Ocp_Account_V1_GetTokenAccountInfosRequest.OneOf_Filter? = nil - - public var filterByTokenAddress: Ocp_Common_V1_SolanaAccountId { - get { - if case .filterByTokenAddress(let v)? = filter {return v} - return Ocp_Common_V1_SolanaAccountId() - } - set {filter = .filterByTokenAddress(newValue)} - } - - public var filterByAccountType: Ocp_Common_V1_AccountType { - get { - if case .filterByAccountType(let v)? = filter {return v} - return .unknown - } - set {filter = .filterByAccountType(newValue)} - } - - public var filterByMintAddress: Ocp_Common_V1_SolanaAccountId { - get { - if case .filterByMintAddress(let v)? = filter {return v} - return Ocp_Common_V1_SolanaAccountId() - } - set {filter = .filterByMintAddress(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Filter to apply to limit response sizes - public enum OneOf_Filter: Equatable, Sendable { - case filterByTokenAddress(Ocp_Common_V1_SolanaAccountId) - case filterByAccountType(Ocp_Common_V1_AccountType) - case filterByMintAddress(Ocp_Common_V1_SolanaAccountId) - - } - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil - fileprivate var _requestingOwner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _requestingOwnerSignature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Account_V1_GetTokenAccountInfosResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Account_V1_GetTokenAccountInfosResponse.Result = .ok - - public var tokenAccountInfos: Dictionary = [:] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Account_V1_GetTokenAccountInfosResponse.Result] = [ - .ok, - .notFound, - ] - - } - - public init() {} -} - -public struct Ocp_Account_V1_TokenAccountInfo: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The token account's address - public var address: Ocp_Common_V1_SolanaAccountId { - get {return _storage._address ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._address = newValue} - } - /// Returns true if `address` has been explicitly set. - public var hasAddress: Bool {return _storage._address != nil} - /// Clears the value of `address`. Subsequent reads from it will return its default value. - public mutating func clearAddress() {_uniqueStorage()._address = nil} - - /// The owner of the token account, which can also be thought of as a parent - /// account that links to one or more token accounts. This is provided when - /// available. - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _storage._owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return _storage._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {_uniqueStorage()._owner = nil} - - /// The token account's authority, which has access to moving funds for the - /// account. This can be the owner account under certain circumstances (eg. - /// ATA, primary account). This is provided when available. - public var authority: Ocp_Common_V1_SolanaAccountId { - get {return _storage._authority ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._authority = newValue} - } - /// Returns true if `authority` has been explicitly set. - public var hasAuthority: Bool {return _storage._authority != nil} - /// Clears the value of `authority`. Subsequent reads from it will return its default value. - public mutating func clearAuthority() {_uniqueStorage()._authority = nil} - - /// The type of token account, which infers its intended use. - public var accountType: Ocp_Common_V1_AccountType { - get {return _storage._accountType} - set {_uniqueStorage()._accountType = newValue} - } - - /// The account's derivation index for applicable account types. When this field - /// doesn't apply, a zero value is provided. - public var index: UInt64 { - get {return _storage._index} - set {_uniqueStorage()._index = newValue} - } - - /// The source of truth for the balance calculation. - public var balanceSource: Ocp_Account_V1_TokenAccountInfo.BalanceSource { - get {return _storage._balanceSource} - set {_uniqueStorage()._balanceSource = newValue} - } - - /// The balance in quarks, as observed by the OCP. This may not reflect the value - /// on the blockchain and could be non-zero even if the account hasn't been created. - /// Use balance_source to determine how this value was calculated. - public var balance: UInt64 { - get {return _storage._balance} - set {_uniqueStorage()._balance = newValue} - } - - /// The state of the account as it pertains to the OCP's ability to manage funds. - public var managementState: Ocp_Account_V1_TokenAccountInfo.ManagementState { - get {return _storage._managementState} - set {_uniqueStorage()._managementState = newValue} - } - - /// The state of the account on the blockchain. - public var blockchainState: Ocp_Account_V1_TokenAccountInfo.BlockchainState { - get {return _storage._blockchainState} - set {_uniqueStorage()._blockchainState = newValue} - } - - /// Whether an account is claimed. This only applies to relevant account types - /// (eg. REMOTE_SEND_GIFT_CARD). - public var claimState: Ocp_Account_V1_TokenAccountInfo.ClaimState { - get {return _storage._claimState} - set {_uniqueStorage()._claimState = newValue} - } - - /// For account types used as an intermediary for sending money between two - /// users (eg. REMOTE_SEND_GIFT_CARD), this represents the original exchange - /// data used to fund the account. Over time, this value will become stale: - /// 1. Exchange rates will fluctuate, so the total fiat amount will differ. - /// 2. External entities can deposit additional funds into the account, so - /// the balance, in quarks, may be greater than the original quark value. - /// 3. The balance could have been received, so the total balance can show - /// as zero. - public var originalExchangeData: Ocp_Transaction_V1_ExchangeData { - get {return _storage._originalExchangeData ?? Ocp_Transaction_V1_ExchangeData()} - set {_uniqueStorage()._originalExchangeData = newValue} - } - /// Returns true if `originalExchangeData` has been explicitly set. - public var hasOriginalExchangeData: Bool {return _storage._originalExchangeData != nil} - /// Clears the value of `originalExchangeData`. Subsequent reads from it will return its default value. - public mutating func clearOriginalExchangeData() {_uniqueStorage()._originalExchangeData = nil} - - /// The token account's mint - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _storage._mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return _storage._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {_uniqueStorage()._mint = nil} - - /// Mint metadata for the token account's mint - public var mintMetadata: Ocp_Currency_V1_Mint { - get {return _storage._mintMetadata ?? Ocp_Currency_V1_Mint()} - set {_uniqueStorage()._mintMetadata = newValue} - } - /// Returns true if `mintMetadata` has been explicitly set. - public var hasMintMetadata: Bool {return _storage._mintMetadata != nil} - /// Clears the value of `mintMetadata`. Subsequent reads from it will return its default value. - public mutating func clearMintMetadata() {_uniqueStorage()._mintMetadata = nil} - - /// Live mint reserve state, if applicable - public var liveReserveState: Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState { - get {return _storage._liveReserveState ?? Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState()} - set {_uniqueStorage()._liveReserveState = newValue} - } - /// Returns true if `liveReserveState` has been explicitly set. - public var hasLiveReserveState: Bool {return _storage._liveReserveState != nil} - /// Clears the value of `liveReserveState`. Subsequent reads from it will return its default value. - public mutating func clearLiveReserveState() {_uniqueStorage()._liveReserveState = nil} - - /// Time the account was created, if available. For OCP accounts, this is - /// the time of intent submission. Otherwise, for external accounts, it is - /// the time created on the blockchain. - public var createdAt: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _storage._createdAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_uniqueStorage()._createdAt = newValue} - } - /// Returns true if `createdAt` has been explicitly set. - public var hasCreatedAt: Bool {return _storage._createdAt != nil} - /// Clears the value of `createdAt`. Subsequent reads from it will return its default value. - public mutating func clearCreatedAt() {_uniqueStorage()._createdAt = nil} - - /// For REMOTE_SEND_GIFT_CARD, if requesting_owner was provided, was - /// requesting_owner the issuer of the account. - public var isGiftCardIssuer: Bool { - get {return _storage._isGiftCardIssuer} - set {_uniqueStorage()._isGiftCardIssuer = newValue} - } - - /// The USD cost basis for this account, which can be used to compute currency - /// appreciation/depreciation - public var usdCostBasis: Double { - get {return _storage._usdCostBasis} - set {_uniqueStorage()._usdCostBasis = newValue} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum BalanceSource: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// The account's balance could not be determined. This may be returned when - /// the data source is unstable and a reliable balance cannot be determined. - case unknown // = 0 - - /// The account's balance was fetched directly from a finalized state on the - /// blockchain. - case blockchain // = 1 - - /// The account's balance was calculated using cached values in OCP. Accuracy - /// is only guaranteed when management_state is LOCKED. - case cache // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .blockchain - case 2: self = .cache - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .blockchain: return 1 - case .cache: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Account_V1_TokenAccountInfo.BalanceSource] = [ - .unknown, - .blockchain, - .cache, - ] - - } - - public enum ManagementState: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// The state of the account is unknown. This may be returned when the - /// data source is unstable and a reliable state cannot be determined. - case unknown // = 0 - - /// OCP does not maintain a management state and won't move funds for this - /// account. - case none // = 1 - - /// The account is in the process of transitioning to the LOCKED state. - case locking // = 2 - - /// The account's funds are locked and OCP has co-signing authority. - case locked // = 3 - - /// The account is in the process of transitioning to the UNLOCKED state. - case unlocking // = 4 - - /// The account's funds are unlocked and OCP no longer has co-signing - /// authority. The account must transition to the LOCKED state to have - /// management capabilities. - case unlocked // = 5 - - /// The account is in the process of transitioning to the CLOSED state. - case closing // = 6 - - /// The account has been closed and doesn't exist on the blockchain. - /// Subsequently, it also has a zero balance. - case closed // = 7 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .none - case 2: self = .locking - case 3: self = .locked - case 4: self = .unlocking - case 5: self = .unlocked - case 6: self = .closing - case 7: self = .closed - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .none: return 1 - case .locking: return 2 - case .locked: return 3 - case .unlocking: return 4 - case .unlocked: return 5 - case .closing: return 6 - case .closed: return 7 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Account_V1_TokenAccountInfo.ManagementState] = [ - .unknown, - .none, - .locking, - .locked, - .unlocking, - .unlocked, - .closing, - .closed, - ] - - } - - public enum BlockchainState: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// The state of the account is unknown. This may be returned when the - /// data source is unstable and a reliable state cannot be determined. - case unknown // = 0 - - /// The account does not exist on the blockchain. - case doesNotExist // = 1 - - /// The account is created and exists on the blockchain. - case exists // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .doesNotExist - case 2: self = .exists - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .doesNotExist: return 1 - case .exists: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Account_V1_TokenAccountInfo.BlockchainState] = [ - .unknown, - .doesNotExist, - .exists, - ] - - } - - public enum ClaimState: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// The account doesn't have a concept of being claimed, or the state - /// could not be fetched by server. - case unknown // = 0 - - /// The account has not yet been claimed. - case notClaimed // = 1 - - /// The account is claimed. Attempting to claim it will fail. - case claimed // = 2 - - /// The account hasn't been claimed, but is expired. Funds will move - /// back to the issuer. Attempting to claim it will fail. - case expired // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .notClaimed - case 2: self = .claimed - case 3: self = .expired - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .notClaimed: return 1 - case .claimed: return 2 - case .expired: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Account_V1_TokenAccountInfo.ClaimState] = [ - .unknown, - .notClaimed, - .claimed, - .expired, - ] - - } - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "ocp.account.v1" - -extension Ocp_Account_V1_IsOcpAccountRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IsOcpAccountRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}owner\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Account_V1_IsOcpAccountRequest, rhs: Ocp_Account_V1_IsOcpAccountRequest) -> Bool { - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Account_V1_IsOcpAccountResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IsOcpAccountResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Account_V1_IsOcpAccountResponse, rhs: Ocp_Account_V1_IsOcpAccountResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Account_V1_IsOcpAccountResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0\u{1}UNLOCKED_TIMELOCK_ACCOUNT\0") -} - -extension Ocp_Account_V1_GetTokenAccountInfosRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetTokenAccountInfosRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}owner\0\u{1}signature\0\u{3}requesting_owner\0\u{3}requesting_owner_signature\0\u{4}\u{6}filter_by_token_address\0\u{3}filter_by_account_type\0\u{3}filter_by_mint_address\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._requestingOwner) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._requestingOwnerSignature) }() - case 10: try { - var v: Ocp_Common_V1_SolanaAccountId? - var hadOneofValue = false - if let current = self.filter { - hadOneofValue = true - if case .filterByTokenAddress(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.filter = .filterByTokenAddress(v) - } - }() - case 11: try { - var v: Ocp_Common_V1_AccountType? - try decoder.decodeSingularEnumField(value: &v) - if let v = v { - if self.filter != nil {try decoder.handleConflictingOneOf()} - self.filter = .filterByAccountType(v) - } - }() - case 12: try { - var v: Ocp_Common_V1_SolanaAccountId? - var hadOneofValue = false - if let current = self.filter { - hadOneofValue = true - if case .filterByMintAddress(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.filter = .filterByMintAddress(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._requestingOwner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._requestingOwnerSignature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - switch self.filter { - case .filterByTokenAddress?: try { - guard case .filterByTokenAddress(let v)? = self.filter else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - }() - case .filterByAccountType?: try { - guard case .filterByAccountType(let v)? = self.filter else { preconditionFailure() } - try visitor.visitSingularEnumField(value: v, fieldNumber: 11) - }() - case .filterByMintAddress?: try { - guard case .filterByMintAddress(let v)? = self.filter else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Account_V1_GetTokenAccountInfosRequest, rhs: Ocp_Account_V1_GetTokenAccountInfosRequest) -> Bool { - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs._requestingOwner != rhs._requestingOwner {return false} - if lhs._requestingOwnerSignature != rhs._requestingOwnerSignature {return false} - if lhs.filter != rhs.filter {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Account_V1_GetTokenAccountInfosResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetTokenAccountInfosResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}token_account_infos\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.tokenAccountInfos) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.tokenAccountInfos.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.tokenAccountInfos, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Account_V1_GetTokenAccountInfosResponse, rhs: Ocp_Account_V1_GetTokenAccountInfosResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.tokenAccountInfos != rhs.tokenAccountInfos {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Account_V1_GetTokenAccountInfosResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0") -} - -extension Ocp_Account_V1_TokenAccountInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TokenAccountInfo" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}address\0\u{1}owner\0\u{1}authority\0\u{3}account_type\0\u{1}index\0\u{3}balance_source\0\u{1}balance\0\u{3}management_state\0\u{3}blockchain_state\0\u{3}claim_state\0\u{3}original_exchange_data\0\u{1}mint\0\u{3}created_at\0\u{3}is_gift_card_issuer\0\u{3}usd_cost_basis\0\u{3}mint_metadata\0\u{3}live_reserve_state\0") - - fileprivate class _StorageClass { - var _address: Ocp_Common_V1_SolanaAccountId? = nil - var _owner: Ocp_Common_V1_SolanaAccountId? = nil - var _authority: Ocp_Common_V1_SolanaAccountId? = nil - var _accountType: Ocp_Common_V1_AccountType = .unknown - var _index: UInt64 = 0 - var _balanceSource: Ocp_Account_V1_TokenAccountInfo.BalanceSource = .unknown - var _balance: UInt64 = 0 - var _managementState: Ocp_Account_V1_TokenAccountInfo.ManagementState = .unknown - var _blockchainState: Ocp_Account_V1_TokenAccountInfo.BlockchainState = .unknown - var _claimState: Ocp_Account_V1_TokenAccountInfo.ClaimState = .unknown - var _originalExchangeData: Ocp_Transaction_V1_ExchangeData? = nil - var _mint: Ocp_Common_V1_SolanaAccountId? = nil - var _mintMetadata: Ocp_Currency_V1_Mint? = nil - var _liveReserveState: Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState? = nil - var _createdAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - var _isGiftCardIssuer: Bool = false - var _usdCostBasis: Double = 0 - - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _address = source._address - _owner = source._owner - _authority = source._authority - _accountType = source._accountType - _index = source._index - _balanceSource = source._balanceSource - _balance = source._balance - _managementState = source._managementState - _blockchainState = source._blockchainState - _claimState = source._claimState - _originalExchangeData = source._originalExchangeData - _mint = source._mint - _mintMetadata = source._mintMetadata - _liveReserveState = source._liveReserveState - _createdAt = source._createdAt - _isGiftCardIssuer = source._isGiftCardIssuer - _usdCostBasis = source._usdCostBasis - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._address) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._owner) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._authority) }() - case 4: try { try decoder.decodeSingularEnumField(value: &_storage._accountType) }() - case 5: try { try decoder.decodeSingularUInt64Field(value: &_storage._index) }() - case 6: try { try decoder.decodeSingularEnumField(value: &_storage._balanceSource) }() - case 7: try { try decoder.decodeSingularUInt64Field(value: &_storage._balance) }() - case 8: try { try decoder.decodeSingularEnumField(value: &_storage._managementState) }() - case 9: try { try decoder.decodeSingularEnumField(value: &_storage._blockchainState) }() - case 10: try { try decoder.decodeSingularEnumField(value: &_storage._claimState) }() - case 11: try { try decoder.decodeSingularMessageField(value: &_storage._originalExchangeData) }() - case 12: try { try decoder.decodeSingularMessageField(value: &_storage._mint) }() - case 13: try { try decoder.decodeSingularMessageField(value: &_storage._createdAt) }() - case 14: try { try decoder.decodeSingularBoolField(value: &_storage._isGiftCardIssuer) }() - case 15: try { try decoder.decodeSingularDoubleField(value: &_storage._usdCostBasis) }() - case 16: try { try decoder.decodeSingularMessageField(value: &_storage._mintMetadata) }() - case 17: try { try decoder.decodeSingularMessageField(value: &_storage._liveReserveState) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._address { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = _storage._authority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if _storage._accountType != .unknown { - try visitor.visitSingularEnumField(value: _storage._accountType, fieldNumber: 4) - } - if _storage._index != 0 { - try visitor.visitSingularUInt64Field(value: _storage._index, fieldNumber: 5) - } - if _storage._balanceSource != .unknown { - try visitor.visitSingularEnumField(value: _storage._balanceSource, fieldNumber: 6) - } - if _storage._balance != 0 { - try visitor.visitSingularUInt64Field(value: _storage._balance, fieldNumber: 7) - } - if _storage._managementState != .unknown { - try visitor.visitSingularEnumField(value: _storage._managementState, fieldNumber: 8) - } - if _storage._blockchainState != .unknown { - try visitor.visitSingularEnumField(value: _storage._blockchainState, fieldNumber: 9) - } - if _storage._claimState != .unknown { - try visitor.visitSingularEnumField(value: _storage._claimState, fieldNumber: 10) - } - try { if let v = _storage._originalExchangeData { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - try { if let v = _storage._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } }() - try { if let v = _storage._createdAt { - try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - } }() - if _storage._isGiftCardIssuer != false { - try visitor.visitSingularBoolField(value: _storage._isGiftCardIssuer, fieldNumber: 14) - } - if _storage._usdCostBasis.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: _storage._usdCostBasis, fieldNumber: 15) - } - try { if let v = _storage._mintMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 16) - } }() - try { if let v = _storage._liveReserveState { - try visitor.visitSingularMessageField(value: v, fieldNumber: 17) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Account_V1_TokenAccountInfo, rhs: Ocp_Account_V1_TokenAccountInfo) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._address != rhs_storage._address {return false} - if _storage._owner != rhs_storage._owner {return false} - if _storage._authority != rhs_storage._authority {return false} - if _storage._accountType != rhs_storage._accountType {return false} - if _storage._index != rhs_storage._index {return false} - if _storage._balanceSource != rhs_storage._balanceSource {return false} - if _storage._balance != rhs_storage._balance {return false} - if _storage._managementState != rhs_storage._managementState {return false} - if _storage._blockchainState != rhs_storage._blockchainState {return false} - if _storage._claimState != rhs_storage._claimState {return false} - if _storage._originalExchangeData != rhs_storage._originalExchangeData {return false} - if _storage._mint != rhs_storage._mint {return false} - if _storage._mintMetadata != rhs_storage._mintMetadata {return false} - if _storage._liveReserveState != rhs_storage._liveReserveState {return false} - if _storage._createdAt != rhs_storage._createdAt {return false} - if _storage._isGiftCardIssuer != rhs_storage._isGiftCardIssuer {return false} - if _storage._usdCostBasis != rhs_storage._usdCostBasis {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Account_V1_TokenAccountInfo.BalanceSource: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0BALANCE_SOURCE_UNKNOWN\0\u{1}BALANCE_SOURCE_BLOCKCHAIN\0\u{1}BALANCE_SOURCE_CACHE\0") -} - -extension Ocp_Account_V1_TokenAccountInfo.ManagementState: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0MANAGEMENT_STATE_UNKNOWN\0\u{1}MANAGEMENT_STATE_NONE\0\u{1}MANAGEMENT_STATE_LOCKING\0\u{1}MANAGEMENT_STATE_LOCKED\0\u{1}MANAGEMENT_STATE_UNLOCKING\0\u{1}MANAGEMENT_STATE_UNLOCKED\0\u{1}MANAGEMENT_STATE_CLOSING\0\u{1}MANAGEMENT_STATE_CLOSED\0") -} - -extension Ocp_Account_V1_TokenAccountInfo.BlockchainState: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0BLOCKCHAIN_STATE_UNKNOWN\0\u{1}BLOCKCHAIN_STATE_DOES_NOT_EXIST\0\u{1}BLOCKCHAIN_STATE_EXISTS\0") -} - -extension Ocp_Account_V1_TokenAccountInfo.ClaimState: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0CLAIM_STATE_UNKNOWN\0\u{1}CLAIM_STATE_NOT_CLAIMED\0\u{1}CLAIM_STATE_CLAIMED\0\u{1}CLAIM_STATE_EXPIRED\0") -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/common_v1_model.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/common_v1_model.pb.swift deleted file mode 100644 index 927cae9c9..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/common_v1_model.pb.swift +++ /dev/null @@ -1,834 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: common/v1/model.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// AccountType associates a type to an account, which infers how an account is used -/// within the OCP ecosystem. -public enum Ocp_Common_V1_AccountType: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case primary // = 1 - case remoteSendGiftCard // = 2 - case swap // = 3 - case associatedTokenAccount // = 4 - case pool // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .primary - case 2: self = .remoteSendGiftCard - case 3: self = .swap - case 4: self = .associatedTokenAccount - case 5: self = .pool - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .primary: return 1 - case .remoteSendGiftCard: return 2 - case .swap: return 3 - case .associatedTokenAccount: return 4 - case .pool: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Common_V1_AccountType] = [ - .unknown, - .primary, - .remoteSendGiftCard, - .swap, - .associatedTokenAccount, - .pool, - ] - -} - -public enum Ocp_Common_V1_Interval: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case raw // = 0 - case second // = 1 - case minute // = 2 - case hour // = 3 - case day // = 4 - case week // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .raw - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .raw - case 1: self = .second - case 2: self = .minute - case 3: self = .hour - case 4: self = .day - case 5: self = .week - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .raw: return 0 - case .second: return 1 - case .minute: return 2 - case .hour: return 3 - case .day: return 4 - case .week: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Common_V1_Interval] = [ - .raw, - .second, - .minute, - .hour, - .day, - .week, - ] - -} - -/// SolanaAccountId is a raw binary Ed25519 public key for a Solana account -public struct Ocp_Common_V1_SolanaAccountId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// A Solana address lookup table used in versioned transactions -public struct Ocp_Common_V1_SolanaAddressLookupTable: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var address: Ocp_Common_V1_SolanaAccountId { - get {return _address ?? Ocp_Common_V1_SolanaAccountId()} - set {_address = newValue} - } - /// Returns true if `address` has been explicitly set. - public var hasAddress: Bool {return self._address != nil} - /// Clears the value of `address`. Subsequent reads from it will return its default value. - public mutating func clearAddress() {self._address = nil} - - public var entries: [Ocp_Common_V1_SolanaAccountId] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _address: Ocp_Common_V1_SolanaAccountId? = nil -} - -/// Transaction is a raw binary Solana transaction -public struct Ocp_Common_V1_Transaction: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Maximum size taken from: https://github.com/solana-labs/solana/blob/39b3ac6a8d29e14faa1de73d8b46d390ad41797b/sdk/src/packet.rs#L9-L13 - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Blockhash is a raw binary Solana blockchash -public struct Ocp_Common_V1_Blockhash: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Signature is a raw binary Ed25519 signature -public struct Ocp_Common_V1_Signature: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// IntentId is a client-side generated ID that maps to an intent to perform actions -/// on the blockchain fulfilled by the OCP sequencer. -public struct Ocp_Common_V1_IntentId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// SwapId is a client-side generated ID that maps to a swap. -public struct Ocp_Common_V1_SwapId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Hash is a raw binary 32 byte hash value -public struct Ocp_Common_V1_Hash: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// UUID is a 16 byte UUID value -public struct Ocp_Common_V1_UUID: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Request is a generic wrapper for gRPC requests -public struct Ocp_Common_V1_Request: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var version: String = String() - - public var service: String = String() - - public var method: String = String() - - public var body: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Response is a generic wrapper for gRPC responses -public struct Ocp_Common_V1_Response: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Common_V1_Response.Result = .ok - - public var body: Data = Data() - - public var message: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case error // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .error - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .error: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Common_V1_Response.Result] = [ - .ok, - .error, - ] - - } - - public init() {} -} - -public struct Ocp_Common_V1_ServerPing: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Timestamp the ping was sent on the stream, for client to get a sense - /// of potential network latency - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - /// The delay server will apply before sending the next ping - public var pingDelay: SwiftProtobuf.Google_Protobuf_Duration { - get {return _pingDelay ?? SwiftProtobuf.Google_Protobuf_Duration()} - set {_pingDelay = newValue} - } - /// Returns true if `pingDelay` has been explicitly set. - public var hasPingDelay: Bool {return self._pingDelay != nil} - /// Clears the value of `pingDelay`. Subsequent reads from it will return its default value. - public mutating func clearPingDelay() {self._pingDelay = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _pingDelay: SwiftProtobuf.Google_Protobuf_Duration? = nil -} - -public struct Ocp_Common_V1_ClientPong: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Timestamp the Pong was sent on the stream, for server to get a sense - /// of potential network latency - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "ocp.common.v1" - -extension Ocp_Common_V1_AccountType: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}PRIMARY\0\u{1}REMOTE_SEND_GIFT_CARD\0\u{1}SWAP\0\u{1}ASSOCIATED_TOKEN_ACCOUNT\0\u{1}POOL\0") -} - -extension Ocp_Common_V1_Interval: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0RAW\0\u{1}SECOND\0\u{1}MINUTE\0\u{1}HOUR\0\u{1}DAY\0\u{1}WEEK\0") -} - -extension Ocp_Common_V1_SolanaAccountId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SolanaAccountId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_SolanaAccountId, rhs: Ocp_Common_V1_SolanaAccountId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_SolanaAddressLookupTable: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SolanaAddressLookupTable" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}address\0\u{1}entries\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._address) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.entries) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._address { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.entries.isEmpty { - try visitor.visitRepeatedMessageField(value: self.entries, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_SolanaAddressLookupTable, rhs: Ocp_Common_V1_SolanaAddressLookupTable) -> Bool { - if lhs._address != rhs._address {return false} - if lhs.entries != rhs.entries {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_Transaction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Transaction" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_Transaction, rhs: Ocp_Common_V1_Transaction) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_Blockhash: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Blockhash" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_Blockhash, rhs: Ocp_Common_V1_Blockhash) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_Signature: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Signature" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_Signature, rhs: Ocp_Common_V1_Signature) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_IntentId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".IntentId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_IntentId, rhs: Ocp_Common_V1_IntentId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_SwapId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SwapId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_SwapId, rhs: Ocp_Common_V1_SwapId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_Hash: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Hash" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_Hash, rhs: Ocp_Common_V1_Hash) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_UUID: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UUID" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_UUID, rhs: Ocp_Common_V1_UUID) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Request" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}version\0\u{1}service\0\u{1}method\0\u{1}body\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.version) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.service) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.method) }() - case 4: try { try decoder.decodeSingularBytesField(value: &self.body) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.version.isEmpty { - try visitor.visitSingularStringField(value: self.version, fieldNumber: 1) - } - if !self.service.isEmpty { - try visitor.visitSingularStringField(value: self.service, fieldNumber: 2) - } - if !self.method.isEmpty { - try visitor.visitSingularStringField(value: self.method, fieldNumber: 3) - } - if !self.body.isEmpty { - try visitor.visitSingularBytesField(value: self.body, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_Request, rhs: Ocp_Common_V1_Request) -> Bool { - if lhs.version != rhs.version {return false} - if lhs.service != rhs.service {return false} - if lhs.method != rhs.method {return false} - if lhs.body != rhs.body {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Response" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}body\0\u{1}message\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.body) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.message) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.body.isEmpty { - try visitor.visitSingularBytesField(value: self.body, fieldNumber: 2) - } - if !self.message.isEmpty { - try visitor.visitSingularStringField(value: self.message, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_Response, rhs: Ocp_Common_V1_Response) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.body != rhs.body {return false} - if lhs.message != rhs.message {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_Response.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}ERROR\0") -} - -extension Ocp_Common_V1_ServerPing: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ServerPing" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}timestamp\0\u{3}ping_delay\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._pingDelay) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._pingDelay { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_ServerPing, rhs: Ocp_Common_V1_ServerPing) -> Bool { - if lhs._timestamp != rhs._timestamp {return false} - if lhs._pingDelay != rhs._pingDelay {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Common_V1_ClientPong: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ClientPong" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}timestamp\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Common_V1_ClientPong, rhs: Ocp_Common_V1_ClientPong) -> Bool { - if lhs._timestamp != rhs._timestamp {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/currency_v1_ocp_currency_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/currency_v1_ocp_currency_service.grpc.swift deleted file mode 100644 index c0006fb87..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/currency_v1_ocp_currency_service.grpc.swift +++ /dev/null @@ -1,1114 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: currency/v1/ocp_currency_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - ocp.currency.v1.Currency - -/// Namespace containing generated types for the "ocp.currency.v1.Currency" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Ocp_Currency_V1_Currency { - /// Service descriptor for the "ocp.currency.v1.Currency" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "GetMints" metadata. - public enum GetMints { - /// Request type for "GetMints". - public typealias Input = Ocp_Currency_V1_GetMintsRequest - /// Response type for "GetMints". - public typealias Output = Ocp_Currency_V1_GetMintsResponse - /// Descriptor for "GetMints". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency"), - method: "GetMints" - ) - } - /// Namespace for "GetHistoricalMintData" metadata. - public enum GetHistoricalMintData { - /// Request type for "GetHistoricalMintData". - public typealias Input = Ocp_Currency_V1_GetHistoricalMintDataRequest - /// Response type for "GetHistoricalMintData". - public typealias Output = Ocp_Currency_V1_GetHistoricalMintDataResponse - /// Descriptor for "GetHistoricalMintData". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency"), - method: "GetHistoricalMintData" - ) - } - /// Namespace for "StreamLiveMintData" metadata. - public enum StreamLiveMintData { - /// Request type for "StreamLiveMintData". - public typealias Input = Ocp_Currency_V1_StreamLiveMintDataRequest - /// Response type for "StreamLiveMintData". - public typealias Output = Ocp_Currency_V1_StreamLiveMintDataResponse - /// Descriptor for "StreamLiveMintData". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency"), - method: "StreamLiveMintData" - ) - } - /// Namespace for "Launch" metadata. - public enum Launch { - /// Request type for "Launch". - public typealias Input = Ocp_Currency_V1_LaunchRequest - /// Response type for "Launch". - public typealias Output = Ocp_Currency_V1_LaunchResponse - /// Descriptor for "Launch". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency"), - method: "Launch" - ) - } - /// Namespace for "UpdateIcon" metadata. - public enum UpdateIcon { - /// Request type for "UpdateIcon". - public typealias Input = Ocp_Currency_V1_UpdateIconRequest - /// Response type for "UpdateIcon". - public typealias Output = Ocp_Currency_V1_UpdateIconResponse - /// Descriptor for "UpdateIcon". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency"), - method: "UpdateIcon" - ) - } - /// Namespace for "UpdateMetadata" metadata. - public enum UpdateMetadata { - /// Request type for "UpdateMetadata". - public typealias Input = Ocp_Currency_V1_UpdateMetadataRequest - /// Response type for "UpdateMetadata". - public typealias Output = Ocp_Currency_V1_UpdateMetadataResponse - /// Descriptor for "UpdateMetadata". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency"), - method: "UpdateMetadata" - ) - } - /// Namespace for "Discover" metadata. - public enum Discover { - /// Request type for "Discover". - public typealias Input = Ocp_Currency_V1_DiscoverRequest - /// Response type for "Discover". - public typealias Output = Ocp_Currency_V1_DiscoverResponse - /// Descriptor for "Discover". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency"), - method: "Discover" - ) - } - /// Namespace for "CheckAvailability" metadata. - public enum CheckAvailability { - /// Request type for "CheckAvailability". - public typealias Input = Ocp_Currency_V1_CheckAvailabilityRequest - /// Response type for "CheckAvailability". - public typealias Output = Ocp_Currency_V1_CheckAvailabilityResponse - /// Descriptor for "CheckAvailability". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency"), - method: "CheckAvailability" - ) - } - /// Descriptors for all methods in the "ocp.currency.v1.Currency" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - GetMints.descriptor, - GetHistoricalMintData.descriptor, - StreamLiveMintData.descriptor, - Launch.descriptor, - UpdateIcon.descriptor, - UpdateMetadata.descriptor, - Discover.descriptor, - CheckAvailability.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "ocp.currency.v1.Currency" service. - public static let ocp_currency_v1_Currency = GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.currency.v1.Currency") -} - -// MARK: ocp.currency.v1.Currency (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Currency_V1_Currency { - /// Generated client protocol for the "ocp.currency.v1.Currency" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "GetMints" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMints gets mint account metadata by address - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_GetMintsRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_GetMintsRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_GetMintsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getMints( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetHistoricalMintData" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetHistoricalMintData returns historical market data for a mint - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_GetHistoricalMintDataRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_GetHistoricalMintDataRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_GetHistoricalMintDataResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getHistoricalMintData( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "StreamLiveMintData" method. - /// - /// > Source IDL Documentation: - /// > - /// > StreamLiveMintData streams live mint data for a set of mints - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Currency_V1_StreamLiveMintDataRequest` messages. - /// - serializer: A serializer for `Ocp_Currency_V1_StreamLiveMintDataRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_StreamLiveMintDataResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func streamLiveMintData( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "Launch" method. - /// - /// > Source IDL Documentation: - /// > - /// > Launch launches a new currency on the launchpad - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_LaunchRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_LaunchRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_LaunchResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func launch( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "UpdateIcon" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateIcon uploads and updates the icon for a currency - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_UpdateIconRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_UpdateIconRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_UpdateIconResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func updateIcon( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "UpdateMetadata" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateMetadata updates mutable metadata for a currency - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_UpdateMetadataRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_UpdateMetadataRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_UpdateMetadataResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func updateMetadata( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "Discover" method. - /// - /// > Source IDL Documentation: - /// > - /// > Discover returns a set of currencies to discover - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_DiscoverRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_DiscoverRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_DiscoverResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func discover( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "CheckAvailability" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckAvailability checks whether a currency name is available for launch - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_CheckAvailabilityRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_CheckAvailabilityRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_CheckAvailabilityResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func checkAvailability( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "ocp.currency.v1.Currency" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "GetMints" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMints gets mint account metadata by address - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_GetMintsRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_GetMintsRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_GetMintsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMints( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Currency_V1_Currency.Method.GetMints.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetHistoricalMintData" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetHistoricalMintData returns historical market data for a mint - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_GetHistoricalMintDataRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_GetHistoricalMintDataRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_GetHistoricalMintDataResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getHistoricalMintData( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Currency_V1_Currency.Method.GetHistoricalMintData.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StreamLiveMintData" method. - /// - /// > Source IDL Documentation: - /// > - /// > StreamLiveMintData streams live mint data for a set of mints - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Currency_V1_StreamLiveMintDataRequest` messages. - /// - serializer: A serializer for `Ocp_Currency_V1_StreamLiveMintDataRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_StreamLiveMintDataResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func streamLiveMintData( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.bidirectionalStreaming( - request: request, - descriptor: Ocp_Currency_V1_Currency.Method.StreamLiveMintData.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Launch" method. - /// - /// > Source IDL Documentation: - /// > - /// > Launch launches a new currency on the launchpad - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_LaunchRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_LaunchRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_LaunchResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func launch( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Currency_V1_Currency.Method.Launch.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateIcon" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateIcon uploads and updates the icon for a currency - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_UpdateIconRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_UpdateIconRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_UpdateIconResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateIcon( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Currency_V1_Currency.Method.UpdateIcon.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateMetadata" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateMetadata updates mutable metadata for a currency - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_UpdateMetadataRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_UpdateMetadataRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_UpdateMetadataResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateMetadata( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Currency_V1_Currency.Method.UpdateMetadata.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Discover" method. - /// - /// > Source IDL Documentation: - /// > - /// > Discover returns a set of currencies to discover - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_DiscoverRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_DiscoverRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_DiscoverResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func discover( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.serverStreaming( - request: request, - descriptor: Ocp_Currency_V1_Currency.Method.Discover.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckAvailability" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckAvailability checks whether a currency name is available for launch - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_CheckAvailabilityRequest` message. - /// - serializer: A serializer for `Ocp_Currency_V1_CheckAvailabilityRequest` messages. - /// - deserializer: A deserializer for `Ocp_Currency_V1_CheckAvailabilityResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkAvailability( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Currency_V1_Currency.Method.CheckAvailability.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Currency_V1_Currency.ClientProtocol { - /// Call the "GetMints" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMints gets mint account metadata by address - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_GetMintsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMints( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getMints( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetHistoricalMintData" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetHistoricalMintData returns historical market data for a mint - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_GetHistoricalMintDataRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getHistoricalMintData( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getHistoricalMintData( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StreamLiveMintData" method. - /// - /// > Source IDL Documentation: - /// > - /// > StreamLiveMintData streams live mint data for a set of mints - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Currency_V1_StreamLiveMintDataRequest` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func streamLiveMintData( - request: GRPCCore.StreamingClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.streamLiveMintData( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Launch" method. - /// - /// > Source IDL Documentation: - /// > - /// > Launch launches a new currency on the launchpad - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_LaunchRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func launch( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.launch( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateIcon" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateIcon uploads and updates the icon for a currency - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_UpdateIconRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateIcon( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.updateIcon( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateMetadata" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateMetadata updates mutable metadata for a currency - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_UpdateMetadataRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateMetadata( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.updateMetadata( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Discover" method. - /// - /// > Source IDL Documentation: - /// > - /// > Discover returns a set of currencies to discover - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_DiscoverRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func discover( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.discover( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckAvailability" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckAvailability checks whether a currency name is available for launch - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Currency_V1_CheckAvailabilityRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkAvailability( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.checkAvailability( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Currency_V1_Currency.ClientProtocol { - /// Call the "GetMints" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetMints gets mint account metadata by address - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getMints( - _ message: Ocp_Currency_V1_GetMintsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getMints( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetHistoricalMintData" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetHistoricalMintData returns historical market data for a mint - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getHistoricalMintData( - _ message: Ocp_Currency_V1_GetHistoricalMintDataRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getHistoricalMintData( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StreamLiveMintData" method. - /// - /// > Source IDL Documentation: - /// > - /// > StreamLiveMintData streams live mint data for a set of mints - /// - /// - Parameters: - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - producer: A closure producing request messages to send to the server. The request - /// stream is closed when the closure returns. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func streamLiveMintData( - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - requestProducer producer: @Sendable @escaping (GRPCCore.RPCWriter) async throws -> Void, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.StreamingClientRequest( - metadata: metadata, - producer: producer - ) - return try await self.streamLiveMintData( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Launch" method. - /// - /// > Source IDL Documentation: - /// > - /// > Launch launches a new currency on the launchpad - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func launch( - _ message: Ocp_Currency_V1_LaunchRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.launch( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateIcon" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateIcon uploads and updates the icon for a currency - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateIcon( - _ message: Ocp_Currency_V1_UpdateIconRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.updateIcon( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "UpdateMetadata" method. - /// - /// > Source IDL Documentation: - /// > - /// > UpdateMetadata updates mutable metadata for a currency - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func updateMetadata( - _ message: Ocp_Currency_V1_UpdateMetadataRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.updateMetadata( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "Discover" method. - /// - /// > Source IDL Documentation: - /// > - /// > Discover returns a set of currencies to discover - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func discover( - _ message: Ocp_Currency_V1_DiscoverRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.discover( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CheckAvailability" method. - /// - /// > Source IDL Documentation: - /// > - /// > CheckAvailability checks whether a currency name is available for launch - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func checkAvailability( - _ message: Ocp_Currency_V1_CheckAvailabilityRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.checkAvailability( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/currency_v1_ocp_currency_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/currency_v1_ocp_currency_service.pb.swift deleted file mode 100644 index 98c1af0ac..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/currency_v1_ocp_currency_service.pb.swift +++ /dev/null @@ -1,3558 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: currency/v1/ocp_currency_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public enum Ocp_Currency_V1_PredefinedRange: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case allTime // = 0 - case lastDay // = 1 - case lastWeek // = 2 - case lastMonth // = 3 - case lastYear // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .allTime - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .allTime - case 1: self = .lastDay - case 2: self = .lastWeek - case 3: self = .lastMonth - case 4: self = .lastYear - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .allTime: return 0 - case .lastDay: return 1 - case .lastWeek: return 2 - case .lastMonth: return 3 - case .lastYear: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_PredefinedRange] = [ - .allTime, - .lastDay, - .lastWeek, - .lastMonth, - .lastYear, - ] - -} - -public struct Ocp_Currency_V1_GetMintsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var addresses: [Ocp_Common_V1_SolanaAccountId] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Currency_V1_GetMintsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Currency_V1_GetMintsResponse.Result = .ok - - public var metadataByAddress: Dictionary = [:] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_GetMintsResponse.Result] = [ - .ok, - .notFound, - ] - - } - - public init() {} -} - -public struct Ocp_Currency_V1_GetHistoricalMintDataRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The mint address to get historical data for - public var address: Ocp_Common_V1_SolanaAccountId { - get {return _address ?? Ocp_Common_V1_SolanaAccountId()} - set {_address = newValue} - } - /// Returns true if `address` has been explicitly set. - public var hasAddress: Bool {return self._address != nil} - /// Clears the value of `address`. Subsequent reads from it will return its default value. - public mutating func clearAddress() {self._address = nil} - - /// The currency code for the returned market data (e.g., "usd") - public var currencyCode: String = String() - - public var range: Ocp_Currency_V1_GetHistoricalMintDataRequest.OneOf_Range? = nil - - public var predefinedRange: Ocp_Currency_V1_PredefinedRange { - get { - if case .predefinedRange(let v)? = range {return v} - return .allTime - } - set {range = .predefinedRange(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Range: Equatable, Sendable { - case predefinedRange(Ocp_Currency_V1_PredefinedRange) - - } - - public init() {} - - fileprivate var _address: Ocp_Common_V1_SolanaAccountId? = nil -} - -public struct Ocp_Currency_V1_GetHistoricalMintDataResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Currency_V1_GetHistoricalMintDataResponse.Result = .ok - - public var data: [Ocp_Currency_V1_HistoricalMintData] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - - /// The requested mint or currency was not found - case notFound // = 1 - - /// No data available for the requested time range - case missingData // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - case 2: self = .missingData - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .missingData: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_GetHistoricalMintDataResponse.Result] = [ - .ok, - .notFound, - .missingData, - ] - - } - - public init() {} -} - -public struct Ocp_Currency_V1_StreamLiveMintDataRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Ocp_Currency_V1_StreamLiveMintDataRequest.OneOf_Type? = nil - - public var request: Ocp_Currency_V1_StreamLiveMintDataRequest.Request { - get { - if case .request(let v)? = type {return v} - return Ocp_Currency_V1_StreamLiveMintDataRequest.Request() - } - set {type = .request(newValue)} - } - - public var pong: Ocp_Common_V1_ClientPong { - get { - if case .pong(let v)? = type {return v} - return Ocp_Common_V1_ClientPong() - } - set {type = .pong(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case request(Ocp_Currency_V1_StreamLiveMintDataRequest.Request) - case pong(Ocp_Common_V1_ClientPong) - - } - - public struct Request: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The set of mints to receive live data against. To update the set of mints, - /// close the current stream and open a new one with the new set. - public var mints: [Ocp_Common_V1_SolanaAccountId] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -public struct Ocp_Currency_V1_StreamLiveMintDataResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Ocp_Currency_V1_StreamLiveMintDataResponse.OneOf_Type? = nil - - public var data: Ocp_Currency_V1_StreamLiveMintDataResponse.LiveData { - get { - if case .data(let v)? = type {return v} - return Ocp_Currency_V1_StreamLiveMintDataResponse.LiveData() - } - set {type = .data(newValue)} - } - - public var ping: Ocp_Common_V1_ServerPing { - get { - if case .ping(let v)? = type {return v} - return Ocp_Common_V1_ServerPing() - } - set {type = .ping(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case data(Ocp_Currency_V1_StreamLiveMintDataResponse.LiveData) - case ping(Ocp_Common_V1_ServerPing) - - } - - public struct LiveData: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Ocp_Currency_V1_StreamLiveMintDataResponse.LiveData.OneOf_Type? = nil - - public var coreMintFiatExchangeRates: Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRateBatch { - get { - if case .coreMintFiatExchangeRates(let v)? = type {return v} - return Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRateBatch() - } - set {type = .coreMintFiatExchangeRates(newValue)} - } - - public var launchpadCurrencyReserveStates: Ocp_Currency_V1_VerifiedLaunchapdCurrencyReserveStateBatch { - get { - if case .launchpadCurrencyReserveStates(let v)? = type {return v} - return Ocp_Currency_V1_VerifiedLaunchapdCurrencyReserveStateBatch() - } - set {type = .launchpadCurrencyReserveStates(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case coreMintFiatExchangeRates(Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRateBatch) - case launchpadCurrencyReserveStates(Ocp_Currency_V1_VerifiedLaunchapdCurrencyReserveStateBatch) - - } - - public init() {} - } - - public init() {} -} - -public struct Ocp_Currency_V1_Mint: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Token mint address - public var address: Ocp_Common_V1_SolanaAccountId { - get {return _storage._address ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._address = newValue} - } - /// Returns true if `address` has been explicitly set. - public var hasAddress: Bool {return _storage._address != nil} - /// Clears the value of `address`. Subsequent reads from it will return its default value. - public mutating func clearAddress() {_uniqueStorage()._address = nil} - - /// The number of decimals configured for the mint - public var decimals: UInt32 { - get {return _storage._decimals} - set {_uniqueStorage()._decimals = newValue} - } - - /// Currency name - public var name: String { - get {return _storage._name} - set {_uniqueStorage()._name = newValue} - } - - /// Currency ticker symbol - public var symbol: String { - get {return _storage._symbol} - set {_uniqueStorage()._symbol = newValue} - } - - /// Currency description - public var description_p: String { - get {return _storage._description_p} - set {_uniqueStorage()._description_p = newValue} - } - - /// URL to currency image - public var imageURL: String { - get {return _storage._imageURL} - set {_uniqueStorage()._imageURL = newValue} - } - - /// Available when a VM exists for the given mint, and can be used for deriving - /// VM deposit PDAs - /// - /// Note: Only currencies with a VM are useable for payments - public var vmMetadata: Ocp_Currency_V1_VmMetadata { - get {return _storage._vmMetadata ?? Ocp_Currency_V1_VmMetadata()} - set {_uniqueStorage()._vmMetadata = newValue} - } - /// Returns true if `vmMetadata` has been explicitly set. - public var hasVmMetadata: Bool {return _storage._vmMetadata != nil} - /// Clears the value of `vmMetadata`. Subsequent reads from it will return its default value. - public mutating func clearVmMetadata() {_uniqueStorage()._vmMetadata = nil} - - /// Available when created by the launchpad via the currency creator program, and - /// can be used for calculating price, market cap, etc. based on the exponential - /// bonding curve - public var launchpadMetadata: Ocp_Currency_V1_LaunchpadMetadata { - get {return _storage._launchpadMetadata ?? Ocp_Currency_V1_LaunchpadMetadata()} - set {_uniqueStorage()._launchpadMetadata = newValue} - } - /// Returns true if `launchpadMetadata` has been explicitly set. - public var hasLaunchpadMetadata: Bool {return _storage._launchpadMetadata != nil} - /// Clears the value of `launchpadMetadata`. Subsequent reads from it will return its default value. - public mutating func clearLaunchpadMetadata() {_uniqueStorage()._launchpadMetadata = nil} - - /// Timestamp the currency was created - public var createdAt: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _storage._createdAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_uniqueStorage()._createdAt = newValue} - } - /// Returns true if `createdAt` has been explicitly set. - public var hasCreatedAt: Bool {return _storage._createdAt != nil} - /// Clears the value of `createdAt`. Subsequent reads from it will return its default value. - public mutating func clearCreatedAt() {_uniqueStorage()._createdAt = nil} - - /// Social links for this currency - public var socialLinks: [Ocp_Currency_V1_SocialLink] { - get {return _storage._socialLinks} - set {_uniqueStorage()._socialLinks = newValue} - } - - /// Bill customization for this currency. Use the default if not provided - public var billCustomization: Ocp_Currency_V1_BillCustomization { - get {return _storage._billCustomization ?? Ocp_Currency_V1_BillCustomization()} - set {_uniqueStorage()._billCustomization = newValue} - } - /// Returns true if `billCustomization` has been explicitly set. - public var hasBillCustomization: Bool {return _storage._billCustomization != nil} - /// Clears the value of `billCustomization`. Subsequent reads from it will return its default value. - public mutating func clearBillCustomization() {_uniqueStorage()._billCustomization = nil} - - /// Holder metrics. This is surfaced where needed (e.g. only in the Discover RPC) - public var holderMetrics: Ocp_Currency_V1_HolderMetrics { - get {return _storage._holderMetrics ?? Ocp_Currency_V1_HolderMetrics()} - set {_uniqueStorage()._holderMetrics = newValue} - } - /// Returns true if `holderMetrics` has been explicitly set. - public var hasHolderMetrics: Bool {return _storage._holderMetrics != nil} - /// Clears the value of `holderMetrics`. Subsequent reads from it will return its default value. - public mutating func clearHolderMetrics() {_uniqueStorage()._holderMetrics = nil} - - /// Market cap metrics. This is surfaced where needed (e.g. only in the Discover RPC) - public var marketCapMetrics: Ocp_Currency_V1_MarketCapMetrics { - get {return _storage._marketCapMetrics ?? Ocp_Currency_V1_MarketCapMetrics()} - set {_uniqueStorage()._marketCapMetrics = newValue} - } - /// Returns true if `marketCapMetrics` has been explicitly set. - public var hasMarketCapMetrics: Bool {return _storage._marketCapMetrics != nil} - /// Clears the value of `marketCapMetrics`. Subsequent reads from it will return its default value. - public mutating func clearMarketCapMetrics() {_uniqueStorage()._marketCapMetrics = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -public struct Ocp_Currency_V1_VmMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// VM address - public var vm: Ocp_Common_V1_SolanaAccountId { - get {return _vm ?? Ocp_Common_V1_SolanaAccountId()} - set {_vm = newValue} - } - /// Returns true if `vm` has been explicitly set. - public var hasVm: Bool {return self._vm != nil} - /// Clears the value of `vm`. Subsequent reads from it will return its default value. - public mutating func clearVm() {self._vm = nil} - - /// Authority that subsidizes and authorizes all transactions against the VM - public var authority: Ocp_Common_V1_SolanaAccountId { - get {return _authority ?? Ocp_Common_V1_SolanaAccountId()} - set {_authority = newValue} - } - /// Returns true if `authority` has been explicitly set. - public var hasAuthority: Bool {return self._authority != nil} - /// Clears the value of `authority`. Subsequent reads from it will return its default value. - public mutating func clearAuthority() {self._authority = nil} - - /// Lock duration of Virtual Timelock Accounts on the VM, currently hardcoded - /// to 21 days - public var lockDurationInDays: UInt32 = 0 - - /// VM omnibus address - public var omnibus: Ocp_Common_V1_SolanaAccountId { - get {return _omnibus ?? Ocp_Common_V1_SolanaAccountId()} - set {_omnibus = newValue} - } - /// Returns true if `omnibus` has been explicitly set. - public var hasOmnibus: Bool {return self._omnibus != nil} - /// Clears the value of `omnibus`. Subsequent reads from it will return its default value. - public mutating func clearOmnibus() {self._omnibus = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _vm: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _authority: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _omnibus: Ocp_Common_V1_SolanaAccountId? = nil -} - -public struct Ocp_Currency_V1_LaunchpadMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The address of the currency config - public var currencyConfig: Ocp_Common_V1_SolanaAccountId { - get {return _currencyConfig ?? Ocp_Common_V1_SolanaAccountId()} - set {_currencyConfig = newValue} - } - /// Returns true if `currencyConfig` has been explicitly set. - public var hasCurrencyConfig: Bool {return self._currencyConfig != nil} - /// Clears the value of `currencyConfig`. Subsequent reads from it will return its default value. - public mutating func clearCurrencyConfig() {self._currencyConfig = nil} - - /// The address of the liquidity pool - public var liquidityPool: Ocp_Common_V1_SolanaAccountId { - get {return _liquidityPool ?? Ocp_Common_V1_SolanaAccountId()} - set {_liquidityPool = newValue} - } - /// Returns true if `liquidityPool` has been explicitly set. - public var hasLiquidityPool: Bool {return self._liquidityPool != nil} - /// Clears the value of `liquidityPool`. Subsequent reads from it will return its default value. - public mutating func clearLiquidityPool() {self._liquidityPool = nil} - - /// The random seed used during currency creation - public var seed: Ocp_Common_V1_SolanaAccountId { - get {return _seed ?? Ocp_Common_V1_SolanaAccountId()} - set {_seed = newValue} - } - /// Returns true if `seed` has been explicitly set. - public var hasSeed: Bool {return self._seed != nil} - /// Clears the value of `seed`. Subsequent reads from it will return its default value. - public mutating func clearSeed() {self._seed = nil} - - /// The address of the authority for the currency - public var authority: Ocp_Common_V1_SolanaAccountId { - get {return _authority ?? Ocp_Common_V1_SolanaAccountId()} - set {_authority = newValue} - } - /// Returns true if `authority` has been explicitly set. - public var hasAuthority: Bool {return self._authority != nil} - /// Clears the value of `authority`. Subsequent reads from it will return its default value. - public mutating func clearAuthority() {self._authority = nil} - - /// The address where this mint's tokens are locked against the liquidity pool - public var mintVault: Ocp_Common_V1_SolanaAccountId { - get {return _mintVault ?? Ocp_Common_V1_SolanaAccountId()} - set {_mintVault = newValue} - } - /// Returns true if `mintVault` has been explicitly set. - public var hasMintVault: Bool {return self._mintVault != nil} - /// Clears the value of `mintVault`. Subsequent reads from it will return its default value. - public mutating func clearMintVault() {self._mintVault = nil} - - /// The address where core mint tokens are locked against the liquidity pool - public var coreMintVault: Ocp_Common_V1_SolanaAccountId { - get {return _coreMintVault ?? Ocp_Common_V1_SolanaAccountId()} - set {_coreMintVault = newValue} - } - /// Returns true if `coreMintVault` has been explicitly set. - public var hasCoreMintVault: Bool {return self._coreMintVault != nil} - /// Clears the value of `coreMintVault`. Subsequent reads from it will return its default value. - public mutating func clearCoreMintVault() {self._coreMintVault = nil} - - /// Current circulating mint token supply in quarks - public var supplyFromBonding: UInt64 = 0 - - /// Precent fee for sells in basis points, currently hardcoded to 1% - public var sellFeeBps: UInt32 = 0 - - /// The current price in USD - public var price: Double = 0 - - /// The current market capitalization in USD - public var marketCap: Double = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _currencyConfig: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _liquidityPool: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _seed: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _authority: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _mintVault: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _coreMintVault: Ocp_Common_V1_SolanaAccountId? = nil -} - -public struct Ocp_Currency_V1_HistoricalMintData: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Timestamp for this data point - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - /// Market capitalization at this point in time - public var marketCap: Double = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -public struct Ocp_Currency_V1_CoreMintFiatExchangeRate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The currency code for the fiat exchange rate - public var currencyCode: String = String() - - /// The exchange rate against the core mint - public var exchangeRate: Double = 0 - - /// Timestamp for this data point - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -/// CoreMintFiatExchangeRate with a server signature for proof for use in a payment -public struct Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var exchangeRate: Ocp_Currency_V1_CoreMintFiatExchangeRate { - get {return _exchangeRate ?? Ocp_Currency_V1_CoreMintFiatExchangeRate()} - set {_exchangeRate = newValue} - } - /// Returns true if `exchangeRate` has been explicitly set. - public var hasExchangeRate: Bool {return self._exchangeRate != nil} - /// Clears the value of `exchangeRate`. Subsequent reads from it will return its default value. - public mutating func clearExchangeRate() {self._exchangeRate = nil} - - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _exchangeRate: Ocp_Currency_V1_CoreMintFiatExchangeRate? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRateBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var exchangeRates: [Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRate] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Currency_V1_LaunchpadCurrencyReserveState: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Launchpad currency mint address - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - /// Current circulating mint token supply in quarks - public var supplyFromBonding: UInt64 = 0 - - /// Timestamp for this data point - public var timestamp: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _timestamp ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_timestamp = newValue} - } - /// Returns true if `timestamp` has been explicitly set. - public var hasTimestamp: Bool {return self._timestamp != nil} - /// Clears the value of `timestamp`. Subsequent reads from it will return its default value. - public mutating func clearTimestamp() {self._timestamp = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _timestamp: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -/// LaunchpadCurrencyReserveState with a server signature for proof for use in a payment -public struct Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var reserveState: Ocp_Currency_V1_LaunchpadCurrencyReserveState { - get {return _reserveState ?? Ocp_Currency_V1_LaunchpadCurrencyReserveState()} - set {_reserveState = newValue} - } - /// Returns true if `reserveState` has been explicitly set. - public var hasReserveState: Bool {return self._reserveState != nil} - /// Clears the value of `reserveState`. Subsequent reads from it will return its default value. - public mutating func clearReserveState() {self._reserveState = nil} - - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _reserveState: Ocp_Currency_V1_LaunchpadCurrencyReserveState? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Currency_V1_VerifiedLaunchapdCurrencyReserveStateBatch: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var reserveStates: [Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Currency_V1_SocialLink: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Ocp_Currency_V1_SocialLink.OneOf_Type? = nil - - public var website: Ocp_Currency_V1_SocialLink.Website { - get { - if case .website(let v)? = type {return v} - return Ocp_Currency_V1_SocialLink.Website() - } - set {type = .website(newValue)} - } - - public var x: Ocp_Currency_V1_SocialLink.X { - get { - if case .x(let v)? = type {return v} - return Ocp_Currency_V1_SocialLink.X() - } - set {type = .x(newValue)} - } - - public var telegram: Ocp_Currency_V1_SocialLink.Telegram { - get { - if case .telegram(let v)? = type {return v} - return Ocp_Currency_V1_SocialLink.Telegram() - } - set {type = .telegram(newValue)} - } - - public var discord: Ocp_Currency_V1_SocialLink.Discord { - get { - if case .discord(let v)? = type {return v} - return Ocp_Currency_V1_SocialLink.Discord() - } - set {type = .discord(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case website(Ocp_Currency_V1_SocialLink.Website) - case x(Ocp_Currency_V1_SocialLink.X) - case telegram(Ocp_Currency_V1_SocialLink.Telegram) - case discord(Ocp_Currency_V1_SocialLink.Discord) - - } - - public struct Website: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var url: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public struct X: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var username: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public struct Telegram: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Telegram username (without the @ prefix) - public var username: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public struct Discord: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Discord invite code (e.g. "abc123" from discord.gg/abc123) - public var inviteCode: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -public struct Ocp_Currency_V1_BillCustomization: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Bill background colors (from top to bottom) - public var colors: [Ocp_Currency_V1_Color] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Currency_V1_Color: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Hex colour value (e.g. "#19191A") - public var hex: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Currency_V1_HolderMetrics: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The current number of holders for a currency - public var currentHolders: UInt64 = 0 - - public var holderDeltas: [Ocp_Currency_V1_HolderMetrics.DeltaHolders] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public struct DeltaHolders: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Predefined range where delta is calculated from - public var range: Ocp_Currency_V1_PredefinedRange = .allTime - - /// Net holders within the time range - public var delta: Int64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -public struct Ocp_Currency_V1_MarketCapMetrics: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The current market capitalization in USD for a currency - public var currentMarketCap: Double = 0 - - public var marketCapDeltas: [Ocp_Currency_V1_MarketCapMetrics.DeltaMarketCap] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public struct DeltaMarketCap: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Predefined range where delta is calculated from - public var range: Ocp_Currency_V1_PredefinedRange = .allTime - - /// Net change in market capitalization in USD within the time range - public var delta: Double = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -public struct Ocp_Currency_V1_LaunchRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The owner account launching the currency - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(LaunchRequest) without this field set - /// using the private key of the owner account. This provides an authentication - /// mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - /// The name of the currency to launch. Must be printable ASCII with no - /// leading or trailing spaces. - public var name: String = String() - - /// The ticker symbol for the currency. Must be printable ASCII with no - /// spaces. If not provided, a default will be generated using the currency - /// name. - public var symbol: String = String() - - /// Optional description - public var description_p: String = String() - - /// Optional bill customization. If not provided, a default will be set. - public var billCustomization: Ocp_Currency_V1_BillCustomization { - get {return _billCustomization ?? Ocp_Currency_V1_BillCustomization()} - set {_billCustomization = newValue} - } - /// Returns true if `billCustomization` has been explicitly set. - public var hasBillCustomization: Bool {return self._billCustomization != nil} - /// Clears the value of `billCustomization`. Subsequent reads from it will return its default value. - public mutating func clearBillCustomization() {self._billCustomization = nil} - - /// The raw image data for the icon. If not provided, a default will be set. - public var icon: Data = Data() - - /// Attestation that the name passed moderation - public var nameModerationAttestation: Ocp_Currency_V1_ModerationAttestation { - get {return _nameModerationAttestation ?? Ocp_Currency_V1_ModerationAttestation()} - set {_nameModerationAttestation = newValue} - } - /// Returns true if `nameModerationAttestation` has been explicitly set. - public var hasNameModerationAttestation: Bool {return self._nameModerationAttestation != nil} - /// Clears the value of `nameModerationAttestation`. Subsequent reads from it will return its default value. - public mutating func clearNameModerationAttestation() {self._nameModerationAttestation = nil} - - /// Attestation that the symbol, if provided, passed moderation - public var symbolModerationAttestation: Ocp_Currency_V1_ModerationAttestation { - get {return _symbolModerationAttestation ?? Ocp_Currency_V1_ModerationAttestation()} - set {_symbolModerationAttestation = newValue} - } - /// Returns true if `symbolModerationAttestation` has been explicitly set. - public var hasSymbolModerationAttestation: Bool {return self._symbolModerationAttestation != nil} - /// Clears the value of `symbolModerationAttestation`. Subsequent reads from it will return its default value. - public mutating func clearSymbolModerationAttestation() {self._symbolModerationAttestation = nil} - - /// Attestation that the descritpion, if provided, passed moderation - public var descriptionModerationAttestation: Ocp_Currency_V1_ModerationAttestation { - get {return _descriptionModerationAttestation ?? Ocp_Currency_V1_ModerationAttestation()} - set {_descriptionModerationAttestation = newValue} - } - /// Returns true if `descriptionModerationAttestation` has been explicitly set. - public var hasDescriptionModerationAttestation: Bool {return self._descriptionModerationAttestation != nil} - /// Clears the value of `descriptionModerationAttestation`. Subsequent reads from it will return its default value. - public mutating func clearDescriptionModerationAttestation() {self._descriptionModerationAttestation = nil} - - /// Attestation that the icon image, if provided, passed moderation - public var iconModerationAttestation: Ocp_Currency_V1_ModerationAttestation { - get {return _iconModerationAttestation ?? Ocp_Currency_V1_ModerationAttestation()} - set {_iconModerationAttestation = newValue} - } - /// Returns true if `iconModerationAttestation` has been explicitly set. - public var hasIconModerationAttestation: Bool {return self._iconModerationAttestation != nil} - /// Clears the value of `iconModerationAttestation`. Subsequent reads from it will return its default value. - public mutating func clearIconModerationAttestation() {self._iconModerationAttestation = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil - fileprivate var _billCustomization: Ocp_Currency_V1_BillCustomization? = nil - fileprivate var _nameModerationAttestation: Ocp_Currency_V1_ModerationAttestation? = nil - fileprivate var _symbolModerationAttestation: Ocp_Currency_V1_ModerationAttestation? = nil - fileprivate var _descriptionModerationAttestation: Ocp_Currency_V1_ModerationAttestation? = nil - fileprivate var _iconModerationAttestation: Ocp_Currency_V1_ModerationAttestation? = nil -} - -public struct Ocp_Currency_V1_LaunchResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Currency_V1_LaunchResponse.Result = .ok - - /// The mint address of the launched currency on success - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - - /// The launch was denied - case denied // = 1 - - /// A similar currency already exists - case nameExists // = 2 - - /// Provided icon is invalid - case invalidIcon // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .nameExists - case 3: self = .invalidIcon - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .nameExists: return 2 - case .invalidIcon: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_LaunchResponse.Result] = [ - .ok, - .denied, - .nameExists, - .invalidIcon, - ] - - } - - public init() {} - - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -public struct Ocp_Currency_V1_UpdateIconRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The owner account of the currency - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(UpdateIconRequest) without this field set - /// using the private key of the owner account. This provides an authentication - /// mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - /// The mint address of the currency to update - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - /// The raw image data for the icon - public var icon: Data = Data() - - /// Attestation that the icon image passed moderation - public var moderationAttestation: Ocp_Currency_V1_ModerationAttestation { - get {return _moderationAttestation ?? Ocp_Currency_V1_ModerationAttestation()} - set {_moderationAttestation = newValue} - } - /// Returns true if `moderationAttestation` has been explicitly set. - public var hasModerationAttestation: Bool {return self._moderationAttestation != nil} - /// Clears the value of `moderationAttestation`. Subsequent reads from it will return its default value. - public mutating func clearModerationAttestation() {self._moderationAttestation = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _moderationAttestation: Ocp_Currency_V1_ModerationAttestation? = nil -} - -public struct Ocp_Currency_V1_UpdateIconResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Currency_V1_UpdateIconResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case denied // = 2 - case invalidIcon // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - case 2: self = .denied - case 3: self = .invalidIcon - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .denied: return 2 - case .invalidIcon: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_UpdateIconResponse.Result] = [ - .ok, - .notFound, - .denied, - .invalidIcon, - ] - - } - - public init() {} -} - -public struct Ocp_Currency_V1_UpdateMetadataRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The owner account of the currency - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(UpdateMetadataRequest) without this field set - /// using the private key of the owner account. This provides an authentication - /// mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - /// The mint address of the currency to update - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - /// Updated currency description. If not provided, description is not updated. - public var newDescription: Ocp_Currency_V1_UpdateMetadataRequest.DescriptionUpdate { - get {return _newDescription ?? Ocp_Currency_V1_UpdateMetadataRequest.DescriptionUpdate()} - set {_newDescription = newValue} - } - /// Returns true if `newDescription` has been explicitly set. - public var hasNewDescription: Bool {return self._newDescription != nil} - /// Clears the value of `newDescription`. Subsequent reads from it will return its default value. - public mutating func clearNewDescription() {self._newDescription = nil} - - /// Updated bill customization. If not provided, bill customization is not updated. - public var newBillCustomization: Ocp_Currency_V1_UpdateMetadataRequest.BillCustomizationUpdate { - get {return _newBillCustomization ?? Ocp_Currency_V1_UpdateMetadataRequest.BillCustomizationUpdate()} - set {_newBillCustomization = newValue} - } - /// Returns true if `newBillCustomization` has been explicitly set. - public var hasNewBillCustomization: Bool {return self._newBillCustomization != nil} - /// Clears the value of `newBillCustomization`. Subsequent reads from it will return its default value. - public mutating func clearNewBillCustomization() {self._newBillCustomization = nil} - - /// Updated social links. This replaces the entire set of social links. If not - /// provided, social links are not updated. - public var newSocialLinks: Ocp_Currency_V1_UpdateMetadataRequest.SocialLinksUpdate { - get {return _newSocialLinks ?? Ocp_Currency_V1_UpdateMetadataRequest.SocialLinksUpdate()} - set {_newSocialLinks = newValue} - } - /// Returns true if `newSocialLinks` has been explicitly set. - public var hasNewSocialLinks: Bool {return self._newSocialLinks != nil} - /// Clears the value of `newSocialLinks`. Subsequent reads from it will return its default value. - public mutating func clearNewSocialLinks() {self._newSocialLinks = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public struct DescriptionUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: String = String() - - /// Attestation that the description passed moderation - public var moderationAttestation: Ocp_Currency_V1_ModerationAttestation { - get {return _moderationAttestation ?? Ocp_Currency_V1_ModerationAttestation()} - set {_moderationAttestation = newValue} - } - /// Returns true if `moderationAttestation` has been explicitly set. - public var hasModerationAttestation: Bool {return self._moderationAttestation != nil} - /// Clears the value of `moderationAttestation`. Subsequent reads from it will return its default value. - public mutating func clearModerationAttestation() {self._moderationAttestation = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _moderationAttestation: Ocp_Currency_V1_ModerationAttestation? = nil - } - - public struct BillCustomizationUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Ocp_Currency_V1_BillCustomization { - get {return _value ?? Ocp_Currency_V1_BillCustomization()} - set {_value = newValue} - } - /// Returns true if `value` has been explicitly set. - public var hasValue: Bool {return self._value != nil} - /// Clears the value of `value`. Subsequent reads from it will return its default value. - public mutating func clearValue() {self._value = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _value: Ocp_Currency_V1_BillCustomization? = nil - } - - public struct SocialLinksUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: [Ocp_Currency_V1_SocialLink] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _newDescription: Ocp_Currency_V1_UpdateMetadataRequest.DescriptionUpdate? = nil - fileprivate var _newBillCustomization: Ocp_Currency_V1_UpdateMetadataRequest.BillCustomizationUpdate? = nil - fileprivate var _newSocialLinks: Ocp_Currency_V1_UpdateMetadataRequest.SocialLinksUpdate? = nil -} - -public struct Ocp_Currency_V1_UpdateMetadataResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Currency_V1_UpdateMetadataResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case denied // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - case 2: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .denied: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_UpdateMetadataResponse.Result] = [ - .ok, - .notFound, - .denied, - ] - - } - - public init() {} -} - -public struct Ocp_Currency_V1_DiscoverRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var category: Ocp_Currency_V1_DiscoverRequest.Category = .popular - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Category: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case popular // = 0 - case new // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .popular - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .popular - case 1: self = .new - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .popular: return 0 - case .new: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_DiscoverRequest.Category] = [ - .popular, - .new, - ] - - } - - public init() {} -} - -public struct Ocp_Currency_V1_DiscoverResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Currency_V1_DiscoverResponse.Result = .ok - - public var mints: [Ocp_Currency_V1_Mint] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_DiscoverResponse.Result] = [ - .ok, - .notFound, - ] - - } - - public init() {} -} - -public struct Ocp_Currency_V1_CheckAvailabilityRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The currency name to check availability for - public var name: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Currency_V1_CheckAvailabilityResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Currency_V1_CheckAvailabilityResponse.Result = .ok - - /// Whether the name is available for use - public var isAvailable: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Currency_V1_CheckAvailabilityResponse.Result] = [ - .ok, - ] - - } - - public init() {} -} - -public struct Ocp_Currency_V1_ModerationAttestation: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var rawValue: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "ocp.currency.v1" - -extension Ocp_Currency_V1_PredefinedRange: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0ALL_TIME\0\u{1}LAST_DAY\0\u{1}LAST_WEEK\0\u{1}LAST_MONTH\0\u{1}LAST_YEAR\0") -} - -extension Ocp_Currency_V1_GetMintsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetMintsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}addresses\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.addresses) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.addresses.isEmpty { - try visitor.visitRepeatedMessageField(value: self.addresses, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_GetMintsRequest, rhs: Ocp_Currency_V1_GetMintsRequest) -> Bool { - if lhs.addresses != rhs.addresses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_GetMintsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetMintsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}metadata_by_address\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.metadataByAddress) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.metadataByAddress.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.metadataByAddress, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_GetMintsResponse, rhs: Ocp_Currency_V1_GetMintsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.metadataByAddress != rhs.metadataByAddress {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_GetMintsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0") -} - -extension Ocp_Currency_V1_GetHistoricalMintDataRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetHistoricalMintDataRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}address\0\u{3}currency_code\0\u{3}predefined_range\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._address) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.currencyCode) }() - case 3: try { - var v: Ocp_Currency_V1_PredefinedRange? - try decoder.decodeSingularEnumField(value: &v) - if let v = v { - if self.range != nil {try decoder.handleConflictingOneOf()} - self.range = .predefinedRange(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._address { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.currencyCode.isEmpty { - try visitor.visitSingularStringField(value: self.currencyCode, fieldNumber: 2) - } - try { if case .predefinedRange(let v)? = self.range { - try visitor.visitSingularEnumField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_GetHistoricalMintDataRequest, rhs: Ocp_Currency_V1_GetHistoricalMintDataRequest) -> Bool { - if lhs._address != rhs._address {return false} - if lhs.currencyCode != rhs.currencyCode {return false} - if lhs.range != rhs.range {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_GetHistoricalMintDataResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetHistoricalMintDataResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}data\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.data) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.data.isEmpty { - try visitor.visitRepeatedMessageField(value: self.data, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_GetHistoricalMintDataResponse, rhs: Ocp_Currency_V1_GetHistoricalMintDataResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.data != rhs.data {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_GetHistoricalMintDataResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0\u{1}MISSING_DATA\0") -} - -extension Ocp_Currency_V1_StreamLiveMintDataRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StreamLiveMintDataRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}request\0\u{1}pong\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Currency_V1_StreamLiveMintDataRequest.Request? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .request(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .request(v) - } - }() - case 2: try { - var v: Ocp_Common_V1_ClientPong? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .pong(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .pong(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .request?: try { - guard case .request(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .pong?: try { - guard case .pong(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_StreamLiveMintDataRequest, rhs: Ocp_Currency_V1_StreamLiveMintDataRequest) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_StreamLiveMintDataRequest.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_StreamLiveMintDataRequest.protoMessageName + ".Request" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}mints\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.mints) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.mints.isEmpty { - try visitor.visitRepeatedMessageField(value: self.mints, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_StreamLiveMintDataRequest.Request, rhs: Ocp_Currency_V1_StreamLiveMintDataRequest.Request) -> Bool { - if lhs.mints != rhs.mints {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_StreamLiveMintDataResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StreamLiveMintDataResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}data\0\u{1}ping\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Currency_V1_StreamLiveMintDataResponse.LiveData? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .data(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .data(v) - } - }() - case 2: try { - var v: Ocp_Common_V1_ServerPing? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .ping(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .ping(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .data?: try { - guard case .data(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .ping?: try { - guard case .ping(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_StreamLiveMintDataResponse, rhs: Ocp_Currency_V1_StreamLiveMintDataResponse) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_StreamLiveMintDataResponse.LiveData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_StreamLiveMintDataResponse.protoMessageName + ".LiveData" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}core_mint_fiat_exchange_rates\0\u{3}launchpad_currency_reserve_states\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRateBatch? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .coreMintFiatExchangeRates(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .coreMintFiatExchangeRates(v) - } - }() - case 2: try { - var v: Ocp_Currency_V1_VerifiedLaunchapdCurrencyReserveStateBatch? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .launchpadCurrencyReserveStates(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .launchpadCurrencyReserveStates(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .coreMintFiatExchangeRates?: try { - guard case .coreMintFiatExchangeRates(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .launchpadCurrencyReserveStates?: try { - guard case .launchpadCurrencyReserveStates(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_StreamLiveMintDataResponse.LiveData, rhs: Ocp_Currency_V1_StreamLiveMintDataResponse.LiveData) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_Mint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Mint" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}address\0\u{1}decimals\0\u{1}name\0\u{1}symbol\0\u{1}description\0\u{3}image_url\0\u{3}vm_metadata\0\u{3}launchpad_metadata\0\u{3}created_at\0\u{3}social_links\0\u{3}bill_customization\0\u{3}holder_metrics\0\u{3}market_cap_metrics\0") - - fileprivate class _StorageClass { - var _address: Ocp_Common_V1_SolanaAccountId? = nil - var _decimals: UInt32 = 0 - var _name: String = String() - var _symbol: String = String() - var _description_p: String = String() - var _imageURL: String = String() - var _vmMetadata: Ocp_Currency_V1_VmMetadata? = nil - var _launchpadMetadata: Ocp_Currency_V1_LaunchpadMetadata? = nil - var _createdAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - var _socialLinks: [Ocp_Currency_V1_SocialLink] = [] - var _billCustomization: Ocp_Currency_V1_BillCustomization? = nil - var _holderMetrics: Ocp_Currency_V1_HolderMetrics? = nil - var _marketCapMetrics: Ocp_Currency_V1_MarketCapMetrics? = nil - - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _address = source._address - _decimals = source._decimals - _name = source._name - _symbol = source._symbol - _description_p = source._description_p - _imageURL = source._imageURL - _vmMetadata = source._vmMetadata - _launchpadMetadata = source._launchpadMetadata - _createdAt = source._createdAt - _socialLinks = source._socialLinks - _billCustomization = source._billCustomization - _holderMetrics = source._holderMetrics - _marketCapMetrics = source._marketCapMetrics - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._address) }() - case 2: try { try decoder.decodeSingularUInt32Field(value: &_storage._decimals) }() - case 3: try { try decoder.decodeSingularStringField(value: &_storage._name) }() - case 4: try { try decoder.decodeSingularStringField(value: &_storage._symbol) }() - case 5: try { try decoder.decodeSingularStringField(value: &_storage._description_p) }() - case 6: try { try decoder.decodeSingularStringField(value: &_storage._imageURL) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._vmMetadata) }() - case 8: try { try decoder.decodeSingularMessageField(value: &_storage._launchpadMetadata) }() - case 9: try { try decoder.decodeSingularMessageField(value: &_storage._createdAt) }() - case 10: try { try decoder.decodeRepeatedMessageField(value: &_storage._socialLinks) }() - case 11: try { try decoder.decodeSingularMessageField(value: &_storage._billCustomization) }() - case 12: try { try decoder.decodeSingularMessageField(value: &_storage._holderMetrics) }() - case 13: try { try decoder.decodeSingularMessageField(value: &_storage._marketCapMetrics) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._address { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if _storage._decimals != 0 { - try visitor.visitSingularUInt32Field(value: _storage._decimals, fieldNumber: 2) - } - if !_storage._name.isEmpty { - try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 3) - } - if !_storage._symbol.isEmpty { - try visitor.visitSingularStringField(value: _storage._symbol, fieldNumber: 4) - } - if !_storage._description_p.isEmpty { - try visitor.visitSingularStringField(value: _storage._description_p, fieldNumber: 5) - } - if !_storage._imageURL.isEmpty { - try visitor.visitSingularStringField(value: _storage._imageURL, fieldNumber: 6) - } - try { if let v = _storage._vmMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try { if let v = _storage._launchpadMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - try { if let v = _storage._createdAt { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - if !_storage._socialLinks.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._socialLinks, fieldNumber: 10) - } - try { if let v = _storage._billCustomization { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - try { if let v = _storage._holderMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } }() - try { if let v = _storage._marketCapMetrics { - try visitor.visitSingularMessageField(value: v, fieldNumber: 13) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_Mint, rhs: Ocp_Currency_V1_Mint) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._address != rhs_storage._address {return false} - if _storage._decimals != rhs_storage._decimals {return false} - if _storage._name != rhs_storage._name {return false} - if _storage._symbol != rhs_storage._symbol {return false} - if _storage._description_p != rhs_storage._description_p {return false} - if _storage._imageURL != rhs_storage._imageURL {return false} - if _storage._vmMetadata != rhs_storage._vmMetadata {return false} - if _storage._launchpadMetadata != rhs_storage._launchpadMetadata {return false} - if _storage._createdAt != rhs_storage._createdAt {return false} - if _storage._socialLinks != rhs_storage._socialLinks {return false} - if _storage._billCustomization != rhs_storage._billCustomization {return false} - if _storage._holderMetrics != rhs_storage._holderMetrics {return false} - if _storage._marketCapMetrics != rhs_storage._marketCapMetrics {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_VmMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VmMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}vm\0\u{1}authority\0\u{3}lock_duration_in_days\0\u{1}omnibus\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._vm) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._authority) }() - case 3: try { try decoder.decodeSingularUInt32Field(value: &self.lockDurationInDays) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._omnibus) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._vm { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._authority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.lockDurationInDays != 0 { - try visitor.visitSingularUInt32Field(value: self.lockDurationInDays, fieldNumber: 3) - } - try { if let v = self._omnibus { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_VmMetadata, rhs: Ocp_Currency_V1_VmMetadata) -> Bool { - if lhs._vm != rhs._vm {return false} - if lhs._authority != rhs._authority {return false} - if lhs.lockDurationInDays != rhs.lockDurationInDays {return false} - if lhs._omnibus != rhs._omnibus {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_LaunchpadMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LaunchpadMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}currency_config\0\u{3}liquidity_pool\0\u{1}seed\0\u{1}authority\0\u{3}mint_vault\0\u{3}core_mint_vault\0\u{3}supply_from_bonding\0\u{3}sell_fee_bps\0\u{1}price\0\u{3}market_cap\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._currencyConfig) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._liquidityPool) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._seed) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._authority) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._mintVault) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._coreMintVault) }() - case 7: try { try decoder.decodeSingularUInt64Field(value: &self.supplyFromBonding) }() - case 8: try { try decoder.decodeSingularUInt32Field(value: &self.sellFeeBps) }() - case 9: try { try decoder.decodeSingularDoubleField(value: &self.price) }() - case 10: try { try decoder.decodeSingularDoubleField(value: &self.marketCap) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._currencyConfig { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._liquidityPool { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._seed { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._authority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._mintVault { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try { if let v = self._coreMintVault { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - if self.supplyFromBonding != 0 { - try visitor.visitSingularUInt64Field(value: self.supplyFromBonding, fieldNumber: 7) - } - if self.sellFeeBps != 0 { - try visitor.visitSingularUInt32Field(value: self.sellFeeBps, fieldNumber: 8) - } - if self.price.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.price, fieldNumber: 9) - } - if self.marketCap.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.marketCap, fieldNumber: 10) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_LaunchpadMetadata, rhs: Ocp_Currency_V1_LaunchpadMetadata) -> Bool { - if lhs._currencyConfig != rhs._currencyConfig {return false} - if lhs._liquidityPool != rhs._liquidityPool {return false} - if lhs._seed != rhs._seed {return false} - if lhs._authority != rhs._authority {return false} - if lhs._mintVault != rhs._mintVault {return false} - if lhs._coreMintVault != rhs._coreMintVault {return false} - if lhs.supplyFromBonding != rhs.supplyFromBonding {return false} - if lhs.sellFeeBps != rhs.sellFeeBps {return false} - if lhs.price != rhs.price {return false} - if lhs.marketCap != rhs.marketCap {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_HistoricalMintData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".HistoricalMintData" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}timestamp\0\u{3}market_cap\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - case 2: try { try decoder.decodeSingularDoubleField(value: &self.marketCap) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.marketCap.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.marketCap, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_HistoricalMintData, rhs: Ocp_Currency_V1_HistoricalMintData) -> Bool { - if lhs._timestamp != rhs._timestamp {return false} - if lhs.marketCap != rhs.marketCap {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_CoreMintFiatExchangeRate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CoreMintFiatExchangeRate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}currency_code\0\u{3}exchange_rate\0\u{1}timestamp\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.currencyCode) }() - case 2: try { try decoder.decodeSingularDoubleField(value: &self.exchangeRate) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.currencyCode.isEmpty { - try visitor.visitSingularStringField(value: self.currencyCode, fieldNumber: 1) - } - if self.exchangeRate.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.exchangeRate, fieldNumber: 2) - } - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_CoreMintFiatExchangeRate, rhs: Ocp_Currency_V1_CoreMintFiatExchangeRate) -> Bool { - if lhs.currencyCode != rhs.currencyCode {return false} - if lhs.exchangeRate != rhs.exchangeRate {return false} - if lhs._timestamp != rhs._timestamp {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerifiedCoreMintFiatExchangeRate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}exchange_rate\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._exchangeRate) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._exchangeRate { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRate, rhs: Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRate) -> Bool { - if lhs._exchangeRate != rhs._exchangeRate {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRateBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerifiedCoreMintFiatExchangeRateBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{4}\u{2}exchange_rates\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.exchangeRates) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.exchangeRates.isEmpty { - try visitor.visitRepeatedMessageField(value: self.exchangeRates, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRateBatch, rhs: Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRateBatch) -> Bool { - if lhs.exchangeRates != rhs.exchangeRates {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_LaunchpadCurrencyReserveState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LaunchpadCurrencyReserveState" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}mint\0\u{3}supply_from_bonding\0\u{1}timestamp\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.supplyFromBonding) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._timestamp) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.supplyFromBonding != 0 { - try visitor.visitSingularUInt64Field(value: self.supplyFromBonding, fieldNumber: 2) - } - try { if let v = self._timestamp { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_LaunchpadCurrencyReserveState, rhs: Ocp_Currency_V1_LaunchpadCurrencyReserveState) -> Bool { - if lhs._mint != rhs._mint {return false} - if lhs.supplyFromBonding != rhs.supplyFromBonding {return false} - if lhs._timestamp != rhs._timestamp {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerifiedLaunchpadCurrencyReserveState" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}reserve_state\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._reserveState) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._reserveState { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState, rhs: Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState) -> Bool { - if lhs._reserveState != rhs._reserveState {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_VerifiedLaunchapdCurrencyReserveStateBatch: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerifiedLaunchapdCurrencyReserveStateBatch" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{4}\u{2}reserve_states\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.reserveStates) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.reserveStates.isEmpty { - try visitor.visitRepeatedMessageField(value: self.reserveStates, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_VerifiedLaunchapdCurrencyReserveStateBatch, rhs: Ocp_Currency_V1_VerifiedLaunchapdCurrencyReserveStateBatch) -> Bool { - if lhs.reserveStates != rhs.reserveStates {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_SocialLink: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SocialLink" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}website\0\u{1}x\0\u{1}telegram\0\u{1}discord\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Currency_V1_SocialLink.Website? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .website(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .website(v) - } - }() - case 2: try { - var v: Ocp_Currency_V1_SocialLink.X? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .x(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .x(v) - } - }() - case 3: try { - var v: Ocp_Currency_V1_SocialLink.Telegram? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .telegram(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .telegram(v) - } - }() - case 4: try { - var v: Ocp_Currency_V1_SocialLink.Discord? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .discord(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .discord(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .website?: try { - guard case .website(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .x?: try { - guard case .x(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .telegram?: try { - guard case .telegram(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .discord?: try { - guard case .discord(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_SocialLink, rhs: Ocp_Currency_V1_SocialLink) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_SocialLink.Website: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_SocialLink.protoMessageName + ".Website" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}url\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.url) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.url.isEmpty { - try visitor.visitSingularStringField(value: self.url, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_SocialLink.Website, rhs: Ocp_Currency_V1_SocialLink.Website) -> Bool { - if lhs.url != rhs.url {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_SocialLink.X: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_SocialLink.protoMessageName + ".X" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}username\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.username) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.username.isEmpty { - try visitor.visitSingularStringField(value: self.username, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_SocialLink.X, rhs: Ocp_Currency_V1_SocialLink.X) -> Bool { - if lhs.username != rhs.username {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_SocialLink.Telegram: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_SocialLink.protoMessageName + ".Telegram" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}username\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.username) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.username.isEmpty { - try visitor.visitSingularStringField(value: self.username, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_SocialLink.Telegram, rhs: Ocp_Currency_V1_SocialLink.Telegram) -> Bool { - if lhs.username != rhs.username {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_SocialLink.Discord: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_SocialLink.protoMessageName + ".Discord" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}invite_code\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.inviteCode) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.inviteCode.isEmpty { - try visitor.visitSingularStringField(value: self.inviteCode, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_SocialLink.Discord, rhs: Ocp_Currency_V1_SocialLink.Discord) -> Bool { - if lhs.inviteCode != rhs.inviteCode {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_BillCustomization: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".BillCustomization" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}colors\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.colors) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.colors.isEmpty { - try visitor.visitRepeatedMessageField(value: self.colors, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_BillCustomization, rhs: Ocp_Currency_V1_BillCustomization) -> Bool { - if lhs.colors != rhs.colors {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_Color: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Color" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}hex\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.hex) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.hex.isEmpty { - try visitor.visitSingularStringField(value: self.hex, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_Color, rhs: Ocp_Currency_V1_Color) -> Bool { - if lhs.hex != rhs.hex {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_HolderMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".HolderMetrics" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}current_holders\0\u{3}holder_deltas\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.currentHolders) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.holderDeltas) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.currentHolders != 0 { - try visitor.visitSingularUInt64Field(value: self.currentHolders, fieldNumber: 1) - } - if !self.holderDeltas.isEmpty { - try visitor.visitRepeatedMessageField(value: self.holderDeltas, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_HolderMetrics, rhs: Ocp_Currency_V1_HolderMetrics) -> Bool { - if lhs.currentHolders != rhs.currentHolders {return false} - if lhs.holderDeltas != rhs.holderDeltas {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_HolderMetrics.DeltaHolders: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_HolderMetrics.protoMessageName + ".DeltaHolders" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}range\0\u{1}delta\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.range) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.delta) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.range != .allTime { - try visitor.visitSingularEnumField(value: self.range, fieldNumber: 1) - } - if self.delta != 0 { - try visitor.visitSingularInt64Field(value: self.delta, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_HolderMetrics.DeltaHolders, rhs: Ocp_Currency_V1_HolderMetrics.DeltaHolders) -> Bool { - if lhs.range != rhs.range {return false} - if lhs.delta != rhs.delta {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_MarketCapMetrics: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MarketCapMetrics" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}current_market_cap\0\u{3}market_cap_deltas\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularDoubleField(value: &self.currentMarketCap) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.marketCapDeltas) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.currentMarketCap.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.currentMarketCap, fieldNumber: 1) - } - if !self.marketCapDeltas.isEmpty { - try visitor.visitRepeatedMessageField(value: self.marketCapDeltas, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_MarketCapMetrics, rhs: Ocp_Currency_V1_MarketCapMetrics) -> Bool { - if lhs.currentMarketCap != rhs.currentMarketCap {return false} - if lhs.marketCapDeltas != rhs.marketCapDeltas {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_MarketCapMetrics.DeltaMarketCap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_MarketCapMetrics.protoMessageName + ".DeltaMarketCap" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}range\0\u{1}delta\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.range) }() - case 2: try { try decoder.decodeSingularDoubleField(value: &self.delta) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.range != .allTime { - try visitor.visitSingularEnumField(value: self.range, fieldNumber: 1) - } - if self.delta.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.delta, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_MarketCapMetrics.DeltaMarketCap, rhs: Ocp_Currency_V1_MarketCapMetrics.DeltaMarketCap) -> Bool { - if lhs.range != rhs.range {return false} - if lhs.delta != rhs.delta {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_LaunchRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LaunchRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}owner\0\u{1}signature\0\u{1}name\0\u{1}symbol\0\u{1}description\0\u{3}bill_customization\0\u{1}icon\0\u{3}name_moderation_attestation\0\u{3}symbol_moderation_attestation\0\u{3}description_moderation_attestation\0\u{3}icon_moderation_attestation\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.symbol) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.description_p) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._billCustomization) }() - case 7: try { try decoder.decodeSingularBytesField(value: &self.icon) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._nameModerationAttestation) }() - case 9: try { try decoder.decodeSingularMessageField(value: &self._symbolModerationAttestation) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._descriptionModerationAttestation) }() - case 11: try { try decoder.decodeSingularMessageField(value: &self._iconModerationAttestation) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 3) - } - if !self.symbol.isEmpty { - try visitor.visitSingularStringField(value: self.symbol, fieldNumber: 4) - } - if !self.description_p.isEmpty { - try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 5) - } - try { if let v = self._billCustomization { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - if !self.icon.isEmpty { - try visitor.visitSingularBytesField(value: self.icon, fieldNumber: 7) - } - try { if let v = self._nameModerationAttestation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - try { if let v = self._symbolModerationAttestation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - try { if let v = self._descriptionModerationAttestation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try { if let v = self._iconModerationAttestation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_LaunchRequest, rhs: Ocp_Currency_V1_LaunchRequest) -> Bool { - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs.name != rhs.name {return false} - if lhs.symbol != rhs.symbol {return false} - if lhs.description_p != rhs.description_p {return false} - if lhs._billCustomization != rhs._billCustomization {return false} - if lhs.icon != rhs.icon {return false} - if lhs._nameModerationAttestation != rhs._nameModerationAttestation {return false} - if lhs._symbolModerationAttestation != rhs._symbolModerationAttestation {return false} - if lhs._descriptionModerationAttestation != rhs._descriptionModerationAttestation {return false} - if lhs._iconModerationAttestation != rhs._iconModerationAttestation {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_LaunchResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LaunchResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_LaunchResponse, rhs: Ocp_Currency_V1_LaunchResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_LaunchResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}NAME_EXISTS\0\u{1}INVALID_ICON\0") -} - -extension Ocp_Currency_V1_UpdateIconRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateIconRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}owner\0\u{1}signature\0\u{1}mint\0\u{1}icon\0\u{3}moderation_attestation\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - case 4: try { try decoder.decodeSingularBytesField(value: &self.icon) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._moderationAttestation) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !self.icon.isEmpty { - try visitor.visitSingularBytesField(value: self.icon, fieldNumber: 4) - } - try { if let v = self._moderationAttestation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_UpdateIconRequest, rhs: Ocp_Currency_V1_UpdateIconRequest) -> Bool { - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs._mint != rhs._mint {return false} - if lhs.icon != rhs.icon {return false} - if lhs._moderationAttestation != rhs._moderationAttestation {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_UpdateIconResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateIconResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_UpdateIconResponse, rhs: Ocp_Currency_V1_UpdateIconResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_UpdateIconResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0\u{1}DENIED\0\u{1}INVALID_ICON\0") -} - -extension Ocp_Currency_V1_UpdateMetadataRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateMetadataRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}owner\0\u{1}signature\0\u{1}mint\0\u{3}new_description\0\u{3}new_bill_customization\0\u{3}new_social_links\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._newDescription) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._newBillCustomization) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._newSocialLinks) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._newDescription { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._newBillCustomization { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try { if let v = self._newSocialLinks { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_UpdateMetadataRequest, rhs: Ocp_Currency_V1_UpdateMetadataRequest) -> Bool { - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs._mint != rhs._mint {return false} - if lhs._newDescription != rhs._newDescription {return false} - if lhs._newBillCustomization != rhs._newBillCustomization {return false} - if lhs._newSocialLinks != rhs._newSocialLinks {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_UpdateMetadataRequest.DescriptionUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_UpdateMetadataRequest.protoMessageName + ".DescriptionUpdate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0\u{3}moderation_attestation\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._moderationAttestation) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) - } - try { if let v = self._moderationAttestation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_UpdateMetadataRequest.DescriptionUpdate, rhs: Ocp_Currency_V1_UpdateMetadataRequest.DescriptionUpdate) -> Bool { - if lhs.value != rhs.value {return false} - if lhs._moderationAttestation != rhs._moderationAttestation {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_UpdateMetadataRequest.BillCustomizationUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_UpdateMetadataRequest.protoMessageName + ".BillCustomizationUpdate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._value { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_UpdateMetadataRequest.BillCustomizationUpdate, rhs: Ocp_Currency_V1_UpdateMetadataRequest.BillCustomizationUpdate) -> Bool { - if lhs._value != rhs._value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_UpdateMetadataRequest.SocialLinksUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Currency_V1_UpdateMetadataRequest.protoMessageName + ".SocialLinksUpdate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitRepeatedMessageField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_UpdateMetadataRequest.SocialLinksUpdate, rhs: Ocp_Currency_V1_UpdateMetadataRequest.SocialLinksUpdate) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_UpdateMetadataResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateMetadataResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_UpdateMetadataResponse, rhs: Ocp_Currency_V1_UpdateMetadataResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_UpdateMetadataResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0\u{1}DENIED\0") -} - -extension Ocp_Currency_V1_DiscoverRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DiscoverRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}category\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.category) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.category != .popular { - try visitor.visitSingularEnumField(value: self.category, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_DiscoverRequest, rhs: Ocp_Currency_V1_DiscoverRequest) -> Bool { - if lhs.category != rhs.category {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_DiscoverRequest.Category: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0POPULAR\0\u{1}NEW\0") -} - -extension Ocp_Currency_V1_DiscoverResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DiscoverResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}mints\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.mints) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.mints.isEmpty { - try visitor.visitRepeatedMessageField(value: self.mints, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_DiscoverResponse, rhs: Ocp_Currency_V1_DiscoverResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.mints != rhs.mints {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_DiscoverResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0") -} - -extension Ocp_Currency_V1_CheckAvailabilityRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CheckAvailabilityRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}name\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_CheckAvailabilityRequest, rhs: Ocp_Currency_V1_CheckAvailabilityRequest) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_CheckAvailabilityResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CheckAvailabilityResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}is_available\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.isAvailable) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if self.isAvailable != false { - try visitor.visitSingularBoolField(value: self.isAvailable, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_CheckAvailabilityResponse, rhs: Ocp_Currency_V1_CheckAvailabilityResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.isAvailable != rhs.isAvailable {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Currency_V1_CheckAvailabilityResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0") -} - -extension Ocp_Currency_V1_ModerationAttestation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ModerationAttestation" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}raw_value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.rawValue) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.rawValue.isEmpty { - try visitor.visitSingularBytesField(value: self.rawValue, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Currency_V1_ModerationAttestation, rhs: Ocp_Currency_V1_ModerationAttestation) -> Bool { - if lhs.rawValue != rhs.rawValue {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/messaging_v1_ocp_messaging_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/messaging_v1_ocp_messaging_service.grpc.swift deleted file mode 100644 index b47879442..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/messaging_v1_ocp_messaging_service.grpc.swift +++ /dev/null @@ -1,910 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: messaging/v1/ocp_messaging_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - ocp.messaging.v1.Messaging - -/// Namespace containing generated types for the "ocp.messaging.v1.Messaging" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Ocp_Messaging_V1_Messaging { - /// Service descriptor for the "ocp.messaging.v1.Messaging" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.messaging.v1.Messaging") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "OpenMessageStream" metadata. - public enum OpenMessageStream { - /// Request type for "OpenMessageStream". - public typealias Input = Ocp_Messaging_V1_OpenMessageStreamRequest - /// Response type for "OpenMessageStream". - public typealias Output = Ocp_Messaging_V1_OpenMessageStreamResponse - /// Descriptor for "OpenMessageStream". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.messaging.v1.Messaging"), - method: "OpenMessageStream" - ) - } - /// Namespace for "OpenMessageStreamWithKeepAlive" metadata. - public enum OpenMessageStreamWithKeepAlive { - /// Request type for "OpenMessageStreamWithKeepAlive". - public typealias Input = Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest - /// Response type for "OpenMessageStreamWithKeepAlive". - public typealias Output = Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveResponse - /// Descriptor for "OpenMessageStreamWithKeepAlive". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.messaging.v1.Messaging"), - method: "OpenMessageStreamWithKeepAlive" - ) - } - /// Namespace for "PollMessages" metadata. - public enum PollMessages { - /// Request type for "PollMessages". - public typealias Input = Ocp_Messaging_V1_PollMessagesRequest - /// Response type for "PollMessages". - public typealias Output = Ocp_Messaging_V1_PollMessagesResponse - /// Descriptor for "PollMessages". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.messaging.v1.Messaging"), - method: "PollMessages" - ) - } - /// Namespace for "AckMessages" metadata. - public enum AckMessages { - /// Request type for "AckMessages". - public typealias Input = Ocp_Messaging_V1_AckMessagesRequest - /// Response type for "AckMessages". - public typealias Output = Ocp_Messaging_V1_AckMesssagesResponse - /// Descriptor for "AckMessages". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.messaging.v1.Messaging"), - method: "AckMessages" - ) - } - /// Namespace for "SendMessage" metadata. - public enum SendMessage { - /// Request type for "SendMessage". - public typealias Input = Ocp_Messaging_V1_SendMessageRequest - /// Response type for "SendMessage". - public typealias Output = Ocp_Messaging_V1_SendMessageResponse - /// Descriptor for "SendMessage". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.messaging.v1.Messaging"), - method: "SendMessage" - ) - } - /// Descriptors for all methods in the "ocp.messaging.v1.Messaging" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - OpenMessageStream.descriptor, - OpenMessageStreamWithKeepAlive.descriptor, - PollMessages.descriptor, - AckMessages.descriptor, - SendMessage.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "ocp.messaging.v1.Messaging" service. - public static let ocp_messaging_v1_Messaging = GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.messaging.v1.Messaging") -} - -// MARK: ocp.messaging.v1.Messaging (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Messaging_V1_Messaging { - /// Generated client protocol for the "ocp.messaging.v1.Messaging" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "OpenMessageStream" method. - /// - /// > Source IDL Documentation: - /// > - /// > OpenMessageStream opens a stream of messages. Messages are routed using the - /// > public key of a rendezvous keypair derived by both the sender and the - /// > recipient of the messages. The sender may be a client or server. - /// > - /// > Messages are expected to be acked once they have been processed by the client. - /// > Ack'd messages will no longer be delivered on future OpenMessageStream calls, - /// > and are eligible for deletion from the service. Clients should, however, handle - /// > duplicate delivery of messages. - /// > - /// > For giving/grabbing a bill, the expected flow is as follows: - /// > 1. The payment sender creates a multi-mint cash scan code. - /// > 2. The payment sender calls OpenMessageStream on the rendezvous public key. - /// > 3. The payment sender uses SendMessage to send the mint in a RequestToGiveBill message. - /// > 4. The payment sender shows the bill with the scan code containing the rendezvous public key. - /// > 4. The payment recipient scans the code. - /// > 5. The payment recipient uses PollMessages to get the RequestToGiveBill message from part 3. - /// > 6. The payment recipient sends the destination address in a RequestToGrabBill message. - /// > 7. The payment sender receives the RequestToGrabBill message in real time, submits the intent - /// > for the payment to the provided destination, and then closes the stream. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_OpenMessageStreamRequest` message. - /// - serializer: A serializer for `Ocp_Messaging_V1_OpenMessageStreamRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_OpenMessageStreamResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func openMessageStream( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "OpenMessageStreamWithKeepAlive" method. - /// - /// > Source IDL Documentation: - /// > - /// > OpenMessageStreamWithKeepAlive is like OpenMessageStream, but enables a ping/pong - /// > keepalive to determine the health of the stream at both the client and server. - /// > - /// > The keepalive protocol is as follows: - /// > 1. Client initiates a stream by sending an OpenMessageStreamRequest. - /// > 2. Upon stream initialization, server begins the keepalive protocol. - /// > 3. Server sends a ping to the client. - /// > 4. Client responds with a pong as fast as possible, making note of - /// > the delay for when to expect the next ping. - /// > 5. Steps 3 and 4 are repeated until the stream is explicitly terminated - /// > or is deemed to be unhealthy. - /// > - /// > Client notes: - /// > * Client should be careful to process messages async, so any responses to pings are - /// > not delayed. - /// > * Clients should implement a reasonable backoff strategy upon continued timeout failures. - /// > * Clients that abuse pong messages may have their streams terminated by server. - /// > - /// > At any point in the stream, server will respond with messages in real time as - /// > they are observed. Messages sent over the stream should not affect the ping/pong - /// > protocol timings. Individual protocols for payment flows remain the same, and are - /// > documented in OpenMessageStream. - /// > - /// > Note: This API will enforce OpenMessageStreamRequest.signature is set as part of migration - /// > to this newer protocol - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest` messages. - /// - serializer: A serializer for `Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func openMessageStreamWithKeepAlive( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "PollMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > PollMessages is like OpenMessageStream, but uses a polling flow for receiving - /// > messages. Updates are not real-time and depedent on the polling interval. - /// > This RPC supports all message types. - /// > - /// > This is a temporary RPC until OpenMessageStream can be built out generically on - /// > both client and server, while supporting things like multiple listeners. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_PollMessagesRequest` message. - /// - serializer: A serializer for `Ocp_Messaging_V1_PollMessagesRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_PollMessagesResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func pollMessages( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "AckMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > AckMessages acks one or more messages that have been successfully delivered to - /// > the client. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_AckMessagesRequest` message. - /// - serializer: A serializer for `Ocp_Messaging_V1_AckMessagesRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_AckMesssagesResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func ackMessages( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "SendMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendMessage sends a message. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_SendMessageRequest` message. - /// - serializer: A serializer for `Ocp_Messaging_V1_SendMessageRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_SendMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func sendMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "ocp.messaging.v1.Messaging" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "OpenMessageStream" method. - /// - /// > Source IDL Documentation: - /// > - /// > OpenMessageStream opens a stream of messages. Messages are routed using the - /// > public key of a rendezvous keypair derived by both the sender and the - /// > recipient of the messages. The sender may be a client or server. - /// > - /// > Messages are expected to be acked once they have been processed by the client. - /// > Ack'd messages will no longer be delivered on future OpenMessageStream calls, - /// > and are eligible for deletion from the service. Clients should, however, handle - /// > duplicate delivery of messages. - /// > - /// > For giving/grabbing a bill, the expected flow is as follows: - /// > 1. The payment sender creates a multi-mint cash scan code. - /// > 2. The payment sender calls OpenMessageStream on the rendezvous public key. - /// > 3. The payment sender uses SendMessage to send the mint in a RequestToGiveBill message. - /// > 4. The payment sender shows the bill with the scan code containing the rendezvous public key. - /// > 4. The payment recipient scans the code. - /// > 5. The payment recipient uses PollMessages to get the RequestToGiveBill message from part 3. - /// > 6. The payment recipient sends the destination address in a RequestToGrabBill message. - /// > 7. The payment sender receives the RequestToGrabBill message in real time, submits the intent - /// > for the payment to the provided destination, and then closes the stream. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_OpenMessageStreamRequest` message. - /// - serializer: A serializer for `Ocp_Messaging_V1_OpenMessageStreamRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_OpenMessageStreamResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func openMessageStream( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.serverStreaming( - request: request, - descriptor: Ocp_Messaging_V1_Messaging.Method.OpenMessageStream.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "OpenMessageStreamWithKeepAlive" method. - /// - /// > Source IDL Documentation: - /// > - /// > OpenMessageStreamWithKeepAlive is like OpenMessageStream, but enables a ping/pong - /// > keepalive to determine the health of the stream at both the client and server. - /// > - /// > The keepalive protocol is as follows: - /// > 1. Client initiates a stream by sending an OpenMessageStreamRequest. - /// > 2. Upon stream initialization, server begins the keepalive protocol. - /// > 3. Server sends a ping to the client. - /// > 4. Client responds with a pong as fast as possible, making note of - /// > the delay for when to expect the next ping. - /// > 5. Steps 3 and 4 are repeated until the stream is explicitly terminated - /// > or is deemed to be unhealthy. - /// > - /// > Client notes: - /// > * Client should be careful to process messages async, so any responses to pings are - /// > not delayed. - /// > * Clients should implement a reasonable backoff strategy upon continued timeout failures. - /// > * Clients that abuse pong messages may have their streams terminated by server. - /// > - /// > At any point in the stream, server will respond with messages in real time as - /// > they are observed. Messages sent over the stream should not affect the ping/pong - /// > protocol timings. Individual protocols for payment flows remain the same, and are - /// > documented in OpenMessageStream. - /// > - /// > Note: This API will enforce OpenMessageStreamRequest.signature is set as part of migration - /// > to this newer protocol - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest` messages. - /// - serializer: A serializer for `Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func openMessageStreamWithKeepAlive( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.bidirectionalStreaming( - request: request, - descriptor: Ocp_Messaging_V1_Messaging.Method.OpenMessageStreamWithKeepAlive.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "PollMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > PollMessages is like OpenMessageStream, but uses a polling flow for receiving - /// > messages. Updates are not real-time and depedent on the polling interval. - /// > This RPC supports all message types. - /// > - /// > This is a temporary RPC until OpenMessageStream can be built out generically on - /// > both client and server, while supporting things like multiple listeners. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_PollMessagesRequest` message. - /// - serializer: A serializer for `Ocp_Messaging_V1_PollMessagesRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_PollMessagesResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func pollMessages( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Messaging_V1_Messaging.Method.PollMessages.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AckMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > AckMessages acks one or more messages that have been successfully delivered to - /// > the client. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_AckMessagesRequest` message. - /// - serializer: A serializer for `Ocp_Messaging_V1_AckMessagesRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_AckMesssagesResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func ackMessages( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Messaging_V1_Messaging.Method.AckMessages.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SendMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendMessage sends a message. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_SendMessageRequest` message. - /// - serializer: A serializer for `Ocp_Messaging_V1_SendMessageRequest` messages. - /// - deserializer: A deserializer for `Ocp_Messaging_V1_SendMessageResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendMessage( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Messaging_V1_Messaging.Method.SendMessage.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Messaging_V1_Messaging.ClientProtocol { - /// Call the "OpenMessageStream" method. - /// - /// > Source IDL Documentation: - /// > - /// > OpenMessageStream opens a stream of messages. Messages are routed using the - /// > public key of a rendezvous keypair derived by both the sender and the - /// > recipient of the messages. The sender may be a client or server. - /// > - /// > Messages are expected to be acked once they have been processed by the client. - /// > Ack'd messages will no longer be delivered on future OpenMessageStream calls, - /// > and are eligible for deletion from the service. Clients should, however, handle - /// > duplicate delivery of messages. - /// > - /// > For giving/grabbing a bill, the expected flow is as follows: - /// > 1. The payment sender creates a multi-mint cash scan code. - /// > 2. The payment sender calls OpenMessageStream on the rendezvous public key. - /// > 3. The payment sender uses SendMessage to send the mint in a RequestToGiveBill message. - /// > 4. The payment sender shows the bill with the scan code containing the rendezvous public key. - /// > 4. The payment recipient scans the code. - /// > 5. The payment recipient uses PollMessages to get the RequestToGiveBill message from part 3. - /// > 6. The payment recipient sends the destination address in a RequestToGrabBill message. - /// > 7. The payment sender receives the RequestToGrabBill message in real time, submits the intent - /// > for the payment to the provided destination, and then closes the stream. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_OpenMessageStreamRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func openMessageStream( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.openMessageStream( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "OpenMessageStreamWithKeepAlive" method. - /// - /// > Source IDL Documentation: - /// > - /// > OpenMessageStreamWithKeepAlive is like OpenMessageStream, but enables a ping/pong - /// > keepalive to determine the health of the stream at both the client and server. - /// > - /// > The keepalive protocol is as follows: - /// > 1. Client initiates a stream by sending an OpenMessageStreamRequest. - /// > 2. Upon stream initialization, server begins the keepalive protocol. - /// > 3. Server sends a ping to the client. - /// > 4. Client responds with a pong as fast as possible, making note of - /// > the delay for when to expect the next ping. - /// > 5. Steps 3 and 4 are repeated until the stream is explicitly terminated - /// > or is deemed to be unhealthy. - /// > - /// > Client notes: - /// > * Client should be careful to process messages async, so any responses to pings are - /// > not delayed. - /// > * Clients should implement a reasonable backoff strategy upon continued timeout failures. - /// > * Clients that abuse pong messages may have their streams terminated by server. - /// > - /// > At any point in the stream, server will respond with messages in real time as - /// > they are observed. Messages sent over the stream should not affect the ping/pong - /// > protocol timings. Individual protocols for payment flows remain the same, and are - /// > documented in OpenMessageStream. - /// > - /// > Note: This API will enforce OpenMessageStreamRequest.signature is set as part of migration - /// > to this newer protocol - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func openMessageStreamWithKeepAlive( - request: GRPCCore.StreamingClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.openMessageStreamWithKeepAlive( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "PollMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > PollMessages is like OpenMessageStream, but uses a polling flow for receiving - /// > messages. Updates are not real-time and depedent on the polling interval. - /// > This RPC supports all message types. - /// > - /// > This is a temporary RPC until OpenMessageStream can be built out generically on - /// > both client and server, while supporting things like multiple listeners. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_PollMessagesRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func pollMessages( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.pollMessages( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AckMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > AckMessages acks one or more messages that have been successfully delivered to - /// > the client. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_AckMessagesRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func ackMessages( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.ackMessages( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SendMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendMessage sends a message. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Messaging_V1_SendMessageRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendMessage( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.sendMessage( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Messaging_V1_Messaging.ClientProtocol { - /// Call the "OpenMessageStream" method. - /// - /// > Source IDL Documentation: - /// > - /// > OpenMessageStream opens a stream of messages. Messages are routed using the - /// > public key of a rendezvous keypair derived by both the sender and the - /// > recipient of the messages. The sender may be a client or server. - /// > - /// > Messages are expected to be acked once they have been processed by the client. - /// > Ack'd messages will no longer be delivered on future OpenMessageStream calls, - /// > and are eligible for deletion from the service. Clients should, however, handle - /// > duplicate delivery of messages. - /// > - /// > For giving/grabbing a bill, the expected flow is as follows: - /// > 1. The payment sender creates a multi-mint cash scan code. - /// > 2. The payment sender calls OpenMessageStream on the rendezvous public key. - /// > 3. The payment sender uses SendMessage to send the mint in a RequestToGiveBill message. - /// > 4. The payment sender shows the bill with the scan code containing the rendezvous public key. - /// > 4. The payment recipient scans the code. - /// > 5. The payment recipient uses PollMessages to get the RequestToGiveBill message from part 3. - /// > 6. The payment recipient sends the destination address in a RequestToGrabBill message. - /// > 7. The payment sender receives the RequestToGrabBill message in real time, submits the intent - /// > for the payment to the provided destination, and then closes the stream. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func openMessageStream( - _ message: Ocp_Messaging_V1_OpenMessageStreamRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.openMessageStream( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "OpenMessageStreamWithKeepAlive" method. - /// - /// > Source IDL Documentation: - /// > - /// > OpenMessageStreamWithKeepAlive is like OpenMessageStream, but enables a ping/pong - /// > keepalive to determine the health of the stream at both the client and server. - /// > - /// > The keepalive protocol is as follows: - /// > 1. Client initiates a stream by sending an OpenMessageStreamRequest. - /// > 2. Upon stream initialization, server begins the keepalive protocol. - /// > 3. Server sends a ping to the client. - /// > 4. Client responds with a pong as fast as possible, making note of - /// > the delay for when to expect the next ping. - /// > 5. Steps 3 and 4 are repeated until the stream is explicitly terminated - /// > or is deemed to be unhealthy. - /// > - /// > Client notes: - /// > * Client should be careful to process messages async, so any responses to pings are - /// > not delayed. - /// > * Clients should implement a reasonable backoff strategy upon continued timeout failures. - /// > * Clients that abuse pong messages may have their streams terminated by server. - /// > - /// > At any point in the stream, server will respond with messages in real time as - /// > they are observed. Messages sent over the stream should not affect the ping/pong - /// > protocol timings. Individual protocols for payment flows remain the same, and are - /// > documented in OpenMessageStream. - /// > - /// > Note: This API will enforce OpenMessageStreamRequest.signature is set as part of migration - /// > to this newer protocol - /// - /// - Parameters: - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - producer: A closure producing request messages to send to the server. The request - /// stream is closed when the closure returns. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func openMessageStreamWithKeepAlive( - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - requestProducer producer: @Sendable @escaping (GRPCCore.RPCWriter) async throws -> Void, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.StreamingClientRequest( - metadata: metadata, - producer: producer - ) - return try await self.openMessageStreamWithKeepAlive( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "PollMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > PollMessages is like OpenMessageStream, but uses a polling flow for receiving - /// > messages. Updates are not real-time and depedent on the polling interval. - /// > This RPC supports all message types. - /// > - /// > This is a temporary RPC until OpenMessageStream can be built out generically on - /// > both client and server, while supporting things like multiple listeners. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func pollMessages( - _ message: Ocp_Messaging_V1_PollMessagesRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.pollMessages( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "AckMessages" method. - /// - /// > Source IDL Documentation: - /// > - /// > AckMessages acks one or more messages that have been successfully delivered to - /// > the client. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func ackMessages( - _ message: Ocp_Messaging_V1_AckMessagesRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.ackMessages( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "SendMessage" method. - /// - /// > Source IDL Documentation: - /// > - /// > SendMessage sends a message. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func sendMessage( - _ message: Ocp_Messaging_V1_SendMessageRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.sendMessage( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/messaging_v1_ocp_messaging_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/messaging_v1_ocp_messaging_service.pb.swift deleted file mode 100644 index bb24cb524..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/messaging_v1_ocp_messaging_service.pb.swift +++ /dev/null @@ -1,1336 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: messaging/v1/ocp_messaging_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public struct Ocp_Messaging_V1_OpenMessageStreamRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var rendezvousKey: Ocp_Messaging_V1_RendezvousKey { - get {return _rendezvousKey ?? Ocp_Messaging_V1_RendezvousKey()} - set {_rendezvousKey = newValue} - } - /// Returns true if `rendezvousKey` has been explicitly set. - public var hasRendezvousKey: Bool {return self._rendezvousKey != nil} - /// Clears the value of `rendezvousKey`. Subsequent reads from it will return its default value. - public mutating func clearRendezvousKey() {self._rendezvousKey = nil} - - /// The signature is of serialize(OpenMessageStreamRequest) using rendezvous_key. - /// - /// todo: Make required once clients migrate - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _rendezvousKey: Ocp_Messaging_V1_RendezvousKey? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Messaging_V1_OpenMessageStreamResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var messages: [Ocp_Messaging_V1_Message] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var requestOrPong: Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest.OneOf_RequestOrPong? = nil - - public var request: Ocp_Messaging_V1_OpenMessageStreamRequest { - get { - if case .request(let v)? = requestOrPong {return v} - return Ocp_Messaging_V1_OpenMessageStreamRequest() - } - set {requestOrPong = .request(newValue)} - } - - public var pong: Ocp_Common_V1_ClientPong { - get { - if case .pong(let v)? = requestOrPong {return v} - return Ocp_Common_V1_ClientPong() - } - set {requestOrPong = .pong(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_RequestOrPong: Equatable, Sendable { - case request(Ocp_Messaging_V1_OpenMessageStreamRequest) - case pong(Ocp_Common_V1_ClientPong) - - } - - public init() {} -} - -public struct Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var responseOrPing: Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveResponse.OneOf_ResponseOrPing? = nil - - public var response: Ocp_Messaging_V1_OpenMessageStreamResponse { - get { - if case .response(let v)? = responseOrPing {return v} - return Ocp_Messaging_V1_OpenMessageStreamResponse() - } - set {responseOrPing = .response(newValue)} - } - - public var ping: Ocp_Common_V1_ServerPing { - get { - if case .ping(let v)? = responseOrPing {return v} - return Ocp_Common_V1_ServerPing() - } - set {responseOrPing = .ping(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_ResponseOrPing: Equatable, Sendable { - case response(Ocp_Messaging_V1_OpenMessageStreamResponse) - case ping(Ocp_Common_V1_ServerPing) - - } - - public init() {} -} - -public struct Ocp_Messaging_V1_PollMessagesRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var rendezvousKey: Ocp_Messaging_V1_RendezvousKey { - get {return _rendezvousKey ?? Ocp_Messaging_V1_RendezvousKey()} - set {_rendezvousKey = newValue} - } - /// Returns true if `rendezvousKey` has been explicitly set. - public var hasRendezvousKey: Bool {return self._rendezvousKey != nil} - /// Clears the value of `rendezvousKey`. Subsequent reads from it will return its default value. - public mutating func clearRendezvousKey() {self._rendezvousKey = nil} - - /// The signature is of serialize(PollMessagesRequest) using rendezvous_key. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _rendezvousKey: Ocp_Messaging_V1_RendezvousKey? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Messaging_V1_PollMessagesResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var messages: [Ocp_Messaging_V1_Message] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Messaging_V1_AckMessagesRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var rendezvousKey: Ocp_Messaging_V1_RendezvousKey { - get {return _rendezvousKey ?? Ocp_Messaging_V1_RendezvousKey()} - set {_rendezvousKey = newValue} - } - /// Returns true if `rendezvousKey` has been explicitly set. - public var hasRendezvousKey: Bool {return self._rendezvousKey != nil} - /// Clears the value of `rendezvousKey`. Subsequent reads from it will return its default value. - public mutating func clearRendezvousKey() {self._rendezvousKey = nil} - - public var messageIds: [Ocp_Messaging_V1_MessageId] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _rendezvousKey: Ocp_Messaging_V1_RendezvousKey? = nil -} - -public struct Ocp_Messaging_V1_AckMesssagesResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Messaging_V1_AckMesssagesResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Messaging_V1_AckMesssagesResponse.Result] = [ - .ok, - ] - - } - - public init() {} -} - -public struct Ocp_Messaging_V1_SendMessageRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The message to send. Types of messages clients can send are restricted. - public var message: Ocp_Messaging_V1_Message { - get {return _message ?? Ocp_Messaging_V1_Message()} - set {_message = newValue} - } - /// Returns true if `message` has been explicitly set. - public var hasMessage: Bool {return self._message != nil} - /// Clears the value of `message`. Subsequent reads from it will return its default value. - public mutating func clearMessage() {self._message = nil} - - /// The rendezvous key that the message should be routed to. - public var rendezvousKey: Ocp_Messaging_V1_RendezvousKey { - get {return _rendezvousKey ?? Ocp_Messaging_V1_RendezvousKey()} - set {_rendezvousKey = newValue} - } - /// Returns true if `rendezvousKey` has been explicitly set. - public var hasRendezvousKey: Bool {return self._rendezvousKey != nil} - /// Clears the value of `rendezvousKey`. Subsequent reads from it will return its default value. - public mutating func clearRendezvousKey() {self._rendezvousKey = nil} - - /// The signature is of serialize(Message) using the PrivateKey of the keypair. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _message: Ocp_Messaging_V1_Message? = nil - fileprivate var _rendezvousKey: Ocp_Messaging_V1_RendezvousKey? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Messaging_V1_SendMessageResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Messaging_V1_SendMessageResponse.Result = .ok - - /// Set if result == OK. - public var messageID: Ocp_Messaging_V1_MessageId { - get {return _messageID ?? Ocp_Messaging_V1_MessageId()} - set {_messageID = newValue} - } - /// Returns true if `messageID` has been explicitly set. - public var hasMessageID: Bool {return self._messageID != nil} - /// Clears the value of `messageID`. Subsequent reads from it will return its default value. - public mutating func clearMessageID() {self._messageID = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case noActiveStream // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .noActiveStream - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .noActiveStream: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Messaging_V1_SendMessageResponse.Result] = [ - .ok, - .noActiveStream, - ] - - } - - public init() {} - - fileprivate var _messageID: Ocp_Messaging_V1_MessageId? = nil -} - -/// RendezvousKey is a unique key pair, typically derived from a scan code payload, -/// which is used to establish a secure communication channel anonymously to coordinate -/// a flow using messages. -public struct Ocp_Messaging_V1_RendezvousKey: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// MessageId identifies a message. It is only guaranteed to be unique when -/// paired with a destination (i.e. the rendezvous public key). -public struct Ocp_Messaging_V1_MessageId: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Request that a pulled out bill be sent to the requested address. -/// -/// This message type is only initiated by clients. -public struct Ocp_Messaging_V1_RequestToGrabBill: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Requestor is the virtual token account on the VM to which a payment - /// should be sent. - public var requestorAccount: Ocp_Common_V1_SolanaAccountId { - get {return _requestorAccount ?? Ocp_Common_V1_SolanaAccountId()} - set {_requestorAccount = newValue} - } - /// Returns true if `requestorAccount` has been explicitly set. - public var hasRequestorAccount: Bool {return self._requestorAccount != nil} - /// Clears the value of `requestorAccount`. Subsequent reads from it will return its default value. - public mutating func clearRequestorAccount() {self._requestorAccount = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _requestorAccount: Ocp_Common_V1_SolanaAccountId? = nil -} - -public struct Ocp_Messaging_V1_RequestToGiveBillServerContext: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Mint metadata for the bill's mint - public var mintMetadata: Ocp_Currency_V1_Mint { - get {return _mintMetadata ?? Ocp_Currency_V1_Mint()} - set {_mintMetadata = newValue} - } - /// Returns true if `mintMetadata` has been explicitly set. - public var hasMintMetadata: Bool {return self._mintMetadata != nil} - /// Clears the value of `mintMetadata`. Subsequent reads from it will return its default value. - public mutating func clearMintMetadata() {self._mintMetadata = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _mintMetadata: Ocp_Currency_V1_Mint? = nil -} - -/// Request that a bill be given in the desired mint -/// -/// This message type is only initiated by clients. -public struct Ocp_Messaging_V1_RequestToGiveBill: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The mint that the bill will be received in - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - /// The validated exchange data that was used to compute the fiat value of the give - /// to support subsequent gives. Clients should be aware of timeouts and dismiss a - /// bill if the threshold is met. - public var exchangeData: Ocp_Transaction_V1_VerifiedExchangeData { - get {return _exchangeData ?? Ocp_Transaction_V1_VerifiedExchangeData()} - set {_exchangeData = newValue} - } - /// Returns true if `exchangeData` has been explicitly set. - public var hasExchangeData: Bool {return self._exchangeData != nil} - /// Clears the value of `exchangeData`. Subsequent reads from it will return its default value. - public mutating func clearExchangeData() {self._exchangeData = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _exchangeData: Ocp_Transaction_V1_VerifiedExchangeData? = nil -} - -public struct Ocp_Messaging_V1_Message: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// MessageId is the Id of the message. This ID is generated by the - /// server, and will _always_ be set when receiving a message. - /// - /// Server generates the message to: - /// 1. Reserve the ability for any future ID changes - /// 2. Prevent clients attempting to collide message IDs. - public var id: Ocp_Messaging_V1_MessageId { - get {return _storage._id ?? Ocp_Messaging_V1_MessageId()} - set {_uniqueStorage()._id = newValue} - } - /// Returns true if `id` has been explicitly set. - public var hasID: Bool {return _storage._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - public mutating func clearID() {_uniqueStorage()._id = nil} - - /// The signature sent from SendMessageRequest, which will be injected by server. - /// This enables clients to ensure no MITM attacks were performed to hijack contents - /// of the typed message. This is only applicable for messages not generated by server. - public var sendMessageRequestSignature: Ocp_Common_V1_Signature { - get {return _storage._sendMessageRequestSignature ?? Ocp_Common_V1_Signature()} - set {_uniqueStorage()._sendMessageRequestSignature = newValue} - } - /// Returns true if `sendMessageRequestSignature` has been explicitly set. - public var hasSendMessageRequestSignature: Bool {return _storage._sendMessageRequestSignature != nil} - /// Clears the value of `sendMessageRequestSignature`. Subsequent reads from it will return its default value. - public mutating func clearSendMessageRequestSignature() {_uniqueStorage()._sendMessageRequestSignature = nil} - - public var kind: OneOf_Kind? { - get {return _storage._kind} - set {_uniqueStorage()._kind = newValue} - } - - public var requestToGrabBill: Ocp_Messaging_V1_RequestToGrabBill { - get { - if case .requestToGrabBill(let v)? = _storage._kind {return v} - return Ocp_Messaging_V1_RequestToGrabBill() - } - set {_uniqueStorage()._kind = .requestToGrabBill(newValue)} - } - - public var requestToGiveBill: Ocp_Messaging_V1_RequestToGiveBill { - get { - if case .requestToGiveBill(let v)? = _storage._kind {return v} - return Ocp_Messaging_V1_RequestToGiveBill() - } - set {_uniqueStorage()._kind = .requestToGiveBill(newValue)} - } - - /// Additional server-provided context for messages sent by client - public var additionalContext: Ocp_Messaging_V1_AdditionalServerContext { - get {return _storage._additionalContext ?? Ocp_Messaging_V1_AdditionalServerContext()} - set {_uniqueStorage()._additionalContext = newValue} - } - /// Returns true if `additionalContext` has been explicitly set. - public var hasAdditionalContext: Bool {return _storage._additionalContext != nil} - /// Clears the value of `additionalContext`. Subsequent reads from it will return its default value. - public mutating func clearAdditionalContext() {_uniqueStorage()._additionalContext = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case requestToGrabBill(Ocp_Messaging_V1_RequestToGrabBill) - case requestToGiveBill(Ocp_Messaging_V1_RequestToGiveBill) - - } - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -public struct Ocp_Messaging_V1_AdditionalServerContext: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Ocp_Messaging_V1_AdditionalServerContext.OneOf_Type? = nil - - public var requestToGiveBill: Ocp_Messaging_V1_RequestToGiveBillServerContext { - get { - if case .requestToGiveBill(let v)? = type {return v} - return Ocp_Messaging_V1_RequestToGiveBillServerContext() - } - set {type = .requestToGiveBill(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case requestToGiveBill(Ocp_Messaging_V1_RequestToGiveBillServerContext) - - } - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "ocp.messaging.v1" - -extension Ocp_Messaging_V1_OpenMessageStreamRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenMessageStreamRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}rendezvous_key\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._rendezvousKey) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._rendezvousKey { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_OpenMessageStreamRequest, rhs: Ocp_Messaging_V1_OpenMessageStreamRequest) -> Bool { - if lhs._rendezvousKey != rhs._rendezvousKey {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_OpenMessageStreamResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenMessageStreamResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}messages\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.messages) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.messages.isEmpty { - try visitor.visitRepeatedMessageField(value: self.messages, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_OpenMessageStreamResponse, rhs: Ocp_Messaging_V1_OpenMessageStreamResponse) -> Bool { - if lhs.messages != rhs.messages {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenMessageStreamWithKeepAliveRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}request\0\u{1}pong\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Messaging_V1_OpenMessageStreamRequest? - var hadOneofValue = false - if let current = self.requestOrPong { - hadOneofValue = true - if case .request(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.requestOrPong = .request(v) - } - }() - case 2: try { - var v: Ocp_Common_V1_ClientPong? - var hadOneofValue = false - if let current = self.requestOrPong { - hadOneofValue = true - if case .pong(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.requestOrPong = .pong(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.requestOrPong { - case .request?: try { - guard case .request(let v)? = self.requestOrPong else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .pong?: try { - guard case .pong(let v)? = self.requestOrPong else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest, rhs: Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveRequest) -> Bool { - if lhs.requestOrPong != rhs.requestOrPong {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenMessageStreamWithKeepAliveResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}response\0\u{1}ping\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Messaging_V1_OpenMessageStreamResponse? - var hadOneofValue = false - if let current = self.responseOrPing { - hadOneofValue = true - if case .response(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.responseOrPing = .response(v) - } - }() - case 2: try { - var v: Ocp_Common_V1_ServerPing? - var hadOneofValue = false - if let current = self.responseOrPing { - hadOneofValue = true - if case .ping(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.responseOrPing = .ping(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.responseOrPing { - case .response?: try { - guard case .response(let v)? = self.responseOrPing else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .ping?: try { - guard case .ping(let v)? = self.responseOrPing else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveResponse, rhs: Ocp_Messaging_V1_OpenMessageStreamWithKeepAliveResponse) -> Bool { - if lhs.responseOrPing != rhs.responseOrPing {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_PollMessagesRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PollMessagesRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}rendezvous_key\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._rendezvousKey) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._rendezvousKey { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_PollMessagesRequest, rhs: Ocp_Messaging_V1_PollMessagesRequest) -> Bool { - if lhs._rendezvousKey != rhs._rendezvousKey {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_PollMessagesResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PollMessagesResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}messages\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.messages) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.messages.isEmpty { - try visitor.visitRepeatedMessageField(value: self.messages, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_PollMessagesResponse, rhs: Ocp_Messaging_V1_PollMessagesResponse) -> Bool { - if lhs.messages != rhs.messages {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_AckMessagesRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AckMessagesRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}rendezvous_key\0\u{3}message_ids\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._rendezvousKey) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.messageIds) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._rendezvousKey { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.messageIds.isEmpty { - try visitor.visitRepeatedMessageField(value: self.messageIds, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_AckMessagesRequest, rhs: Ocp_Messaging_V1_AckMessagesRequest) -> Bool { - if lhs._rendezvousKey != rhs._rendezvousKey {return false} - if lhs.messageIds != rhs.messageIds {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_AckMesssagesResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AckMesssagesResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_AckMesssagesResponse, rhs: Ocp_Messaging_V1_AckMesssagesResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_AckMesssagesResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0") -} - -extension Ocp_Messaging_V1_SendMessageRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendMessageRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}message\0\u{3}rendezvous_key\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._message) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._rendezvousKey) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._message { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._rendezvousKey { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_SendMessageRequest, rhs: Ocp_Messaging_V1_SendMessageRequest) -> Bool { - if lhs._message != rhs._message {return false} - if lhs._rendezvousKey != rhs._rendezvousKey {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_SendMessageResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendMessageResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}message_id\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._messageID) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._messageID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_SendMessageResponse, rhs: Ocp_Messaging_V1_SendMessageResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._messageID != rhs._messageID {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_SendMessageResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NO_ACTIVE_STREAM\0") -} - -extension Ocp_Messaging_V1_RendezvousKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RendezvousKey" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_RendezvousKey, rhs: Ocp_Messaging_V1_RendezvousKey) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_MessageId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MessageId" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_MessageId, rhs: Ocp_Messaging_V1_MessageId) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_RequestToGrabBill: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RequestToGrabBill" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}requestor_account\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._requestorAccount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._requestorAccount { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_RequestToGrabBill, rhs: Ocp_Messaging_V1_RequestToGrabBill) -> Bool { - if lhs._requestorAccount != rhs._requestorAccount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_RequestToGiveBillServerContext: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RequestToGiveBillServerContext" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}mint_metadata\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._mintMetadata) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._mintMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_RequestToGiveBillServerContext, rhs: Ocp_Messaging_V1_RequestToGiveBillServerContext) -> Bool { - if lhs._mintMetadata != rhs._mintMetadata {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_RequestToGiveBill: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RequestToGiveBill" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}mint\0\u{3}exchange_data\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._exchangeData) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._exchangeData { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_RequestToGiveBill, rhs: Ocp_Messaging_V1_RequestToGiveBill) -> Bool { - if lhs._mint != rhs._mint {return false} - if lhs._exchangeData != rhs._exchangeData {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Message" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{3}send_message_request_signature\0\u{3}request_to_grab_bill\0\u{3}request_to_give_bill\0\u{3}additional_context\0") - - fileprivate class _StorageClass { - var _id: Ocp_Messaging_V1_MessageId? = nil - var _sendMessageRequestSignature: Ocp_Common_V1_Signature? = nil - var _kind: Ocp_Messaging_V1_Message.OneOf_Kind? - var _additionalContext: Ocp_Messaging_V1_AdditionalServerContext? = nil - - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _id = source._id - _sendMessageRequestSignature = source._sendMessageRequestSignature - _kind = source._kind - _additionalContext = source._additionalContext - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._id) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._sendMessageRequestSignature) }() - case 3: try { - var v: Ocp_Messaging_V1_RequestToGrabBill? - var hadOneofValue = false - if let current = _storage._kind { - hadOneofValue = true - if case .requestToGrabBill(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._kind = .requestToGrabBill(v) - } - }() - case 4: try { - var v: Ocp_Messaging_V1_RequestToGiveBill? - var hadOneofValue = false - if let current = _storage._kind { - hadOneofValue = true - if case .requestToGiveBill(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._kind = .requestToGiveBill(v) - } - }() - case 5: try { try decoder.decodeSingularMessageField(value: &_storage._additionalContext) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._id { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._sendMessageRequestSignature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - switch _storage._kind { - case .requestToGrabBill?: try { - guard case .requestToGrabBill(let v)? = _storage._kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .requestToGiveBill?: try { - guard case .requestToGiveBill(let v)? = _storage._kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break - } - try { if let v = _storage._additionalContext { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_Message, rhs: Ocp_Messaging_V1_Message) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._id != rhs_storage._id {return false} - if _storage._sendMessageRequestSignature != rhs_storage._sendMessageRequestSignature {return false} - if _storage._kind != rhs_storage._kind {return false} - if _storage._additionalContext != rhs_storage._additionalContext {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Messaging_V1_AdditionalServerContext: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AdditionalServerContext" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}request_to_give_bill\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Messaging_V1_RequestToGiveBillServerContext? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .requestToGiveBill(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .requestToGiveBill(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .requestToGiveBill(let v)? = self.type { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Messaging_V1_AdditionalServerContext, rhs: Ocp_Messaging_V1_AdditionalServerContext) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/transaction_v1_ocp_transaction_service.grpc.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/transaction_v1_ocp_transaction_service.grpc.swift deleted file mode 100644 index bc41e87f4..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/transaction_v1_ocp_transaction_service.grpc.swift +++ /dev/null @@ -1,1454 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. -// Source: transaction/v1/ocp_transaction_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/grpc/grpc-swift - -import GRPCCore -import GRPCProtobuf - -// MARK: - ocp.transaction.v1.Transaction - -/// Namespace containing generated types for the "ocp.transaction.v1.Transaction" service. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -public enum Ocp_Transaction_V1_Transaction { - /// Service descriptor for the "ocp.transaction.v1.Transaction" service. - public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction") - /// Namespace for method metadata. - public enum Method { - /// Namespace for "SubmitIntent" metadata. - public enum SubmitIntent { - /// Request type for "SubmitIntent". - public typealias Input = Ocp_Transaction_V1_SubmitIntentRequest - /// Response type for "SubmitIntent". - public typealias Output = Ocp_Transaction_V1_SubmitIntentResponse - /// Descriptor for "SubmitIntent". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "SubmitIntent" - ) - } - /// Namespace for "GetIntentMetadata" metadata. - public enum GetIntentMetadata { - /// Request type for "GetIntentMetadata". - public typealias Input = Ocp_Transaction_V1_GetIntentMetadataRequest - /// Response type for "GetIntentMetadata". - public typealias Output = Ocp_Transaction_V1_GetIntentMetadataResponse - /// Descriptor for "GetIntentMetadata". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "GetIntentMetadata" - ) - } - /// Namespace for "GetLimits" metadata. - public enum GetLimits { - /// Request type for "GetLimits". - public typealias Input = Ocp_Transaction_V1_GetLimitsRequest - /// Response type for "GetLimits". - public typealias Output = Ocp_Transaction_V1_GetLimitsResponse - /// Descriptor for "GetLimits". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "GetLimits" - ) - } - /// Namespace for "CanWithdrawToAccount" metadata. - public enum CanWithdrawToAccount { - /// Request type for "CanWithdrawToAccount". - public typealias Input = Ocp_Transaction_V1_CanWithdrawToAccountRequest - /// Response type for "CanWithdrawToAccount". - public typealias Output = Ocp_Transaction_V1_CanWithdrawToAccountResponse - /// Descriptor for "CanWithdrawToAccount". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "CanWithdrawToAccount" - ) - } - /// Namespace for "VoidGiftCard" metadata. - public enum VoidGiftCard { - /// Request type for "VoidGiftCard". - public typealias Input = Ocp_Transaction_V1_VoidGiftCardRequest - /// Response type for "VoidGiftCard". - public typealias Output = Ocp_Transaction_V1_VoidGiftCardResponse - /// Descriptor for "VoidGiftCard". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "VoidGiftCard" - ) - } - /// Namespace for "StatefulSwap" metadata. - public enum StatefulSwap { - /// Request type for "StatefulSwap". - public typealias Input = Ocp_Transaction_V1_StatefulSwapRequest - /// Response type for "StatefulSwap". - public typealias Output = Ocp_Transaction_V1_StatefulSwapResponse - /// Descriptor for "StatefulSwap". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "StatefulSwap" - ) - } - /// Namespace for "StatelessSwap" metadata. - public enum StatelessSwap { - /// Request type for "StatelessSwap". - public typealias Input = Ocp_Transaction_V1_StatelessSwapRequest - /// Response type for "StatelessSwap". - public typealias Output = Ocp_Transaction_V1_StatelessSwapResponse - /// Descriptor for "StatelessSwap". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "StatelessSwap" - ) - } - /// Namespace for "GetSwap" metadata. - public enum GetSwap { - /// Request type for "GetSwap". - public typealias Input = Ocp_Transaction_V1_GetSwapRequest - /// Response type for "GetSwap". - public typealias Output = Ocp_Transaction_V1_GetSwapResponse - /// Descriptor for "GetSwap". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "GetSwap" - ) - } - /// Namespace for "GetPendingSwaps" metadata. - public enum GetPendingSwaps { - /// Request type for "GetPendingSwaps". - public typealias Input = Ocp_Transaction_V1_GetPendingSwapsRequest - /// Response type for "GetPendingSwaps". - public typealias Output = Ocp_Transaction_V1_GetPendingSwapsResponse - /// Descriptor for "GetPendingSwaps". - public static let descriptor = GRPCCore.MethodDescriptor( - service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction"), - method: "GetPendingSwaps" - ) - } - /// Descriptors for all methods in the "ocp.transaction.v1.Transaction" service. - public static let descriptors: [GRPCCore.MethodDescriptor] = [ - SubmitIntent.descriptor, - GetIntentMetadata.descriptor, - GetLimits.descriptor, - CanWithdrawToAccount.descriptor, - VoidGiftCard.descriptor, - StatefulSwap.descriptor, - StatelessSwap.descriptor, - GetSwap.descriptor, - GetPendingSwaps.descriptor - ] - } -} - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension GRPCCore.ServiceDescriptor { - /// Service descriptor for the "ocp.transaction.v1.Transaction" service. - public static let ocp_transaction_v1_Transaction = GRPCCore.ServiceDescriptor(fullyQualifiedService: "ocp.transaction.v1.Transaction") -} - -// MARK: ocp.transaction.v1.Transaction (client) - -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Transaction_V1_Transaction { - /// Generated client protocol for the "ocp.transaction.v1.Transaction" service. - /// - /// You don't need to implement this protocol directly, use the generated - /// implementation, ``Client``. - public protocol ClientProtocol: Sendable { - /// Call the "SubmitIntent" method. - /// - /// > Source IDL Documentation: - /// > - /// > SubmitIntent is the mechanism for client and server to agree upon a set of - /// > client actions to execute on the blockchain using the Code sequencer for - /// > fulfillment. - /// > - /// > Transactions and virtual instructions are never exchanged between client and server. - /// > Instead, the required accounts and arguments for instructions known to each actor are - /// > exchanged to allow independent and local construction. - /// > - /// > Client and server are expected to fully validate the intent. Proofs will - /// > be provided for any parameter requiring one. Signatures should only be - /// > generated after approval. - /// > - /// > This RPC is not a traditional streaming endpoint. It bundles two unary calls - /// > to enable DB-level transaction semantics. - /// > - /// > The high-level happy path flow for the RPC is as follows: - /// > 1. Client initiates a stream and sends SubmitIntentRequest.SubmitActions - /// > 2. Server validates the intent, its actions and metadata - /// > 3a. If there are transactions or virtual instructions requiring the user's signature, - /// > then server returns SubmitIntentResponse.ServerParameters - /// > 3b. Otherwise, server returns SubmitIntentResponse.Success and closes the - /// > stream - /// > 4. For each transaction or virtual instruction requiring the user's signature, the client - /// > locally constructs it, performs validation and collects the signature - /// > 5. Client sends SubmitIntentRequest.SubmitSignatures with the signature - /// > list generated from 4 - /// > 6. Server validates all signatures are submitted and are the expected values - /// > using locally constructed transactions or virtual instructions. - /// > 7. Server returns SubmitIntentResponse.Success and closes the stream - /// > In the error case: - /// > * Server will return SubmitIntentResponse.Error and close the stream - /// > * Client will close the stream - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_SubmitIntentRequest` messages. - /// - serializer: A serializer for `Ocp_Transaction_V1_SubmitIntentRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_SubmitIntentResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func submitIntent( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetIntentMetadata" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetIntentMetadata gets basic metadata on an intent. It can also be used - /// > to fetch the status of submitted intents. Metadata exists only for intents - /// > that have been successfully submitted. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetIntentMetadataRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_GetIntentMetadataRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_GetIntentMetadataResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getIntentMetadata( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetLimits" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetLimits gets limits for money moving intents for an owner account in an - /// > identity-aware manner - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetLimitsRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_GetLimitsRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_GetLimitsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getLimits( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "CanWithdrawToAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > CanWithdrawToAccount provides hints to clients for submitting withdraw intents. - /// > The RPC indicates if a withdrawal is possible, and how it should be performed. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_CanWithdrawToAccountRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_CanWithdrawToAccountRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_CanWithdrawToAccountResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func canWithdrawToAccount( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "VoidGiftCard" method. - /// - /// > Source IDL Documentation: - /// > - /// > VoidGiftCard voids a gift card account by returning the funds to the funds back - /// > to the issuer via the auto-return action if it hasn't been claimed or already - /// > returned. - /// > - /// > Note: The RPC is idempotent. If the user already claimed/voided the gift card, or - /// > it is close to or is auto-returned, then OK will be returned. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_VoidGiftCardRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_VoidGiftCardRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_VoidGiftCardResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func voidGiftCard( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "StatefulSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > StatefulSwap swaps tokens using a non-custodial state-management system. - /// > The high-level flow mirrors SubmitIntent closely. However, due to the - /// > unreliability of swaps, they do not fit within the broader intent system. - /// > This results in a few key differences: - /// > * Client is (potentially) involved in additional steps to complete the - /// > swap within the state machine - /// > * Transactions are submitted on a best-effort basis outside of the Code - /// > Sequencer - /// > * Balance changes are applied after the transaction has finalized - /// > - /// > Swap transaction signatures are collected up-front. They are executed once the - /// > swap is funded. - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_StatefulSwapRequest` messages. - /// - serializer: A serializer for `Ocp_Transaction_V1_StatefulSwapRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_StatefulSwapResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func statefulSwap( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "StatelessSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > StatelessSwap is like StatefulSwap, but without a state management system and a - /// > best-effort submission system. - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_StatelessSwapRequest` messages. - /// - serializer: A serializer for `Ocp_Transaction_V1_StatelessSwapRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_StatelessSwapResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func statelessSwap( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetSwap gets metadata for a swap - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetSwapRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_GetSwapRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_GetSwapResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getSwap( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - - /// Call the "GetPendingSwaps" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetPendingSwaps gets swaps that are pending client actions which include: - /// > * Swaps that need a call to SubmitIntent to fund the VM swap PDA - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetPendingSwapsRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_GetPendingSwapsRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_GetPendingSwapsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - func getPendingSwaps( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable - } - - /// Generated client for the "ocp.transaction.v1.Transaction" service. - /// - /// The ``Client`` provides an implementation of ``ClientProtocol`` which wraps - /// a `GRPCCore.GRPCCClient`. The underlying `GRPCClient` provides the long-lived - /// means of communication with the remote peer. - public struct Client: ClientProtocol where Transport: GRPCCore.ClientTransport { - private let client: GRPCCore.GRPCClient - - /// Creates a new client wrapping the provided `GRPCCore.GRPCClient`. - /// - /// - Parameters: - /// - client: A `GRPCCore.GRPCClient` providing a communication channel to the service. - public init(wrapping client: GRPCCore.GRPCClient) { - self.client = client - } - - /// Call the "SubmitIntent" method. - /// - /// > Source IDL Documentation: - /// > - /// > SubmitIntent is the mechanism for client and server to agree upon a set of - /// > client actions to execute on the blockchain using the Code sequencer for - /// > fulfillment. - /// > - /// > Transactions and virtual instructions are never exchanged between client and server. - /// > Instead, the required accounts and arguments for instructions known to each actor are - /// > exchanged to allow independent and local construction. - /// > - /// > Client and server are expected to fully validate the intent. Proofs will - /// > be provided for any parameter requiring one. Signatures should only be - /// > generated after approval. - /// > - /// > This RPC is not a traditional streaming endpoint. It bundles two unary calls - /// > to enable DB-level transaction semantics. - /// > - /// > The high-level happy path flow for the RPC is as follows: - /// > 1. Client initiates a stream and sends SubmitIntentRequest.SubmitActions - /// > 2. Server validates the intent, its actions and metadata - /// > 3a. If there are transactions or virtual instructions requiring the user's signature, - /// > then server returns SubmitIntentResponse.ServerParameters - /// > 3b. Otherwise, server returns SubmitIntentResponse.Success and closes the - /// > stream - /// > 4. For each transaction or virtual instruction requiring the user's signature, the client - /// > locally constructs it, performs validation and collects the signature - /// > 5. Client sends SubmitIntentRequest.SubmitSignatures with the signature - /// > list generated from 4 - /// > 6. Server validates all signatures are submitted and are the expected values - /// > using locally constructed transactions or virtual instructions. - /// > 7. Server returns SubmitIntentResponse.Success and closes the stream - /// > In the error case: - /// > * Server will return SubmitIntentResponse.Error and close the stream - /// > * Client will close the stream - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_SubmitIntentRequest` messages. - /// - serializer: A serializer for `Ocp_Transaction_V1_SubmitIntentRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_SubmitIntentResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func submitIntent( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.bidirectionalStreaming( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.SubmitIntent.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetIntentMetadata" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetIntentMetadata gets basic metadata on an intent. It can also be used - /// > to fetch the status of submitted intents. Metadata exists only for intents - /// > that have been successfully submitted. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetIntentMetadataRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_GetIntentMetadataRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_GetIntentMetadataResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getIntentMetadata( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.GetIntentMetadata.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetLimits" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetLimits gets limits for money moving intents for an owner account in an - /// > identity-aware manner - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetLimitsRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_GetLimitsRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_GetLimitsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getLimits( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.GetLimits.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CanWithdrawToAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > CanWithdrawToAccount provides hints to clients for submitting withdraw intents. - /// > The RPC indicates if a withdrawal is possible, and how it should be performed. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_CanWithdrawToAccountRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_CanWithdrawToAccountRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_CanWithdrawToAccountResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func canWithdrawToAccount( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.CanWithdrawToAccount.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "VoidGiftCard" method. - /// - /// > Source IDL Documentation: - /// > - /// > VoidGiftCard voids a gift card account by returning the funds to the funds back - /// > to the issuer via the auto-return action if it hasn't been claimed or already - /// > returned. - /// > - /// > Note: The RPC is idempotent. If the user already claimed/voided the gift card, or - /// > it is close to or is auto-returned, then OK will be returned. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_VoidGiftCardRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_VoidGiftCardRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_VoidGiftCardResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func voidGiftCard( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.VoidGiftCard.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StatefulSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > StatefulSwap swaps tokens using a non-custodial state-management system. - /// > The high-level flow mirrors SubmitIntent closely. However, due to the - /// > unreliability of swaps, they do not fit within the broader intent system. - /// > This results in a few key differences: - /// > * Client is (potentially) involved in additional steps to complete the - /// > swap within the state machine - /// > * Transactions are submitted on a best-effort basis outside of the Code - /// > Sequencer - /// > * Balance changes are applied after the transaction has finalized - /// > - /// > Swap transaction signatures are collected up-front. They are executed once the - /// > swap is funded. - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_StatefulSwapRequest` messages. - /// - serializer: A serializer for `Ocp_Transaction_V1_StatefulSwapRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_StatefulSwapResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func statefulSwap( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.bidirectionalStreaming( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.StatefulSwap.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StatelessSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > StatelessSwap is like StatefulSwap, but without a state management system and a - /// > best-effort submission system. - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_StatelessSwapRequest` messages. - /// - serializer: A serializer for `Ocp_Transaction_V1_StatelessSwapRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_StatelessSwapResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func statelessSwap( - request: GRPCCore.StreamingClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.client.bidirectionalStreaming( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.StatelessSwap.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetSwap gets metadata for a swap - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetSwapRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_GetSwapRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_GetSwapResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getSwap( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.GetSwap.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetPendingSwaps" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetPendingSwaps gets swaps that are pending client actions which include: - /// > * Swaps that need a call to SubmitIntent to fund the VM swap PDA - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetPendingSwapsRequest` message. - /// - serializer: A serializer for `Ocp_Transaction_V1_GetPendingSwapsRequest` messages. - /// - deserializer: A deserializer for `Ocp_Transaction_V1_GetPendingSwapsResponse` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getPendingSwaps( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.client.unary( - request: request, - descriptor: Ocp_Transaction_V1_Transaction.Method.GetPendingSwaps.descriptor, - serializer: serializer, - deserializer: deserializer, - options: options, - onResponse: handleResponse - ) - } - } -} - -// Helpers providing default arguments to 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Transaction_V1_Transaction.ClientProtocol { - /// Call the "SubmitIntent" method. - /// - /// > Source IDL Documentation: - /// > - /// > SubmitIntent is the mechanism for client and server to agree upon a set of - /// > client actions to execute on the blockchain using the Code sequencer for - /// > fulfillment. - /// > - /// > Transactions and virtual instructions are never exchanged between client and server. - /// > Instead, the required accounts and arguments for instructions known to each actor are - /// > exchanged to allow independent and local construction. - /// > - /// > Client and server are expected to fully validate the intent. Proofs will - /// > be provided for any parameter requiring one. Signatures should only be - /// > generated after approval. - /// > - /// > This RPC is not a traditional streaming endpoint. It bundles two unary calls - /// > to enable DB-level transaction semantics. - /// > - /// > The high-level happy path flow for the RPC is as follows: - /// > 1. Client initiates a stream and sends SubmitIntentRequest.SubmitActions - /// > 2. Server validates the intent, its actions and metadata - /// > 3a. If there are transactions or virtual instructions requiring the user's signature, - /// > then server returns SubmitIntentResponse.ServerParameters - /// > 3b. Otherwise, server returns SubmitIntentResponse.Success and closes the - /// > stream - /// > 4. For each transaction or virtual instruction requiring the user's signature, the client - /// > locally constructs it, performs validation and collects the signature - /// > 5. Client sends SubmitIntentRequest.SubmitSignatures with the signature - /// > list generated from 4 - /// > 6. Server validates all signatures are submitted and are the expected values - /// > using locally constructed transactions or virtual instructions. - /// > 7. Server returns SubmitIntentResponse.Success and closes the stream - /// > In the error case: - /// > * Server will return SubmitIntentResponse.Error and close the stream - /// > * Client will close the stream - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_SubmitIntentRequest` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func submitIntent( - request: GRPCCore.StreamingClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.submitIntent( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetIntentMetadata" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetIntentMetadata gets basic metadata on an intent. It can also be used - /// > to fetch the status of submitted intents. Metadata exists only for intents - /// > that have been successfully submitted. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetIntentMetadataRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getIntentMetadata( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getIntentMetadata( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetLimits" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetLimits gets limits for money moving intents for an owner account in an - /// > identity-aware manner - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetLimitsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getLimits( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getLimits( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CanWithdrawToAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > CanWithdrawToAccount provides hints to clients for submitting withdraw intents. - /// > The RPC indicates if a withdrawal is possible, and how it should be performed. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_CanWithdrawToAccountRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func canWithdrawToAccount( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.canWithdrawToAccount( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "VoidGiftCard" method. - /// - /// > Source IDL Documentation: - /// > - /// > VoidGiftCard voids a gift card account by returning the funds to the funds back - /// > to the issuer via the auto-return action if it hasn't been claimed or already - /// > returned. - /// > - /// > Note: The RPC is idempotent. If the user already claimed/voided the gift card, or - /// > it is close to or is auto-returned, then OK will be returned. - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_VoidGiftCardRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func voidGiftCard( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.voidGiftCard( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StatefulSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > StatefulSwap swaps tokens using a non-custodial state-management system. - /// > The high-level flow mirrors SubmitIntent closely. However, due to the - /// > unreliability of swaps, they do not fit within the broader intent system. - /// > This results in a few key differences: - /// > * Client is (potentially) involved in additional steps to complete the - /// > swap within the state machine - /// > * Transactions are submitted on a best-effort basis outside of the Code - /// > Sequencer - /// > * Balance changes are applied after the transaction has finalized - /// > - /// > Swap transaction signatures are collected up-front. They are executed once the - /// > swap is funded. - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_StatefulSwapRequest` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func statefulSwap( - request: GRPCCore.StreamingClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.statefulSwap( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StatelessSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > StatelessSwap is like StatefulSwap, but without a state management system and a - /// > best-effort submission system. - /// - /// - Parameters: - /// - request: A streaming request producing `Ocp_Transaction_V1_StatelessSwapRequest` messages. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func statelessSwap( - request: GRPCCore.StreamingClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - try await self.statelessSwap( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetSwap gets metadata for a swap - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetSwapRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getSwap( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getSwap( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetPendingSwaps" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetPendingSwaps gets swaps that are pending client actions which include: - /// > * Swaps that need a call to SubmitIntent to fund the VM swap PDA - /// - /// - Parameters: - /// - request: A request containing a single `Ocp_Transaction_V1_GetPendingSwapsRequest` message. - /// - options: Options to apply to this RPC. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getPendingSwaps( - request: GRPCCore.ClientRequest, - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - try await self.getPendingSwaps( - request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), - options: options, - onResponse: handleResponse - ) - } -} - -// Helpers providing sugared APIs for 'ClientProtocol' methods. -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) -extension Ocp_Transaction_V1_Transaction.ClientProtocol { - /// Call the "SubmitIntent" method. - /// - /// > Source IDL Documentation: - /// > - /// > SubmitIntent is the mechanism for client and server to agree upon a set of - /// > client actions to execute on the blockchain using the Code sequencer for - /// > fulfillment. - /// > - /// > Transactions and virtual instructions are never exchanged between client and server. - /// > Instead, the required accounts and arguments for instructions known to each actor are - /// > exchanged to allow independent and local construction. - /// > - /// > Client and server are expected to fully validate the intent. Proofs will - /// > be provided for any parameter requiring one. Signatures should only be - /// > generated after approval. - /// > - /// > This RPC is not a traditional streaming endpoint. It bundles two unary calls - /// > to enable DB-level transaction semantics. - /// > - /// > The high-level happy path flow for the RPC is as follows: - /// > 1. Client initiates a stream and sends SubmitIntentRequest.SubmitActions - /// > 2. Server validates the intent, its actions and metadata - /// > 3a. If there are transactions or virtual instructions requiring the user's signature, - /// > then server returns SubmitIntentResponse.ServerParameters - /// > 3b. Otherwise, server returns SubmitIntentResponse.Success and closes the - /// > stream - /// > 4. For each transaction or virtual instruction requiring the user's signature, the client - /// > locally constructs it, performs validation and collects the signature - /// > 5. Client sends SubmitIntentRequest.SubmitSignatures with the signature - /// > list generated from 4 - /// > 6. Server validates all signatures are submitted and are the expected values - /// > using locally constructed transactions or virtual instructions. - /// > 7. Server returns SubmitIntentResponse.Success and closes the stream - /// > In the error case: - /// > * Server will return SubmitIntentResponse.Error and close the stream - /// > * Client will close the stream - /// - /// - Parameters: - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - producer: A closure producing request messages to send to the server. The request - /// stream is closed when the closure returns. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func submitIntent( - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - requestProducer producer: @Sendable @escaping (GRPCCore.RPCWriter) async throws -> Void, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.StreamingClientRequest( - metadata: metadata, - producer: producer - ) - return try await self.submitIntent( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetIntentMetadata" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetIntentMetadata gets basic metadata on an intent. It can also be used - /// > to fetch the status of submitted intents. Metadata exists only for intents - /// > that have been successfully submitted. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getIntentMetadata( - _ message: Ocp_Transaction_V1_GetIntentMetadataRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getIntentMetadata( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetLimits" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetLimits gets limits for money moving intents for an owner account in an - /// > identity-aware manner - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getLimits( - _ message: Ocp_Transaction_V1_GetLimitsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getLimits( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "CanWithdrawToAccount" method. - /// - /// > Source IDL Documentation: - /// > - /// > CanWithdrawToAccount provides hints to clients for submitting withdraw intents. - /// > The RPC indicates if a withdrawal is possible, and how it should be performed. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func canWithdrawToAccount( - _ message: Ocp_Transaction_V1_CanWithdrawToAccountRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.canWithdrawToAccount( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "VoidGiftCard" method. - /// - /// > Source IDL Documentation: - /// > - /// > VoidGiftCard voids a gift card account by returning the funds to the funds back - /// > to the issuer via the auto-return action if it hasn't been claimed or already - /// > returned. - /// > - /// > Note: The RPC is idempotent. If the user already claimed/voided the gift card, or - /// > it is close to or is auto-returned, then OK will be returned. - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func voidGiftCard( - _ message: Ocp_Transaction_V1_VoidGiftCardRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.voidGiftCard( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StatefulSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > StatefulSwap swaps tokens using a non-custodial state-management system. - /// > The high-level flow mirrors SubmitIntent closely. However, due to the - /// > unreliability of swaps, they do not fit within the broader intent system. - /// > This results in a few key differences: - /// > * Client is (potentially) involved in additional steps to complete the - /// > swap within the state machine - /// > * Transactions are submitted on a best-effort basis outside of the Code - /// > Sequencer - /// > * Balance changes are applied after the transaction has finalized - /// > - /// > Swap transaction signatures are collected up-front. They are executed once the - /// > swap is funded. - /// - /// - Parameters: - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - producer: A closure producing request messages to send to the server. The request - /// stream is closed when the closure returns. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func statefulSwap( - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - requestProducer producer: @Sendable @escaping (GRPCCore.RPCWriter) async throws -> Void, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.StreamingClientRequest( - metadata: metadata, - producer: producer - ) - return try await self.statefulSwap( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "StatelessSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > StatelessSwap is like StatefulSwap, but without a state management system and a - /// > best-effort submission system. - /// - /// - Parameters: - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - producer: A closure producing request messages to send to the server. The request - /// stream is closed when the closure returns. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func statelessSwap( - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - requestProducer producer: @Sendable @escaping (GRPCCore.RPCWriter) async throws -> Void, - onResponse handleResponse: @Sendable @escaping (GRPCCore.StreamingClientResponse) async throws -> Result - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.StreamingClientRequest( - metadata: metadata, - producer: producer - ) - return try await self.statelessSwap( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetSwap" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetSwap gets metadata for a swap - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getSwap( - _ message: Ocp_Transaction_V1_GetSwapRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getSwap( - request: request, - options: options, - onResponse: handleResponse - ) - } - - /// Call the "GetPendingSwaps" method. - /// - /// > Source IDL Documentation: - /// > - /// > GetPendingSwaps gets swaps that are pending client actions which include: - /// > * Swaps that need a call to SubmitIntent to fund the VM swap PDA - /// - /// - Parameters: - /// - message: request message to send. - /// - metadata: Additional metadata to send, defaults to empty. - /// - options: Options to apply to this RPC, defaults to `.defaults`. - /// - handleResponse: A closure which handles the response, the result of which is - /// returned to the caller. Returning from the closure will cancel the RPC if it - /// hasn't already finished. - /// - Returns: The result of `handleResponse`. - public func getPendingSwaps( - _ message: Ocp_Transaction_V1_GetPendingSwapsRequest, - metadata: GRPCCore.Metadata = [:], - options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in - try response.message - } - ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( - message: message, - metadata: metadata - ) - return try await self.getPendingSwaps( - request: request, - options: options, - onResponse: handleResponse - ) - } -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/transaction_v1_ocp_transaction_service.pb.swift b/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/transaction_v1_ocp_transaction_service.pb.swift deleted file mode 100644 index 993823198..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/Generated/transaction_v1_ocp_transaction_service.pb.swift +++ /dev/null @@ -1,7500 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: transaction/v1/ocp_transaction_service.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -public enum Ocp_Transaction_V1_FundingSource: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case submitIntent // = 1 - case externalWallet // = 2 - case coinbaseOnramp // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .submitIntent - case 2: self = .externalWallet - case 3: self = .coinbaseOnramp - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .submitIntent: return 1 - case .externalWallet: return 2 - case .coinbaseOnramp: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_FundingSource] = [ - .unknown, - .submitIntent, - .externalWallet, - .coinbaseOnramp, - ] - -} - -public struct Ocp_Transaction_V1_SubmitIntentRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var request: Ocp_Transaction_V1_SubmitIntentRequest.OneOf_Request? = nil - - public var submitActions: Ocp_Transaction_V1_SubmitIntentRequest.SubmitActions { - get { - if case .submitActions(let v)? = request {return v} - return Ocp_Transaction_V1_SubmitIntentRequest.SubmitActions() - } - set {request = .submitActions(newValue)} - } - - public var submitSignatures: Ocp_Transaction_V1_SubmitIntentRequest.SubmitSignatures { - get { - if case .submitSignatures(let v)? = request {return v} - return Ocp_Transaction_V1_SubmitIntentRequest.SubmitSignatures() - } - set {request = .submitSignatures(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Request: Equatable, Sendable { - case submitActions(Ocp_Transaction_V1_SubmitIntentRequest.SubmitActions) - case submitSignatures(Ocp_Transaction_V1_SubmitIntentRequest.SubmitSignatures) - - } - - public struct SubmitActions: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The globally unique client generated intent ID. Use the original intent - /// ID when operating on actions that mutate the intent. - public var id: Ocp_Common_V1_IntentId { - get {return _id ?? Ocp_Common_V1_IntentId()} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - public var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - public mutating func clearID() {self._id = nil} - - /// The verified owner account public key - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// Additional metadata that describes the high-level intention - public var metadata: Ocp_Transaction_V1_Metadata { - get {return _metadata ?? Ocp_Transaction_V1_Metadata()} - set {_metadata = newValue} - } - /// Returns true if `metadata` has been explicitly set. - public var hasMetadata: Bool {return self._metadata != nil} - /// Clears the value of `metadata`. Subsequent reads from it will return its default value. - public mutating func clearMetadata() {self._metadata = nil} - - /// The set of all ordered actions required to fulfill the intent - public var actions: [Ocp_Transaction_V1_Action] = [] - - /// The signature is of serialize(SubmitActions) without this field set using the - /// private key of the owner account. This provides an authentication mechanism - /// to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _id: Ocp_Common_V1_IntentId? = nil - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _metadata: Ocp_Transaction_V1_Metadata? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil - } - - public struct SubmitSignatures: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The set of all signatures for each transaction or virtual instruction requiring - /// signature from the authority accounts. - /// - /// The signature for a transaction is for the marshalled transaction. - /// The signature for a virtual instruction is the hash of the marshalled instruction. - public var signatures: [Ocp_Common_V1_Signature] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -public struct Ocp_Transaction_V1_SubmitIntentResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var response: Ocp_Transaction_V1_SubmitIntentResponse.OneOf_Response? = nil - - public var serverParameters: Ocp_Transaction_V1_SubmitIntentResponse.ServerParameters { - get { - if case .serverParameters(let v)? = response {return v} - return Ocp_Transaction_V1_SubmitIntentResponse.ServerParameters() - } - set {response = .serverParameters(newValue)} - } - - public var success: Ocp_Transaction_V1_SubmitIntentResponse.Success { - get { - if case .success(let v)? = response {return v} - return Ocp_Transaction_V1_SubmitIntentResponse.Success() - } - set {response = .success(newValue)} - } - - public var error: Ocp_Transaction_V1_SubmitIntentResponse.Error { - get { - if case .error(let v)? = response {return v} - return Ocp_Transaction_V1_SubmitIntentResponse.Error() - } - set {response = .error(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Response: Equatable, Sendable { - case serverParameters(Ocp_Transaction_V1_SubmitIntentResponse.ServerParameters) - case success(Ocp_Transaction_V1_SubmitIntentResponse.Success) - case error(Ocp_Transaction_V1_SubmitIntentResponse.Error) - - } - - public struct ServerParameters: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The set of all server paremeters required to fill missing transaction - /// or virtual instruction details. Server guarantees to provide a message - /// for each client action in an order consistent with the received action - /// list. - public var serverParameters: [Ocp_Transaction_V1_ServerParameter] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public struct Success: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Ocp_Transaction_V1_SubmitIntentResponse.Success.Code = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// The intent was successfully created and is now scheduled. - case ok // = 0 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_SubmitIntentResponse.Success.Code] = [ - .ok, - ] - - } - - public init() {} - } - - public struct Error: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Ocp_Transaction_V1_SubmitIntentResponse.Error.Code = .denied - - public var errorDetails: [Ocp_Transaction_V1_ErrorDetails] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// Denied by a guard (spam, money laundering, etc) - case denied // = 0 - - /// The intent is invalid. - case invalidIntent // = 1 - - /// There is an issue with provided signatures. - case signatureError // = 2 - - /// Server detected client has stale state. - case staleState // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .denied - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .denied - case 1: self = .invalidIntent - case 2: self = .signatureError - case 3: self = .staleState - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .denied: return 0 - case .invalidIntent: return 1 - case .signatureError: return 2 - case .staleState: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_SubmitIntentResponse.Error.Code] = [ - .denied, - .invalidIntent, - .signatureError, - .staleState, - ] - - } - - public init() {} - } - - public init() {} -} - -public struct Ocp_Transaction_V1_GetIntentMetadataRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The intent ID to query - public var intentID: Ocp_Common_V1_IntentId { - get {return _intentID ?? Ocp_Common_V1_IntentId()} - set {_intentID = newValue} - } - /// Returns true if `intentID` has been explicitly set. - public var hasIntentID: Bool {return self._intentID != nil} - /// Clears the value of `intentID`. Subsequent reads from it will return its default value. - public mutating func clearIntentID() {self._intentID = nil} - - /// The verified owner account public key when not signing with the rendezvous - /// key. Only owner accounts involved in the intent can access the metadata. - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(GetIntentStatusRequest) without this field set - /// using the private key of the rendezvous or owner account. This provides an - /// authentication mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _intentID: Ocp_Common_V1_IntentId? = nil - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Transaction_V1_GetIntentMetadataResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Transaction_V1_GetIntentMetadataResponse.Result = .ok - - public var metadata: Ocp_Transaction_V1_Metadata { - get {return _metadata ?? Ocp_Transaction_V1_Metadata()} - set {_metadata = newValue} - } - /// Returns true if `metadata` has been explicitly set. - public var hasMetadata: Bool {return self._metadata != nil} - /// Clears the value of `metadata`. Subsequent reads from it will return its default value. - public mutating func clearMetadata() {self._metadata = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case denied // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - case 2: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .denied: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_GetIntentMetadataResponse.Result] = [ - .ok, - .notFound, - .denied, - ] - - } - - public init() {} - - fileprivate var _metadata: Ocp_Transaction_V1_Metadata? = nil -} - -public struct Ocp_Transaction_V1_GetLimitsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The owner account whose limits will be calculated. Any other owner accounts - /// linked with the same identity of the owner will also be applied. - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(GetLimitsRequest) without this field set - /// using the private key of the owner account. This provides an authentication - /// mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - /// All transactions starting at this time will be incorporated into the consumed - /// limit calculation. Clients should set this to the start of the current day in - /// the client's current time zone (because server has no knowledge of this atm). - public var consumedSince: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _consumedSince ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_consumedSince = newValue} - } - /// Returns true if `consumedSince` has been explicitly set. - public var hasConsumedSince: Bool {return self._consumedSince != nil} - /// Clears the value of `consumedSince`. Subsequent reads from it will return its default value. - public mutating func clearConsumedSince() {self._consumedSince = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil - fileprivate var _consumedSince: SwiftProtobuf.Google_Protobuf_Timestamp? = nil -} - -public struct Ocp_Transaction_V1_GetLimitsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Transaction_V1_GetLimitsResponse.Result = .ok - - /// Send limits keyed by currency - public var sendLimitsByCurrency: Dictionary = [:] - - /// The amount of USD transacted since the consumption timestamp - public var usdTransacted: Double = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_GetLimitsResponse.Result] = [ - .ok, - ] - - } - - public init() {} -} - -public struct Ocp_Transaction_V1_CanWithdrawToAccountRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The destination account attempted to be withdrawn to. Can be an owner or - /// token account. - public var account: Ocp_Common_V1_SolanaAccountId { - get {return _account ?? Ocp_Common_V1_SolanaAccountId()} - set {_account = newValue} - } - /// Returns true if `account` has been explicitly set. - public var hasAccount: Bool {return self._account != nil} - /// Clears the value of `account`. Subsequent reads from it will return its default value. - public mutating func clearAccount() {self._account = nil} - - /// The mint that the withdraw will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _account: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -public struct Ocp_Transaction_V1_CanWithdrawToAccountResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Server-controlled flag to indicate if the account can be withdrawn to. - /// There are several reasons server may deny it, including: - /// - Wrong type of Code account - /// - Unsupported external account type (eg. token account but of the wrong mint) - /// This is guaranteed to be false when account_type = Unknown. - public var isValidPaymentDestination: Bool = false - - /// Metadata so the client knows how to withdraw to the account. Server cannot - /// provide precalculated addresses in this response to maintain non-custodial - /// status. - public var accountType: Ocp_Transaction_V1_CanWithdrawToAccountResponse.AccountType = .unknown - - /// ATA requires initialization before the withdrawal can occur. Server may not - /// subsidize the account creation, so a fee may be required. - public var requiresInitialization: Bool = false - - /// The CREATE_ON_SEND_WITHDRAWAL fee, in USD, that must be paid in order to - /// submit a withdrawal to subsidize the creation of the account at time of - /// send. The user must explicitly agree to this fee amount before submitting - /// the intent. - /// - /// This can be set when requires_initialization = true if server decides to - /// not subsidize the token account creation. - /// - /// Note: The fee is always paid in the target mint. - public var feeAmount: Ocp_Transaction_V1_ExchangeDataWithoutRate { - get {return _feeAmount ?? Ocp_Transaction_V1_ExchangeDataWithoutRate()} - set {_feeAmount = newValue} - } - /// Returns true if `feeAmount` has been explicitly set. - public var hasFeeAmount: Bool {return self._feeAmount != nil} - /// Clears the value of `feeAmount`. Subsequent reads from it will return its default value. - public mutating func clearFeeAmount() {self._feeAmount = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum AccountType: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// Server cannot determine - case unknown // = 0 - - /// Client uses the address as is in SubmitIntent - case tokenAccount // = 1 - - /// Client locally derives the ATA to use in SubmitIntent - case ownerAccount // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .tokenAccount - case 2: self = .ownerAccount - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .tokenAccount: return 1 - case .ownerAccount: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_CanWithdrawToAccountResponse.AccountType] = [ - .unknown, - .tokenAccount, - .ownerAccount, - ] - - } - - public init() {} - - fileprivate var _feeAmount: Ocp_Transaction_V1_ExchangeDataWithoutRate? = nil -} - -public struct Ocp_Transaction_V1_VoidGiftCardRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The owner account that issued the gift card account - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The vault of the gift card account to void - public var giftCardVault: Ocp_Common_V1_SolanaAccountId { - get {return _giftCardVault ?? Ocp_Common_V1_SolanaAccountId()} - set {_giftCardVault = newValue} - } - /// Returns true if `giftCardVault` has been explicitly set. - public var hasGiftCardVault: Bool {return self._giftCardVault != nil} - /// Clears the value of `giftCardVault`. Subsequent reads from it will return its default value. - public mutating func clearGiftCardVault() {self._giftCardVault = nil} - - /// The signature is of serialize(VoidGiftCardRequest) without this field set using - /// the private key of the owner account. This provides an authentication mechanism - /// to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _giftCardVault: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Transaction_V1_VoidGiftCardResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Transaction_V1_VoidGiftCardResponse.Result = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - - /// The owner account didn't issue the gift card accoun - case denied // = 1 - - /// A different owner account than the issuer claimed the gift card - case claimedByOtherUser // = 2 - - /// The gift card doesn't exist - case notFound // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .denied - case 2: self = .claimedByOtherUser - case 3: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .denied: return 1 - case .claimedByOtherUser: return 2 - case .notFound: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_VoidGiftCardResponse.Result] = [ - .ok, - .denied, - .claimedByOtherUser, - .notFound, - ] - - } - - public init() {} -} - -public struct Ocp_Transaction_V1_StatefulSwapRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var request: Ocp_Transaction_V1_StatefulSwapRequest.OneOf_Request? = nil - - public var initiate: Ocp_Transaction_V1_StatefulSwapRequest.Initiate { - get { - if case .initiate(let v)? = request {return v} - return Ocp_Transaction_V1_StatefulSwapRequest.Initiate() - } - set {request = .initiate(newValue)} - } - - public var submitSignatures: Ocp_Transaction_V1_StatefulSwapRequest.SubmitSignatures { - get { - if case .submitSignatures(let v)? = request {return v} - return Ocp_Transaction_V1_StatefulSwapRequest.SubmitSignatures() - } - set {request = .submitSignatures(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Request: Equatable, Sendable { - case initiate(Ocp_Transaction_V1_StatefulSwapRequest.Initiate) - case submitSignatures(Ocp_Transaction_V1_StatefulSwapRequest.SubmitSignatures) - - } - - public struct Initiate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.OneOf_Kind? = nil - - public var reserve: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters { - get { - if case .reserve(let v)? = kind {return v} - return Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters() - } - set {kind = .reserve(newValue)} - } - - public var stablecoin: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters { - get { - if case .stablecoin(let v)? = kind {return v} - return Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters() - } - set {kind = .stablecoin(newValue)} - } - - /// The owner account starting the swap - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The user authority account that will sign to authorize the swap. - /// - /// For Reserve contract buy/sell flows against existing currencies, this must be a random one-time use account. - /// For Reserve contract buy flows against new currencies, this must be the owner account that is the currency creator. - /// For Coinbase Stable Swapper swap flows, this must be a random one-time use account. - public var swapAuthority: Ocp_Common_V1_SolanaAccountId { - get {return _swapAuthority ?? Ocp_Common_V1_SolanaAccountId()} - set {_swapAuthority = newValue} - } - /// Returns true if `swapAuthority` has been explicitly set. - public var hasSwapAuthority: Bool {return self._swapAuthority != nil} - /// Clears the value of `swapAuthority`. Subsequent reads from it will return its default value. - public mutating func clearSwapAuthority() {self._swapAuthority = nil} - - /// The signature of serialize(VerifiedSwapMetadata) for the swap being initiated. - public var proofSignature: Ocp_Common_V1_Signature { - get {return _proofSignature ?? Ocp_Common_V1_Signature()} - set {_proofSignature = newValue} - } - /// Returns true if `proofSignature` has been explicitly set. - public var hasProofSignature: Bool {return self._proofSignature != nil} - /// Clears the value of `proofSignature`. Subsequent reads from it will return its default value. - public mutating func clearProofSignature() {self._proofSignature = nil} - - /// The signature is of serialize(StatefulSwapRequest.Initiate) without this field - /// set using the private key of the owner account. This provides an authentication - /// mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case reserve(Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters) - case stablecoin(Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters) - - } - - /// Client parameters for starting swaps against the Reserve contract - public struct ReserveSwapClientParameters: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The unique ID for this swap randomly generated on client - public var id: Ocp_Common_V1_SwapId { - get {return _storage._id ?? Ocp_Common_V1_SwapId()} - set {_uniqueStorage()._id = newValue} - } - /// Returns true if `id` has been explicitly set. - public var hasID: Bool {return _storage._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - public mutating func clearID() {_uniqueStorage()._id = nil} - - /// The source mint that will be swapped from - public var fromMint: Ocp_Common_V1_SolanaAccountId { - get {return _storage._fromMint ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._fromMint = newValue} - } - /// Returns true if `fromMint` has been explicitly set. - public var hasFromMint: Bool {return _storage._fromMint != nil} - /// Clears the value of `fromMint`. Subsequent reads from it will return its default value. - public mutating func clearFromMint() {_uniqueStorage()._fromMint = nil} - - /// The destination mint that will be swapped to - public var toMint: Ocp_Common_V1_SolanaAccountId { - get {return _storage._toMint ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._toMint = newValue} - } - /// Returns true if `toMint` has been explicitly set. - public var hasToMint: Bool {return _storage._toMint != nil} - /// Clears the value of `toMint`. Subsequent reads from it will return its default value. - public mutating func clearToMint() {_uniqueStorage()._toMint = nil} - - /// The amount to swap from the source mint in quarks. - public var swapAmount: UInt64 { - get {return _storage._swapAmount} - set {_uniqueStorage()._swapAmount = newValue} - } - - /// Where "amount" of "from_mint" will be sent from to the VM swap PDA - public var fundingSource: Ocp_Transaction_V1_FundingSource { - get {return _storage._fundingSource} - set {_uniqueStorage()._fundingSource = newValue} - } - - /// The ID of the "transaction" to lookup funding state. - /// - /// For FUNDING_SOURCE_SUBMIT_INTENT, this value is the base58 encoded intent ID. - /// For FUNDING_SOURCE_EXTERNAL_WALLET, this value is the base58 encoded transaction signature. - /// For FUNDING_SOURCE_COINBASE_ONRAMP, this value is the order ID - public var fundingID: String { - get {return _storage._fundingID} - set {_uniqueStorage()._fundingID = newValue} - } - - /// The fee amount to pay for this swap - /// - /// Note: Amounts are coordinated outside this RPC for user verifications - /// and validated in this RPC. - public var feeAmount: UInt64 { - get {return _storage._feeAmount} - set {_uniqueStorage()._feeAmount = newValue} - } - - /// Verified exchange data for flows that require a specific fiat value - /// over the full amount (swap + fee). For intent fundings, it's expected - /// that this exchange data will be used. - /// - /// Required for the following flows: - /// - Initializing a new reserve currency outside of the core mint - public var fullAmountExchangeData: Ocp_Transaction_V1_VerifiedExchangeData { - get {return _storage._fullAmountExchangeData ?? Ocp_Transaction_V1_VerifiedExchangeData()} - set {_uniqueStorage()._fullAmountExchangeData = newValue} - } - /// Returns true if `fullAmountExchangeData` has been explicitly set. - public var hasFullAmountExchangeData: Bool {return _storage._fullAmountExchangeData != nil} - /// Clears the value of `fullAmountExchangeData`. Subsequent reads from it will return its default value. - public mutating func clearFullAmountExchangeData() {_uniqueStorage()._fullAmountExchangeData = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance - } - - /// Client parameters for starting swaps against the Coinbase Stable Swaper program - public struct CoinbaseStableSwapperClientParameters: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The unique ID for this swap randomly generated on client - public var id: Ocp_Common_V1_SwapId { - get {return _id ?? Ocp_Common_V1_SwapId()} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - public var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - public mutating func clearID() {self._id = nil} - - /// The source mint that will be swapped from - /// - /// Note: Currently always the core mint - public var fromMint: Ocp_Common_V1_SolanaAccountId { - get {return _fromMint ?? Ocp_Common_V1_SolanaAccountId()} - set {_fromMint = newValue} - } - /// Returns true if `fromMint` has been explicitly set. - public var hasFromMint: Bool {return self._fromMint != nil} - /// Clears the value of `fromMint`. Subsequent reads from it will return its default value. - public mutating func clearFromMint() {self._fromMint = nil} - - /// The destination mint that will be swapped to - public var toMint: Ocp_Common_V1_SolanaAccountId { - get {return _toMint ?? Ocp_Common_V1_SolanaAccountId()} - set {_toMint = newValue} - } - /// Returns true if `toMint` has been explicitly set. - public var hasToMint: Bool {return self._toMint != nil} - /// Clears the value of `toMint`. Subsequent reads from it will return its default value. - public mutating func clearToMint() {self._toMint = nil} - - /// The amount to swap from the source mint in quarks. - public var swapAmount: UInt64 = 0 - - /// Where "amount" of "from_mint" will be sent from to the VM swap PDA - public var fundingSource: Ocp_Transaction_V1_FundingSource = .unknown - - /// The ID of the "transaction" to lookup funding state. - /// - /// For FUNDING_SOURCE_SUBMIT_INTENT, this value is the base58 encoded intent ID. - public var fundingID: String = String() - - /// Destination owner account where from_mint tokens will land. Use - /// CanWithdrawToAccountResponse to determine if an account is an owner. - public var destinationOwner: Ocp_Common_V1_SolanaAccountId { - get {return _destinationOwner ?? Ocp_Common_V1_SolanaAccountId()} - set {_destinationOwner = newValue} - } - /// Returns true if `destinationOwner` has been explicitly set. - public var hasDestinationOwner: Bool {return self._destinationOwner != nil} - /// Clears the value of `destinationOwner`. Subsequent reads from it will return its default value. - public mutating func clearDestinationOwner() {self._destinationOwner = nil} - - /// The fee amount to pay for this swap, which should be exactly - /// CanWithdrawToAccountResponse.fee_amount - public var feeAmount: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _id: Ocp_Common_V1_SwapId? = nil - fileprivate var _fromMint: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _toMint: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _destinationOwner: Ocp_Common_V1_SolanaAccountId? = nil - } - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _swapAuthority: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _proofSignature: Ocp_Common_V1_Signature? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil - } - - public struct SubmitSignatures: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The signatures for the locally constructed swap transaction: - /// - owner is at index 0 - /// - swap_authority is at index 1 - public var transactionSignatures: [Ocp_Common_V1_Signature] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -public struct Ocp_Transaction_V1_StatefulSwapResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var response: Ocp_Transaction_V1_StatefulSwapResponse.OneOf_Response? = nil - - public var serverParameters: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters { - get { - if case .serverParameters(let v)? = response {return v} - return Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters() - } - set {response = .serverParameters(newValue)} - } - - public var success: Ocp_Transaction_V1_StatefulSwapResponse.Success { - get { - if case .success(let v)? = response {return v} - return Ocp_Transaction_V1_StatefulSwapResponse.Success() - } - set {response = .success(newValue)} - } - - public var error: Ocp_Transaction_V1_StatefulSwapResponse.Error { - get { - if case .error(let v)? = response {return v} - return Ocp_Transaction_V1_StatefulSwapResponse.Error() - } - set {response = .error(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Response: Equatable, Sendable { - case serverParameters(Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters) - case success(Ocp_Transaction_V1_StatefulSwapResponse.Success) - case error(Ocp_Transaction_V1_StatefulSwapResponse.Error) - - } - - public struct ServerParameters: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.OneOf_Kind? = nil - - public var reserveExistingCurrency: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveExistingCurrencyServerParameters { - get { - if case .reserveExistingCurrency(let v)? = kind {return v} - return Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveExistingCurrencyServerParameters() - } - set {kind = .reserveExistingCurrency(newValue)} - } - - public var reserveNewCurrency: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveNewCurrencyServerParameter { - get { - if case .reserveNewCurrency(let v)? = kind {return v} - return Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveNewCurrencyServerParameter() - } - set {kind = .reserveNewCurrency(newValue)} - } - - public var stablecoin: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter { - get { - if case .stablecoin(let v)? = kind {return v} - return Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter() - } - set {kind = .stablecoin(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case reserveExistingCurrency(Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveExistingCurrencyServerParameters) - case reserveNewCurrency(Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveNewCurrencyServerParameter) - case stablecoin(Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter) - - } - - /// Server parameters when executing stateful buy/sell flows against the - /// Reserve contract against an existing currency - /// - /// Supported Solana transaction version: v0 - /// - /// Instruction formats: - /// - /// Buy Tokens (Core Mint -> Launchpad Currency Mint) without a buy fee: - /// 1. System::AdvanceNonce - /// 2. [Optional] ComputeBudget::SetComputeUnitLimit - /// 3. [Optional] ComputeBudget::SetComputeUnitPrice - /// 4. [Optional] Memo::Memo - /// 5. AssociatedTokenAccount::CreateIdempotent (open Core Mint temporary account) - /// 6. VM::TransferForSwap (Core Mint VM swap ATA -> Core Mint temporary account) - /// 7. Reserve::BuyAndDepositIntoVm (bounded buy depositing to_mint tokens into the to_mint VM) - /// 8. Token::CloseAccount (closes Core Mint temporary account) - /// 9. VM::CloseSwapAccountIfEmpty (closes Core Mint VM swap ATA if empty) - /// - /// Buy Tokens (Core Mint -> Launchpad Currency Mint) with a buy fee, which - /// is used when fee_amount is non-zero: - /// 1. System::AdvanceNonce - /// 2. [Optional] ComputeBudget::SetComputeUnitLimit - /// 3. [Optional] ComputeBudget::SetComputeUnitPrice - /// 4. [Optional] Memo::Memo - /// 5. AssociatedTokenAccount::CreateIdempotent (open Core Mint temporary account) - /// 6. VM::TransferForSwapWithFee (Core Mint VM swap ATA -> Core Mint temporary account (swap amount) and fee destination (fee amount)) - /// 7. Reserve::BuyAndDepositIntoVm (bounded buy of the swap amount depositing to_mint tokens into the to_mint VM) - /// 8. Token::CloseAccount (closes Core Mint temporary account) - /// 9. VM::CloseSwapAccountIfEmpty (closes Core Mint VM swap ATA if empty) - /// - /// Sell Tokens (Launchpad Currency Mint -> Core Mint): - /// 1. System::AdvanceNonce - /// 2. [Optional] ComputeBudget::SetComputeUnitLimit - /// 3. [Optional] ComputeBudget::SetComputeUnitPrice - /// 4. [Optional] Memo::Memo - /// 5. AssociatedTokenAccount::CreateIdempotent (open from_mint temporary account) - /// 6. VM::TransferForSwap (from_mint VM swap ATA -> from_mint temporary account) - /// 7. Reserve::SellAndDepositIntoVm (bounded sell depositing Core Mint into the Core Mint VM) - /// 8. Token::CloseAccount (closes from_mint temporary account) - /// 9. VM::CloseSwapAccountIfEmpty (closes from_mint swap PDA/ATA if empty) - /// - /// Swap Tokens (Launchpad Currency Mint -> Launchpad Currency Mint): - /// 1. System::AdvanceNonce - /// 2. [Optional] ComputeBudget::SetComputeUnitLimit - /// 3. [Optional] ComputeBudget::SetComputeUnitPrice - /// 4. [Optional] Memo::Memo - /// 5. AssociatedTokenAccount::CreateIdempotent (open Core Mint temporary account) - /// 6. AssociatedTokenAccount::CreateIdempotent (open from_mint temporary account) - /// 7. VM::TransferForSwap (from_mint VM swap ATA -> from_mint temporary account) - /// 8. Reserve::SellTokens (bounded sell transferring Core Mint into temporary account) - /// 9. Reserve::BuyAndDepositIntoVm (unlimited buy depositing to_mint tokens into the to_mint VM) - /// 10. Token::CloseAccount (closes Core Mint temporary account) - /// 11. Token::CloseAccount (closes from_mint temporary account) - /// 12. VM::CloseSwapAccountIfEmpty (closes from_mint VM swap ATA if empty) - public struct ReserveExistingCurrencyServerParameters: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Subisdizer account that will be paying for the swap - public var payer: Ocp_Common_V1_SolanaAccountId { - get {return _payer ?? Ocp_Common_V1_SolanaAccountId()} - set {_payer = newValue} - } - /// Returns true if `payer` has been explicitly set. - public var hasPayer: Bool {return self._payer != nil} - /// Clears the value of `payer`. Subsequent reads from it will return its default value. - public mutating func clearPayer() {self._payer = nil} - - /// The nonce that is reserved for use in the swap transaction - public var nonce: Ocp_Common_V1_SolanaAccountId { - get {return _nonce ?? Ocp_Common_V1_SolanaAccountId()} - set {_nonce = newValue} - } - /// Returns true if `nonce` has been explicitly set. - public var hasNonce: Bool {return self._nonce != nil} - /// Clears the value of `nonce`. Subsequent reads from it will return its default value. - public mutating func clearNonce() {self._nonce = nil} - - /// The blockhash that is reserved for use in the swap transaction - public var blockhash: Ocp_Common_V1_Blockhash { - get {return _blockhash ?? Ocp_Common_V1_Blockhash()} - set {_blockhash = newValue} - } - /// Returns true if `blockhash` has been explicitly set. - public var hasBlockhash: Bool {return self._blockhash != nil} - /// Clears the value of `blockhash`. Subsequent reads from it will return its default value. - public mutating func clearBlockhash() {self._blockhash = nil} - - /// ALTs that should be used when constructing the versioned transaction - public var alts: [Ocp_Common_V1_SolanaAddressLookupTable] = [] - - /// Compute unit limit provided to the ComputeBudget::SetComputeUnitLimit - /// instruction. If the value is 0, then the instruction can be omitted. - public var computeUnitLimit: UInt32 = 0 - - /// Compute unit price provided in the ComputeBudget::SetComputeUnitPrice - /// instruction. If the value is 0, then the instruction can be omitted. - public var computeUnitPrice: UInt64 = 0 - - /// Value provided into the Memo::Memo instruction. If the value length is 0, - /// then the instruction can be omitted. - public var memoValue: String = String() - - /// The memory account where the destination virtual Timelock account lives - public var memoryAccount: Ocp_Common_V1_SolanaAccountId { - get {return _memoryAccount ?? Ocp_Common_V1_SolanaAccountId()} - set {_memoryAccount = newValue} - } - /// Returns true if `memoryAccount` has been explicitly set. - public var hasMemoryAccount: Bool {return self._memoryAccount != nil} - /// Clears the value of `memoryAccount`. Subsequent reads from it will return its default value. - public mutating func clearMemoryAccount() {self._memoryAccount = nil} - - /// The memory index where the destination virtual Timelock account lives - public var memoryIndex: UInt32 = 0 - - /// Destination account where the buy fee should be paid. Only set when - /// a non-zero fee_amount was provided in the client parameters. - public var feeDestination: Ocp_Common_V1_SolanaAccountId { - get {return _feeDestination ?? Ocp_Common_V1_SolanaAccountId()} - set {_feeDestination = newValue} - } - /// Returns true if `feeDestination` has been explicitly set. - public var hasFeeDestination: Bool {return self._feeDestination != nil} - /// Clears the value of `feeDestination`. Subsequent reads from it will return its default value. - public mutating func clearFeeDestination() {self._feeDestination = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _payer: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _nonce: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _blockhash: Ocp_Common_V1_Blockhash? = nil - fileprivate var _memoryAccount: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _feeDestination: Ocp_Common_V1_SolanaAccountId? = nil - } - - /// Server parameters when executing stateful buy flows against the - /// Reserve contract against a new currency. Only the creator of the - /// currency will be able to execute this flow. - /// - /// Supported Solana transaction version: v0 - /// - /// Instruction format (paying with Core Mint): - /// 1. System::AdvanceNonce - /// 2. [Optional] ComputeBudget::SetComputeUnitLimit - /// 3. [Optional] ComputeBudget::SetComputeUnitPrice - /// 4. [Optional] Memo::Memo - /// 5. Reserve::InitializeCurrency - /// 6. Reserve::InitializePool - /// 7. VM::InitializeVm - /// 8. AssociatedTokenAccount::CreateIdempotent (open owner's Core Mint ATA) - /// 9. AssociatedTokenAccount::CreateIdempotent (open owner's to_mint VM Deposit ATA) - /// 10. VM::TransferForSwapWithFee (Core Mint VM swap ATA -> owner's Core Mint ATA (swap amount) and fee destination (fee amount)) - /// 11. Reserve::BuyTokens (limited buy transferring to_mint tokens into the to_mint VM Deposit ATA) - /// 12. Token::CloseAccount (closes owner's Core Mint ATA) - /// - /// Instruction format (all other cases): - /// 1. System::AdvanceNonce - /// 2. [Optional] ComputeBudget::SetComputeUnitLimit - /// 3. [Optional] ComputeBudget::SetComputeUnitPrice - /// 4. [Optional] Memo::Memo - /// 5. AssociatedTokenAccount::CreateIdempotent (open treasury's from_mint ATA) - /// 6. VM::TransferForSwapWithFee (from_mint VM swap ATA -> treasury's from_mint ATA (swap + fee amount)) - /// 7. Reserve::SellTokens (limited sell of the full swap + fee amount, transferring the Core Mint value into the fee destination) - /// 8. Reserve::BuyTokens (limited buy funded by the treasury's Core Mint ATA, transferring to_mint tokens into the to_mint VM Deposit ATA) - /// - /// Note: The currency, VM and to_mint VM Deposit ATA will be initialized prior to - /// executing this transaction. Atomicity cannot be guaranteed due to transaction - /// size limits, which will be revisited when the v1 transaction format is released. - /// - /// Note: Client should verify that the new currency's mint address matches that derived - /// from using these server parameters. - public struct ReserveNewCurrencyServerParameter: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Subisdizer account that will be paying for the swap - public var payer: Ocp_Common_V1_SolanaAccountId { - get {return _payer ?? Ocp_Common_V1_SolanaAccountId()} - set {_payer = newValue} - } - /// Returns true if `payer` has been explicitly set. - public var hasPayer: Bool {return self._payer != nil} - /// Clears the value of `payer`. Subsequent reads from it will return its default value. - public mutating func clearPayer() {self._payer = nil} - - /// The nonce that is reserved for use in the swap transaction - public var nonce: Ocp_Common_V1_SolanaAccountId { - get {return _nonce ?? Ocp_Common_V1_SolanaAccountId()} - set {_nonce = newValue} - } - /// Returns true if `nonce` has been explicitly set. - public var hasNonce: Bool {return self._nonce != nil} - /// Clears the value of `nonce`. Subsequent reads from it will return its default value. - public mutating func clearNonce() {self._nonce = nil} - - /// The blockhash that is reserved for use in the swap transaction - public var blockhash: Ocp_Common_V1_Blockhash { - get {return _blockhash ?? Ocp_Common_V1_Blockhash()} - set {_blockhash = newValue} - } - /// Returns true if `blockhash` has been explicitly set. - public var hasBlockhash: Bool {return self._blockhash != nil} - /// Clears the value of `blockhash`. Subsequent reads from it will return its default value. - public mutating func clearBlockhash() {self._blockhash = nil} - - /// ALTs that should be used when constructing the versioned transaction - public var alts: [Ocp_Common_V1_SolanaAddressLookupTable] = [] - - /// Compute unit limit provided to the ComputeBudget::SetComputeUnitLimit - /// instruction. If the value is 0, then the instruction can be omitted. - public var computeUnitLimit: UInt32 = 0 - - /// Compute unit price provided in the ComputeBudget::SetComputeUnitPrice - /// instruction. If the value is 0, then the instruction can be omitted. - public var computeUnitPrice: UInt64 = 0 - - /// Value provided into the Memo::Memo instruction. If the value length is 0, - /// then the instruction can be omitted. - public var memoValue: String = String() - - /// The VM and currency authority - public var authority: Ocp_Common_V1_SolanaAccountId { - get {return _authority ?? Ocp_Common_V1_SolanaAccountId()} - set {_authority = newValue} - } - /// Returns true if `authority` has been explicitly set. - public var hasAuthority: Bool {return self._authority != nil} - /// Clears the value of `authority`. Subsequent reads from it will return its default value. - public mutating func clearAuthority() {self._authority = nil} - - /// The currency name - public var name: String = String() - - /// The currency symbol - public var symbol: String = String() - - /// The random seed value used to generate a unique currency of the given name - public var seed: Ocp_Common_V1_SolanaAccountId { - get {return _seed ?? Ocp_Common_V1_SolanaAccountId()} - set {_seed = newValue} - } - /// Returns true if `seed` has been explicitly set. - public var hasSeed: Bool {return self._seed != nil} - /// Clears the value of `seed`. Subsequent reads from it will return its default value. - public mutating func clearSeed() {self._seed = nil} - - /// Liquidity pool's percent sell fee in basis points - public var sellFeeBps: UInt32 = 0 - - /// The VM lock duration - public var vmLockDurationInDays: UInt32 = 0 - - /// Destination account where fee should be paid - public var feeDestination: Ocp_Common_V1_SolanaAccountId { - get {return _feeDestination ?? Ocp_Common_V1_SolanaAccountId()} - set {_feeDestination = newValue} - } - /// Returns true if `feeDestination` has been explicitly set. - public var hasFeeDestination: Bool {return self._feeDestination != nil} - /// Clears the value of `feeDestination`. Subsequent reads from it will return its default value. - public mutating func clearFeeDestination() {self._feeDestination = nil} - - /// Server-controlled treasury for flows that require it - public var treasury: Ocp_Common_V1_SolanaAccountId { - get {return _treasury ?? Ocp_Common_V1_SolanaAccountId()} - set {_treasury = newValue} - } - /// Returns true if `treasury` has been explicitly set. - public var hasTreasury: Bool {return self._treasury != nil} - /// Clears the value of `treasury`. Subsequent reads from it will return its default value. - public mutating func clearTreasury() {self._treasury = nil} - - /// The amount of core mint tokens used for purchase. Client should - /// validate this is as expected based on a pre-coordinated amount - /// accepted by the user. - public var treasuryPurchaseAmount: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _payer: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _nonce: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _blockhash: Ocp_Common_V1_Blockhash? = nil - fileprivate var _authority: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _seed: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _feeDestination: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _treasury: Ocp_Common_V1_SolanaAccountId? = nil - } - - /// Server parameters when executing stateful swap flows against the - /// Coinbase Stable Swapper program. - /// - /// Supported Solana transaction version: v0 - /// - /// Instruction format: - /// 1. System::AdvanceNonce - /// 2. [Optional] ComputeBudget::SetComputeUnitLimit - /// 3. [Optional] ComputeBudget::SetComputeUnitPrice - /// 4. [Optional] Memo::Memo - /// 5. AssociatedTokenAccount::CreateIdempotent (open swap authority's from_mint ATA) - /// 6. AssociatedTokenAccount::CreateIdempotent (open destination owner's to_mint ATA) - /// 7. VM::TransferForSwapWithFee (from_mint VM swap ATA -> swap authority's from_mint ATA (swap amount) and fee destination (fee amount)) - /// 8. CoinbaseStableSwapper::Swap (from_mint swap authority ATA -> to_mint destination owner ATA) - /// 9. Token::CloseAccount (closes swap authority's from_mint ATA) - public struct CoinbaseStableSwapperServerParameter: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Subisdizer account that will be paying for the swap - public var payer: Ocp_Common_V1_SolanaAccountId { - get {return _payer ?? Ocp_Common_V1_SolanaAccountId()} - set {_payer = newValue} - } - /// Returns true if `payer` has been explicitly set. - public var hasPayer: Bool {return self._payer != nil} - /// Clears the value of `payer`. Subsequent reads from it will return its default value. - public mutating func clearPayer() {self._payer = nil} - - /// The nonce that is reserved for use in the swap transaction - public var nonce: Ocp_Common_V1_SolanaAccountId { - get {return _nonce ?? Ocp_Common_V1_SolanaAccountId()} - set {_nonce = newValue} - } - /// Returns true if `nonce` has been explicitly set. - public var hasNonce: Bool {return self._nonce != nil} - /// Clears the value of `nonce`. Subsequent reads from it will return its default value. - public mutating func clearNonce() {self._nonce = nil} - - /// The blockhash that is reserved for use in the swap transaction - public var blockhash: Ocp_Common_V1_Blockhash { - get {return _blockhash ?? Ocp_Common_V1_Blockhash()} - set {_blockhash = newValue} - } - /// Returns true if `blockhash` has been explicitly set. - public var hasBlockhash: Bool {return self._blockhash != nil} - /// Clears the value of `blockhash`. Subsequent reads from it will return its default value. - public mutating func clearBlockhash() {self._blockhash = nil} - - /// ALTs that should be used when constructing the versioned transaction - public var alts: [Ocp_Common_V1_SolanaAddressLookupTable] = [] - - /// Compute unit limit provided to the ComputeBudget::SetComputeUnitLimit - /// instruction. If the value is 0, then the instruction can be omitted. - public var computeUnitLimit: UInt32 = 0 - - /// Compute unit price provided in the ComputeBudget::SetComputeUnitPrice - /// instruction. If the value is 0, then the instruction can be omitted. - public var computeUnitPrice: UInt64 = 0 - - /// Value provided into the Memo::Memo instruction. If the value length is 0, - /// then the instruction can be omitted. - public var memoValue: String = String() - - /// Destination account where fee should be paid - public var feeDestination: Ocp_Common_V1_SolanaAccountId { - get {return _feeDestination ?? Ocp_Common_V1_SolanaAccountId()} - set {_feeDestination = newValue} - } - /// Returns true if `feeDestination` has been explicitly set. - public var hasFeeDestination: Bool {return self._feeDestination != nil} - /// Clears the value of `feeDestination`. Subsequent reads from it will return its default value. - public mutating func clearFeeDestination() {self._feeDestination = nil} - - /// The CoinbaseStableSwapper liquidity pool's configured fee recipient, - /// sourced from the on-chain LiquidityPool account. Required by the - /// CoinbaseStableSwapper::Swap instruction. - public var poolFeeRecipient: Ocp_Common_V1_SolanaAccountId { - get {return _poolFeeRecipient ?? Ocp_Common_V1_SolanaAccountId()} - set {_poolFeeRecipient = newValue} - } - /// Returns true if `poolFeeRecipient` has been explicitly set. - public var hasPoolFeeRecipient: Bool {return self._poolFeeRecipient != nil} - /// Clears the value of `poolFeeRecipient`. Subsequent reads from it will return its default value. - public mutating func clearPoolFeeRecipient() {self._poolFeeRecipient = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _payer: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _nonce: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _blockhash: Ocp_Common_V1_Blockhash? = nil - fileprivate var _feeDestination: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _poolFeeRecipient: Ocp_Common_V1_SolanaAccountId? = nil - } - - public init() {} - } - - public struct Success: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Ocp_Transaction_V1_StatefulSwapResponse.Success.Code = .ok - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_StatefulSwapResponse.Success.Code] = [ - .ok, - ] - - } - - public init() {} - } - - public struct Error: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Ocp_Transaction_V1_StatefulSwapResponse.Error.Code = .denied - - public var errorDetails: [Ocp_Transaction_V1_ErrorDetails] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// Denied by a guard (spam, money laundering, etc) - case denied // = 0 - - /// There is an issue with the provided proof or transaction signatures - case signatureError // = 1 - - /// The swap metadata failed server-side validation - case invalidSwap // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .denied - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .denied - case 1: self = .signatureError - case 2: self = .invalidSwap - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .denied: return 0 - case .signatureError: return 1 - case .invalidSwap: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_StatefulSwapResponse.Error.Code] = [ - .denied, - .signatureError, - .invalidSwap, - ] - - } - - public init() {} - } - - public init() {} -} - -public struct Ocp_Transaction_V1_StatelessSwapRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var request: Ocp_Transaction_V1_StatelessSwapRequest.OneOf_Request? = nil - - public var initiate: Ocp_Transaction_V1_StatelessSwapRequest.Initiate { - get { - if case .initiate(let v)? = request {return v} - return Ocp_Transaction_V1_StatelessSwapRequest.Initiate() - } - set {request = .initiate(newValue)} - } - - public var submitSignatures: Ocp_Transaction_V1_StatelessSwapRequest.SubmitSignatures { - get { - if case .submitSignatures(let v)? = request {return v} - return Ocp_Transaction_V1_StatelessSwapRequest.SubmitSignatures() - } - set {request = .submitSignatures(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Request: Equatable, Sendable { - case initiate(Ocp_Transaction_V1_StatelessSwapRequest.Initiate) - case submitSignatures(Ocp_Transaction_V1_StatelessSwapRequest.SubmitSignatures) - - } - - public struct Initiate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Ocp_Transaction_V1_StatelessSwapRequest.Initiate.OneOf_Kind? = nil - - public var stablecoin: Ocp_Transaction_V1_StatelessSwapRequest.Initiate.CoinbaseStableSwapperClientParameters { - get { - if case .stablecoin(let v)? = kind {return v} - return Ocp_Transaction_V1_StatelessSwapRequest.Initiate.CoinbaseStableSwapperClientParameters() - } - set {kind = .stablecoin(newValue)} - } - - /// The owner account that owns the source ATA and the destination VM - /// Deposit ATA. The owner is the sole client-side signer of the swap - /// transaction. - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// If true, server waits until the swap transaction is finalized before - /// returning Success. If false, server returns Success as soon as the - /// transaction is submitted to the cluster. - public var waitForFinalization: Bool = false - - /// The signature is of serialize(StatelessSwapRequest.Initiate) without - /// this field set using the private key of the owner account. This - /// provides an authentication mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case stablecoin(Ocp_Transaction_V1_StatelessSwapRequest.Initiate.CoinbaseStableSwapperClientParameters) - - } - - /// Client parameters for stateless swaps via the Coinbase Stable - /// Swapper program. Source funds are drawn from the owner's source-mint - /// ATA; destination is the owner's destination-mint VM Deposit ATA. - public struct CoinbaseStableSwapperClientParameters: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The source mint that will be swapped from. - public var fromMint: Ocp_Common_V1_SolanaAccountId { - get {return _fromMint ?? Ocp_Common_V1_SolanaAccountId()} - set {_fromMint = newValue} - } - /// Returns true if `fromMint` has been explicitly set. - public var hasFromMint: Bool {return self._fromMint != nil} - /// Clears the value of `fromMint`. Subsequent reads from it will return its default value. - public mutating func clearFromMint() {self._fromMint = nil} - - /// The destination mint that will be swapped to. - public var toMint: Ocp_Common_V1_SolanaAccountId { - get {return _toMint ?? Ocp_Common_V1_SolanaAccountId()} - set {_toMint = newValue} - } - /// Returns true if `toMint` has been explicitly set. - public var hasToMint: Bool {return self._toMint != nil} - /// Clears the value of `toMint`. Subsequent reads from it will return its default value. - public mutating func clearToMint() {self._toMint = nil} - - /// The amount to swap from the source mint in quarks. - public var swapAmount: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _fromMint: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _toMint: Ocp_Common_V1_SolanaAccountId? = nil - } - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil - } - - public struct SubmitSignatures: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The owner's signature over the locally constructed swap transaction. - public var transactionSignatures: [Ocp_Common_V1_Signature] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -public struct Ocp_Transaction_V1_StatelessSwapResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var response: Ocp_Transaction_V1_StatelessSwapResponse.OneOf_Response? = nil - - public var serverParameters: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters { - get { - if case .serverParameters(let v)? = response {return v} - return Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters() - } - set {response = .serverParameters(newValue)} - } - - public var success: Ocp_Transaction_V1_StatelessSwapResponse.Success { - get { - if case .success(let v)? = response {return v} - return Ocp_Transaction_V1_StatelessSwapResponse.Success() - } - set {response = .success(newValue)} - } - - public var error: Ocp_Transaction_V1_StatelessSwapResponse.Error { - get { - if case .error(let v)? = response {return v} - return Ocp_Transaction_V1_StatelessSwapResponse.Error() - } - set {response = .error(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Response: Equatable, Sendable { - case serverParameters(Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters) - case success(Ocp_Transaction_V1_StatelessSwapResponse.Success) - case error(Ocp_Transaction_V1_StatelessSwapResponse.Error) - - } - - public struct ServerParameters: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.OneOf_Kind? = nil - - public var stablecoin: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter { - get { - if case .stablecoin(let v)? = kind {return v} - return Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter() - } - set {kind = .stablecoin(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case stablecoin(Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter) - - } - - /// Server parameters for executing stateless swap flows against the - /// Coinbase Stable Swapper program. - /// - /// Supported Solana transaction version: v0 - /// - /// Instruction format: - /// 1. [Optional] ComputeBudget::SetComputeUnitLimit - /// 2. [Optional] ComputeBudget::SetComputeUnitPrice - /// 3. [Optional] Memo::Memo - /// 4. AssociatedTokenAccount::CreateIdempotent (open owner's to_mint VM Deposit ATA) - /// 5. CoinbaseStableSwapper::Swap (owner's from_mint ATA -> owner's to_mint VM Deposit ATA) - public struct CoinbaseStableSwapperServerParameter: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Subsidizer account that will pay the transaction fee. - public var payer: Ocp_Common_V1_SolanaAccountId { - get {return _payer ?? Ocp_Common_V1_SolanaAccountId()} - set {_payer = newValue} - } - /// Returns true if `payer` has been explicitly set. - public var hasPayer: Bool {return self._payer != nil} - /// Clears the value of `payer`. Subsequent reads from it will return its default value. - public mutating func clearPayer() {self._payer = nil} - - /// The Solana blockhash to set on the transaction. This is a - /// regular recent blockhash, not a durable nonce. - public var blockhash: Ocp_Common_V1_Blockhash { - get {return _blockhash ?? Ocp_Common_V1_Blockhash()} - set {_blockhash = newValue} - } - /// Returns true if `blockhash` has been explicitly set. - public var hasBlockhash: Bool {return self._blockhash != nil} - /// Clears the value of `blockhash`. Subsequent reads from it will return its default value. - public mutating func clearBlockhash() {self._blockhash = nil} - - /// ALTs that should be used when constructing the versioned transaction - public var alts: [Ocp_Common_V1_SolanaAddressLookupTable] = [] - - /// Compute unit limit provided to the ComputeBudget::SetComputeUnitLimit - /// instruction. If the value is 0, then the instruction can be omitted. - public var computeUnitLimit: UInt32 = 0 - - /// Compute unit price provided in the ComputeBudget::SetComputeUnitPrice - /// instruction. If the value is 0, then the instruction can be omitted. - public var computeUnitPrice: UInt64 = 0 - - /// Value provided into the Memo::Memo instruction. If the value length is 0, - /// then the instruction can be omitted. - public var memoValue: String = String() - - /// The CoinbaseStableSwapper liquidity pool's configured fee recipient, - /// sourced from the on-chain LiquidityPool account. Required by the - /// CoinbaseStableSwapper::Swap instruction. - public var poolFeeRecipient: Ocp_Common_V1_SolanaAccountId { - get {return _poolFeeRecipient ?? Ocp_Common_V1_SolanaAccountId()} - set {_poolFeeRecipient = newValue} - } - /// Returns true if `poolFeeRecipient` has been explicitly set. - public var hasPoolFeeRecipient: Bool {return self._poolFeeRecipient != nil} - /// Clears the value of `poolFeeRecipient`. Subsequent reads from it will return its default value. - public mutating func clearPoolFeeRecipient() {self._poolFeeRecipient = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _payer: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _blockhash: Ocp_Common_V1_Blockhash? = nil - fileprivate var _poolFeeRecipient: Ocp_Common_V1_SolanaAccountId? = nil - } - - public init() {} - } - - public struct Success: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Ocp_Transaction_V1_StatelessSwapResponse.Success.Code = .submitted - - /// The signature of the submitted swap transaction. Clients may use - /// this to look up the transaction on-chain. - public var transactionSignature: Ocp_Common_V1_Signature { - get {return _transactionSignature ?? Ocp_Common_V1_Signature()} - set {_transactionSignature = newValue} - } - /// Returns true if `transactionSignature` has been explicitly set. - public var hasTransactionSignature: Bool {return self._transactionSignature != nil} - /// Clears the value of `transactionSignature`. Subsequent reads from it will return its default value. - public mutating func clearTransactionSignature() {self._transactionSignature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// Transaction was forwarded to the cluster. Returned when - /// wait_for_finalization = false. - case submitted // = 0 - - /// Transaction was finalized on-chain. Returned when - /// wait_for_finalization = true. - case finalized // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .submitted - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .submitted - case 1: self = .finalized - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .submitted: return 0 - case .finalized: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_StatelessSwapResponse.Success.Code] = [ - .submitted, - .finalized, - ] - - } - - public init() {} - - fileprivate var _transactionSignature: Ocp_Common_V1_Signature? = nil - } - - public struct Error: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Ocp_Transaction_V1_StatelessSwapResponse.Error.Code = .denied - - public var errorDetails: [Ocp_Transaction_V1_ErrorDetails] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// Denied by a guard (spam, money laundering, etc) - case denied // = 0 - - /// There is an issue with the provided transaction signature - case signatureError // = 1 - - /// The swap parameters failed server-side validation (eg. - /// unsupported mint pair, insufficient source balance, swap amount - /// out of allowed range) - case invalidSwap // = 2 - - /// The transaction was submitted but reverted on-chain, or its - /// blockhash expired before confirmation. Only relevant when - /// wait_for_finalization = true. - case transactionFailed // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .denied - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .denied - case 1: self = .signatureError - case 2: self = .invalidSwap - case 3: self = .transactionFailed - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .denied: return 0 - case .signatureError: return 1 - case .invalidSwap: return 2 - case .transactionFailed: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_StatelessSwapResponse.Error.Code] = [ - .denied, - .signatureError, - .invalidSwap, - .transactionFailed, - ] - - } - - public init() {} - } - - public init() {} -} - -public struct Ocp_Transaction_V1_GetSwapRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var id: Ocp_Common_V1_SwapId { - get {return _id ?? Ocp_Common_V1_SwapId()} - set {_id = newValue} - } - /// Returns true if `id` has been explicitly set. - public var hasID: Bool {return self._id != nil} - /// Clears the value of `id`. Subsequent reads from it will return its default value. - public mutating func clearID() {self._id = nil} - - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(GetSwapRequest) without this field set using the - /// private key of the owner account. This provides an authentication mechanism - /// to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _id: Ocp_Common_V1_SwapId? = nil - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Transaction_V1_GetSwapResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Transaction_V1_GetSwapResponse.Result = .ok - - public var swap: Ocp_Transaction_V1_SwapMetadata { - get {return _swap ?? Ocp_Transaction_V1_SwapMetadata()} - set {_swap = newValue} - } - /// Returns true if `swap` has been explicitly set. - public var hasSwap: Bool {return self._swap != nil} - /// Clears the value of `swap`. Subsequent reads from it will return its default value. - public mutating func clearSwap() {self._swap = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case denied // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - case 2: self = .denied - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .denied: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_GetSwapResponse.Result] = [ - .ok, - .notFound, - .denied, - ] - - } - - public init() {} - - fileprivate var _swap: Ocp_Transaction_V1_SwapMetadata? = nil -} - -public struct Ocp_Transaction_V1_GetPendingSwapsRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The signature is of serialize(GetPendingSwapsRequest) without this field set - /// using the private key of the owner account. This provides an authentication - /// mechanism to the RPC. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Transaction_V1_GetPendingSwapsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var result: Ocp_Transaction_V1_GetPendingSwapsResponse.Result = .ok - - public var swaps: [Ocp_Transaction_V1_SwapMetadata] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case ok // = 0 - case notFound // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .ok - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .ok - case 1: self = .notFound - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .ok: return 0 - case .notFound: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_GetPendingSwapsResponse.Result] = [ - .ok, - .notFound, - ] - - } - - public init() {} -} - -/// Metadata describes the high-level details of an intent -public struct Ocp_Transaction_V1_Metadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Ocp_Transaction_V1_Metadata.OneOf_Type? = nil - - public var openAccounts: Ocp_Transaction_V1_OpenAccountsMetadata { - get { - if case .openAccounts(let v)? = type {return v} - return Ocp_Transaction_V1_OpenAccountsMetadata() - } - set {type = .openAccounts(newValue)} - } - - public var sendPublicPayment: Ocp_Transaction_V1_SendPublicPaymentMetadata { - get { - if case .sendPublicPayment(let v)? = type {return v} - return Ocp_Transaction_V1_SendPublicPaymentMetadata() - } - set {type = .sendPublicPayment(newValue)} - } - - public var receivePaymentsPublicly: Ocp_Transaction_V1_ReceivePaymentsPubliclyMetadata { - get { - if case .receivePaymentsPublicly(let v)? = type {return v} - return Ocp_Transaction_V1_ReceivePaymentsPubliclyMetadata() - } - set {type = .receivePaymentsPublicly(newValue)} - } - - public var publicDistribution: Ocp_Transaction_V1_PublicDistributionMetadata { - get { - if case .publicDistribution(let v)? = type {return v} - return Ocp_Transaction_V1_PublicDistributionMetadata() - } - set {type = .publicDistribution(newValue)} - } - - /// Optional app-level metadata - public var appMetadata: Ocp_Transaction_V1_AppMetadata { - get {return _appMetadata ?? Ocp_Transaction_V1_AppMetadata()} - set {_appMetadata = newValue} - } - /// Returns true if `appMetadata` has been explicitly set. - public var hasAppMetadata: Bool {return self._appMetadata != nil} - /// Clears the value of `appMetadata`. Subsequent reads from it will return its default value. - public mutating func clearAppMetadata() {self._appMetadata = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case openAccounts(Ocp_Transaction_V1_OpenAccountsMetadata) - case sendPublicPayment(Ocp_Transaction_V1_SendPublicPaymentMetadata) - case receivePaymentsPublicly(Ocp_Transaction_V1_ReceivePaymentsPubliclyMetadata) - case publicDistribution(Ocp_Transaction_V1_PublicDistributionMetadata) - - } - - public init() {} - - fileprivate var _appMetadata: Ocp_Transaction_V1_AppMetadata? = nil -} - -/// Open a set of accounts -/// -/// Action Spec (User): -/// -/// for account in [PRIMARY] -/// actions.push_back(OpenAccountAction(account)) -/// -/// Action Spec (Pool): -/// -/// for account in [POOL] -/// actions.push_back(OpenAccountAction(account)) -public struct Ocp_Transaction_V1_OpenAccountsMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var accountSet: Ocp_Transaction_V1_OpenAccountsMetadata.AccountSet = .user - - /// The mint that this action will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum AccountSet: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// Opens a set of user accounts - case user // = 0 - - /// Opens a pool account - case pool // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .user - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .user - case 1: self = .pool - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .user: return 0 - case .pool: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_OpenAccountsMetadata.AccountSet] = [ - .user, - .pool, - ] - - } - - public init() {} - - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -/// Send a payment to a destination account publicly. -/// -/// Action Spec (Payment): -/// -/// actions = [NoPrivacyTransferAction(PRIMARY, destination, ExchangeData.Quarks)] -/// -/// Action Spec (Withdrawal): -/// -/// actions = [NoPrivacyTransferAction(PRIMARY, destination, ExchangeData.Quarks)] -/// if destinationRequiresInitialization { -/// actions[0].NoPrivacyTransferAction.ExchangeData.Quarks -= feeAmount -/// actions.push_back(FeePaymentAction(PRIMARY, feeAccount, feeAmount)) -/// } -/// -/// Action Spec (Indirect Send): -/// -/// actions = [ -/// OpenAccountAction(REMOTE_SEND_GIFT_CARD), -/// NoPrivacyTransferAction(PRIMARY, REMOTE_SEND_GIFT_CARD, ExchangeData.Quarks), -/// NoPrivacyWithdrawAction(REMOTE_SEND_GIFT_CARD, PRIMARY, ExchangeData.Quarks, is_auto_return=true), -/// ] -public struct Ocp_Transaction_V1_SendPublicPaymentMetadata: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The source account where funds will be sent from. Currently, this is always - /// the user's primary account. - public var source: Ocp_Common_V1_SolanaAccountId { - get {return _storage._source ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._source = newValue} - } - /// Returns true if `source` has been explicitly set. - public var hasSource: Bool {return _storage._source != nil} - /// Clears the value of `source`. Subsequent reads from it will return its default value. - public mutating func clearSource() {_uniqueStorage()._source = nil} - - /// The destination token account to send funds to. - public var destination: Ocp_Common_V1_SolanaAccountId { - get {return _storage._destination ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - public var hasDestination: Bool {return _storage._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - public mutating func clearDestination() {_uniqueStorage()._destination = nil} - - /// Destination owner account, which is required for withdrawals that intend - /// to create an ATA. Every other variation of this intent can omit this field. - public var destinationOwner: Ocp_Common_V1_SolanaAccountId { - get {return _storage._destinationOwner ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._destinationOwner = newValue} - } - /// Returns true if `destinationOwner` has been explicitly set. - public var hasDestinationOwner: Bool {return _storage._destinationOwner != nil} - /// Clears the value of `destinationOwner`. Subsequent reads from it will return its default value. - public mutating func clearDestinationOwner() {_uniqueStorage()._destinationOwner = nil} - - /// The exchange data of total funds being sent to the destination - public var exchangeData: OneOf_ExchangeData? { - get {return _storage._exchangeData} - set {_uniqueStorage()._exchangeData = newValue} - } - - /// Provided by server for submitted intents - public var serverExchangeData: Ocp_Transaction_V1_ExchangeData { - get { - if case .serverExchangeData(let v)? = _storage._exchangeData {return v} - return Ocp_Transaction_V1_ExchangeData() - } - set {_uniqueStorage()._exchangeData = .serverExchangeData(newValue)} - } - - /// Provided by clients when submitting new intents - public var clientExchangeData: Ocp_Transaction_V1_VerifiedExchangeData { - get { - if case .clientExchangeData(let v)? = _storage._exchangeData {return v} - return Ocp_Transaction_V1_VerifiedExchangeData() - } - set {_uniqueStorage()._exchangeData = .clientExchangeData(newValue)} - } - - /// Is the payment a withdrawal? - public var isWithdrawal: Bool { - get {return _storage._isWithdrawal} - set {_uniqueStorage()._isWithdrawal = newValue} - } - - /// Is the payment going to a new gift card? Note is_withdrawal must be false. - public var isIndirectSend: Bool { - get {return _storage._isIndirectSend} - set {_uniqueStorage()._isIndirectSend = newValue} - } - - /// The mint that this intent will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _storage._mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_uniqueStorage()._mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return _storage._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {_uniqueStorage()._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// The exchange data of total funds being sent to the destination - public enum OneOf_ExchangeData: Equatable, Sendable { - /// Provided by server for submitted intents - case serverExchangeData(Ocp_Transaction_V1_ExchangeData) - /// Provided by clients when submitting new intents - case clientExchangeData(Ocp_Transaction_V1_VerifiedExchangeData) - - } - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -/// Receive funds into a user-owned account publicly. All use cases of this intent -/// close the account, so all funds must be moved. -/// -/// Action Spec (Indirect Send): -/// -/// actions = [NoPrivacyWithdrawAction(REMOTE_SEND_GIFT_CARD, PRIMARY, quarks)] -public struct Ocp_Transaction_V1_ReceivePaymentsPubliclyMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The remote send gift card to receive funds from - public var source: Ocp_Common_V1_SolanaAccountId { - get {return _source ?? Ocp_Common_V1_SolanaAccountId()} - set {_source = newValue} - } - /// Returns true if `source` has been explicitly set. - public var hasSource: Bool {return self._source != nil} - /// Clears the value of `source`. Subsequent reads from it will return its default value. - public mutating func clearSource() {self._source = nil} - - /// The exact amount of quarks being received - public var quarks: UInt64 = 0 - - /// Is the receipt of funds from a remote send gift card? Currently, this is - /// the only use case for this intent and validation enforces the flag to true. - public var isIndirectSend: Bool = false - - /// If is_indirect_send is true, the original exchange data that was provided as - /// part of creating the gift card account. This is purely a server-provided value. - /// SubmitIntent will disallow this being set. - public var exchangeData: Ocp_Transaction_V1_ExchangeData { - get {return _exchangeData ?? Ocp_Transaction_V1_ExchangeData()} - set {_exchangeData = newValue} - } - /// Returns true if `exchangeData` has been explicitly set. - public var hasExchangeData: Bool {return self._exchangeData != nil} - /// Clears the value of `exchangeData`. Subsequent reads from it will return its default value. - public mutating func clearExchangeData() {self._exchangeData = nil} - - /// The mint that this intent will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _source: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _exchangeData: Ocp_Transaction_V1_ExchangeData? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -/// Distribute funds from a pool account publicly to one or more user-owned accounts. -/// -/// Action Spec: -/// -/// for distribution in distributions[:len(distributions)-1] -/// actions.push_back(NoPrivacyTransferAction(POOL, distribution.destination, distributions.quarks)) -/// actions.push_back(NoPrivacyWithdrawAction(POOL, distributions[len(distributions)-1].destination, distributions[len(distributions)-1].quarks)) -/// -/// Notes: -/// - All funds must distributed. The balance of the pool must be zero at the end of the intent -/// - The pool is closed at the end of the intent via a NoPrivacyWithdrawAction -public struct Ocp_Transaction_V1_PublicDistributionMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The pool account to distribute from - public var source: Ocp_Common_V1_SolanaAccountId { - get {return _source ?? Ocp_Common_V1_SolanaAccountId()} - set {_source = newValue} - } - /// Returns true if `source` has been explicitly set. - public var hasSource: Bool {return self._source != nil} - /// Clears the value of `source`. Subsequent reads from it will return its default value. - public mutating func clearSource() {self._source = nil} - - /// The set of distributions - public var distributions: [Ocp_Transaction_V1_PublicDistributionMetadata.Distribution] = [] - - /// The mint that this intent will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public struct Distribution: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Destination where a portion of the pool's funds will be distributed. - /// This must always be a primary account. - public var destination: Ocp_Common_V1_SolanaAccountId { - get {return _destination ?? Ocp_Common_V1_SolanaAccountId()} - set {_destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - public var hasDestination: Bool {return self._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - public mutating func clearDestination() {self._destination = nil} - - /// The amount of funds to distribute to the destination - public var quarks: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _destination: Ocp_Common_V1_SolanaAccountId? = nil - } - - public init() {} - - fileprivate var _source: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -/// Action is a well-defined, ordered and small set of transactions or virtual instructions -/// for a unit of work that the client wants to perform on the blockchain. Clients provide -/// parameters known to them in the action. -public struct Ocp_Transaction_V1_Action: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The ID of this action, which is unique within an intent. It must match - /// the index of the action's location in the SubmitAction's actions field. - public var id: UInt32 = 0 - - /// The type of action to perform. - public var type: Ocp_Transaction_V1_Action.OneOf_Type? = nil - - public var openAccount: Ocp_Transaction_V1_OpenAccountAction { - get { - if case .openAccount(let v)? = type {return v} - return Ocp_Transaction_V1_OpenAccountAction() - } - set {type = .openAccount(newValue)} - } - - public var noPrivacyTransfer: Ocp_Transaction_V1_NoPrivacyTransferAction { - get { - if case .noPrivacyTransfer(let v)? = type {return v} - return Ocp_Transaction_V1_NoPrivacyTransferAction() - } - set {type = .noPrivacyTransfer(newValue)} - } - - public var noPrivacyWithdraw: Ocp_Transaction_V1_NoPrivacyWithdrawAction { - get { - if case .noPrivacyWithdraw(let v)? = type {return v} - return Ocp_Transaction_V1_NoPrivacyWithdrawAction() - } - set {type = .noPrivacyWithdraw(newValue)} - } - - public var feePayment: Ocp_Transaction_V1_FeePaymentAction { - get { - if case .feePayment(let v)? = type {return v} - return Ocp_Transaction_V1_FeePaymentAction() - } - set {type = .feePayment(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// The type of action to perform. - public enum OneOf_Type: Equatable, Sendable { - case openAccount(Ocp_Transaction_V1_OpenAccountAction) - case noPrivacyTransfer(Ocp_Transaction_V1_NoPrivacyTransferAction) - case noPrivacyWithdraw(Ocp_Transaction_V1_NoPrivacyWithdrawAction) - case feePayment(Ocp_Transaction_V1_FeePaymentAction) - - } - - public init() {} -} - -/// No client signature required -public struct Ocp_Transaction_V1_OpenAccountAction: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The type of account, which will dictate its intended use - public var accountType: Ocp_Common_V1_AccountType = .unknown - - /// The owner of the account. For accounts liked to a user's 12 words, this is - /// the verified parent owner account public key. All other account types should - /// set this to the authority value. - public var owner: Ocp_Common_V1_SolanaAccountId { - get {return _owner ?? Ocp_Common_V1_SolanaAccountId()} - set {_owner = newValue} - } - /// Returns true if `owner` has been explicitly set. - public var hasOwner: Bool {return self._owner != nil} - /// Clears the value of `owner`. Subsequent reads from it will return its default value. - public mutating func clearOwner() {self._owner = nil} - - /// The index used to for accounts that are derived from owner - public var index: UInt64 = 0 - - /// The public key of the private key that has authority over the opened token account - public var authority: Ocp_Common_V1_SolanaAccountId { - get {return _authority ?? Ocp_Common_V1_SolanaAccountId()} - set {_authority = newValue} - } - /// Returns true if `authority` has been explicitly set. - public var hasAuthority: Bool {return self._authority != nil} - /// Clears the value of `authority`. Subsequent reads from it will return its default value. - public mutating func clearAuthority() {self._authority = nil} - - /// The token account being opened - public var token: Ocp_Common_V1_SolanaAccountId { - get {return _token ?? Ocp_Common_V1_SolanaAccountId()} - set {_token = newValue} - } - /// Returns true if `token` has been explicitly set. - public var hasToken: Bool {return self._token != nil} - /// Clears the value of `token`. Subsequent reads from it will return its default value. - public mutating func clearToken() {self._token = nil} - - /// The signature is of serialize(OpenAccountAction) without this field set - /// using the private key of the authority account. This provides a proof - /// of authorization to link authority to owner. - public var authoritySignature: Ocp_Common_V1_Signature { - get {return _authoritySignature ?? Ocp_Common_V1_Signature()} - set {_authoritySignature = newValue} - } - /// Returns true if `authoritySignature` has been explicitly set. - public var hasAuthoritySignature: Bool {return self._authoritySignature != nil} - /// Clears the value of `authoritySignature`. Subsequent reads from it will return its default value. - public mutating func clearAuthoritySignature() {self._authoritySignature = nil} - - /// The mint that this action will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _owner: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _authority: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _token: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _authoritySignature: Ocp_Common_V1_Signature? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -/// Compact message signature required -public struct Ocp_Transaction_V1_NoPrivacyTransferAction: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The public key of the private key that has authority over source - public var authority: Ocp_Common_V1_SolanaAccountId { - get {return _authority ?? Ocp_Common_V1_SolanaAccountId()} - set {_authority = newValue} - } - /// Returns true if `authority` has been explicitly set. - public var hasAuthority: Bool {return self._authority != nil} - /// Clears the value of `authority`. Subsequent reads from it will return its default value. - public mutating func clearAuthority() {self._authority = nil} - - /// The source account where funds are transferred from - public var source: Ocp_Common_V1_SolanaAccountId { - get {return _source ?? Ocp_Common_V1_SolanaAccountId()} - set {_source = newValue} - } - /// Returns true if `source` has been explicitly set. - public var hasSource: Bool {return self._source != nil} - /// Clears the value of `source`. Subsequent reads from it will return its default value. - public mutating func clearSource() {self._source = nil} - - /// The destination account where funds are transferred to - public var destination: Ocp_Common_V1_SolanaAccountId { - get {return _destination ?? Ocp_Common_V1_SolanaAccountId()} - set {_destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - public var hasDestination: Bool {return self._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - public mutating func clearDestination() {self._destination = nil} - - /// The quark amount to transfer - public var amount: UInt64 = 0 - - /// The mint that this action will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _authority: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _source: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _destination: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -/// Compact message signature required -public struct Ocp_Transaction_V1_NoPrivacyWithdrawAction: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The public key of the private key that has authority over source - public var authority: Ocp_Common_V1_SolanaAccountId { - get {return _authority ?? Ocp_Common_V1_SolanaAccountId()} - set {_authority = newValue} - } - /// Returns true if `authority` has been explicitly set. - public var hasAuthority: Bool {return self._authority != nil} - /// Clears the value of `authority`. Subsequent reads from it will return its default value. - public mutating func clearAuthority() {self._authority = nil} - - /// The source account where funds are transferred from - public var source: Ocp_Common_V1_SolanaAccountId { - get {return _source ?? Ocp_Common_V1_SolanaAccountId()} - set {_source = newValue} - } - /// Returns true if `source` has been explicitly set. - public var hasSource: Bool {return self._source != nil} - /// Clears the value of `source`. Subsequent reads from it will return its default value. - public mutating func clearSource() {self._source = nil} - - /// The destination account where funds are transferred to - public var destination: Ocp_Common_V1_SolanaAccountId { - get {return _destination ?? Ocp_Common_V1_SolanaAccountId()} - set {_destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - public var hasDestination: Bool {return self._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - public mutating func clearDestination() {self._destination = nil} - - /// The quark amount to withdraw - public var amount: UInt64 = 0 - - /// Whether the account is closed afterwards. This is always true, since there - /// are no current se cases to leave it open. - public var shouldClose: Bool = false - - /// Whether this action is for an auto-return, which client allows server to defer - /// scheduling at its own discretion to return funds back to the owner (to their primary - /// account) that funded source. - public var isAutoReturn: Bool = false - - /// The mint that this action will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _authority: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _source: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _destination: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -/// Compact message signature required -public struct Ocp_Transaction_V1_FeePaymentAction: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The type of fee being operated on - public var type: Ocp_Transaction_V1_FeePaymentAction.FeeType = .unknown - - /// The public key of the private key that has authority over source - public var authority: Ocp_Common_V1_SolanaAccountId { - get {return _authority ?? Ocp_Common_V1_SolanaAccountId()} - set {_authority = newValue} - } - /// Returns true if `authority` has been explicitly set. - public var hasAuthority: Bool {return self._authority != nil} - /// Clears the value of `authority`. Subsequent reads from it will return its default value. - public mutating func clearAuthority() {self._authority = nil} - - /// The source account where funds are transferred from - public var source: Ocp_Common_V1_SolanaAccountId { - get {return _source ?? Ocp_Common_V1_SolanaAccountId()} - set {_source = newValue} - } - /// Returns true if `source` has been explicitly set. - public var hasSource: Bool {return self._source != nil} - /// Clears the value of `source`. Subsequent reads from it will return its default value. - public mutating func clearSource() {self._source = nil} - - /// The quark amount to transfer - public var amount: UInt64 = 0 - - /// The mint that this action will be operating against - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum FeeType: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// Server-defined fee for creating an external ATA on withdrawals on send - case createOnSendWithdrawal // = 1 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .createOnSendWithdrawal - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .createOnSendWithdrawal: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_FeePaymentAction.FeeType] = [ - .unknown, - .createOnSendWithdrawal, - ] - - } - - public init() {} - - fileprivate var _authority: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _source: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -/// ServerParameter are a set of parameters known and returned by server that -/// enables clients to complete transaction construction. Any necessary proofs, -/// which are required to be locally verifiable, are also provided to ensure -/// safe use in the event of a malicious server. -public struct Ocp_Transaction_V1_ServerParameter: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The action the server parameters belong to - public var actionID: UInt32 = 0 - - /// The set of nonces used for the action. Server will only provide values - /// for transactions requiring client signatures. - public var nonces: [Ocp_Transaction_V1_NoncedTransactionMetadata] = [] - - /// The type of server parameter which maps to the type of action requested - public var type: Ocp_Transaction_V1_ServerParameter.OneOf_Type? = nil - - public var openAccount: Ocp_Transaction_V1_OpenAccountServerParameter { - get { - if case .openAccount(let v)? = type {return v} - return Ocp_Transaction_V1_OpenAccountServerParameter() - } - set {type = .openAccount(newValue)} - } - - public var noPrivacyTransfer: Ocp_Transaction_V1_NoPrivacyTransferServerParameter { - get { - if case .noPrivacyTransfer(let v)? = type {return v} - return Ocp_Transaction_V1_NoPrivacyTransferServerParameter() - } - set {type = .noPrivacyTransfer(newValue)} - } - - public var noPrivacyWithdraw: Ocp_Transaction_V1_NoPrivacyWithdrawServerParameter { - get { - if case .noPrivacyWithdraw(let v)? = type {return v} - return Ocp_Transaction_V1_NoPrivacyWithdrawServerParameter() - } - set {type = .noPrivacyWithdraw(newValue)} - } - - public var feePayment: Ocp_Transaction_V1_FeePaymentServerParameter { - get { - if case .feePayment(let v)? = type {return v} - return Ocp_Transaction_V1_FeePaymentServerParameter() - } - set {type = .feePayment(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// The type of server parameter which maps to the type of action requested - public enum OneOf_Type: Equatable, Sendable { - case openAccount(Ocp_Transaction_V1_OpenAccountServerParameter) - case noPrivacyTransfer(Ocp_Transaction_V1_NoPrivacyTransferServerParameter) - case noPrivacyWithdraw(Ocp_Transaction_V1_NoPrivacyWithdrawServerParameter) - case feePayment(Ocp_Transaction_V1_FeePaymentServerParameter) - - } - - public init() {} -} - -/// For transactions, the nonce is a standard nonce on Solana -/// For virtual instructions, the nonce is a virtual nonce on the Code VM -public struct Ocp_Transaction_V1_NoncedTransactionMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The nonce account to use in the system::AdvanceNonce instruction - public var nonce: Ocp_Common_V1_SolanaAccountId { - get {return _nonce ?? Ocp_Common_V1_SolanaAccountId()} - set {_nonce = newValue} - } - /// Returns true if `nonce` has been explicitly set. - public var hasNonce: Bool {return self._nonce != nil} - /// Clears the value of `nonce`. Subsequent reads from it will return its default value. - public mutating func clearNonce() {self._nonce = nil} - - /// The blockhash to set in the transaction or virtual instruction - public var blockhash: Ocp_Common_V1_Blockhash { - get {return _blockhash ?? Ocp_Common_V1_Blockhash()} - set {_blockhash = newValue} - } - /// Returns true if `blockhash` has been explicitly set. - public var hasBlockhash: Bool {return self._blockhash != nil} - /// Clears the value of `blockhash`. Subsequent reads from it will return its default value. - public mutating func clearBlockhash() {self._blockhash = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _nonce: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _blockhash: Ocp_Common_V1_Blockhash? = nil -} - -/// There are no transactions requiring client signatures -public struct Ocp_Transaction_V1_OpenAccountServerParameter: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// There are no action-specific server parameters -public struct Ocp_Transaction_V1_NoPrivacyTransferServerParameter: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// There are no action-specific server parameters -public struct Ocp_Transaction_V1_NoPrivacyWithdrawServerParameter: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Transaction_V1_FeePaymentServerParameter: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The destination account where OCP fee payments should be sent. This will - /// only be set when the corresponding FeePaymentAction.Type: - /// - CREATE_ON_SEND_WITHDRAWAL - public var destination: Ocp_Common_V1_SolanaAccountId { - get {return _destination ?? Ocp_Common_V1_SolanaAccountId()} - set {_destination = newValue} - } - /// Returns true if `destination` has been explicitly set. - public var hasDestination: Bool {return self._destination != nil} - /// Clears the value of `destination`. Subsequent reads from it will return its default value. - public mutating func clearDestination() {self._destination = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _destination: Ocp_Common_V1_SolanaAccountId? = nil -} - -public struct Ocp_Transaction_V1_ErrorDetails: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var type: Ocp_Transaction_V1_ErrorDetails.OneOf_Type? = nil - - public var reasonString: Ocp_Transaction_V1_ReasonStringErrorDetails { - get { - if case .reasonString(let v)? = type {return v} - return Ocp_Transaction_V1_ReasonStringErrorDetails() - } - set {type = .reasonString(newValue)} - } - - public var invalidSignature: Ocp_Transaction_V1_InvalidSignatureErrorDetails { - get { - if case .invalidSignature(let v)? = type {return v} - return Ocp_Transaction_V1_InvalidSignatureErrorDetails() - } - set {type = .invalidSignature(newValue)} - } - - public var denied: Ocp_Transaction_V1_DeniedErrorDetails { - get { - if case .denied(let v)? = type {return v} - return Ocp_Transaction_V1_DeniedErrorDetails() - } - set {type = .denied(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Type: Equatable, Sendable { - case reasonString(Ocp_Transaction_V1_ReasonStringErrorDetails) - case invalidSignature(Ocp_Transaction_V1_InvalidSignatureErrorDetails) - case denied(Ocp_Transaction_V1_DeniedErrorDetails) - - } - - public init() {} -} - -public struct Ocp_Transaction_V1_ReasonStringErrorDetails: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Human readable string indicating the failure. - public var reason: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Transaction_V1_InvalidSignatureErrorDetails: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The action whose signature mismatched - public var actionID: UInt32 = 0 - - public var expectedBlob: Ocp_Transaction_V1_InvalidSignatureErrorDetails.OneOf_ExpectedBlob? = nil - - /// The transaction the server expected to have signed. - public var expectedTransaction: Ocp_Common_V1_Transaction { - get { - if case .expectedTransaction(let v)? = expectedBlob {return v} - return Ocp_Common_V1_Transaction() - } - set {expectedBlob = .expectedTransaction(newValue)} - } - - /// The virtual ixn hash the server expected to have signed. - public var expectedVixnHash: Ocp_Common_V1_Hash { - get { - if case .expectedVixnHash(let v)? = expectedBlob {return v} - return Ocp_Common_V1_Hash() - } - set {expectedBlob = .expectedVixnHash(newValue)} - } - - /// The signature that was provided by the client. - public var providedSignature: Ocp_Common_V1_Signature { - get {return _providedSignature ?? Ocp_Common_V1_Signature()} - set {_providedSignature = newValue} - } - /// Returns true if `providedSignature` has been explicitly set. - public var hasProvidedSignature: Bool {return self._providedSignature != nil} - /// Clears the value of `providedSignature`. Subsequent reads from it will return its default value. - public mutating func clearProvidedSignature() {self._providedSignature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_ExpectedBlob: Equatable, Sendable { - /// The transaction the server expected to have signed. - case expectedTransaction(Ocp_Common_V1_Transaction) - /// The virtual ixn hash the server expected to have signed. - case expectedVixnHash(Ocp_Common_V1_Hash) - - } - - public init() {} - - fileprivate var _providedSignature: Ocp_Common_V1_Signature? = nil -} - -public struct Ocp_Transaction_V1_DeniedErrorDetails: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var code: Ocp_Transaction_V1_DeniedErrorDetails.Code = .unspecified - - /// Human readable string indicating the failure. - public var reason: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Code: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// Reason code not yet defined - case unspecified // = 0 - case UNRECOGNIZED(Int) - - public init() { - self = .unspecified - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unspecified - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unspecified: return 0 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_DeniedErrorDetails.Code] = [ - .unspecified, - ] - - } - - public init() {} -} - -/// VerifiedExchangeData defines an amount of crypto to use in a payment flow -/// with verified server-state for provable fiat exchange data -public struct Ocp_Transaction_V1_VerifiedExchangeData: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// The crypto mint that is being operated against for the payment flow. - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - /// The exact amount of quarks being operated in a payment flow. - /// This will be used as the source of truth for validating transfer amounts. - public var quarks: UInt64 = 0 - - /// The agreed upon fiat amount in a payment flow. - public var nativeAmount: Double = 0 - - /// Verified core mint fiat exchange rate used to compute the exchange data - /// - /// Required when operating against: - /// - Core mint - /// - Launchpad currency - public var coreMintFiatExchangeRate: Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRate { - get {return _coreMintFiatExchangeRate ?? Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRate()} - set {_coreMintFiatExchangeRate = newValue} - } - /// Returns true if `coreMintFiatExchangeRate` has been explicitly set. - public var hasCoreMintFiatExchangeRate: Bool {return self._coreMintFiatExchangeRate != nil} - /// Clears the value of `coreMintFiatExchangeRate`. Subsequent reads from it will return its default value. - public mutating func clearCoreMintFiatExchangeRate() {self._coreMintFiatExchangeRate = nil} - - /// Verified launchpad currency reserve state used to compute the exchange data - /// - /// Required when operating against: - /// - Launchpad currency - public var launchpadCurrencyReserveState: Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState { - get {return _launchpadCurrencyReserveState ?? Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState()} - set {_launchpadCurrencyReserveState = newValue} - } - /// Returns true if `launchpadCurrencyReserveState` has been explicitly set. - public var hasLaunchpadCurrencyReserveState: Bool {return self._launchpadCurrencyReserveState != nil} - /// Clears the value of `launchpadCurrencyReserveState`. Subsequent reads from it will return its default value. - public mutating func clearLaunchpadCurrencyReserveState() {self._launchpadCurrencyReserveState = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil - fileprivate var _coreMintFiatExchangeRate: Ocp_Currency_V1_VerifiedCoreMintFiatExchangeRate? = nil - fileprivate var _launchpadCurrencyReserveState: Ocp_Currency_V1_VerifiedLaunchpadCurrencyReserveState? = nil -} - -/// ExchangeData defines an amount of crypto to use in a payment flow with -/// fiat exchange data -public struct Ocp_Transaction_V1_ExchangeData: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// ISO 4217 alpha-3 currency code. - public var currency: String = String() - - /// The agreed upon exchange rate. This might not be the same as the - /// actual exchange rate at the time of intent or fund transfer. - public var exchangeRate: Double = 0 - - /// The agreed upon fiat amount in a payment flow. - public var nativeAmount: Double = 0 - - /// The exact amount of quarks being operated in a payment flow. - /// This will be used as the source of truth for validating transfer amounts. - public var quarks: UInt64 = 0 - - /// The crypto mint that is being operated against for the payment flow. - public var mint: Ocp_Common_V1_SolanaAccountId { - get {return _mint ?? Ocp_Common_V1_SolanaAccountId()} - set {_mint = newValue} - } - /// Returns true if `mint` has been explicitly set. - public var hasMint: Bool {return self._mint != nil} - /// Clears the value of `mint`. Subsequent reads from it will return its default value. - public mutating func clearMint() {self._mint = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _mint: Ocp_Common_V1_SolanaAccountId? = nil -} - -public struct Ocp_Transaction_V1_ExchangeDataWithoutRate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// ISO 4217 alpha-3 currency code. - public var currency: String = String() - - /// The agreed upon fiat amount in a payment flow. - public var nativeAmount: Double = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Ocp_Transaction_V1_SendLimit: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Remaining limit to apply on the next transaction - public var nextTransaction: Float = 0 - - /// Maximum allowed on a per-transaction basis - public var maxPerTransaction: Float = 0 - - /// Maximum allowed on a per-day basis - public var maxPerDay: Float = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// VerifiedSwapMetadata defines verifiable swap metadata for non-custodial swap -/// state management using client signature verification. -public struct Ocp_Transaction_V1_VerifiedSwapMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var kind: Ocp_Transaction_V1_VerifiedSwapMetadata.OneOf_Kind? = nil - - public var reserve: Ocp_Transaction_V1_VerifiedReserveSwapMetadata { - get { - if case .reserve(let v)? = kind {return v} - return Ocp_Transaction_V1_VerifiedReserveSwapMetadata() - } - set {kind = .reserve(newValue)} - } - - public var stablecoin: Ocp_Transaction_V1_VerifiedCoinbaseStableSwapperSwapMetadata { - get { - if case .stablecoin(let v)? = kind {return v} - return Ocp_Transaction_V1_VerifiedCoinbaseStableSwapperSwapMetadata() - } - set {kind = .stablecoin(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Kind: Equatable, Sendable { - case reserve(Ocp_Transaction_V1_VerifiedReserveSwapMetadata) - case stablecoin(Ocp_Transaction_V1_VerifiedCoinbaseStableSwapperSwapMetadata) - - } - - public init() {} -} - -/// VerifiedReserveSwapMetadata is verified metadata for swaps against the -/// Currency Creator program -public struct Ocp_Transaction_V1_VerifiedReserveSwapMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Verifiable client-side parameters that were provided during the StatefulSwap RPC - public var clientParameters: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters { - get {return _clientParameters ?? Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters()} - set {_clientParameters = newValue} - } - /// Returns true if `clientParameters` has been explicitly set. - public var hasClientParameters: Bool {return self._clientParameters != nil} - /// Clears the value of `clientParameters`. Subsequent reads from it will return its default value. - public mutating func clearClientParameters() {self._clientParameters = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _clientParameters: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters? = nil -} - -/// VerifiedCoinbaseStableSwapperSwapMetadata is verified metadata for swaps against the -/// Coinbase Stable Swapper program -public struct Ocp_Transaction_V1_VerifiedCoinbaseStableSwapperSwapMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Verifiable client-side parameters that were provided during the StatefulSwap RPC - public var clientParameters: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters { - get {return _clientParameters ?? Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters()} - set {_clientParameters = newValue} - } - /// Returns true if `clientParameters` has been explicitly set. - public var hasClientParameters: Bool {return self._clientParameters != nil} - /// Clears the value of `clientParameters`. Subsequent reads from it will return its default value. - public mutating func clearClientParameters() {self._clientParameters = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _clientParameters: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters? = nil -} - -public struct Ocp_Transaction_V1_SwapMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var verifiedMetadata: Ocp_Transaction_V1_VerifiedSwapMetadata { - get {return _verifiedMetadata ?? Ocp_Transaction_V1_VerifiedSwapMetadata()} - set {_verifiedMetadata = newValue} - } - /// Returns true if `verifiedMetadata` has been explicitly set. - public var hasVerifiedMetadata: Bool {return self._verifiedMetadata != nil} - /// Clears the value of `verifiedMetadata`. Subsequent reads from it will return its default value. - public mutating func clearVerifiedMetadata() {self._verifiedMetadata = nil} - - public var state: Ocp_Transaction_V1_SwapMetadata.State = .unknown - - /// The signature is of serialize(VerifiedSwapMetadata) using the private - /// key of the owner account. Use this to guarantee that VerifiedSwapMetadata - /// has not been tampered with. - public var signature: Ocp_Common_V1_Signature { - get {return _signature ?? Ocp_Common_V1_Signature()} - set {_signature = newValue} - } - /// Returns true if `signature` has been explicitly set. - public var hasSignature: Bool {return self._signature != nil} - /// Clears the value of `signature`. Subsequent reads from it will return its default value. - public mutating func clearSignature() {self._signature = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum State: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - - /// Swap state has been created and is pending funding - case created // = 1 - - /// The VM swap PDA is in the process of being funded - case funding // = 2 - - /// The VM swap PDA has been funded - case funded // = 3 - - /// The swap transaction is being submitted to the blockchain - case submitting // = 4 - - /// The swap transaction has been finalized on the blockchain - case finalized // = 5 - - /// The swap transaction failed - case failed // = 6 - - /// The swap is in the process of being cancelled. - case cancelling // = 7 - - /// The swap transaction is cancelled. Funds have been deposited back into the VM - case cancelled // = 8 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .created - case 2: self = .funding - case 3: self = .funded - case 4: self = .submitting - case 5: self = .finalized - case 6: self = .failed - case 7: self = .cancelling - case 8: self = .cancelled - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .created: return 1 - case .funding: return 2 - case .funded: return 3 - case .submitting: return 4 - case .finalized: return 5 - case .failed: return 6 - case .cancelling: return 7 - case .cancelled: return 8 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Ocp_Transaction_V1_SwapMetadata.State] = [ - .unknown, - .created, - .funding, - .funded, - .submitting, - .finalized, - .failed, - .cancelling, - .cancelled, - ] - - } - - public init() {} - - fileprivate var _verifiedMetadata: Ocp_Transaction_V1_VerifiedSwapMetadata? = nil - fileprivate var _signature: Ocp_Common_V1_Signature? = nil -} - -/// AppMetadata is additional app-level metadata provided for an intent -public struct Ocp_Transaction_V1_AppMetadata: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var value: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "ocp.transaction.v1" - -extension Ocp_Transaction_V1_FundingSource: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0FUNDING_SOURCE_UNKNOWN\0\u{1}FUNDING_SOURCE_SUBMIT_INTENT\0\u{1}FUNDING_SOURCE_EXTERNAL_WALLET\0\u{1}FUNDING_SOURCE_COINBASE_ONRAMP\0") -} - -extension Ocp_Transaction_V1_SubmitIntentRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SubmitIntentRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}submit_actions\0\u{3}submit_signatures\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_SubmitIntentRequest.SubmitActions? - var hadOneofValue = false - if let current = self.request { - hadOneofValue = true - if case .submitActions(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.request = .submitActions(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_SubmitIntentRequest.SubmitSignatures? - var hadOneofValue = false - if let current = self.request { - hadOneofValue = true - if case .submitSignatures(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.request = .submitSignatures(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.request { - case .submitActions?: try { - guard case .submitActions(let v)? = self.request else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .submitSignatures?: try { - guard case .submitSignatures(let v)? = self.request else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SubmitIntentRequest, rhs: Ocp_Transaction_V1_SubmitIntentRequest) -> Bool { - if lhs.request != rhs.request {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SubmitIntentRequest.SubmitActions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_SubmitIntentRequest.protoMessageName + ".SubmitActions" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}owner\0\u{1}metadata\0\u{1}actions\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._id) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._metadata) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.actions) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._id { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._metadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !self.actions.isEmpty { - try visitor.visitRepeatedMessageField(value: self.actions, fieldNumber: 4) - } - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SubmitIntentRequest.SubmitActions, rhs: Ocp_Transaction_V1_SubmitIntentRequest.SubmitActions) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._owner != rhs._owner {return false} - if lhs._metadata != rhs._metadata {return false} - if lhs.actions != rhs.actions {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SubmitIntentRequest.SubmitSignatures: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_SubmitIntentRequest.protoMessageName + ".SubmitSignatures" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}signatures\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.signatures) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.signatures.isEmpty { - try visitor.visitRepeatedMessageField(value: self.signatures, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SubmitIntentRequest.SubmitSignatures, rhs: Ocp_Transaction_V1_SubmitIntentRequest.SubmitSignatures) -> Bool { - if lhs.signatures != rhs.signatures {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SubmitIntentResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SubmitIntentResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}server_parameters\0\u{1}success\0\u{1}error\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_SubmitIntentResponse.ServerParameters? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .serverParameters(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .serverParameters(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_SubmitIntentResponse.Success? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .success(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .success(v) - } - }() - case 3: try { - var v: Ocp_Transaction_V1_SubmitIntentResponse.Error? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .error(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .error(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.response { - case .serverParameters?: try { - guard case .serverParameters(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .success?: try { - guard case .success(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .error?: try { - guard case .error(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SubmitIntentResponse, rhs: Ocp_Transaction_V1_SubmitIntentResponse) -> Bool { - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SubmitIntentResponse.ServerParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_SubmitIntentResponse.protoMessageName + ".ServerParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}server_parameters\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.serverParameters) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.serverParameters.isEmpty { - try visitor.visitRepeatedMessageField(value: self.serverParameters, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SubmitIntentResponse.ServerParameters, rhs: Ocp_Transaction_V1_SubmitIntentResponse.ServerParameters) -> Bool { - if lhs.serverParameters != rhs.serverParameters {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SubmitIntentResponse.Success: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_SubmitIntentResponse.protoMessageName + ".Success" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .ok { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SubmitIntentResponse.Success, rhs: Ocp_Transaction_V1_SubmitIntentResponse.Success) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SubmitIntentResponse.Success.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0") -} - -extension Ocp_Transaction_V1_SubmitIntentResponse.Error: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_SubmitIntentResponse.protoMessageName + ".Error" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0\u{3}error_details\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.errorDetails) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .denied { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - if !self.errorDetails.isEmpty { - try visitor.visitRepeatedMessageField(value: self.errorDetails, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SubmitIntentResponse.Error, rhs: Ocp_Transaction_V1_SubmitIntentResponse.Error) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.errorDetails != rhs.errorDetails {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SubmitIntentResponse.Error.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DENIED\0\u{1}INVALID_INTENT\0\u{1}SIGNATURE_ERROR\0\u{1}STALE_STATE\0") -} - -extension Ocp_Transaction_V1_GetIntentMetadataRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetIntentMetadataRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}intent_id\0\u{1}owner\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._intentID) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._intentID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_GetIntentMetadataRequest, rhs: Ocp_Transaction_V1_GetIntentMetadataRequest) -> Bool { - if lhs._intentID != rhs._intentID {return false} - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_GetIntentMetadataResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetIntentMetadataResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}metadata\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._metadata) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._metadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_GetIntentMetadataResponse, rhs: Ocp_Transaction_V1_GetIntentMetadataResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._metadata != rhs._metadata {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_GetIntentMetadataResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0\u{1}DENIED\0") -} - -extension Ocp_Transaction_V1_GetLimitsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetLimitsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}owner\0\u{1}signature\0\u{3}consumed_since\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._consumedSince) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._consumedSince { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_GetLimitsRequest, rhs: Ocp_Transaction_V1_GetLimitsRequest) -> Bool { - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs._consumedSince != rhs._consumedSince {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_GetLimitsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetLimitsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}send_limits_by_currency\0\u{3}usd_transacted\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.sendLimitsByCurrency) }() - case 3: try { try decoder.decodeSingularDoubleField(value: &self.usdTransacted) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.sendLimitsByCurrency.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.sendLimitsByCurrency, fieldNumber: 2) - } - if self.usdTransacted.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.usdTransacted, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_GetLimitsResponse, rhs: Ocp_Transaction_V1_GetLimitsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.sendLimitsByCurrency != rhs.sendLimitsByCurrency {return false} - if lhs.usdTransacted != rhs.usdTransacted {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_GetLimitsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0") -} - -extension Ocp_Transaction_V1_CanWithdrawToAccountRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CanWithdrawToAccountRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}account\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._account) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._account { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_CanWithdrawToAccountRequest, rhs: Ocp_Transaction_V1_CanWithdrawToAccountRequest) -> Bool { - if lhs._account != rhs._account {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_CanWithdrawToAccountResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CanWithdrawToAccountResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}is_valid_payment_destination\0\u{3}account_type\0\u{3}requires_initialization\0\u{3}fee_amount\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.isValidPaymentDestination) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.accountType) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self.requiresInitialization) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._feeAmount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.isValidPaymentDestination != false { - try visitor.visitSingularBoolField(value: self.isValidPaymentDestination, fieldNumber: 1) - } - if self.accountType != .unknown { - try visitor.visitSingularEnumField(value: self.accountType, fieldNumber: 2) - } - if self.requiresInitialization != false { - try visitor.visitSingularBoolField(value: self.requiresInitialization, fieldNumber: 3) - } - try { if let v = self._feeAmount { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_CanWithdrawToAccountResponse, rhs: Ocp_Transaction_V1_CanWithdrawToAccountResponse) -> Bool { - if lhs.isValidPaymentDestination != rhs.isValidPaymentDestination {return false} - if lhs.accountType != rhs.accountType {return false} - if lhs.requiresInitialization != rhs.requiresInitialization {return false} - if lhs._feeAmount != rhs._feeAmount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_CanWithdrawToAccountResponse.AccountType: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0Unknown\0\u{1}TokenAccount\0\u{1}OwnerAccount\0") -} - -extension Ocp_Transaction_V1_VoidGiftCardRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VoidGiftCardRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}owner\0\u{3}gift_card_vault\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._giftCardVault) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._giftCardVault { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_VoidGiftCardRequest, rhs: Ocp_Transaction_V1_VoidGiftCardRequest) -> Bool { - if lhs._owner != rhs._owner {return false} - if lhs._giftCardVault != rhs._giftCardVault {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_VoidGiftCardResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VoidGiftCardResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_VoidGiftCardResponse, rhs: Ocp_Transaction_V1_VoidGiftCardResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_VoidGiftCardResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}CLAIMED_BY_OTHER_USER\0\u{1}NOT_FOUND\0") -} - -extension Ocp_Transaction_V1_StatefulSwapRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StatefulSwapRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}initiate\0\u{3}submit_signatures\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_StatefulSwapRequest.Initiate? - var hadOneofValue = false - if let current = self.request { - hadOneofValue = true - if case .initiate(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.request = .initiate(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_StatefulSwapRequest.SubmitSignatures? - var hadOneofValue = false - if let current = self.request { - hadOneofValue = true - if case .submitSignatures(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.request = .submitSignatures(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.request { - case .initiate?: try { - guard case .initiate(let v)? = self.request else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .submitSignatures?: try { - guard case .submitSignatures(let v)? = self.request else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapRequest, rhs: Ocp_Transaction_V1_StatefulSwapRequest) -> Bool { - if lhs.request != rhs.request {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapRequest.Initiate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapRequest.protoMessageName + ".Initiate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}reserve\0\u{1}stablecoin\0\u{2}\u{7}owner\0\u{3}swap_authority\0\u{3}proof_signature\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .reserve(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .reserve(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .stablecoin(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .stablecoin(v) - } - }() - case 9: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._swapAuthority) }() - case 11: try { try decoder.decodeSingularMessageField(value: &self._proofSignature) }() - case 12: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.kind { - case .reserve?: try { - guard case .reserve(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .stablecoin?: try { - guard case .stablecoin(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - try { if let v = self._swapAuthority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try { if let v = self._proofSignature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapRequest.Initiate, rhs: Ocp_Transaction_V1_StatefulSwapRequest.Initiate) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs._owner != rhs._owner {return false} - if lhs._swapAuthority != rhs._swapAuthority {return false} - if lhs._proofSignature != rhs._proofSignature {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapRequest.Initiate.protoMessageName + ".ReserveSwapClientParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{3}from_mint\0\u{3}to_mint\0\u{3}swap_amount\0\u{3}funding_source\0\u{3}funding_id\0\u{3}fee_amount\0\u{3}full_amount_exchange_data\0") - - fileprivate class _StorageClass { - var _id: Ocp_Common_V1_SwapId? = nil - var _fromMint: Ocp_Common_V1_SolanaAccountId? = nil - var _toMint: Ocp_Common_V1_SolanaAccountId? = nil - var _swapAmount: UInt64 = 0 - var _fundingSource: Ocp_Transaction_V1_FundingSource = .unknown - var _fundingID: String = String() - var _feeAmount: UInt64 = 0 - var _fullAmountExchangeData: Ocp_Transaction_V1_VerifiedExchangeData? = nil - - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _id = source._id - _fromMint = source._fromMint - _toMint = source._toMint - _swapAmount = source._swapAmount - _fundingSource = source._fundingSource - _fundingID = source._fundingID - _feeAmount = source._feeAmount - _fullAmountExchangeData = source._fullAmountExchangeData - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._id) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._fromMint) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._toMint) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._swapAmount) }() - case 5: try { try decoder.decodeSingularEnumField(value: &_storage._fundingSource) }() - case 6: try { try decoder.decodeSingularStringField(value: &_storage._fundingID) }() - case 7: try { try decoder.decodeSingularUInt64Field(value: &_storage._feeAmount) }() - case 8: try { try decoder.decodeSingularMessageField(value: &_storage._fullAmountExchangeData) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._id { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._fromMint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = _storage._toMint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if _storage._swapAmount != 0 { - try visitor.visitSingularUInt64Field(value: _storage._swapAmount, fieldNumber: 4) - } - if _storage._fundingSource != .unknown { - try visitor.visitSingularEnumField(value: _storage._fundingSource, fieldNumber: 5) - } - if !_storage._fundingID.isEmpty { - try visitor.visitSingularStringField(value: _storage._fundingID, fieldNumber: 6) - } - if _storage._feeAmount != 0 { - try visitor.visitSingularUInt64Field(value: _storage._feeAmount, fieldNumber: 7) - } - try { if let v = _storage._fullAmountExchangeData { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters, rhs: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.ReserveSwapClientParameters) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._id != rhs_storage._id {return false} - if _storage._fromMint != rhs_storage._fromMint {return false} - if _storage._toMint != rhs_storage._toMint {return false} - if _storage._swapAmount != rhs_storage._swapAmount {return false} - if _storage._fundingSource != rhs_storage._fundingSource {return false} - if _storage._fundingID != rhs_storage._fundingID {return false} - if _storage._feeAmount != rhs_storage._feeAmount {return false} - if _storage._fullAmountExchangeData != rhs_storage._fullAmountExchangeData {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapRequest.Initiate.protoMessageName + ".CoinbaseStableSwapperClientParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{3}from_mint\0\u{3}to_mint\0\u{3}swap_amount\0\u{3}funding_source\0\u{3}funding_id\0\u{3}destination_owner\0\u{3}fee_amount\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._id) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._fromMint) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._toMint) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.swapAmount) }() - case 5: try { try decoder.decodeSingularEnumField(value: &self.fundingSource) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.fundingID) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._destinationOwner) }() - case 8: try { try decoder.decodeSingularUInt64Field(value: &self.feeAmount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._id { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._fromMint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._toMint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.swapAmount != 0 { - try visitor.visitSingularUInt64Field(value: self.swapAmount, fieldNumber: 4) - } - if self.fundingSource != .unknown { - try visitor.visitSingularEnumField(value: self.fundingSource, fieldNumber: 5) - } - if !self.fundingID.isEmpty { - try visitor.visitSingularStringField(value: self.fundingID, fieldNumber: 6) - } - try { if let v = self._destinationOwner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - if self.feeAmount != 0 { - try visitor.visitSingularUInt64Field(value: self.feeAmount, fieldNumber: 8) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters, rhs: Ocp_Transaction_V1_StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._fromMint != rhs._fromMint {return false} - if lhs._toMint != rhs._toMint {return false} - if lhs.swapAmount != rhs.swapAmount {return false} - if lhs.fundingSource != rhs.fundingSource {return false} - if lhs.fundingID != rhs.fundingID {return false} - if lhs._destinationOwner != rhs._destinationOwner {return false} - if lhs.feeAmount != rhs.feeAmount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapRequest.SubmitSignatures: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapRequest.protoMessageName + ".SubmitSignatures" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}transaction_signatures\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.transactionSignatures) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.transactionSignatures.isEmpty { - try visitor.visitRepeatedMessageField(value: self.transactionSignatures, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapRequest.SubmitSignatures, rhs: Ocp_Transaction_V1_StatefulSwapRequest.SubmitSignatures) -> Bool { - if lhs.transactionSignatures != rhs.transactionSignatures {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StatefulSwapResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}server_parameters\0\u{1}success\0\u{1}error\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .serverParameters(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .serverParameters(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_StatefulSwapResponse.Success? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .success(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .success(v) - } - }() - case 3: try { - var v: Ocp_Transaction_V1_StatefulSwapResponse.Error? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .error(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .error(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.response { - case .serverParameters?: try { - guard case .serverParameters(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .success?: try { - guard case .success(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .error?: try { - guard case .error(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapResponse, rhs: Ocp_Transaction_V1_StatefulSwapResponse) -> Bool { - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapResponse.protoMessageName + ".ServerParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}reserve_existing_currency\0\u{3}reserve_new_currency\0\u{1}stablecoin\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveExistingCurrencyServerParameters? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .reserveExistingCurrency(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .reserveExistingCurrency(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveNewCurrencyServerParameter? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .reserveNewCurrency(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .reserveNewCurrency(v) - } - }() - case 3: try { - var v: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .stablecoin(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .stablecoin(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.kind { - case .reserveExistingCurrency?: try { - guard case .reserveExistingCurrency(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .reserveNewCurrency?: try { - guard case .reserveNewCurrency(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .stablecoin?: try { - guard case .stablecoin(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters, rhs: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveExistingCurrencyServerParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.protoMessageName + ".ReserveExistingCurrencyServerParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}payer\0\u{1}nonce\0\u{1}blockhash\0\u{1}alts\0\u{3}compute_unit_limit\0\u{3}compute_unit_price\0\u{3}memo_value\0\u{3}memory_account\0\u{3}memory_index\0\u{3}fee_destination\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._payer) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._nonce) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._blockhash) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.alts) }() - case 5: try { try decoder.decodeSingularUInt32Field(value: &self.computeUnitLimit) }() - case 6: try { try decoder.decodeSingularUInt64Field(value: &self.computeUnitPrice) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.memoValue) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._memoryAccount) }() - case 9: try { try decoder.decodeSingularUInt32Field(value: &self.memoryIndex) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._feeDestination) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._payer { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._nonce { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._blockhash { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !self.alts.isEmpty { - try visitor.visitRepeatedMessageField(value: self.alts, fieldNumber: 4) - } - if self.computeUnitLimit != 0 { - try visitor.visitSingularUInt32Field(value: self.computeUnitLimit, fieldNumber: 5) - } - if self.computeUnitPrice != 0 { - try visitor.visitSingularUInt64Field(value: self.computeUnitPrice, fieldNumber: 6) - } - if !self.memoValue.isEmpty { - try visitor.visitSingularStringField(value: self.memoValue, fieldNumber: 7) - } - try { if let v = self._memoryAccount { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - if self.memoryIndex != 0 { - try visitor.visitSingularUInt32Field(value: self.memoryIndex, fieldNumber: 9) - } - try { if let v = self._feeDestination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveExistingCurrencyServerParameters, rhs: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveExistingCurrencyServerParameters) -> Bool { - if lhs._payer != rhs._payer {return false} - if lhs._nonce != rhs._nonce {return false} - if lhs._blockhash != rhs._blockhash {return false} - if lhs.alts != rhs.alts {return false} - if lhs.computeUnitLimit != rhs.computeUnitLimit {return false} - if lhs.computeUnitPrice != rhs.computeUnitPrice {return false} - if lhs.memoValue != rhs.memoValue {return false} - if lhs._memoryAccount != rhs._memoryAccount {return false} - if lhs.memoryIndex != rhs.memoryIndex {return false} - if lhs._feeDestination != rhs._feeDestination {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveNewCurrencyServerParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.protoMessageName + ".ReserveNewCurrencyServerParameter" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}payer\0\u{1}nonce\0\u{1}blockhash\0\u{1}alts\0\u{3}compute_unit_limit\0\u{3}compute_unit_price\0\u{3}memo_value\0\u{1}authority\0\u{1}name\0\u{1}symbol\0\u{1}seed\0\u{3}sell_fee_bps\0\u{3}vm_lock_duration_in_days\0\u{3}fee_destination\0\u{1}treasury\0\u{3}treasury_purchase_amount\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._payer) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._nonce) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._blockhash) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.alts) }() - case 5: try { try decoder.decodeSingularUInt32Field(value: &self.computeUnitLimit) }() - case 6: try { try decoder.decodeSingularUInt64Field(value: &self.computeUnitPrice) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.memoValue) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._authority) }() - case 9: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 10: try { try decoder.decodeSingularStringField(value: &self.symbol) }() - case 11: try { try decoder.decodeSingularMessageField(value: &self._seed) }() - case 12: try { try decoder.decodeSingularUInt32Field(value: &self.sellFeeBps) }() - case 13: try { try decoder.decodeSingularUInt32Field(value: &self.vmLockDurationInDays) }() - case 14: try { try decoder.decodeSingularMessageField(value: &self._feeDestination) }() - case 15: try { try decoder.decodeSingularMessageField(value: &self._treasury) }() - case 16: try { try decoder.decodeSingularUInt64Field(value: &self.treasuryPurchaseAmount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._payer { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._nonce { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._blockhash { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !self.alts.isEmpty { - try visitor.visitRepeatedMessageField(value: self.alts, fieldNumber: 4) - } - if self.computeUnitLimit != 0 { - try visitor.visitSingularUInt32Field(value: self.computeUnitLimit, fieldNumber: 5) - } - if self.computeUnitPrice != 0 { - try visitor.visitSingularUInt64Field(value: self.computeUnitPrice, fieldNumber: 6) - } - if !self.memoValue.isEmpty { - try visitor.visitSingularStringField(value: self.memoValue, fieldNumber: 7) - } - try { if let v = self._authority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 9) - } - if !self.symbol.isEmpty { - try visitor.visitSingularStringField(value: self.symbol, fieldNumber: 10) - } - try { if let v = self._seed { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - if self.sellFeeBps != 0 { - try visitor.visitSingularUInt32Field(value: self.sellFeeBps, fieldNumber: 12) - } - if self.vmLockDurationInDays != 0 { - try visitor.visitSingularUInt32Field(value: self.vmLockDurationInDays, fieldNumber: 13) - } - try { if let v = self._feeDestination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 14) - } }() - try { if let v = self._treasury { - try visitor.visitSingularMessageField(value: v, fieldNumber: 15) - } }() - if self.treasuryPurchaseAmount != 0 { - try visitor.visitSingularUInt64Field(value: self.treasuryPurchaseAmount, fieldNumber: 16) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveNewCurrencyServerParameter, rhs: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.ReserveNewCurrencyServerParameter) -> Bool { - if lhs._payer != rhs._payer {return false} - if lhs._nonce != rhs._nonce {return false} - if lhs._blockhash != rhs._blockhash {return false} - if lhs.alts != rhs.alts {return false} - if lhs.computeUnitLimit != rhs.computeUnitLimit {return false} - if lhs.computeUnitPrice != rhs.computeUnitPrice {return false} - if lhs.memoValue != rhs.memoValue {return false} - if lhs._authority != rhs._authority {return false} - if lhs.name != rhs.name {return false} - if lhs.symbol != rhs.symbol {return false} - if lhs._seed != rhs._seed {return false} - if lhs.sellFeeBps != rhs.sellFeeBps {return false} - if lhs.vmLockDurationInDays != rhs.vmLockDurationInDays {return false} - if lhs._feeDestination != rhs._feeDestination {return false} - if lhs._treasury != rhs._treasury {return false} - if lhs.treasuryPurchaseAmount != rhs.treasuryPurchaseAmount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.protoMessageName + ".CoinbaseStableSwapperServerParameter" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}payer\0\u{1}nonce\0\u{1}blockhash\0\u{1}alts\0\u{3}compute_unit_limit\0\u{3}compute_unit_price\0\u{3}memo_value\0\u{3}fee_destination\0\u{3}pool_fee_recipient\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._payer) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._nonce) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._blockhash) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.alts) }() - case 5: try { try decoder.decodeSingularUInt32Field(value: &self.computeUnitLimit) }() - case 6: try { try decoder.decodeSingularUInt64Field(value: &self.computeUnitPrice) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.memoValue) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._feeDestination) }() - case 9: try { try decoder.decodeSingularMessageField(value: &self._poolFeeRecipient) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._payer { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._nonce { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._blockhash { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !self.alts.isEmpty { - try visitor.visitRepeatedMessageField(value: self.alts, fieldNumber: 4) - } - if self.computeUnitLimit != 0 { - try visitor.visitSingularUInt32Field(value: self.computeUnitLimit, fieldNumber: 5) - } - if self.computeUnitPrice != 0 { - try visitor.visitSingularUInt64Field(value: self.computeUnitPrice, fieldNumber: 6) - } - if !self.memoValue.isEmpty { - try visitor.visitSingularStringField(value: self.memoValue, fieldNumber: 7) - } - try { if let v = self._feeDestination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - try { if let v = self._poolFeeRecipient { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter, rhs: Ocp_Transaction_V1_StatefulSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter) -> Bool { - if lhs._payer != rhs._payer {return false} - if lhs._nonce != rhs._nonce {return false} - if lhs._blockhash != rhs._blockhash {return false} - if lhs.alts != rhs.alts {return false} - if lhs.computeUnitLimit != rhs.computeUnitLimit {return false} - if lhs.computeUnitPrice != rhs.computeUnitPrice {return false} - if lhs.memoValue != rhs.memoValue {return false} - if lhs._feeDestination != rhs._feeDestination {return false} - if lhs._poolFeeRecipient != rhs._poolFeeRecipient {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapResponse.Success: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapResponse.protoMessageName + ".Success" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .ok { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapResponse.Success, rhs: Ocp_Transaction_V1_StatefulSwapResponse.Success) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapResponse.Success.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0") -} - -extension Ocp_Transaction_V1_StatefulSwapResponse.Error: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatefulSwapResponse.protoMessageName + ".Error" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0\u{3}error_details\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.errorDetails) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .denied { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - if !self.errorDetails.isEmpty { - try visitor.visitRepeatedMessageField(value: self.errorDetails, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatefulSwapResponse.Error, rhs: Ocp_Transaction_V1_StatefulSwapResponse.Error) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.errorDetails != rhs.errorDetails {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatefulSwapResponse.Error.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DENIED\0\u{1}SIGNATURE_ERROR\0\u{1}INVALID_SWAP\0") -} - -extension Ocp_Transaction_V1_StatelessSwapRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StatelessSwapRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}initiate\0\u{3}submit_signatures\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_StatelessSwapRequest.Initiate? - var hadOneofValue = false - if let current = self.request { - hadOneofValue = true - if case .initiate(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.request = .initiate(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_StatelessSwapRequest.SubmitSignatures? - var hadOneofValue = false - if let current = self.request { - hadOneofValue = true - if case .submitSignatures(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.request = .submitSignatures(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.request { - case .initiate?: try { - guard case .initiate(let v)? = self.request else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .submitSignatures?: try { - guard case .submitSignatures(let v)? = self.request else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapRequest, rhs: Ocp_Transaction_V1_StatelessSwapRequest) -> Bool { - if lhs.request != rhs.request {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapRequest.Initiate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatelessSwapRequest.protoMessageName + ".Initiate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}stablecoin\0\u{1}owner\0\u{3}wait_for_finalization\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_StatelessSwapRequest.Initiate.CoinbaseStableSwapperClientParameters? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .stablecoin(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .stablecoin(v) - } - }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self.waitForFinalization) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .stablecoin(let v)? = self.kind { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.waitForFinalization != false { - try visitor.visitSingularBoolField(value: self.waitForFinalization, fieldNumber: 3) - } - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapRequest.Initiate, rhs: Ocp_Transaction_V1_StatelessSwapRequest.Initiate) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs._owner != rhs._owner {return false} - if lhs.waitForFinalization != rhs.waitForFinalization {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapRequest.Initiate.CoinbaseStableSwapperClientParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatelessSwapRequest.Initiate.protoMessageName + ".CoinbaseStableSwapperClientParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}from_mint\0\u{3}to_mint\0\u{3}swap_amount\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._fromMint) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._toMint) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.swapAmount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._fromMint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._toMint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.swapAmount != 0 { - try visitor.visitSingularUInt64Field(value: self.swapAmount, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapRequest.Initiate.CoinbaseStableSwapperClientParameters, rhs: Ocp_Transaction_V1_StatelessSwapRequest.Initiate.CoinbaseStableSwapperClientParameters) -> Bool { - if lhs._fromMint != rhs._fromMint {return false} - if lhs._toMint != rhs._toMint {return false} - if lhs.swapAmount != rhs.swapAmount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapRequest.SubmitSignatures: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatelessSwapRequest.protoMessageName + ".SubmitSignatures" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}transaction_signatures\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.transactionSignatures) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.transactionSignatures.isEmpty { - try visitor.visitRepeatedMessageField(value: self.transactionSignatures, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapRequest.SubmitSignatures, rhs: Ocp_Transaction_V1_StatelessSwapRequest.SubmitSignatures) -> Bool { - if lhs.transactionSignatures != rhs.transactionSignatures {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StatelessSwapResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}server_parameters\0\u{1}success\0\u{1}error\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .serverParameters(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .serverParameters(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_StatelessSwapResponse.Success? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .success(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .success(v) - } - }() - case 3: try { - var v: Ocp_Transaction_V1_StatelessSwapResponse.Error? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .error(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .error(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.response { - case .serverParameters?: try { - guard case .serverParameters(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .success?: try { - guard case .success(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .error?: try { - guard case .error(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapResponse, rhs: Ocp_Transaction_V1_StatelessSwapResponse) -> Bool { - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatelessSwapResponse.protoMessageName + ".ServerParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}stablecoin\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .stablecoin(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .stablecoin(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if case .stablecoin(let v)? = self.kind { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters, rhs: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.protoMessageName + ".CoinbaseStableSwapperServerParameter" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}payer\0\u{1}blockhash\0\u{1}alts\0\u{3}compute_unit_limit\0\u{3}compute_unit_price\0\u{3}memo_value\0\u{3}pool_fee_recipient\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._payer) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blockhash) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.alts) }() - case 4: try { try decoder.decodeSingularUInt32Field(value: &self.computeUnitLimit) }() - case 5: try { try decoder.decodeSingularUInt64Field(value: &self.computeUnitPrice) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.memoValue) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._poolFeeRecipient) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._payer { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._blockhash { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.alts.isEmpty { - try visitor.visitRepeatedMessageField(value: self.alts, fieldNumber: 3) - } - if self.computeUnitLimit != 0 { - try visitor.visitSingularUInt32Field(value: self.computeUnitLimit, fieldNumber: 4) - } - if self.computeUnitPrice != 0 { - try visitor.visitSingularUInt64Field(value: self.computeUnitPrice, fieldNumber: 5) - } - if !self.memoValue.isEmpty { - try visitor.visitSingularStringField(value: self.memoValue, fieldNumber: 6) - } - try { if let v = self._poolFeeRecipient { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter, rhs: Ocp_Transaction_V1_StatelessSwapResponse.ServerParameters.CoinbaseStableSwapperServerParameter) -> Bool { - if lhs._payer != rhs._payer {return false} - if lhs._blockhash != rhs._blockhash {return false} - if lhs.alts != rhs.alts {return false} - if lhs.computeUnitLimit != rhs.computeUnitLimit {return false} - if lhs.computeUnitPrice != rhs.computeUnitPrice {return false} - if lhs.memoValue != rhs.memoValue {return false} - if lhs._poolFeeRecipient != rhs._poolFeeRecipient {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapResponse.Success: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatelessSwapResponse.protoMessageName + ".Success" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0\u{3}transaction_signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._transactionSignature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.code != .submitted { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - try { if let v = self._transactionSignature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapResponse.Success, rhs: Ocp_Transaction_V1_StatelessSwapResponse.Success) -> Bool { - if lhs.code != rhs.code {return false} - if lhs._transactionSignature != rhs._transactionSignature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapResponse.Success.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0SUBMITTED\0\u{1}FINALIZED\0") -} - -extension Ocp_Transaction_V1_StatelessSwapResponse.Error: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_StatelessSwapResponse.protoMessageName + ".Error" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0\u{3}error_details\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.errorDetails) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .denied { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - if !self.errorDetails.isEmpty { - try visitor.visitRepeatedMessageField(value: self.errorDetails, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_StatelessSwapResponse.Error, rhs: Ocp_Transaction_V1_StatelessSwapResponse.Error) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.errorDetails != rhs.errorDetails {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_StatelessSwapResponse.Error.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0DENIED\0\u{1}SIGNATURE_ERROR\0\u{1}INVALID_SWAP\0\u{1}TRANSACTION_FAILED\0") -} - -extension Ocp_Transaction_V1_GetSwapRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetSwapRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}owner\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._id) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._id { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_GetSwapRequest, rhs: Ocp_Transaction_V1_GetSwapRequest) -> Bool { - if lhs._id != rhs._id {return false} - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_GetSwapResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetSwapResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}swap\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._swap) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - try { if let v = self._swap { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_GetSwapResponse, rhs: Ocp_Transaction_V1_GetSwapResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs._swap != rhs._swap {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_GetSwapResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0\u{1}DENIED\0") -} - -extension Ocp_Transaction_V1_GetPendingSwapsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetPendingSwapsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}owner\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_GetPendingSwapsRequest, rhs: Ocp_Transaction_V1_GetPendingSwapsRequest) -> Bool { - if lhs._owner != rhs._owner {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_GetPendingSwapsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetPendingSwapsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}swaps\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.swaps) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.swaps.isEmpty { - try visitor.visitRepeatedMessageField(value: self.swaps, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_GetPendingSwapsResponse, rhs: Ocp_Transaction_V1_GetPendingSwapsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.swaps != rhs.swaps {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_GetPendingSwapsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0") -} - -extension Ocp_Transaction_V1_Metadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Metadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}open_accounts\0\u{3}send_public_payment\0\u{3}receive_payments_publicly\0\u{3}public_distribution\0\u{4}\u{6}app_metadata\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_OpenAccountsMetadata? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .openAccounts(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .openAccounts(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_SendPublicPaymentMetadata? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .sendPublicPayment(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .sendPublicPayment(v) - } - }() - case 3: try { - var v: Ocp_Transaction_V1_ReceivePaymentsPubliclyMetadata? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .receivePaymentsPublicly(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .receivePaymentsPublicly(v) - } - }() - case 4: try { - var v: Ocp_Transaction_V1_PublicDistributionMetadata? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .publicDistribution(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .publicDistribution(v) - } - }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._appMetadata) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .openAccounts?: try { - guard case .openAccounts(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .sendPublicPayment?: try { - guard case .sendPublicPayment(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .receivePaymentsPublicly?: try { - guard case .receivePaymentsPublicly(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .publicDistribution?: try { - guard case .publicDistribution(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break - } - try { if let v = self._appMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_Metadata, rhs: Ocp_Transaction_V1_Metadata) -> Bool { - if lhs.type != rhs.type {return false} - if lhs._appMetadata != rhs._appMetadata {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_OpenAccountsMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenAccountsMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}account_set\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.accountSet) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.accountSet != .user { - try visitor.visitSingularEnumField(value: self.accountSet, fieldNumber: 1) - } - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_OpenAccountsMetadata, rhs: Ocp_Transaction_V1_OpenAccountsMetadata) -> Bool { - if lhs.accountSet != rhs.accountSet {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_OpenAccountsMetadata.AccountSet: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0USER\0\u{1}POOL\0") -} - -extension Ocp_Transaction_V1_SendPublicPaymentMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendPublicPaymentMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}source\0\u{1}destination\0\u{3}destination_owner\0\u{3}server_exchange_data\0\u{3}is_withdrawal\0\u{3}is_indirect_send\0\u{1}mint\0\u{3}client_exchange_data\0") - - fileprivate class _StorageClass { - var _source: Ocp_Common_V1_SolanaAccountId? = nil - var _destination: Ocp_Common_V1_SolanaAccountId? = nil - var _destinationOwner: Ocp_Common_V1_SolanaAccountId? = nil - var _exchangeData: Ocp_Transaction_V1_SendPublicPaymentMetadata.OneOf_ExchangeData? - var _isWithdrawal: Bool = false - var _isIndirectSend: Bool = false - var _mint: Ocp_Common_V1_SolanaAccountId? = nil - - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _source = source._source - _destination = source._destination - _destinationOwner = source._destinationOwner - _exchangeData = source._exchangeData - _isWithdrawal = source._isWithdrawal - _isIndirectSend = source._isIndirectSend - _mint = source._mint - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._source) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._destination) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._destinationOwner) }() - case 4: try { - var v: Ocp_Transaction_V1_ExchangeData? - var hadOneofValue = false - if let current = _storage._exchangeData { - hadOneofValue = true - if case .serverExchangeData(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._exchangeData = .serverExchangeData(v) - } - }() - case 5: try { try decoder.decodeSingularBoolField(value: &_storage._isWithdrawal) }() - case 6: try { try decoder.decodeSingularBoolField(value: &_storage._isIndirectSend) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._mint) }() - case 8: try { - var v: Ocp_Transaction_V1_VerifiedExchangeData? - var hadOneofValue = false - if let current = _storage._exchangeData { - hadOneofValue = true - if case .clientExchangeData(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - _storage._exchangeData = .clientExchangeData(v) - } - }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._source { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._destination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = _storage._destinationOwner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if case .serverExchangeData(let v)? = _storage._exchangeData { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - if _storage._isWithdrawal != false { - try visitor.visitSingularBoolField(value: _storage._isWithdrawal, fieldNumber: 5) - } - if _storage._isIndirectSend != false { - try visitor.visitSingularBoolField(value: _storage._isIndirectSend, fieldNumber: 6) - } - try { if let v = _storage._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try { if case .clientExchangeData(let v)? = _storage._exchangeData { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SendPublicPaymentMetadata, rhs: Ocp_Transaction_V1_SendPublicPaymentMetadata) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._source != rhs_storage._source {return false} - if _storage._destination != rhs_storage._destination {return false} - if _storage._destinationOwner != rhs_storage._destinationOwner {return false} - if _storage._exchangeData != rhs_storage._exchangeData {return false} - if _storage._isWithdrawal != rhs_storage._isWithdrawal {return false} - if _storage._isIndirectSend != rhs_storage._isIndirectSend {return false} - if _storage._mint != rhs_storage._mint {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_ReceivePaymentsPubliclyMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ReceivePaymentsPubliclyMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}source\0\u{1}quarks\0\u{3}is_indirect_send\0\u{3}exchange_data\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._source) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.quarks) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self.isIndirectSend) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._exchangeData) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._source { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.quarks != 0 { - try visitor.visitSingularUInt64Field(value: self.quarks, fieldNumber: 2) - } - if self.isIndirectSend != false { - try visitor.visitSingularBoolField(value: self.isIndirectSend, fieldNumber: 3) - } - try { if let v = self._exchangeData { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_ReceivePaymentsPubliclyMetadata, rhs: Ocp_Transaction_V1_ReceivePaymentsPubliclyMetadata) -> Bool { - if lhs._source != rhs._source {return false} - if lhs.quarks != rhs.quarks {return false} - if lhs.isIndirectSend != rhs.isIndirectSend {return false} - if lhs._exchangeData != rhs._exchangeData {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_PublicDistributionMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PublicDistributionMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}source\0\u{1}distributions\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._source) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.distributions) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._source { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.distributions.isEmpty { - try visitor.visitRepeatedMessageField(value: self.distributions, fieldNumber: 2) - } - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_PublicDistributionMetadata, rhs: Ocp_Transaction_V1_PublicDistributionMetadata) -> Bool { - if lhs._source != rhs._source {return false} - if lhs.distributions != rhs.distributions {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_PublicDistributionMetadata.Distribution: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Ocp_Transaction_V1_PublicDistributionMetadata.protoMessageName + ".Distribution" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}destination\0\u{1}quarks\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._destination) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.quarks) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._destination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.quarks != 0 { - try visitor.visitSingularUInt64Field(value: self.quarks, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_PublicDistributionMetadata.Distribution, rhs: Ocp_Transaction_V1_PublicDistributionMetadata.Distribution) -> Bool { - if lhs._destination != rhs._destination {return false} - if lhs.quarks != rhs.quarks {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_Action: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Action" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{3}open_account\0\u{3}no_privacy_transfer\0\u{3}no_privacy_withdraw\0\u{3}fee_payment\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt32Field(value: &self.id) }() - case 2: try { - var v: Ocp_Transaction_V1_OpenAccountAction? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .openAccount(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .openAccount(v) - } - }() - case 3: try { - var v: Ocp_Transaction_V1_NoPrivacyTransferAction? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .noPrivacyTransfer(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .noPrivacyTransfer(v) - } - }() - case 4: try { - var v: Ocp_Transaction_V1_NoPrivacyWithdrawAction? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .noPrivacyWithdraw(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .noPrivacyWithdraw(v) - } - }() - case 5: try { - var v: Ocp_Transaction_V1_FeePaymentAction? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .feePayment(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .feePayment(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.id != 0 { - try visitor.visitSingularUInt32Field(value: self.id, fieldNumber: 1) - } - switch self.type { - case .openAccount?: try { - guard case .openAccount(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .noPrivacyTransfer?: try { - guard case .noPrivacyTransfer(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .noPrivacyWithdraw?: try { - guard case .noPrivacyWithdraw(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .feePayment?: try { - guard case .feePayment(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_Action, rhs: Ocp_Transaction_V1_Action) -> Bool { - if lhs.id != rhs.id {return false} - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_OpenAccountAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenAccountAction" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}account_type\0\u{1}owner\0\u{1}index\0\u{1}authority\0\u{1}token\0\u{3}authority_signature\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.accountType) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._owner) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.index) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._authority) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._token) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._authoritySignature) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.accountType != .unknown { - try visitor.visitSingularEnumField(value: self.accountType, fieldNumber: 1) - } - try { if let v = self._owner { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.index != 0 { - try visitor.visitSingularUInt64Field(value: self.index, fieldNumber: 3) - } - try { if let v = self._authority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._token { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try { if let v = self._authoritySignature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_OpenAccountAction, rhs: Ocp_Transaction_V1_OpenAccountAction) -> Bool { - if lhs.accountType != rhs.accountType {return false} - if lhs._owner != rhs._owner {return false} - if lhs.index != rhs.index {return false} - if lhs._authority != rhs._authority {return false} - if lhs._token != rhs._token {return false} - if lhs._authoritySignature != rhs._authoritySignature {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_NoPrivacyTransferAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NoPrivacyTransferAction" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}authority\0\u{1}source\0\u{1}destination\0\u{1}amount\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._authority) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._source) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._destination) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.amount) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._authority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._source { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._destination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.amount != 0 { - try visitor.visitSingularUInt64Field(value: self.amount, fieldNumber: 4) - } - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_NoPrivacyTransferAction, rhs: Ocp_Transaction_V1_NoPrivacyTransferAction) -> Bool { - if lhs._authority != rhs._authority {return false} - if lhs._source != rhs._source {return false} - if lhs._destination != rhs._destination {return false} - if lhs.amount != rhs.amount {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_NoPrivacyWithdrawAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NoPrivacyWithdrawAction" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}authority\0\u{1}source\0\u{1}destination\0\u{1}amount\0\u{3}should_close\0\u{3}is_auto_return\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._authority) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._source) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._destination) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.amount) }() - case 5: try { try decoder.decodeSingularBoolField(value: &self.shouldClose) }() - case 6: try { try decoder.decodeSingularBoolField(value: &self.isAutoReturn) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._authority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._source { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._destination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.amount != 0 { - try visitor.visitSingularUInt64Field(value: self.amount, fieldNumber: 4) - } - if self.shouldClose != false { - try visitor.visitSingularBoolField(value: self.shouldClose, fieldNumber: 5) - } - if self.isAutoReturn != false { - try visitor.visitSingularBoolField(value: self.isAutoReturn, fieldNumber: 6) - } - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_NoPrivacyWithdrawAction, rhs: Ocp_Transaction_V1_NoPrivacyWithdrawAction) -> Bool { - if lhs._authority != rhs._authority {return false} - if lhs._source != rhs._source {return false} - if lhs._destination != rhs._destination {return false} - if lhs.amount != rhs.amount {return false} - if lhs.shouldClose != rhs.shouldClose {return false} - if lhs.isAutoReturn != rhs.isAutoReturn {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_FeePaymentAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FeePaymentAction" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}type\0\u{1}authority\0\u{1}source\0\u{1}amount\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._authority) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._source) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.amount) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.type != .unknown { - try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1) - } - try { if let v = self._authority { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._source { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if self.amount != 0 { - try visitor.visitSingularUInt64Field(value: self.amount, fieldNumber: 4) - } - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_FeePaymentAction, rhs: Ocp_Transaction_V1_FeePaymentAction) -> Bool { - if lhs.type != rhs.type {return false} - if lhs._authority != rhs._authority {return false} - if lhs._source != rhs._source {return false} - if lhs.amount != rhs.amount {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_FeePaymentAction.FeeType: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}CREATE_ON_SEND_WITHDRAWAL\0") -} - -extension Ocp_Transaction_V1_ServerParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ServerParameter" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}action_id\0\u{1}nonces\0\u{3}open_account\0\u{3}no_privacy_transfer\0\u{3}no_privacy_withdraw\0\u{3}fee_payment\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt32Field(value: &self.actionID) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.nonces) }() - case 3: try { - var v: Ocp_Transaction_V1_OpenAccountServerParameter? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .openAccount(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .openAccount(v) - } - }() - case 4: try { - var v: Ocp_Transaction_V1_NoPrivacyTransferServerParameter? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .noPrivacyTransfer(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .noPrivacyTransfer(v) - } - }() - case 5: try { - var v: Ocp_Transaction_V1_NoPrivacyWithdrawServerParameter? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .noPrivacyWithdraw(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .noPrivacyWithdraw(v) - } - }() - case 6: try { - var v: Ocp_Transaction_V1_FeePaymentServerParameter? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .feePayment(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .feePayment(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.actionID != 0 { - try visitor.visitSingularUInt32Field(value: self.actionID, fieldNumber: 1) - } - if !self.nonces.isEmpty { - try visitor.visitRepeatedMessageField(value: self.nonces, fieldNumber: 2) - } - switch self.type { - case .openAccount?: try { - guard case .openAccount(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .noPrivacyTransfer?: try { - guard case .noPrivacyTransfer(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .noPrivacyWithdraw?: try { - guard case .noPrivacyWithdraw(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case .feePayment?: try { - guard case .feePayment(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_ServerParameter, rhs: Ocp_Transaction_V1_ServerParameter) -> Bool { - if lhs.actionID != rhs.actionID {return false} - if lhs.nonces != rhs.nonces {return false} - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_NoncedTransactionMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NoncedTransactionMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}nonce\0\u{1}blockhash\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._nonce) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._blockhash) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._nonce { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._blockhash { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_NoncedTransactionMetadata, rhs: Ocp_Transaction_V1_NoncedTransactionMetadata) -> Bool { - if lhs._nonce != rhs._nonce {return false} - if lhs._blockhash != rhs._blockhash {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_OpenAccountServerParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".OpenAccountServerParameter" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_OpenAccountServerParameter, rhs: Ocp_Transaction_V1_OpenAccountServerParameter) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_NoPrivacyTransferServerParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NoPrivacyTransferServerParameter" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_NoPrivacyTransferServerParameter, rhs: Ocp_Transaction_V1_NoPrivacyTransferServerParameter) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_NoPrivacyWithdrawServerParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NoPrivacyWithdrawServerParameter" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_NoPrivacyWithdrawServerParameter, rhs: Ocp_Transaction_V1_NoPrivacyWithdrawServerParameter) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_FeePaymentServerParameter: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".FeePaymentServerParameter" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}destination\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._destination) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._destination { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_FeePaymentServerParameter, rhs: Ocp_Transaction_V1_FeePaymentServerParameter) -> Bool { - if lhs._destination != rhs._destination {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_ErrorDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ErrorDetails" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}reason_string\0\u{3}invalid_signature\0\u{1}denied\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_ReasonStringErrorDetails? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .reasonString(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .reasonString(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_InvalidSignatureErrorDetails? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .invalidSignature(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .invalidSignature(v) - } - }() - case 3: try { - var v: Ocp_Transaction_V1_DeniedErrorDetails? - var hadOneofValue = false - if let current = self.type { - hadOneofValue = true - if case .denied(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.type = .denied(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.type { - case .reasonString?: try { - guard case .reasonString(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .invalidSignature?: try { - guard case .invalidSignature(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .denied?: try { - guard case .denied(let v)? = self.type else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_ErrorDetails, rhs: Ocp_Transaction_V1_ErrorDetails) -> Bool { - if lhs.type != rhs.type {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_ReasonStringErrorDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ReasonStringErrorDetails" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}reason\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.reason) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.reason.isEmpty { - try visitor.visitSingularStringField(value: self.reason, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_ReasonStringErrorDetails, rhs: Ocp_Transaction_V1_ReasonStringErrorDetails) -> Bool { - if lhs.reason != rhs.reason {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_InvalidSignatureErrorDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".InvalidSignatureErrorDetails" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}action_id\0\u{3}expected_transaction\0\u{3}provided_signature\0\u{3}expected_vixn_hash\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt32Field(value: &self.actionID) }() - case 2: try { - var v: Ocp_Common_V1_Transaction? - var hadOneofValue = false - if let current = self.expectedBlob { - hadOneofValue = true - if case .expectedTransaction(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.expectedBlob = .expectedTransaction(v) - } - }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._providedSignature) }() - case 4: try { - var v: Ocp_Common_V1_Hash? - var hadOneofValue = false - if let current = self.expectedBlob { - hadOneofValue = true - if case .expectedVixnHash(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.expectedBlob = .expectedVixnHash(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.actionID != 0 { - try visitor.visitSingularUInt32Field(value: self.actionID, fieldNumber: 1) - } - try { if case .expectedTransaction(let v)? = self.expectedBlob { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._providedSignature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if case .expectedVixnHash(let v)? = self.expectedBlob { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_InvalidSignatureErrorDetails, rhs: Ocp_Transaction_V1_InvalidSignatureErrorDetails) -> Bool { - if lhs.actionID != rhs.actionID {return false} - if lhs.expectedBlob != rhs.expectedBlob {return false} - if lhs._providedSignature != rhs._providedSignature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_DeniedErrorDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DeniedErrorDetails" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}code\0\u{1}reason\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.code) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.reason) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.code != .unspecified { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 1) - } - if !self.reason.isEmpty { - try visitor.visitSingularStringField(value: self.reason, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_DeniedErrorDetails, rhs: Ocp_Transaction_V1_DeniedErrorDetails) -> Bool { - if lhs.code != rhs.code {return false} - if lhs.reason != rhs.reason {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_DeniedErrorDetails.Code: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNSPECIFIED\0") -} - -extension Ocp_Transaction_V1_VerifiedExchangeData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerifiedExchangeData" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}mint\0\u{1}quarks\0\u{3}native_amount\0\u{3}core_mint_fiat_exchange_rate\0\u{3}launchpad_currency_reserve_state\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.quarks) }() - case 3: try { try decoder.decodeSingularDoubleField(value: &self.nativeAmount) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._coreMintFiatExchangeRate) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._launchpadCurrencyReserveState) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.quarks != 0 { - try visitor.visitSingularUInt64Field(value: self.quarks, fieldNumber: 2) - } - if self.nativeAmount.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.nativeAmount, fieldNumber: 3) - } - try { if let v = self._coreMintFiatExchangeRate { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._launchpadCurrencyReserveState { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_VerifiedExchangeData, rhs: Ocp_Transaction_V1_VerifiedExchangeData) -> Bool { - if lhs._mint != rhs._mint {return false} - if lhs.quarks != rhs.quarks {return false} - if lhs.nativeAmount != rhs.nativeAmount {return false} - if lhs._coreMintFiatExchangeRate != rhs._coreMintFiatExchangeRate {return false} - if lhs._launchpadCurrencyReserveState != rhs._launchpadCurrencyReserveState {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_ExchangeData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ExchangeData" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}currency\0\u{3}exchange_rate\0\u{3}native_amount\0\u{1}quarks\0\u{1}mint\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.currency) }() - case 2: try { try decoder.decodeSingularDoubleField(value: &self.exchangeRate) }() - case 3: try { try decoder.decodeSingularDoubleField(value: &self.nativeAmount) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.quarks) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._mint) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.currency.isEmpty { - try visitor.visitSingularStringField(value: self.currency, fieldNumber: 1) - } - if self.exchangeRate.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.exchangeRate, fieldNumber: 2) - } - if self.nativeAmount.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.nativeAmount, fieldNumber: 3) - } - if self.quarks != 0 { - try visitor.visitSingularUInt64Field(value: self.quarks, fieldNumber: 4) - } - try { if let v = self._mint { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_ExchangeData, rhs: Ocp_Transaction_V1_ExchangeData) -> Bool { - if lhs.currency != rhs.currency {return false} - if lhs.exchangeRate != rhs.exchangeRate {return false} - if lhs.nativeAmount != rhs.nativeAmount {return false} - if lhs.quarks != rhs.quarks {return false} - if lhs._mint != rhs._mint {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_ExchangeDataWithoutRate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ExchangeDataWithoutRate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}currency\0\u{3}native_amount\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.currency) }() - case 2: try { try decoder.decodeSingularDoubleField(value: &self.nativeAmount) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.currency.isEmpty { - try visitor.visitSingularStringField(value: self.currency, fieldNumber: 1) - } - if self.nativeAmount.bitPattern != 0 { - try visitor.visitSingularDoubleField(value: self.nativeAmount, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_ExchangeDataWithoutRate, rhs: Ocp_Transaction_V1_ExchangeDataWithoutRate) -> Bool { - if lhs.currency != rhs.currency {return false} - if lhs.nativeAmount != rhs.nativeAmount {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SendLimit: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SendLimit" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}next_transaction\0\u{3}max_per_transaction\0\u{3}max_per_day\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularFloatField(value: &self.nextTransaction) }() - case 2: try { try decoder.decodeSingularFloatField(value: &self.maxPerTransaction) }() - case 3: try { try decoder.decodeSingularFloatField(value: &self.maxPerDay) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.nextTransaction.bitPattern != 0 { - try visitor.visitSingularFloatField(value: self.nextTransaction, fieldNumber: 1) - } - if self.maxPerTransaction.bitPattern != 0 { - try visitor.visitSingularFloatField(value: self.maxPerTransaction, fieldNumber: 2) - } - if self.maxPerDay.bitPattern != 0 { - try visitor.visitSingularFloatField(value: self.maxPerDay, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SendLimit, rhs: Ocp_Transaction_V1_SendLimit) -> Bool { - if lhs.nextTransaction != rhs.nextTransaction {return false} - if lhs.maxPerTransaction != rhs.maxPerTransaction {return false} - if lhs.maxPerDay != rhs.maxPerDay {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_VerifiedSwapMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerifiedSwapMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}reserve\0\u{1}stablecoin\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { - var v: Ocp_Transaction_V1_VerifiedReserveSwapMetadata? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .reserve(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .reserve(v) - } - }() - case 2: try { - var v: Ocp_Transaction_V1_VerifiedCoinbaseStableSwapperSwapMetadata? - var hadOneofValue = false - if let current = self.kind { - hadOneofValue = true - if case .stablecoin(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.kind = .stablecoin(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - switch self.kind { - case .reserve?: try { - guard case .reserve(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .stablecoin?: try { - guard case .stablecoin(let v)? = self.kind else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_VerifiedSwapMetadata, rhs: Ocp_Transaction_V1_VerifiedSwapMetadata) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_VerifiedReserveSwapMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerifiedReserveSwapMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}client_parameters\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._clientParameters) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._clientParameters { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_VerifiedReserveSwapMetadata, rhs: Ocp_Transaction_V1_VerifiedReserveSwapMetadata) -> Bool { - if lhs._clientParameters != rhs._clientParameters {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_VerifiedCoinbaseStableSwapperSwapMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".VerifiedCoinbaseStableSwapperSwapMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}client_parameters\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._clientParameters) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._clientParameters { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_VerifiedCoinbaseStableSwapperSwapMetadata, rhs: Ocp_Transaction_V1_VerifiedCoinbaseStableSwapperSwapMetadata) -> Bool { - if lhs._clientParameters != rhs._clientParameters {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SwapMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SwapMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}verified_metadata\0\u{1}state\0\u{1}signature\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._verifiedMetadata) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.state) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._signature) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._verifiedMetadata { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.state != .unknown { - try visitor.visitSingularEnumField(value: self.state, fieldNumber: 2) - } - try { if let v = self._signature { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_SwapMetadata, rhs: Ocp_Transaction_V1_SwapMetadata) -> Bool { - if lhs._verifiedMetadata != rhs._verifiedMetadata {return false} - if lhs.state != rhs.state {return false} - if lhs._signature != rhs._signature {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Ocp_Transaction_V1_SwapMetadata.State: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}CREATED\0\u{1}FUNDING\0\u{1}FUNDED\0\u{1}SUBMITTING\0\u{1}FINALIZED\0\u{1}FAILED\0\u{1}CANCELLING\0\u{1}CANCELLED\0") -} - -extension Ocp_Transaction_V1_AppMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AppMetadata" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularBytesField(value: self.value, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Ocp_Transaction_V1_AppMetadata, rhs: Ocp_Transaction_V1_AppMetadata) -> Bool { - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/account/v1/ocp_account_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/account/v1/ocp_account_service.proto deleted file mode 100644 index 31548f954..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/account/v1/ocp_account_service.proto +++ /dev/null @@ -1,215 +0,0 @@ -syntax = "proto3"; - -package ocp.account.v1; - -option go_package = "github.com/code-payments/ocp-protobuf-api/generated/go/account/v1;account"; -option java_package = "com.codeinc.gen.account.v1"; -option objc_class_prefix = "CPBAccountV1"; - -import "common/v1/model.proto"; -import "currency/v1/ocp_currency_service.proto"; -import "transaction/v1/ocp_transaction_service.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -service Account { - // IsOcpAccount returns whether an owner account is a OCP account. This hints - // to the client whether the account can be logged in, used for making payments, - // etc. - rpc IsOcpAccount(IsOcpAccountRequest) returns (IsOcpAccountResponse); - - // GetTokenAccountInfos returns token account metadata relevant to the OCP owner - // account. - rpc GetTokenAccountInfos(GetTokenAccountInfosRequest) returns (GetTokenAccountInfosResponse); -} - -message IsOcpAccountRequest { - // The owner account to check against. - common.v1.SolanaAccountId owner = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(IsOcpAccountRequest) without this field set - // using the private key of the owner account. This provides an authentication - // mechanism to the RPC. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; -} - -message IsOcpAccountResponse { - Result result = 1; - enum Result { - // The account is an OCP account. - OK = 0; - // The account is not an OCP account. - NOT_FOUND = 1; - // The account exists, but at least one timelock account is unlocked. - UNLOCKED_TIMELOCK_ACCOUNT = 2; - } -} - -message GetTokenAccountInfosRequest { - // The owner account to fetch balances for, which can also be thought of as a - // parent account for this RPC that links to one or more token accounts. - common.v1.SolanaAccountId owner = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(GetTokenAccountInfosRequest) without signature - // fields set using the private key of the owner account. This provides - // an authentication mechanism to the RPC. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; - - // A requesting owner account that is requesting the balance for owner. Additional - // metadata that is considered private will be provided, if applicable. An example - // use case includes a user owner account requesting account info for a gift card - // owner account. - common.v1.SolanaAccountId requesting_owner = 3; - - // The signature is of serialize(GetTokenAccountInfosRequest) without signature - // fields set using the private key of the requesting_owner_signature account. - // This provides an authentication mechanism to the RPC when requesting_owner is - // present. - // - // This must be set when requesting_owner is present. - common.v1.Signature requesting_owner_signature = 4; - - // Filter to apply to limit response sizes - oneof Filter { - common.v1.SolanaAccountId filter_by_token_address = 10; - common.v1.AccountType filter_by_account_type = 11; - common.v1.SolanaAccountId filter_by_mint_address = 12; - } -} - -message GetTokenAccountInfosResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - } - - map token_account_infos = 2; -} - -message TokenAccountInfo { - // The token account's address - common.v1.SolanaAccountId address = 1 [(validate.rules).message.required = true]; - - // The owner of the token account, which can also be thought of as a parent - // account that links to one or more token accounts. This is provided when - // available. - common.v1.SolanaAccountId owner = 2; - - // The token account's authority, which has access to moving funds for the - // account. This can be the owner account under certain circumstances (eg. - // ATA, primary account). This is provided when available. - common.v1.SolanaAccountId authority = 3; - - // The type of token account, which infers its intended use. - common.v1.AccountType account_type = 4 [(validate.rules).enum.not_in = 0]; - - // The account's derivation index for applicable account types. When this field - // doesn't apply, a zero value is provided. - uint64 index = 5; - - // The source of truth for the balance calculation. - BalanceSource balance_source = 6; - enum BalanceSource { - // The account's balance could not be determined. This may be returned when - // the data source is unstable and a reliable balance cannot be determined. - BALANCE_SOURCE_UNKNOWN = 0; - // The account's balance was fetched directly from a finalized state on the - // blockchain. - BALANCE_SOURCE_BLOCKCHAIN = 1; - // The account's balance was calculated using cached values in OCP. Accuracy - // is only guaranteed when management_state is LOCKED. - BALANCE_SOURCE_CACHE = 2; - } - - // The balance in quarks, as observed by the OCP. This may not reflect the value - // on the blockchain and could be non-zero even if the account hasn't been created. - // Use balance_source to determine how this value was calculated. - uint64 balance = 7; - - // The state of the account as it pertains to the OCP's ability to manage funds. - ManagementState management_state = 8; - enum ManagementState { - // The state of the account is unknown. This may be returned when the - // data source is unstable and a reliable state cannot be determined. - MANAGEMENT_STATE_UNKNOWN = 0; - // OCP does not maintain a management state and won't move funds for this - // account. - MANAGEMENT_STATE_NONE = 1; - // The account is in the process of transitioning to the LOCKED state. - MANAGEMENT_STATE_LOCKING = 2; - // The account's funds are locked and OCP has co-signing authority. - MANAGEMENT_STATE_LOCKED = 3; - // The account is in the process of transitioning to the UNLOCKED state. - MANAGEMENT_STATE_UNLOCKING = 4; - // The account's funds are unlocked and OCP no longer has co-signing - // authority. The account must transition to the LOCKED state to have - // management capabilities. - MANAGEMENT_STATE_UNLOCKED = 5; - // The account is in the process of transitioning to the CLOSED state. - MANAGEMENT_STATE_CLOSING = 6; - // The account has been closed and doesn't exist on the blockchain. - // Subsequently, it also has a zero balance. - MANAGEMENT_STATE_CLOSED = 7; - } - - // The state of the account on the blockchain. - BlockchainState blockchain_state = 9; - enum BlockchainState { - // The state of the account is unknown. This may be returned when the - // data source is unstable and a reliable state cannot be determined. - BLOCKCHAIN_STATE_UNKNOWN = 0; - // The account does not exist on the blockchain. - BLOCKCHAIN_STATE_DOES_NOT_EXIST = 1; - // The account is created and exists on the blockchain. - BLOCKCHAIN_STATE_EXISTS = 2; - } - - // Whether an account is claimed. This only applies to relevant account types - // (eg. REMOTE_SEND_GIFT_CARD). - ClaimState claim_state = 10; - enum ClaimState { - // The account doesn't have a concept of being claimed, or the state - // could not be fetched by server. - CLAIM_STATE_UNKNOWN = 0; - // The account has not yet been claimed. - CLAIM_STATE_NOT_CLAIMED = 1; - // The account is claimed. Attempting to claim it will fail. - CLAIM_STATE_CLAIMED = 2; - // The account hasn't been claimed, but is expired. Funds will move - // back to the issuer. Attempting to claim it will fail. - CLAIM_STATE_EXPIRED = 3; - } - - // For account types used as an intermediary for sending money between two - // users (eg. REMOTE_SEND_GIFT_CARD), this represents the original exchange - // data used to fund the account. Over time, this value will become stale: - // 1. Exchange rates will fluctuate, so the total fiat amount will differ. - // 2. External entities can deposit additional funds into the account, so - // the balance, in quarks, may be greater than the original quark value. - // 3. The balance could have been received, so the total balance can show - // as zero. - transaction.v1.ExchangeData original_exchange_data = 11; - - // The token account's mint - common.v1.SolanaAccountId mint = 12; - - // Mint metadata for the token account's mint - currency.v1.Mint mint_metadata = 16; - - // Live mint reserve state, if applicable - currency.v1.VerifiedLaunchpadCurrencyReserveState live_reserve_state = 17; - - // Time the account was created, if available. For OCP accounts, this is - // the time of intent submission. Otherwise, for external accounts, it is - // the time created on the blockchain. - google.protobuf.Timestamp created_at = 13; - - // For REMOTE_SEND_GIFT_CARD, if requesting_owner was provided, was - // requesting_owner the issuer of the account. - bool is_gift_card_issuer = 14; - - // The USD cost basis for this account, which can be used to compute currency - // appreciation/depreciation - double usd_cost_basis = 15; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/common/v1/model.proto b/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/common/v1/model.proto deleted file mode 100644 index ea9047222..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/common/v1/model.proto +++ /dev/null @@ -1,143 +0,0 @@ -syntax = "proto3"; - -package ocp.common.v1; - -option go_package = "github.com/code-payments/ocp-protobuf-api/generated/go/common/v1;common"; -option java_package = "com.codeinc.gen.common.v1"; -option objc_class_prefix = "CPBCommonV1"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -// AccountType associates a type to an account, which infers how an account is used -// within the OCP ecosystem. -enum AccountType { - UNKNOWN = 0; - PRIMARY = 1; - REMOTE_SEND_GIFT_CARD = 2; - SWAP = 3; - ASSOCIATED_TOKEN_ACCOUNT = 4; - POOL = 5; -} - -// SolanaAccountId is a raw binary Ed25519 public key for a Solana account -message SolanaAccountId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// A Solana address lookup table used in versioned transactions -message SolanaAddressLookupTable { - common.v1.SolanaAccountId address = 1 [(validate.rules).message.required = true]; - - repeated common.v1.SolanaAccountId entries = 2 [(validate.rules).repeated = { - min_items: 1, - max_items: 256, - }]; -} - -// Transaction is a raw binary Solana transaction -message Transaction { - // Maximum size taken from: https://github.com/solana-labs/solana/blob/39b3ac6a8d29e14faa1de73d8b46d390ad41797b/sdk/src/packet.rs#L9-L13 - bytes value = 1 [(validate.rules).bytes = { - min_len: 1 - max_len: 1232 - }]; -} - -// Blockhash is a raw binary Solana blockchash -message Blockhash { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// Signature is a raw binary Ed25519 signature -message Signature { - bytes value = 1 [(validate.rules).bytes = { - min_len: 64 - max_len: 64 - }]; -} - -// IntentId is a client-side generated ID that maps to an intent to perform actions -// on the blockchain fulfilled by the OCP sequencer. -message IntentId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// SwapId is a client-side generated ID that maps to a swap. -message SwapId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// Hash is a raw binary 32 byte hash value -message Hash { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// UUID is a 16 byte UUID value -message UUID { - bytes value = 1 [(validate.rules).bytes = { - min_len: 16 - max_len: 16 - }]; -} - -// Request is a generic wrapper for gRPC requests -message Request { - string version = 1; - string service = 2; - string method = 3; - bytes body = 4; -} - -// Response is a generic wrapper for gRPC responses -message Response { - Result result = 1; - - bytes body = 2; - string message = 3; - - enum Result { - OK = 0; - ERROR = 1; - } -} - -message ServerPing { - // Timestamp the ping was sent on the stream, for client to get a sense - // of potential network latency - google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true]; - - // The delay server will apply before sending the next ping - google.protobuf.Duration ping_delay = 2 [(validate.rules).duration.required = true]; -} - -message ClientPong { - // Timestamp the Pong was sent on the stream, for server to get a sense - // of potential network latency - google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true]; -} - -enum Interval { - RAW = 0; - SECOND = 1; - MINUTE = 2; - HOUR = 3; - DAY = 4; - WEEK = 5; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/currency/v1/ocp_currency_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/currency/v1/ocp_currency_service.proto deleted file mode 100644 index 2d1f71544..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/currency/v1/ocp_currency_service.proto +++ /dev/null @@ -1,594 +0,0 @@ -syntax = "proto3"; - -package ocp.currency.v1; - -option go_package = "github.com/code-payments/ocp-protobuf-api/generated/go/currency/v1;currency"; -option java_package = "com.codeinc.gen.currency.v1"; -option objc_class_prefix = "CPBCurrencyV1"; - -import "common/v1/model.proto"; -import "validate/validate.proto"; -import "google/protobuf/timestamp.proto"; - -service Currency { - // GetMints gets mint account metadata by address - rpc GetMints(GetMintsRequest) returns (GetMintsResponse); - - // GetHistoricalMintData returns historical market data for a mint - rpc GetHistoricalMintData(GetHistoricalMintDataRequest) returns (GetHistoricalMintDataResponse); - - // StreamLiveMintData streams live mint data for a set of mints - rpc StreamLiveMintData(stream StreamLiveMintDataRequest) returns (stream StreamLiveMintDataResponse); - - // Launch launches a new currency on the launchpad - rpc Launch(LaunchRequest) returns (LaunchResponse); - - // UpdateIcon uploads and updates the icon for a currency - rpc UpdateIcon(UpdateIconRequest) returns (UpdateIconResponse); - - // UpdateMetadata updates mutable metadata for a currency - rpc UpdateMetadata(UpdateMetadataRequest) returns (UpdateMetadataResponse); - - // Discover returns a set of currencies to discover - rpc Discover(DiscoverRequest) returns (stream DiscoverResponse); - - // CheckAvailability checks whether a currency name is available for launch - rpc CheckAvailability(CheckAvailabilityRequest) returns (CheckAvailabilityResponse); -} - -message GetMintsRequest { - repeated common.v1.SolanaAccountId addresses = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 // Arbitrary - }]; -} - -message GetMintsResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - } - - map metadata_by_address = 2; -} - -message GetHistoricalMintDataRequest { - // The mint address to get historical data for - common.v1.SolanaAccountId address = 1 [(validate.rules).message.required = true]; - - // The currency code for the returned market data (e.g., "usd") - string currency_code = 2 [(validate.rules).string = { - pattern: "^[a-z]{3,4}$" - }]; - - oneof range { - option (validate.required) = true; - - PredefinedRange predefined_range = 3; - } -} - -message GetHistoricalMintDataResponse { - Result result = 1; - enum Result { - OK = 0; - - // The requested mint or currency was not found - NOT_FOUND = 1; - - // No data available for the requested time range - MISSING_DATA = 2; - } - - repeated HistoricalMintData data = 2; -} - -message StreamLiveMintDataRequest { - oneof type { - option (validate.required) = true; - - Request request = 1; - common.v1.ClientPong pong = 2; - } - - message Request { - // The set of mints to receive live data against. To update the set of mints, - // close the current stream and open a new one with the new set. - repeated common.v1.SolanaAccountId mints = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 // Arbitrary - }]; - } -} - -message StreamLiveMintDataResponse { - oneof type { - option (validate.required) = true; - - LiveData data = 1; - common.v1.ServerPing ping = 2; - } - - message LiveData { - oneof type { - option (validate.required) = true; - - VerifiedCoreMintFiatExchangeRateBatch core_mint_fiat_exchange_rates = 1; - VerifiedLaunchapdCurrencyReserveStateBatch launchpad_currency_reserve_states = 2; - } - } -} - -message Mint { - // Token mint address - common.v1.SolanaAccountId address = 1 [(validate.rules).message.required = true]; - - // The number of decimals configured for the mint - uint32 decimals = 2; - - // Currency name - string name = 3 [(validate.rules).string = { - min_len: 1, - max_len: 32, - }]; - - // Currency ticker symbol - string symbol = 4 [(validate.rules).string = { - min_len: 1, - max_len: 8, - }]; - - // Currency description - string description = 5 [(validate.rules).string = { - min_len: 1, - max_len: 4096, - }]; - - // URL to currency image - string image_url = 6 [(validate.rules).string = { - min_len: 1, - max_len: 1024, - }]; - - // Available when a VM exists for the given mint, and can be used for deriving - // VM deposit PDAs - // - // Note: Only currencies with a VM are useable for payments - VmMetadata vm_metadata = 7; - - // Available when created by the launchpad via the currency creator program, and - // can be used for calculating price, market cap, etc. based on the exponential - // bonding curve - LaunchpadMetadata launchpad_metadata = 8; - - // Timestamp the currency was created - google.protobuf.Timestamp created_at = 9 [(validate.rules).timestamp.required = true]; - - // Social links for this currency - repeated SocialLink social_links = 10 [(validate.rules).repeated = { - min_items: 0 - max_items: 32 // Arbitrary - }]; - - // Bill customization for this currency. Use the default if not provided - BillCustomization bill_customization = 11; - - // Holder metrics. This is surfaced where needed (e.g. only in the Discover RPC) - HolderMetrics holder_metrics = 12; - - // Market cap metrics. This is surfaced where needed (e.g. only in the Discover RPC) - MarketCapMetrics market_cap_metrics = 13; -} - -message VmMetadata { - // VM address - common.v1.SolanaAccountId vm = 1 [(validate.rules).message.required = true]; - - // Authority that subsidizes and authorizes all transactions against the VM - common.v1.SolanaAccountId authority = 2 [(validate.rules).message.required = true]; - - // Lock duration of Virtual Timelock Accounts on the VM, currently hardcoded - // to 21 days - uint32 lock_duration_in_days = 3 [(validate.rules).uint32.const = 21]; - - // VM omnibus address - common.v1.SolanaAccountId omnibus = 4 [(validate.rules).message.required = true]; -} - -message LaunchpadMetadata { - // The address of the currency config - common.v1.SolanaAccountId currency_config = 1 [(validate.rules).message.required = true]; - - // The address of the liquidity pool - common.v1.SolanaAccountId liquidity_pool = 2 [(validate.rules).message.required = true]; - - // The random seed used during currency creation - common.v1.SolanaAccountId seed = 3 [(validate.rules).message.required = true]; - - // The address of the authority for the currency - common.v1.SolanaAccountId authority = 4 [(validate.rules).message.required = true]; - - // The address where this mint's tokens are locked against the liquidity pool - common.v1.SolanaAccountId mint_vault = 5 [(validate.rules).message.required = true]; - - // The address where core mint tokens are locked against the liquidity pool - common.v1.SolanaAccountId core_mint_vault = 6 [(validate.rules).message.required = true]; - - // Current circulating mint token supply in quarks - uint64 supply_from_bonding = 7; - - // Precent fee for sells in basis points, currently hardcoded to 1% - uint32 sell_fee_bps = 8 [(validate.rules).uint32.const = 100]; - - // The current price in USD - double price = 9; - - // The current market capitalization in USD - double market_cap = 10; -} - -message HistoricalMintData { - // Timestamp for this data point - google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true]; - - // Market capitalization at this point in time - double market_cap = 2; -} - -message CoreMintFiatExchangeRate { - // The currency code for the fiat exchange rate - string currency_code = 1 [(validate.rules).string = { - pattern: "^[a-z]{3,4}$" - }]; - - // The exchange rate against the core mint - double exchange_rate = 2; - - // Timestamp for this data point - google.protobuf.Timestamp timestamp = 3 [(validate.rules).timestamp.required = true]; -} - -// CoreMintFiatExchangeRate with a server signature for proof for use in a payment -message VerifiedCoreMintFiatExchangeRate { - CoreMintFiatExchangeRate exchange_rate = 1 [(validate.rules).message.required = true]; - - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; -} - -message VerifiedCoreMintFiatExchangeRateBatch { - repeated VerifiedCoreMintFiatExchangeRate exchange_rates = 2 [(validate.rules).repeated = { - min_items: 1 - max_items: 256 // Arbitrary - }]; -} - -message LaunchpadCurrencyReserveState { - // Launchpad currency mint address - common.v1.SolanaAccountId mint = 1 [(validate.rules).message.required = true]; - - // Current circulating mint token supply in quarks - uint64 supply_from_bonding = 2; - - // Timestamp for this data point - google.protobuf.Timestamp timestamp = 3 [(validate.rules).timestamp.required = true]; -} - -// LaunchpadCurrencyReserveState with a server signature for proof for use in a payment -message VerifiedLaunchpadCurrencyReserveState { - LaunchpadCurrencyReserveState reserve_state = 1 [(validate.rules).message.required = true];; - - common.v1.Signature signature = 2 [(validate.rules).message.required = true];; -} - -message VerifiedLaunchapdCurrencyReserveStateBatch { - repeated VerifiedLaunchpadCurrencyReserveState reserve_states = 2 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 // Arbitrary - }]; -} - -message SocialLink { - oneof type { - option (validate.required) = true; - - Website website = 1; - X x = 2; - Telegram telegram = 3; - Discord discord = 4; - } - - message Website { - string url = 1 [(validate.rules).string = { - uri: true, - max_len: 2048, - }]; - } - - message X { - string username = 1 [(validate.rules).string = { - min_len: 1, - max_len: 15, - pattern: "^[a-zA-Z0-9_]+$", - }]; - } - - message Telegram { - // Telegram username (without the @ prefix) - string username = 1 [(validate.rules).string = { - min_len: 1, - max_len: 32, - pattern: "^[a-zA-Z0-9_]+$", - }]; - } - - message Discord { - // Discord invite code (e.g. "abc123" from discord.gg/abc123) - string invite_code = 1 [(validate.rules).string = { - min_len: 1, - max_len: 32, - pattern: "^[a-zA-Z0-9]+$", - }]; - } -} - -message BillCustomization { - // Bill background colors (from top to bottom) - repeated Color colors = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 3 - }]; -} - -message Color { - // Hex colour value (e.g. "#19191A") - string hex = 1 [(validate.rules).string = { - pattern: "^#[0-9a-fA-F]{6}$" - }]; -} - -message HolderMetrics { - // The current number of holders for a currency - uint64 current_holders = 1; - - repeated DeltaHolders holder_deltas = 2 [(validate.rules).repeated = { - min_items: 0 - max_items: 4 - }]; - - message DeltaHolders { - // Predefined range where delta is calculated from - PredefinedRange range = 1; - - // Net holders within the time range - int64 delta = 2; - } -} - -message MarketCapMetrics { - // The current market capitalization in USD for a currency - double current_market_cap = 1; - - repeated DeltaMarketCap market_cap_deltas = 2 [(validate.rules).repeated = { - min_items: 0 - max_items: 4 - }]; - - message DeltaMarketCap { - // Predefined range where delta is calculated from - PredefinedRange range = 1; - - // Net change in market capitalization in USD within the time range - double delta = 2; - } -} - -message LaunchRequest { - // The owner account launching the currency - common.v1.SolanaAccountId owner = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(LaunchRequest) without this field set - // using the private key of the owner account. This provides an authentication - // mechanism to the RPC. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; - - // The name of the currency to launch. Must be printable ASCII with no - // leading or trailing spaces. - string name = 3 [(validate.rules).string = { - min_len: 1, - max_len: 32, - // [!-~] = printable ASCII excluding space; [ -~] = printable ASCII including space - pattern: "^[!-~]([ -~]*[!-~])?$", - }]; - - // The ticker symbol for the currency. Must be printable ASCII with no - // spaces. If not provided, a default will be generated using the currency - // name. - string symbol = 4 [(validate.rules).string = { - max_len: 8, - // [!-~] = printable ASCII excluding space - pattern: "^[!-~]*$", - }]; - - // Optional description - string description = 5 [(validate.rules).string = { - max_len: 4096, - }]; - - // Optional bill customization. If not provided, a default will be set. - BillCustomization bill_customization = 6; - - // The raw image data for the icon. If not provided, a default will be set. - bytes icon = 7 [(validate.rules).bytes = { - max_len: 1048576, // 1 MB - }]; - - // Attestation that the name passed moderation - ModerationAttestation name_moderation_attestation = 8 [(validate.rules).message.required = true]; - - // Attestation that the symbol, if provided, passed moderation - ModerationAttestation symbol_moderation_attestation = 9; - - // Attestation that the descritpion, if provided, passed moderation - ModerationAttestation description_moderation_attestation = 10; - - // Attestation that the icon image, if provided, passed moderation - ModerationAttestation icon_moderation_attestation = 11; -} - -message LaunchResponse { - Result result = 1; - enum Result { - OK = 0; - // The launch was denied - DENIED = 1; - // A similar currency already exists - NAME_EXISTS = 2; - // Provided icon is invalid - INVALID_ICON = 3; - } - - // The mint address of the launched currency on success - common.v1.SolanaAccountId mint = 2; -} - -message UpdateIconRequest { - // The owner account of the currency - common.v1.SolanaAccountId owner = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(UpdateIconRequest) without this field set - // using the private key of the owner account. This provides an authentication - // mechanism to the RPC. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; - - // The mint address of the currency to update - common.v1.SolanaAccountId mint = 3 [(validate.rules).message.required = true]; - - // The raw image data for the icon - bytes icon = 4 [(validate.rules).bytes = { - min_len: 1, - max_len: 1048576, // 1 MB - }]; - - // Attestation that the icon image passed moderation - ModerationAttestation moderation_attestation = 5 [(validate.rules).message.required = true]; -} - -message UpdateIconResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - DENIED = 2; - INVALID_ICON = 3; - } -} - -message UpdateMetadataRequest { - // The owner account of the currency - common.v1.SolanaAccountId owner = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(UpdateMetadataRequest) without this field set - // using the private key of the owner account. This provides an authentication - // mechanism to the RPC. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; - - // The mint address of the currency to update - common.v1.SolanaAccountId mint = 3 [(validate.rules).message.required = true]; - - // Updated currency description. If not provided, description is not updated. - DescriptionUpdate new_description = 4; - - // Updated bill customization. If not provided, bill customization is not updated. - BillCustomizationUpdate new_bill_customization = 5; - - // Updated social links. This replaces the entire set of social links. If not - // provided, social links are not updated. - SocialLinksUpdate new_social_links = 6; - - message DescriptionUpdate { - string value = 1 [(validate.rules).string = { - min_len: 1, - max_len: 4096, - }]; - - // Attestation that the description passed moderation - ModerationAttestation moderation_attestation = 2 [(validate.rules).message.required = true]; - } - - message BillCustomizationUpdate { - BillCustomization value = 1 [(validate.rules).message.required = true]; - } - - message SocialLinksUpdate { - repeated SocialLink value = 1 [(validate.rules).repeated = { - min_items: 0 - max_items: 32 // Arbitrary - }]; - } -} - -message UpdateMetadataResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - DENIED = 2; - } -} - -message DiscoverRequest { - Category category = 1; - enum Category { - POPULAR = 0; - NEW = 1; - } -} - -message DiscoverResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - } - - repeated Mint mints = 2 [(validate.rules).repeated = { - min_items: 0 - max_items: 1024 // Arbitrary - }]; -} - -message CheckAvailabilityRequest { - // The currency name to check availability for - string name = 1 [(validate.rules).string = { - min_len: 1, - max_len: 32, - // [!-~] = printable ASCII excluding space; [ -~] = printable ASCII including space - pattern: "^[!-~]([ -~]*[!-~])?$", - }]; -} - -message CheckAvailabilityResponse { - Result result = 1; - enum Result { - OK = 0; - } - - // Whether the name is available for use - bool is_available = 2; -} - -enum PredefinedRange { - ALL_TIME = 0; - LAST_DAY = 1; - LAST_WEEK = 2; - LAST_MONTH = 3; - LAST_YEAR = 4; -} - -message ModerationAttestation { - bytes raw_value = 1 [(validate.rules).bytes = { - min_len: 1, - max_len: 4096, - }]; -} \ No newline at end of file diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/messaging/v1/ocp_messaging_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/messaging/v1/ocp_messaging_service.proto deleted file mode 100644 index 3d7b445d5..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/messaging/v1/ocp_messaging_service.proto +++ /dev/null @@ -1,246 +0,0 @@ -syntax = "proto3"; - -package ocp.messaging.v1; - -option go_package = "github.com/code-payments/ocp-protobuf-api/generated/go/messaging/v1;messaging"; -option java_package = "com.codeinc.gen.messaging.v1"; -option objc_class_prefix = "CPBMessagingV1"; - -import "common/v1/model.proto"; -import "currency/v1/ocp_currency_service.proto"; -import "transaction/v1/ocp_transaction_service.proto"; -import "validate/validate.proto"; - -service Messaging { - // OpenMessageStream opens a stream of messages. Messages are routed using the - // public key of a rendezvous keypair derived by both the sender and the - // recipient of the messages. The sender may be a client or server. - // - // Messages are expected to be acked once they have been processed by the client. - // Ack'd messages will no longer be delivered on future OpenMessageStream calls, - // and are eligible for deletion from the service. Clients should, however, handle - // duplicate delivery of messages. - // - // For giving/grabbing a bill, the expected flow is as follows: - // 1. The payment sender creates a multi-mint cash scan code. - // 2. The payment sender calls OpenMessageStream on the rendezvous public key. - // 3. The payment sender uses SendMessage to send the mint in a RequestToGiveBill message. - // 4. The payment sender shows the bill with the scan code containing the rendezvous public key. - // 4. The payment recipient scans the code. - // 5. The payment recipient uses PollMessages to get the RequestToGiveBill message from part 3. - // 6. The payment recipient sends the destination address in a RequestToGrabBill message. - // 7. The payment sender receives the RequestToGrabBill message in real time, submits the intent - // for the payment to the provided destination, and then closes the stream. - rpc OpenMessageStream(OpenMessageStreamRequest) returns (stream OpenMessageStreamResponse); - - // OpenMessageStreamWithKeepAlive is like OpenMessageStream, but enables a ping/pong - // keepalive to determine the health of the stream at both the client and server. - // - // The keepalive protocol is as follows: - // 1. Client initiates a stream by sending an OpenMessageStreamRequest. - // 2. Upon stream initialization, server begins the keepalive protocol. - // 3. Server sends a ping to the client. - // 4. Client responds with a pong as fast as possible, making note of - // the delay for when to expect the next ping. - // 5. Steps 3 and 4 are repeated until the stream is explicitly terminated - // or is deemed to be unhealthy. - // - // Client notes: - // * Client should be careful to process messages async, so any responses to pings are - // not delayed. - // * Clients should implement a reasonable backoff strategy upon continued timeout failures. - // * Clients that abuse pong messages may have their streams terminated by server. - // - // At any point in the stream, server will respond with messages in real time as - // they are observed. Messages sent over the stream should not affect the ping/pong - // protocol timings. Individual protocols for payment flows remain the same, and are - // documented in OpenMessageStream. - // - // Note: This API will enforce OpenMessageStreamRequest.signature is set as part of migration - // to this newer protocol - rpc OpenMessageStreamWithKeepAlive(stream OpenMessageStreamWithKeepAliveRequest) returns (stream OpenMessageStreamWithKeepAliveResponse); - - // PollMessages is like OpenMessageStream, but uses a polling flow for receiving - // messages. Updates are not real-time and depedent on the polling interval. - // This RPC supports all message types. - // - // This is a temporary RPC until OpenMessageStream can be built out generically on - // both client and server, while supporting things like multiple listeners. - rpc PollMessages(PollMessagesRequest) returns (PollMessagesResponse); - - // AckMessages acks one or more messages that have been successfully delivered to - // the client. - rpc AckMessages(AckMessagesRequest) returns (AckMesssagesResponse); - - // SendMessage sends a message. - rpc SendMessage(SendMessageRequest) returns (SendMessageResponse); -} - -message OpenMessageStreamRequest { - RendezvousKey rendezvous_key = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(OpenMessageStreamRequest) using rendezvous_key. - // - // todo: Make required once clients migrate - common.v1.Signature signature = 2 [(validate.rules).message.required = false]; -} - -message OpenMessageStreamResponse { - repeated Message messages = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 - }]; -} - -message OpenMessageStreamWithKeepAliveRequest { - oneof request_or_pong { - option (validate.required) = true; - - OpenMessageStreamRequest request = 1; - common.v1.ClientPong pong = 2; - } -} - -message OpenMessageStreamWithKeepAliveResponse { - oneof response_or_ping { - option (validate.required) = true; - - OpenMessageStreamResponse response = 1; - common.v1.ServerPing ping = 2; - } -} - -message PollMessagesRequest { - RendezvousKey rendezvous_key = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(PollMessagesRequest) using rendezvous_key. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; -} - -message PollMessagesResponse { - repeated Message messages = 1 [(validate.rules).repeated = { - min_items: 0 - max_items: 1024 - }]; -} - -message AckMessagesRequest { - RendezvousKey rendezvous_key = 1 [(validate.rules).message.required = true]; - - repeated MessageId message_ids = 2 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 - }]; -} - -message AckMesssagesResponse { - Result result = 1; - enum Result { - OK = 0; - } -} - -message SendMessageRequest { - // The message to send. Types of messages clients can send are restricted. - Message message = 1 [(validate.rules).message.required = true]; - - // The rendezvous key that the message should be routed to. - RendezvousKey rendezvous_key = 2 [(validate.rules).message.required = true]; - - // The signature is of serialize(Message) using the PrivateKey of the keypair. - common.v1.Signature signature = 3 [(validate.rules).message.required = true]; -} - -message SendMessageResponse { - Result result = 1; - enum Result { - OK = 0; - NO_ACTIVE_STREAM = 1; - } - - // Set if result == OK. - MessageId message_id = 2; -} - -// RendezvousKey is a unique key pair, typically derived from a scan code payload, -// which is used to establish a secure communication channel anonymously to coordinate -// a flow using messages. -message RendezvousKey { - bytes value = 1 [(validate.rules).bytes = { - min_len: 32 - max_len: 32 - }]; -} - -// MessageId identifies a message. It is only guaranteed to be unique when -// paired with a destination (i.e. the rendezvous public key). -message MessageId { - bytes value = 1 [(validate.rules).bytes = { - min_len: 16 - max_len: 16 - }]; -} - -// Request that a pulled out bill be sent to the requested address. -// -// This message type is only initiated by clients. -message RequestToGrabBill { - // Requestor is the virtual token account on the VM to which a payment - // should be sent. - common.v1.SolanaAccountId requestor_account = 1 [(validate.rules).message.required = true]; -} - -message RequestToGiveBillServerContext { - // Mint metadata for the bill's mint - currency.v1.Mint mint_metadata = 1 [(validate.rules).message.required = true]; -} - -// Request that a bill be given in the desired mint -// -// This message type is only initiated by clients. -message RequestToGiveBill { - // The mint that the bill will be received in - common.v1.SolanaAccountId mint = 1 [(validate.rules).message.required = true]; - - // The validated exchange data that was used to compute the fiat value of the give - // to support subsequent gives. Clients should be aware of timeouts and dismiss a - // bill if the threshold is met. - transaction.v1.VerifiedExchangeData exchange_data = 2; -} - -message Message { - // MessageId is the Id of the message. This ID is generated by the - // server, and will _always_ be set when receiving a message. - // - // Server generates the message to: - // 1. Reserve the ability for any future ID changes - // 2. Prevent clients attempting to collide message IDs. - MessageId id = 1 [(validate.rules).message.required = false]; - - // The signature sent from SendMessageRequest, which will be injected by server. - // This enables clients to ensure no MITM attacks were performed to hijack contents - // of the typed message. This is only applicable for messages not generated by server. - common.v1.Signature send_message_request_signature = 2 [(validate.rules).message.required = false]; - - oneof kind { - option (validate.required) = true; - - // - // Section: Cash - // - - RequestToGrabBill request_to_grab_bill = 3; - RequestToGiveBill request_to_give_bill = 4; - } - - // Additional server-provided context for messages sent by client - AdditionalServerContext additional_context = 5; -} - -message AdditionalServerContext { - oneof type { - option (validate.required) = true; - - RequestToGiveBillServerContext request_to_give_bill = 1; - } -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/transaction/v1/ocp_transaction_service.proto b/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/transaction/v1/ocp_transaction_service.proto deleted file mode 100644 index 90f82f73e..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/transaction/v1/ocp_transaction_service.proto +++ /dev/null @@ -1,1433 +0,0 @@ -syntax = "proto3"; - -package ocp.transaction.v1; - -option go_package = "github.com/code-payments/ocp-protobuf-api/generated/go/transaction/v1;transaction"; -option java_package = "com.codeinc.gen.transaction.v1"; -option objc_class_prefix = "APBTransactionV1"; - -import "common/v1/model.proto"; -import "currency/v1/ocp_currency_service.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -service Transaction { - // SubmitIntent is the mechanism for client and server to agree upon a set of - // client actions to execute on the blockchain using the Code sequencer for - // fulfillment. - // - // Transactions and virtual instructions are never exchanged between client and server. - // Instead, the required accounts and arguments for instructions known to each actor are - // exchanged to allow independent and local construction. - // - // Client and server are expected to fully validate the intent. Proofs will - // be provided for any parameter requiring one. Signatures should only be - // generated after approval. - // - // This RPC is not a traditional streaming endpoint. It bundles two unary calls - // to enable DB-level transaction semantics. - // - // The high-level happy path flow for the RPC is as follows: - // 1. Client initiates a stream and sends SubmitIntentRequest.SubmitActions - // 2. Server validates the intent, its actions and metadata - // 3a. If there are transactions or virtual instructions requiring the user's signature, - // then server returns SubmitIntentResponse.ServerParameters - // 3b. Otherwise, server returns SubmitIntentResponse.Success and closes the - // stream - // 4. For each transaction or virtual instruction requiring the user's signature, the client - // locally constructs it, performs validation and collects the signature - // 5. Client sends SubmitIntentRequest.SubmitSignatures with the signature - // list generated from 4 - // 6. Server validates all signatures are submitted and are the expected values - // using locally constructed transactions or virtual instructions. - // 7. Server returns SubmitIntentResponse.Success and closes the stream - // In the error case: - // * Server will return SubmitIntentResponse.Error and close the stream - // * Client will close the stream - rpc SubmitIntent(stream SubmitIntentRequest) returns (stream SubmitIntentResponse); - - // GetIntentMetadata gets basic metadata on an intent. It can also be used - // to fetch the status of submitted intents. Metadata exists only for intents - // that have been successfully submitted. - rpc GetIntentMetadata(GetIntentMetadataRequest) returns (GetIntentMetadataResponse); - - // GetLimits gets limits for money moving intents for an owner account in an - // identity-aware manner - rpc GetLimits(GetLimitsRequest) returns (GetLimitsResponse); - - // CanWithdrawToAccount provides hints to clients for submitting withdraw intents. - // The RPC indicates if a withdrawal is possible, and how it should be performed. - rpc CanWithdrawToAccount(CanWithdrawToAccountRequest) returns (CanWithdrawToAccountResponse); - - // VoidGiftCard voids a gift card account by returning the funds to the funds back - // to the issuer via the auto-return action if it hasn't been claimed or already - // returned. - // - // Note: The RPC is idempotent. If the user already claimed/voided the gift card, or - // it is close to or is auto-returned, then OK will be returned. - rpc VoidGiftCard(VoidGiftCardRequest) returns (VoidGiftCardResponse); - - // StatefulSwap swaps tokens using a non-custodial state-management system. - // The high-level flow mirrors SubmitIntent closely. However, due to the - // unreliability of swaps, they do not fit within the broader intent system. - // This results in a few key differences: - // * Client is (potentially) involved in additional steps to complete the - // swap within the state machine - // * Transactions are submitted on a best-effort basis outside of the Code - // Sequencer - // * Balance changes are applied after the transaction has finalized - // - // Swap transaction signatures are collected up-front. They are executed once the - // swap is funded. - rpc StatefulSwap(stream StatefulSwapRequest) returns (stream StatefulSwapResponse); - - // StatelessSwap is like StatefulSwap, but without a state management system and a - // best-effort submission system. - rpc StatelessSwap(stream StatelessSwapRequest) returns (stream StatelessSwapResponse); - - // GetSwap gets metadata for a swap - rpc GetSwap(GetSwapRequest) returns (GetSwapResponse); - - // GetPendingSwaps gets swaps that are pending client actions which include: - // * Swaps that need a call to SubmitIntent to fund the VM swap PDA - rpc GetPendingSwaps(GetPendingSwapsRequest) returns (GetPendingSwapsResponse); -} - -// -// Request and Response Definitions -// - -message SubmitIntentRequest { - oneof request { - option (validate.required) = true; - - SubmitActions submit_actions = 1; - SubmitSignatures submit_signatures = 2; - } - - message SubmitActions { - // The globally unique client generated intent ID. Use the original intent - // ID when operating on actions that mutate the intent. - common.v1.IntentId id = 1 [(validate.rules).message.required = true]; - - // The verified owner account public key - common.v1.SolanaAccountId owner = 2 [(validate.rules).message.required = true]; - - // Additional metadata that describes the high-level intention - Metadata metadata = 3 [(validate.rules).message.required = true]; - - // The set of all ordered actions required to fulfill the intent - repeated Action actions = 4 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 // Arbitrary - }]; - - // The signature is of serialize(SubmitActions) without this field set using the - // private key of the owner account. This provides an authentication mechanism - // to the RPC. - common.v1.Signature signature = 5 [(validate.rules).message.required = true]; - } - - message SubmitSignatures { - // The set of all signatures for each transaction or virtual instruction requiring - // signature from the authority accounts. - // - // The signature for a transaction is for the marshalled transaction. - // The signature for a virtual instruction is the hash of the marshalled instruction. - repeated common.v1.Signature signatures = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 // Assumes at most 1 client signatures per action - }]; - } -} - -message SubmitIntentResponse { - oneof response { - option (validate.required) = true; - - ServerParameters server_parameters = 1; - Success success = 2; - Error error = 3; - } - - message ServerParameters { - // The set of all server paremeters required to fill missing transaction - // or virtual instruction details. Server guarantees to provide a message - // for each client action in an order consistent with the received action - // list. - repeated ServerParameter server_parameters = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1024 // Arbitrary, but must match SubmitActions.actions.max_items - }]; - } - - message Success { - Code code = 1; - enum Code { - // The intent was successfully created and is now scheduled. - OK = 0; - } - } - - message Error { - Code code = 1; - enum Code { - // Denied by a guard (spam, money laundering, etc) - DENIED = 0; - // The intent is invalid. - INVALID_INTENT = 1; - // There is an issue with provided signatures. - SIGNATURE_ERROR = 2; - // Server detected client has stale state. - STALE_STATE = 3; - } - - repeated ErrorDetails error_details = 2; - } -} - -message GetIntentMetadataRequest { - // The intent ID to query - common.v1.IntentId intent_id = 1 [(validate.rules).message.required = true]; - - // The verified owner account public key when not signing with the rendezvous - // key. Only owner accounts involved in the intent can access the metadata. - common.v1.SolanaAccountId owner = 2; - - // The signature is of serialize(GetIntentStatusRequest) without this field set - // using the private key of the rendezvous or owner account. This provides an - // authentication mechanism to the RPC. - common.v1.Signature signature = 3 [(validate.rules).message.required = true]; -} - -message GetIntentMetadataResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - DENIED = 2; - } - - Metadata metadata = 2; -} - -message GetLimitsRequest { - // The owner account whose limits will be calculated. Any other owner accounts - // linked with the same identity of the owner will also be applied. - common.v1.SolanaAccountId owner = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(GetLimitsRequest) without this field set - // using the private key of the owner account. This provides an authentication - // mechanism to the RPC. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; - - // All transactions starting at this time will be incorporated into the consumed - // limit calculation. Clients should set this to the start of the current day in - // the client's current time zone (because server has no knowledge of this atm). - google.protobuf.Timestamp consumed_since = 3 [(validate.rules).timestamp.required = true]; -} - -message GetLimitsResponse { - Result result = 1; - enum Result { - OK = 0; - } - - // Send limits keyed by currency - map send_limits_by_currency = 2; - - // The amount of USD transacted since the consumption timestamp - double usd_transacted = 3 [(validate.rules).double.gte = 0];; -} - -message CanWithdrawToAccountRequest { - // The destination account attempted to be withdrawn to. Can be an owner or - // token account. - common.v1.SolanaAccountId account = 1 [(validate.rules).message.required = true]; - - // The mint that the withdraw will be operating against - common.v1.SolanaAccountId mint = 2 [(validate.rules).message.required = true];; -} - -message CanWithdrawToAccountResponse { - // Server-controlled flag to indicate if the account can be withdrawn to. - // There are several reasons server may deny it, including: - // - Wrong type of Code account - // - Unsupported external account type (eg. token account but of the wrong mint) - // This is guaranteed to be false when account_type = Unknown. - bool is_valid_payment_destination = 1; - - // Metadata so the client knows how to withdraw to the account. Server cannot - // provide precalculated addresses in this response to maintain non-custodial - // status. - AccountType account_type = 2; - enum AccountType { - Unknown = 0; // Server cannot determine - TokenAccount = 1; // Client uses the address as is in SubmitIntent - OwnerAccount = 2; // Client locally derives the ATA to use in SubmitIntent - } - - // ATA requires initialization before the withdrawal can occur. Server may not - // subsidize the account creation, so a fee may be required. - bool requires_initialization = 3; - - // The CREATE_ON_SEND_WITHDRAWAL fee, in USD, that must be paid in order to - // submit a withdrawal to subsidize the creation of the account at time of - // send. The user must explicitly agree to this fee amount before submitting - // the intent. - // - // This can be set when requires_initialization = true if server decides to - // not subsidize the token account creation. - // - // Note: The fee is always paid in the target mint. - ExchangeDataWithoutRate fee_amount = 4; -} - -message VoidGiftCardRequest { - // The owner account that issued the gift card account - common.v1.SolanaAccountId owner = 1 [(validate.rules).message.required = true]; - - // The vault of the gift card account to void - common.v1.SolanaAccountId gift_card_vault = 2 [(validate.rules).message.required = true]; - - // The signature is of serialize(VoidGiftCardRequest) without this field set using - // the private key of the owner account. This provides an authentication mechanism - // to the RPC. - common.v1.Signature signature = 3 [(validate.rules).message.required = true]; -} - -message VoidGiftCardResponse { - Result result = 1; - enum Result { - OK = 0; - // The owner account didn't issue the gift card accoun - DENIED = 1; - // A different owner account than the issuer claimed the gift card - CLAIMED_BY_OTHER_USER = 2; - // The gift card doesn't exist - NOT_FOUND = 3; - } -} - -message StatefulSwapRequest { - oneof request { - option (validate.required) = true; - - Initiate initiate = 1; - SubmitSignatures submit_signatures = 2; - } - - message Initiate { - oneof kind { - option (validate.required) = true; - - ReserveSwapClientParameters reserve = 1; - CoinbaseStableSwapperClientParameters stablecoin = 2; - } - - // Client parameters for starting swaps against the Reserve contract - message ReserveSwapClientParameters { - // The unique ID for this swap randomly generated on client - common.v1.SwapId id = 1 [(validate.rules).message.required = true]; - - // The source mint that will be swapped from - common.v1.SolanaAccountId from_mint = 2 [(validate.rules).message.required = true]; - - // The destination mint that will be swapped to - common.v1.SolanaAccountId to_mint = 3 [(validate.rules).message.required = true]; - - // The amount to swap from the source mint in quarks. - uint64 swap_amount = 4 [(validate.rules).uint64.gt = 0]; - - // Where "amount" of "from_mint" will be sent from to the VM swap PDA - FundingSource funding_source = 5 [(validate.rules).enum = { - in: [1, 2, 3] // FUNDING_SOURCE_SUBMIT_INTENT, FUNDING_SOURCE_EXTERNAL_WALLET, FUNDING_SOURCE_COINBASE_ONRAMP - }]; - - // The ID of the "transaction" to lookup funding state. - // - // For FUNDING_SOURCE_SUBMIT_INTENT, this value is the base58 encoded intent ID. - // For FUNDING_SOURCE_EXTERNAL_WALLET, this value is the base58 encoded transaction signature. - // For FUNDING_SOURCE_COINBASE_ONRAMP, this value is the order ID - string funding_id = 6 [(validate.rules).string = { - min_len: 32, - max_len: 88, - }]; - - // The fee amount to pay for this swap - // - // Note: Amounts are coordinated outside this RPC for user verifications - // and validated in this RPC. - uint64 fee_amount = 7; - - // Verified exchange data for flows that require a specific fiat value - // over the full amount (swap + fee). For intent fundings, it's expected - // that this exchange data will be used. - // - // Required for the following flows: - // - Initializing a new reserve currency outside of the core mint - VerifiedExchangeData full_amount_exchange_data = 8; - } - - // Client parameters for starting swaps against the Coinbase Stable Swaper program - message CoinbaseStableSwapperClientParameters { - // The unique ID for this swap randomly generated on client - common.v1.SwapId id = 1 [(validate.rules).message.required = true]; - - // The source mint that will be swapped from - // - // Note: Currently always the core mint - common.v1.SolanaAccountId from_mint = 2 [(validate.rules).message.required = true]; - - // The destination mint that will be swapped to - common.v1.SolanaAccountId to_mint = 3 [(validate.rules).message.required = true]; - - // The amount to swap from the source mint in quarks. - uint64 swap_amount = 4 [(validate.rules).uint64.gt = 0]; - - // Where "amount" of "from_mint" will be sent from to the VM swap PDA - FundingSource funding_source = 5 [(validate.rules).enum = { - in: [1] // FUNDING_SOURCE_SUBMIT_INTENT - }]; - - // The ID of the "transaction" to lookup funding state. - // - // For FUNDING_SOURCE_SUBMIT_INTENT, this value is the base58 encoded intent ID. - string funding_id = 6 [(validate.rules).string = { - min_len: 32, - max_len: 44, - }]; - - // Destination owner account where from_mint tokens will land. Use - // CanWithdrawToAccountResponse to determine if an account is an owner. - common.v1.SolanaAccountId destination_owner = 7 [(validate.rules).message.required = true]; - - // The fee amount to pay for this swap, which should be exactly - // CanWithdrawToAccountResponse.fee_amount - uint64 fee_amount = 8; - } - - // The owner account starting the swap - common.v1.SolanaAccountId owner = 9 [(validate.rules).message.required = true]; - - // The user authority account that will sign to authorize the swap. - // - // For Reserve contract buy/sell flows against existing currencies, this must be a random one-time use account. - // For Reserve contract buy flows against new currencies, this must be the owner account that is the currency creator. - // For Coinbase Stable Swapper swap flows, this must be a random one-time use account. - common.v1.SolanaAccountId swap_authority = 10 [(validate.rules).message.required = true]; - - // The signature of serialize(VerifiedSwapMetadata) for the swap being initiated. - common.v1.Signature proof_signature = 11 [(validate.rules).message.required = true]; - - // The signature is of serialize(StatefulSwapRequest.Initiate) without this field - // set using the private key of the owner account. This provides an authentication - // mechanism to the RPC. - common.v1.Signature signature = 12 [(validate.rules).message.required = true]; - } - - message SubmitSignatures { - // The signatures for the locally constructed swap transaction: - // - owner is at index 0 - // - swap_authority is at index 1 - repeated common.v1.Signature transaction_signatures = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 2 - }]; - } -} - -message StatefulSwapResponse { - oneof response { - option (validate.required) = true; - - ServerParameters server_parameters = 1; - Success success = 2; - Error error = 3; - } - - message ServerParameters { - oneof kind { - option (validate.required) = true; - - ReserveExistingCurrencyServerParameters reserve_existing_currency = 1; - ReserveNewCurrencyServerParameter reserve_new_currency = 2; - CoinbaseStableSwapperServerParameter stablecoin = 3; - } - - // Server parameters when executing stateful buy/sell flows against the - // Reserve contract against an existing currency - // - // Supported Solana transaction version: v0 - // - // Instruction formats: - // - // Buy Tokens (Core Mint -> Launchpad Currency Mint) without a buy fee: - // 1. System::AdvanceNonce - // 2. [Optional] ComputeBudget::SetComputeUnitLimit - // 3. [Optional] ComputeBudget::SetComputeUnitPrice - // 4. [Optional] Memo::Memo - // 5. AssociatedTokenAccount::CreateIdempotent (open Core Mint temporary account) - // 6. VM::TransferForSwap (Core Mint VM swap ATA -> Core Mint temporary account) - // 7. Reserve::BuyAndDepositIntoVm (bounded buy depositing to_mint tokens into the to_mint VM) - // 8. Token::CloseAccount (closes Core Mint temporary account) - // 9. VM::CloseSwapAccountIfEmpty (closes Core Mint VM swap ATA if empty) - // - // Buy Tokens (Core Mint -> Launchpad Currency Mint) with a buy fee, which - // is used when fee_amount is non-zero: - // 1. System::AdvanceNonce - // 2. [Optional] ComputeBudget::SetComputeUnitLimit - // 3. [Optional] ComputeBudget::SetComputeUnitPrice - // 4. [Optional] Memo::Memo - // 5. AssociatedTokenAccount::CreateIdempotent (open Core Mint temporary account) - // 6. VM::TransferForSwapWithFee (Core Mint VM swap ATA -> Core Mint temporary account (swap amount) and fee destination (fee amount)) - // 7. Reserve::BuyAndDepositIntoVm (bounded buy of the swap amount depositing to_mint tokens into the to_mint VM) - // 8. Token::CloseAccount (closes Core Mint temporary account) - // 9. VM::CloseSwapAccountIfEmpty (closes Core Mint VM swap ATA if empty) - // - // Sell Tokens (Launchpad Currency Mint -> Core Mint): - // 1. System::AdvanceNonce - // 2. [Optional] ComputeBudget::SetComputeUnitLimit - // 3. [Optional] ComputeBudget::SetComputeUnitPrice - // 4. [Optional] Memo::Memo - // 5. AssociatedTokenAccount::CreateIdempotent (open from_mint temporary account) - // 6. VM::TransferForSwap (from_mint VM swap ATA -> from_mint temporary account) - // 7. Reserve::SellAndDepositIntoVm (bounded sell depositing Core Mint into the Core Mint VM) - // 8. Token::CloseAccount (closes from_mint temporary account) - // 9. VM::CloseSwapAccountIfEmpty (closes from_mint swap PDA/ATA if empty) - // - // Swap Tokens (Launchpad Currency Mint -> Launchpad Currency Mint): - // 1. System::AdvanceNonce - // 2. [Optional] ComputeBudget::SetComputeUnitLimit - // 3. [Optional] ComputeBudget::SetComputeUnitPrice - // 4. [Optional] Memo::Memo - // 5. AssociatedTokenAccount::CreateIdempotent (open Core Mint temporary account) - // 6. AssociatedTokenAccount::CreateIdempotent (open from_mint temporary account) - // 7. VM::TransferForSwap (from_mint VM swap ATA -> from_mint temporary account) - // 8. Reserve::SellTokens (bounded sell transferring Core Mint into temporary account) - // 9. Reserve::BuyAndDepositIntoVm (unlimited buy depositing to_mint tokens into the to_mint VM) - // 10. Token::CloseAccount (closes Core Mint temporary account) - // 11. Token::CloseAccount (closes from_mint temporary account) - // 12. VM::CloseSwapAccountIfEmpty (closes from_mint VM swap ATA if empty) - message ReserveExistingCurrencyServerParameters { - // Subisdizer account that will be paying for the swap - common.v1.SolanaAccountId payer = 1 [(validate.rules).message.required = true]; - - // The nonce that is reserved for use in the swap transaction - common.v1.SolanaAccountId nonce = 2 [(validate.rules).message.required = true]; - - // The blockhash that is reserved for use in the swap transaction - common.v1.Blockhash blockhash = 3 [(validate.rules).message.required = true]; - - // ALTs that should be used when constructing the versioned transaction - repeated common.v1.SolanaAddressLookupTable alts = 4; - - // Compute unit limit provided to the ComputeBudget::SetComputeUnitLimit - // instruction. If the value is 0, then the instruction can be omitted. - uint32 compute_unit_limit = 5; - - // Compute unit price provided in the ComputeBudget::SetComputeUnitPrice - // instruction. If the value is 0, then the instruction can be omitted. - uint64 compute_unit_price = 6; - - // Value provided into the Memo::Memo instruction. If the value length is 0, - // then the instruction can be omitted. - string memo_value = 7 [(validate.rules).string.max_len = 64]; - - // The memory account where the destination virtual Timelock account lives - common.v1.SolanaAccountId memory_account = 8 [(validate.rules).message.required = true]; - - // The memory index where the destination virtual Timelock account lives - uint32 memory_index = 9; - - // Destination account where the buy fee should be paid. Only set when - // a non-zero fee_amount was provided in the client parameters. - common.v1.SolanaAccountId fee_destination = 10; - } - - // Server parameters when executing stateful buy flows against the - // Reserve contract against a new currency. Only the creator of the - // currency will be able to execute this flow. - // - // Supported Solana transaction version: v0 - // - // Instruction format (paying with Core Mint): - // 1. System::AdvanceNonce - // 2. [Optional] ComputeBudget::SetComputeUnitLimit - // 3. [Optional] ComputeBudget::SetComputeUnitPrice - // 4. [Optional] Memo::Memo - // 5. Reserve::InitializeCurrency - // 6. Reserve::InitializePool - // 7. VM::InitializeVm - // 8. AssociatedTokenAccount::CreateIdempotent (open owner's Core Mint ATA) - // 9. AssociatedTokenAccount::CreateIdempotent (open owner's to_mint VM Deposit ATA) - // 10. VM::TransferForSwapWithFee (Core Mint VM swap ATA -> owner's Core Mint ATA (swap amount) and fee destination (fee amount)) - // 11. Reserve::BuyTokens (limited buy transferring to_mint tokens into the to_mint VM Deposit ATA) - // 12. Token::CloseAccount (closes owner's Core Mint ATA) - // - // Instruction format (all other cases): - // 1. System::AdvanceNonce - // 2. [Optional] ComputeBudget::SetComputeUnitLimit - // 3. [Optional] ComputeBudget::SetComputeUnitPrice - // 4. [Optional] Memo::Memo - // 5. AssociatedTokenAccount::CreateIdempotent (open treasury's from_mint ATA) - // 6. VM::TransferForSwapWithFee (from_mint VM swap ATA -> treasury's from_mint ATA (swap + fee amount)) - // 7. Reserve::SellTokens (limited sell of the full swap + fee amount, transferring the Core Mint value into the fee destination) - // 8. Reserve::BuyTokens (limited buy funded by the treasury's Core Mint ATA, transferring to_mint tokens into the to_mint VM Deposit ATA) - // - // Note: The currency, VM and to_mint VM Deposit ATA will be initialized prior to - // executing this transaction. Atomicity cannot be guaranteed due to transaction - // size limits, which will be revisited when the v1 transaction format is released. - // - // Note: Client should verify that the new currency's mint address matches that derived - // from using these server parameters. - message ReserveNewCurrencyServerParameter { - // Subisdizer account that will be paying for the swap - common.v1.SolanaAccountId payer = 1 [(validate.rules).message.required = true]; - - // The nonce that is reserved for use in the swap transaction - common.v1.SolanaAccountId nonce = 2 [(validate.rules).message.required = true]; - - // The blockhash that is reserved for use in the swap transaction - common.v1.Blockhash blockhash = 3 [(validate.rules).message.required = true]; - - // ALTs that should be used when constructing the versioned transaction - repeated common.v1.SolanaAddressLookupTable alts = 4; - - // Compute unit limit provided to the ComputeBudget::SetComputeUnitLimit - // instruction. If the value is 0, then the instruction can be omitted. - uint32 compute_unit_limit = 5; - - // Compute unit price provided in the ComputeBudget::SetComputeUnitPrice - // instruction. If the value is 0, then the instruction can be omitted. - uint64 compute_unit_price = 6; - - // Value provided into the Memo::Memo instruction. If the value length is 0, - // then the instruction can be omitted. - string memo_value = 7 [(validate.rules).string.max_len = 64]; - - // The VM and currency authority - common.v1.SolanaAccountId authority = 8 [(validate.rules).message.required = true]; - - // The currency name - string name = 9 [(validate.rules).string = { - min_len: 1, - max_len: 32, - }]; - - // The currency symbol - string symbol = 10 [(validate.rules).string = { - min_len: 1, - max_len: 8, - }]; - - // The random seed value used to generate a unique currency of the given name - common.v1.SolanaAccountId seed = 11 [(validate.rules).message.required = true]; - - // Liquidity pool's percent sell fee in basis points - uint32 sell_fee_bps = 12 [(validate.rules).uint32.const = 100]; - - // The VM lock duration - uint32 vm_lock_duration_in_days = 13 [(validate.rules).uint32.const = 21]; - - // Destination account where fee should be paid - common.v1.SolanaAccountId fee_destination = 14 [(validate.rules).message.required = true]; - - // Server-controlled treasury for flows that require it - common.v1.SolanaAccountId treasury = 15; - - // The amount of core mint tokens used for purchase. Client should - // validate this is as expected based on a pre-coordinated amount - // accepted by the user. - uint64 treasury_purchase_amount = 16; - } - - // Server parameters when executing stateful swap flows against the - // Coinbase Stable Swapper program. - // - // Supported Solana transaction version: v0 - // - // Instruction format: - // 1. System::AdvanceNonce - // 2. [Optional] ComputeBudget::SetComputeUnitLimit - // 3. [Optional] ComputeBudget::SetComputeUnitPrice - // 4. [Optional] Memo::Memo - // 5. AssociatedTokenAccount::CreateIdempotent (open swap authority's from_mint ATA) - // 6. AssociatedTokenAccount::CreateIdempotent (open destination owner's to_mint ATA) - // 7. VM::TransferForSwapWithFee (from_mint VM swap ATA -> swap authority's from_mint ATA (swap amount) and fee destination (fee amount)) - // 8. CoinbaseStableSwapper::Swap (from_mint swap authority ATA -> to_mint destination owner ATA) - // 9. Token::CloseAccount (closes swap authority's from_mint ATA) - message CoinbaseStableSwapperServerParameter { - // Subisdizer account that will be paying for the swap - common.v1.SolanaAccountId payer = 1 [(validate.rules).message.required = true]; - - // The nonce that is reserved for use in the swap transaction - common.v1.SolanaAccountId nonce = 2 [(validate.rules).message.required = true]; - - // The blockhash that is reserved for use in the swap transaction - common.v1.Blockhash blockhash = 3 [(validate.rules).message.required = true]; - - // ALTs that should be used when constructing the versioned transaction - repeated common.v1.SolanaAddressLookupTable alts = 4; - - // Compute unit limit provided to the ComputeBudget::SetComputeUnitLimit - // instruction. If the value is 0, then the instruction can be omitted. - uint32 compute_unit_limit = 5; - - // Compute unit price provided in the ComputeBudget::SetComputeUnitPrice - // instruction. If the value is 0, then the instruction can be omitted. - uint64 compute_unit_price = 6; - - // Value provided into the Memo::Memo instruction. If the value length is 0, - // then the instruction can be omitted. - string memo_value = 7 [(validate.rules).string.max_len = 64]; - - // Destination account where fee should be paid - common.v1.SolanaAccountId fee_destination = 8 [(validate.rules).message.required = true]; - - // The CoinbaseStableSwapper liquidity pool's configured fee recipient, - // sourced from the on-chain LiquidityPool account. Required by the - // CoinbaseStableSwapper::Swap instruction. - common.v1.SolanaAccountId pool_fee_recipient = 9 [(validate.rules).message.required = true]; - } - } - - message Success { - Code code = 1; - enum Code { - OK = 0; - } - } - - message Error { - Code code = 1; - enum Code { - // Denied by a guard (spam, money laundering, etc) - DENIED = 0; - // There is an issue with the provided proof or transaction signatures - SIGNATURE_ERROR = 1; - // The swap metadata failed server-side validation - INVALID_SWAP = 2; - } - - repeated ErrorDetails error_details = 2; - } -} - -message StatelessSwapRequest { - oneof request { - option (validate.required) = true; - - Initiate initiate = 1; - SubmitSignatures submit_signatures = 2; - } - - message Initiate { - oneof kind { - option (validate.required) = true; - - CoinbaseStableSwapperClientParameters stablecoin = 1; - } - - // Client parameters for stateless swaps via the Coinbase Stable - // Swapper program. Source funds are drawn from the owner's source-mint - // ATA; destination is the owner's destination-mint VM Deposit ATA. - message CoinbaseStableSwapperClientParameters { - // The source mint that will be swapped from. - common.v1.SolanaAccountId from_mint = 1 [(validate.rules).message.required = true]; - - // The destination mint that will be swapped to. - common.v1.SolanaAccountId to_mint = 2 [(validate.rules).message.required = true]; - - // The amount to swap from the source mint in quarks. - uint64 swap_amount = 3 [(validate.rules).uint64.gt = 0]; - } - - // The owner account that owns the source ATA and the destination VM - // Deposit ATA. The owner is the sole client-side signer of the swap - // transaction. - common.v1.SolanaAccountId owner = 2 [(validate.rules).message.required = true]; - - // If true, server waits until the swap transaction is finalized before - // returning Success. If false, server returns Success as soon as the - // transaction is submitted to the cluster. - bool wait_for_finalization = 3; - - // The signature is of serialize(StatelessSwapRequest.Initiate) without - // this field set using the private key of the owner account. This - // provides an authentication mechanism to the RPC. - common.v1.Signature signature = 4 [(validate.rules).message.required = true]; - } - - message SubmitSignatures { - // The owner's signature over the locally constructed swap transaction. - repeated common.v1.Signature transaction_signatures = 1 [(validate.rules).repeated = { - min_items: 1 - max_items: 1 - }]; - } -} - -message StatelessSwapResponse { - oneof response { - option (validate.required) = true; - - ServerParameters server_parameters = 1; - Success success = 2; - Error error = 3; - } - - message ServerParameters { - oneof kind { - option (validate.required) = true; - - CoinbaseStableSwapperServerParameter stablecoin = 1; - } - - // Server parameters for executing stateless swap flows against the - // Coinbase Stable Swapper program. - // - // Supported Solana transaction version: v0 - // - // Instruction format: - // 1. [Optional] ComputeBudget::SetComputeUnitLimit - // 2. [Optional] ComputeBudget::SetComputeUnitPrice - // 3. [Optional] Memo::Memo - // 4. AssociatedTokenAccount::CreateIdempotent (open owner's to_mint VM Deposit ATA) - // 5. CoinbaseStableSwapper::Swap (owner's from_mint ATA -> owner's to_mint VM Deposit ATA) - message CoinbaseStableSwapperServerParameter { - // Subsidizer account that will pay the transaction fee. - common.v1.SolanaAccountId payer = 1 [(validate.rules).message.required = true]; - - // The Solana blockhash to set on the transaction. This is a - // regular recent blockhash, not a durable nonce. - common.v1.Blockhash blockhash = 2 [(validate.rules).message.required = true]; - - // ALTs that should be used when constructing the versioned transaction - repeated common.v1.SolanaAddressLookupTable alts = 3; - - // Compute unit limit provided to the ComputeBudget::SetComputeUnitLimit - // instruction. If the value is 0, then the instruction can be omitted. - uint32 compute_unit_limit = 4; - - // Compute unit price provided in the ComputeBudget::SetComputeUnitPrice - // instruction. If the value is 0, then the instruction can be omitted. - uint64 compute_unit_price = 5; - - // Value provided into the Memo::Memo instruction. If the value length is 0, - // then the instruction can be omitted. - string memo_value = 6 [(validate.rules).string.max_len = 64]; - - // The CoinbaseStableSwapper liquidity pool's configured fee recipient, - // sourced from the on-chain LiquidityPool account. Required by the - // CoinbaseStableSwapper::Swap instruction. - common.v1.SolanaAccountId pool_fee_recipient = 7 [(validate.rules).message.required = true]; - } - } - - message Success { - Code code = 1; - enum Code { - // Transaction was forwarded to the cluster. Returned when - // wait_for_finalization = false. - SUBMITTED = 0; - // Transaction was finalized on-chain. Returned when - // wait_for_finalization = true. - FINALIZED = 1; - } - - // The signature of the submitted swap transaction. Clients may use - // this to look up the transaction on-chain. - common.v1.Signature transaction_signature = 2 [(validate.rules).message.required = true]; - } - - message Error { - Code code = 1; - enum Code { - // Denied by a guard (spam, money laundering, etc) - DENIED = 0; - // There is an issue with the provided transaction signature - SIGNATURE_ERROR = 1; - // The swap parameters failed server-side validation (eg. - // unsupported mint pair, insufficient source balance, swap amount - // out of allowed range) - INVALID_SWAP = 2; - // The transaction was submitted but reverted on-chain, or its - // blockhash expired before confirmation. Only relevant when - // wait_for_finalization = true. - TRANSACTION_FAILED = 3; - } - - repeated ErrorDetails error_details = 2; - } -} - -message GetSwapRequest { - common.v1.SwapId id = 1 [(validate.rules).message.required = true]; - - common.v1.SolanaAccountId owner = 2 [(validate.rules).message.required = true]; - - // The signature is of serialize(GetSwapRequest) without this field set using the - // private key of the owner account. This provides an authentication mechanism - // to the RPC. - common.v1.Signature signature = 3 [(validate.rules).message.required = true]; -} - -message GetSwapResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - DENIED = 2; - } - - SwapMetadata swap = 2; -} - -message GetPendingSwapsRequest{ - common.v1.SolanaAccountId owner = 1 [(validate.rules).message.required = true]; - - // The signature is of serialize(GetPendingSwapsRequest) without this field set - // using the private key of the owner account. This provides an authentication - // mechanism to the RPC. - common.v1.Signature signature = 2 [(validate.rules).message.required = true]; -} - -message GetPendingSwapsResponse { - Result result = 1; - enum Result { - OK = 0; - NOT_FOUND = 1; - } - - repeated SwapMetadata swaps = 2 [(validate.rules).repeated = { - max_items: 1024 // Arbitrary - }]; -} - -// -// Metadata definitions -// - -// Metadata describes the high-level details of an intent -message Metadata { - oneof type { - option (validate.required) = true; - - OpenAccountsMetadata open_accounts = 1; - SendPublicPaymentMetadata send_public_payment = 2; - ReceivePaymentsPubliclyMetadata receive_payments_publicly = 3; - PublicDistributionMetadata public_distribution = 4; - } - - // Optional app-level metadata - AppMetadata app_metadata = 10; -} - -// Open a set of accounts -// -// Action Spec (User): -// -// for account in [PRIMARY] -// actions.push_back(OpenAccountAction(account)) -// -// Action Spec (Pool): -// -// for account in [POOL] -// actions.push_back(OpenAccountAction(account)) -message OpenAccountsMetadata { - AccountSet account_set = 1 [(validate.rules).enum.defined_only = true]; - enum AccountSet { - USER = 0; // Opens a set of user accounts - POOL = 1; // Opens a pool account - } - - - // The mint that this action will be operating against - common.v1.SolanaAccountId mint = 2 [(validate.rules).message.required = true];; -} - -// Send a payment to a destination account publicly. -// -// Action Spec (Payment): -// -// actions = [NoPrivacyTransferAction(PRIMARY, destination, ExchangeData.Quarks)] -// -// Action Spec (Withdrawal): -// -// actions = [NoPrivacyTransferAction(PRIMARY, destination, ExchangeData.Quarks)] -// if destinationRequiresInitialization { -// actions[0].NoPrivacyTransferAction.ExchangeData.Quarks -= feeAmount -// actions.push_back(FeePaymentAction(PRIMARY, feeAccount, feeAmount)) -// } -// -// Action Spec (Indirect Send): -// -// actions = [ -// OpenAccountAction(REMOTE_SEND_GIFT_CARD), -// NoPrivacyTransferAction(PRIMARY, REMOTE_SEND_GIFT_CARD, ExchangeData.Quarks), -// NoPrivacyWithdrawAction(REMOTE_SEND_GIFT_CARD, PRIMARY, ExchangeData.Quarks, is_auto_return=true), -// ] -message SendPublicPaymentMetadata { - // The source account where funds will be sent from. Currently, this is always - // the user's primary account. - common.v1.SolanaAccountId source = 1 [(validate.rules).message.required = true]; - - // The destination token account to send funds to. - common.v1.SolanaAccountId destination = 2 [(validate.rules).message.required = true]; - - // Destination owner account, which is required for withdrawals that intend - // to create an ATA. Every other variation of this intent can omit this field. - common.v1.SolanaAccountId destination_owner = 3; - - // The exchange data of total funds being sent to the destination - oneof exchange_data { - option (validate.required) = true; - - // Provided by server for submitted intents - ExchangeData server_exchange_data = 4; - - // Provided by clients when submitting new intents - VerifiedExchangeData client_exchange_data = 8; - } - - // Is the payment a withdrawal? - bool is_withdrawal = 5; - - // Is the payment going to a new gift card? Note is_withdrawal must be false. - bool is_indirect_send = 6; - - // The mint that this intent will be operating against - common.v1.SolanaAccountId mint = 7 [(validate.rules).message.required = true];; -} - -// Receive funds into a user-owned account publicly. All use cases of this intent -// close the account, so all funds must be moved. -// -// Action Spec (Indirect Send): -// -// actions = [NoPrivacyWithdrawAction(REMOTE_SEND_GIFT_CARD, PRIMARY, quarks)] -message ReceivePaymentsPubliclyMetadata { - // The remote send gift card to receive funds from - common.v1.SolanaAccountId source = 1 [(validate.rules).message.required = true]; - - // The exact amount of quarks being received - uint64 quarks = 2 [(validate.rules).uint64.gt = 0]; - - // Is the receipt of funds from a remote send gift card? Currently, this is - // the only use case for this intent and validation enforces the flag to true. - bool is_indirect_send = 3 [(validate.rules).bool.const = true]; - - // If is_indirect_send is true, the original exchange data that was provided as - // part of creating the gift card account. This is purely a server-provided value. - // SubmitIntent will disallow this being set. - ExchangeData exchange_data = 4; - - - // The mint that this intent will be operating against - common.v1.SolanaAccountId mint = 5 [(validate.rules).message.required = true];; -} - -// Distribute funds from a pool account publicly to one or more user-owned accounts. -// -// Action Spec: -// -// for distribution in distributions[:len(distributions)-1] -// actions.push_back(NoPrivacyTransferAction(POOL, distribution.destination, distributions.quarks)) -// actions.push_back(NoPrivacyWithdrawAction(POOL, distributions[len(distributions)-1].destination, distributions[len(distributions)-1].quarks)) -// -// Notes: -// - All funds must distributed. The balance of the pool must be zero at the end of the intent -// - The pool is closed at the end of the intent via a NoPrivacyWithdrawAction -message PublicDistributionMetadata { - // The pool account to distribute from - common.v1.SolanaAccountId source = 1 [(validate.rules).message.required = true]; - - // The set of distributions - repeated Distribution distributions = 2 [(validate.rules).repeated = { - min_items: 1, - // todo: max-items? - }];; - message Distribution { - // Destination where a portion of the pool's funds will be distributed. - // This must always be a primary account. - common.v1.SolanaAccountId destination = 1 [(validate.rules).message.required = true]; - - // The amount of funds to distribute to the destination - uint64 quarks = 2 [(validate.rules).uint64.gt = 0]; - } - - - // The mint that this intent will be operating against - common.v1.SolanaAccountId mint = 3 [(validate.rules).message.required = true];; -} - -// -// Action Definitions -// - -// Action is a well-defined, ordered and small set of transactions or virtual instructions -// for a unit of work that the client wants to perform on the blockchain. Clients provide -// parameters known to them in the action. -message Action { - // The ID of this action, which is unique within an intent. It must match - // the index of the action's location in the SubmitAction's actions field. - uint32 id = 1; - - // The type of action to perform. - oneof type { - option (validate.required) = true; - - OpenAccountAction open_account = 2; - NoPrivacyTransferAction no_privacy_transfer = 3; - NoPrivacyWithdrawAction no_privacy_withdraw = 4; - FeePaymentAction fee_payment = 5; - } -} - -// No client signature required -message OpenAccountAction { - // The type of account, which will dictate its intended use - common.v1.AccountType account_type = 1 [(validate.rules).enum.not_in = 0]; - - // The owner of the account. For accounts liked to a user's 12 words, this is - // the verified parent owner account public key. All other account types should - // set this to the authority value. - common.v1.SolanaAccountId owner = 2 [(validate.rules).message.required = true]; - - // The index used to for accounts that are derived from owner - uint64 index = 3; - - // The public key of the private key that has authority over the opened token account - common.v1.SolanaAccountId authority = 4 [(validate.rules).message.required = true]; - - // The token account being opened - common.v1.SolanaAccountId token = 5 [(validate.rules).message.required = true]; - - // The signature is of serialize(OpenAccountAction) without this field set - // using the private key of the authority account. This provides a proof - // of authorization to link authority to owner. - common.v1.Signature authority_signature = 6 [(validate.rules).message.required = true]; - - - // The mint that this action will be operating against - common.v1.SolanaAccountId mint = 7 [(validate.rules).message.required = true];; -} - -// Compact message signature required -message NoPrivacyTransferAction { - // The public key of the private key that has authority over source - common.v1.SolanaAccountId authority = 1 [(validate.rules).message.required = true]; - - // The source account where funds are transferred from - common.v1.SolanaAccountId source = 2 [(validate.rules).message.required = true]; - - // The destination account where funds are transferred to - common.v1.SolanaAccountId destination = 3 [(validate.rules).message.required = true]; - - // The quark amount to transfer - uint64 amount = 4 [(validate.rules).uint64.gt = 0]; - - - // The mint that this action will be operating against - common.v1.SolanaAccountId mint = 5 [(validate.rules).message.required = true];; -} - -// Compact message signature required -message NoPrivacyWithdrawAction { - // The public key of the private key that has authority over source - common.v1.SolanaAccountId authority = 1 [(validate.rules).message.required = true]; - - // The source account where funds are transferred from - common.v1.SolanaAccountId source = 2 [(validate.rules).message.required = true]; - - // The destination account where funds are transferred to - common.v1.SolanaAccountId destination = 3 [(validate.rules).message.required = true]; - - // The quark amount to withdraw - uint64 amount = 4 [(validate.rules).uint64.gt = 0]; - - // Whether the account is closed afterwards. This is always true, since there - // are no current se cases to leave it open. - bool should_close = 5 [(validate.rules).bool.const = true]; - - // Whether this action is for an auto-return, which client allows server to defer - // scheduling at its own discretion to return funds back to the owner (to their primary - // account) that funded source. - bool is_auto_return = 6; - - - // The mint that this action will be operating against - common.v1.SolanaAccountId mint = 7 [(validate.rules).message.required = true];; -} - -// Compact message signature required -message FeePaymentAction { - // The type of fee being operated on - FeeType type = 1 [(validate.rules).enum.not_in = 0]; - enum FeeType { - UNKNOWN = 0; - CREATE_ON_SEND_WITHDRAWAL = 1; // Server-defined fee for creating an external ATA on withdrawals on send - } - - // The public key of the private key that has authority over source - common.v1.SolanaAccountId authority = 2 [(validate.rules).message.required = true]; - - // The source account where funds are transferred from - common.v1.SolanaAccountId source = 3 [(validate.rules).message.required = true]; - - // The quark amount to transfer - uint64 amount = 4 [(validate.rules).uint64.gt = 0]; - - - // The mint that this action will be operating against - common.v1.SolanaAccountId mint = 5 [(validate.rules).message.required = true];; -} - -// -// Server Parameter Definitions -// - -// ServerParameter are a set of parameters known and returned by server that -// enables clients to complete transaction construction. Any necessary proofs, -// which are required to be locally verifiable, are also provided to ensure -// safe use in the event of a malicious server. -message ServerParameter { - // The action the server parameters belong to - uint32 action_id = 1; - - // The set of nonces used for the action. Server will only provide values - // for transactions requiring client signatures. - repeated NoncedTransactionMetadata nonces = 2 [(validate.rules).repeated = { - max_items: 1 - }]; - - // The type of server parameter which maps to the type of action requested - oneof type { - option (validate.required) = true; - - OpenAccountServerParameter open_account = 3; - NoPrivacyTransferServerParameter no_privacy_transfer = 4; - NoPrivacyWithdrawServerParameter no_privacy_withdraw = 5; - FeePaymentServerParameter fee_payment = 6; - } -} - -// For transactions, the nonce is a standard nonce on Solana -// For virtual instructions, the nonce is a virtual nonce on the Code VM -message NoncedTransactionMetadata { - // The nonce account to use in the system::AdvanceNonce instruction - common.v1.SolanaAccountId nonce = 1 [(validate.rules).message.required = true]; - - // The blockhash to set in the transaction or virtual instruction - common.v1.Blockhash blockhash = 2 [(validate.rules).message.required = true]; -} - -message OpenAccountServerParameter { - // There are no transactions requiring client signatures -} - -message NoPrivacyTransferServerParameter { - // There are no action-specific server parameters -} - -message NoPrivacyWithdrawServerParameter { - // There are no action-specific server parameters -} - -message FeePaymentServerParameter { - // The destination account where OCP fee payments should be sent. This will - // only be set when the corresponding FeePaymentAction.Type: - // - CREATE_ON_SEND_WITHDRAWAL - common.v1.SolanaAccountId destination = 1 [(validate.rules).message.required = true]; -} - -// -// Structured Error Definitions -// - -message ErrorDetails { - oneof type { - option (validate.required) = true; - - ReasonStringErrorDetails reason_string = 1; - InvalidSignatureErrorDetails invalid_signature = 2; - DeniedErrorDetails denied = 3; - } -} - -message ReasonStringErrorDetails { - // Human readable string indicating the failure. - string reason = 1 [(validate.rules).string = { - min_len: 1, - max_len: 2048, // Arbitrary - }]; -} - -message InvalidSignatureErrorDetails { - // The action whose signature mismatched - uint32 action_id = 1; - - oneof expected_blob { - option (validate.required) = true; - - // The transaction the server expected to have signed. - common.v1.Transaction expected_transaction = 2; - - // The virtual ixn hash the server expected to have signed. - common.v1.Hash expected_vixn_hash = 4; - } - - // The signature that was provided by the client. - common.v1.Signature provided_signature = 3 [(validate.rules).message.required = true]; -} - -message DeniedErrorDetails { - Code code = 1; - enum Code { - // Reason code not yet defined - UNSPECIFIED = 0; - } - - // Human readable string indicating the failure. - string reason = 2 [(validate.rules).string = { - min_len: 1, - max_len: 2048, // Arbitrary - }]; -} - -// -// Other Model Definitions -// - -// VerifiedExchangeData defines an amount of crypto to use in a payment flow -// with verified server-state for provable fiat exchange data -message VerifiedExchangeData { - // The crypto mint that is being operated against for the payment flow. - common.v1.SolanaAccountId mint = 1 [(validate.rules).message.required = true]; - - // The exact amount of quarks being operated in a payment flow. - // This will be used as the source of truth for validating transfer amounts. - uint64 quarks = 2 [(validate.rules).uint64.gt = 0]; - - // The agreed upon fiat amount in a payment flow. - double native_amount = 3 [(validate.rules).double.gt = 0]; - - // Verified core mint fiat exchange rate used to compute the exchange data - // - // Required when operating against: - // - Core mint - // - Launchpad currency - currency.v1.VerifiedCoreMintFiatExchangeRate core_mint_fiat_exchange_rate = 4 [(validate.rules).message.required = true]; - - // Verified launchpad currency reserve state used to compute the exchange data - // - // Required when operating against: - // - Launchpad currency - currency.v1.VerifiedLaunchpadCurrencyReserveState launchpad_currency_reserve_state = 5; -} - -// ExchangeData defines an amount of crypto to use in a payment flow with -// fiat exchange data -message ExchangeData { - // ISO 4217 alpha-3 currency code. - string currency = 1 [(validate.rules).string = { pattern: "^[a-z]{3,4}$" }]; - - // The agreed upon exchange rate. This might not be the same as the - // actual exchange rate at the time of intent or fund transfer. - double exchange_rate = 2 [(validate.rules).double.gt = 0]; - - // The agreed upon fiat amount in a payment flow. - double native_amount = 3 [(validate.rules).double.gt = 0]; - - // The exact amount of quarks being operated in a payment flow. - // This will be used as the source of truth for validating transfer amounts. - uint64 quarks = 4 [(validate.rules).uint64.gt = 0]; - - // The crypto mint that is being operated against for the payment flow. - common.v1.SolanaAccountId mint = 5 [(validate.rules).message.required = true];; -} - -message ExchangeDataWithoutRate { - // ISO 4217 alpha-3 currency code. - string currency = 1 [(validate.rules).string = { pattern: "^[a-z]{3,4}$" }]; - - // The agreed upon fiat amount in a payment flow. - double native_amount = 2 [(validate.rules).double.gt = 0]; -} - -message SendLimit { - // Remaining limit to apply on the next transaction - float next_transaction = 1; - - // Maximum allowed on a per-transaction basis - float max_per_transaction = 2; - - // Maximum allowed on a per-day basis - float max_per_day = 3; -} - -// VerifiedSwapMetadata defines verifiable swap metadata for non-custodial swap -// state management using client signature verification. -message VerifiedSwapMetadata { - oneof kind { - option (validate.required) = true; - - VerifiedReserveSwapMetadata reserve = 1; - VerifiedCoinbaseStableSwapperSwapMetadata stablecoin = 2; - } -} - -// VerifiedReserveSwapMetadata is verified metadata for swaps against the -// Currency Creator program -message VerifiedReserveSwapMetadata { - // Verifiable client-side parameters that were provided during the StatefulSwap RPC - StatefulSwapRequest.Initiate.ReserveSwapClientParameters client_parameters = 1 [(validate.rules).message.required = true]; -} - -// VerifiedCoinbaseStableSwapperSwapMetadata is verified metadata for swaps against the -// Coinbase Stable Swapper program -message VerifiedCoinbaseStableSwapperSwapMetadata { - // Verifiable client-side parameters that were provided during the StatefulSwap RPC - StatefulSwapRequest.Initiate.CoinbaseStableSwapperClientParameters client_parameters = 1 [(validate.rules).message.required = true]; -} - -message SwapMetadata { - VerifiedSwapMetadata verified_metadata = 1 [(validate.rules).message.required = true]; - - State state = 2 [(validate.rules).enum = { - not_in: [0] // UNKNOWN - }]; - - // The signature is of serialize(VerifiedSwapMetadata) using the private - // key of the owner account. Use this to guarantee that VerifiedSwapMetadata - // has not been tampered with. - common.v1.Signature signature = 3 [(validate.rules).message.required = true]; - - enum State { - UNKNOWN = 0; - CREATED = 1; // Swap state has been created and is pending funding - FUNDING = 2; // The VM swap PDA is in the process of being funded - FUNDED = 3; // The VM swap PDA has been funded - SUBMITTING = 4; // The swap transaction is being submitted to the blockchain - FINALIZED = 5; // The swap transaction has been finalized on the blockchain - FAILED = 6; // The swap transaction failed - CANCELLING = 7; // The swap is in the process of being cancelled. - CANCELLED = 8; // The swap transaction is cancelled. Funds have been deposited back into the VM - } -} - -enum FundingSource { - FUNDING_SOURCE_UNKNOWN = 0; - FUNDING_SOURCE_SUBMIT_INTENT = 1; - FUNDING_SOURCE_EXTERNAL_WALLET = 2; - FUNDING_SOURCE_COINBASE_ONRAMP = 3; -} - -// AppMetadata is additional app-level metadata provided for an intent -message AppMetadata { - bytes value = 1 [(validate.rules).bytes = { - min_len: 1 - max_len: 4096 - }]; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/validate/validate.proto b/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/validate/validate.proto deleted file mode 100644 index 4195ecf9c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto/validate/validate.proto +++ /dev/null @@ -1,863 +0,0 @@ -syntax = "proto2"; -package validate; - -option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; -option java_package = "io.envoyproxy.pgv.validate"; - -import "google/protobuf/descriptor.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// Validation rules applied at the message level -extend google.protobuf.MessageOptions { - // Disabled nullifies any validation rules for this message, including any - // message fields associated with it that do support validation. - optional bool disabled = 1071; - // Ignore skips generation of validation methods for this message. - optional bool ignored = 1072; -} - -// Validation rules applied at the oneof level -extend google.protobuf.OneofOptions { - // Required ensures that exactly one the field options in a oneof is set; - // validation fails if no fields in the oneof are set. - optional bool required = 1071; -} - -// Validation rules applied at the field level -extend google.protobuf.FieldOptions { - // Rules specify the validations to be performed on this field. By default, - // no validation is performed against a field. - optional FieldRules rules = 1071; -} - -// FieldRules encapsulates the rules for each type of field. Depending on the -// field, the correct set should be used to ensure proper validations. -message FieldRules { - optional MessageRules message = 17; - oneof type { - // Scalar Field Types - FloatRules float = 1; - DoubleRules double = 2; - Int32Rules int32 = 3; - Int64Rules int64 = 4; - UInt32Rules uint32 = 5; - UInt64Rules uint64 = 6; - SInt32Rules sint32 = 7; - SInt64Rules sint64 = 8; - Fixed32Rules fixed32 = 9; - Fixed64Rules fixed64 = 10; - SFixed32Rules sfixed32 = 11; - SFixed64Rules sfixed64 = 12; - BoolRules bool = 13; - StringRules string = 14; - BytesRules bytes = 15; - - // Complex Field Types - EnumRules enum = 16; - RepeatedRules repeated = 18; - MapRules map = 19; - - // Well-Known Field Types - AnyRules any = 20; - DurationRules duration = 21; - TimestampRules timestamp = 22; - } -} - -// FloatRules describes the constraints applied to `float` values -message FloatRules { - // Const specifies that this field must be exactly the specified value - optional float const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional float lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional float lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional float gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional float gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated float in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated float not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// DoubleRules describes the constraints applied to `double` values -message DoubleRules { - // Const specifies that this field must be exactly the specified value - optional double const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional double lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional double lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional double gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional double gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated double in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated double not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int32Rules describes the constraints applied to `int32` values -message Int32Rules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int64Rules describes the constraints applied to `int64` values -message Int64Rules { - // Const specifies that this field must be exactly the specified value - optional int64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt32Rules describes the constraints applied to `uint32` values -message UInt32Rules { - // Const specifies that this field must be exactly the specified value - optional uint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt64Rules describes the constraints applied to `uint64` values -message UInt64Rules { - // Const specifies that this field must be exactly the specified value - optional uint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt32Rules describes the constraints applied to `sint32` values -message SInt32Rules { - // Const specifies that this field must be exactly the specified value - optional sint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt64Rules describes the constraints applied to `sint64` values -message SInt64Rules { - // Const specifies that this field must be exactly the specified value - optional sint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed32Rules describes the constraints applied to `fixed32` values -message Fixed32Rules { - // Const specifies that this field must be exactly the specified value - optional fixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed64Rules describes the constraints applied to `fixed64` values -message Fixed64Rules { - // Const specifies that this field must be exactly the specified value - optional fixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed32Rules describes the constraints applied to `sfixed32` values -message SFixed32Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed64Rules describes the constraints applied to `sfixed64` values -message SFixed64Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// BoolRules describes the constraints applied to `bool` values -message BoolRules { - // Const specifies that this field must be exactly the specified value - optional bool const = 1; -} - -// StringRules describe the constraints applied to `string` values -message StringRules { - // Const specifies that this field must be exactly the specified value - optional string const = 1; - - // Len specifies that this field must be the specified number of - // characters (Unicode code points). Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 len = 19; - - // MinLen specifies that this field must be the specified number of - // characters (Unicode code points) at a minimum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of - // characters (Unicode code points) at a maximum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 max_len = 3; - - // LenBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 len_bytes = 20; - - // MinBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_bytes = 4; - - // MaxBytes specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_bytes = 5; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 6; - - // Prefix specifies that this field must have the specified substring at - // the beginning of the string. - optional string prefix = 7; - - // Suffix specifies that this field must have the specified substring at - // the end of the string. - optional string suffix = 8; - - // Contains specifies that this field must have the specified substring - // anywhere in the string. - optional string contains = 9; - - // NotContains specifies that this field cannot have the specified substring - // anywhere in the string. - optional string not_contains = 23; - - // In specifies that this field must be equal to one of the specified - // values - repeated string in = 10; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated string not_in = 11; - - // WellKnown rules provide advanced constraints against common string - // patterns - oneof well_known { - // Email specifies that the field must be a valid email address as - // defined by RFC 5322 - bool email = 12; - - // Hostname specifies that the field must be a valid hostname as - // defined by RFC 1034. This constraint does not support - // internationalized domain names (IDNs). - bool hostname = 13; - - // Ip specifies that the field must be a valid IP (v4 or v6) address. - // Valid IPv6 addresses should not include surrounding square brackets. - bool ip = 14; - - // Ipv4 specifies that the field must be a valid IPv4 address. - bool ipv4 = 15; - - // Ipv6 specifies that the field must be a valid IPv6 address. Valid - // IPv6 addresses should not include surrounding square brackets. - bool ipv6 = 16; - - // Uri specifies that the field must be a valid, absolute URI as defined - // by RFC 3986 - bool uri = 17; - - // UriRef specifies that the field must be a valid URI as defined by RFC - // 3986 and may be relative or absolute. - bool uri_ref = 18; - - // Address specifies that the field must be either a valid hostname as - // defined by RFC 1034 (which does not support internationalized domain - // names or IDNs), or it can be a valid IP (v4 or v6). - bool address = 21; - - // Uuid specifies that the field must be a valid UUID as defined by - // RFC 4122 - bool uuid = 22; - - // WellKnownRegex specifies a common well known pattern defined as a regex. - KnownRegex well_known_regex = 24; - } - - // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - // strict header validation. - // By default, this is true, and HTTP header validations are RFC-compliant. - // Setting to false will enable a looser validations that only disallows - // \r\n\0 characters, which can be used to bypass header matching rules. - optional bool strict = 25 [default = true]; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 26; -} - -// WellKnownRegex contain some well-known patterns. -enum KnownRegex { - UNKNOWN = 0; - - // HTTP header name as defined by RFC 7230. - HTTP_HEADER_NAME = 1; - - // HTTP header value as defined by RFC 7230. - HTTP_HEADER_VALUE = 2; -} - -// BytesRules describe the constraints applied to `bytes` values -message BytesRules { - // Const specifies that this field must be exactly the specified value - optional bytes const = 1; - - // Len specifies that this field must be the specified number of bytes - optional uint64 len = 13; - - // MinLen specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_len = 3; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 4; - - // Prefix specifies that this field must have the specified bytes at the - // beginning of the string. - optional bytes prefix = 5; - - // Suffix specifies that this field must have the specified bytes at the - // end of the string. - optional bytes suffix = 6; - - // Contains specifies that this field must have the specified bytes - // anywhere in the string. - optional bytes contains = 7; - - // In specifies that this field must be equal to one of the specified - // values - repeated bytes in = 8; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated bytes not_in = 9; - - // WellKnown rules provide advanced constraints against common byte - // patterns - oneof well_known { - // Ip specifies that the field must be a valid IP (v4 or v6) address in - // byte format - bool ip = 10; - - // Ipv4 specifies that the field must be a valid IPv4 address in byte - // format - bool ipv4 = 11; - - // Ipv6 specifies that the field must be a valid IPv6 address in byte - // format - bool ipv6 = 12; - } - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 14; -} - -// EnumRules describe the constraints applied to enum values -message EnumRules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // DefinedOnly specifies that this field must be only one of the defined - // values for this enum, failing on any undefined value. - optional bool defined_only = 2; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 3; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 4; -} - -// MessageRules describe the constraints applied to embedded message values. -// For message-type fields, validation is performed recursively. -message MessageRules { - // Skip specifies that the validation rules of this field should not be - // evaluated - optional bool skip = 1; - - // Required specifies that this field must be set - optional bool required = 2; -} - -// RepeatedRules describe the constraints applied to `repeated` values -message RepeatedRules { - // MinItems specifies that this field must have the specified number of - // items at a minimum - optional uint64 min_items = 1; - - // MaxItems specifies that this field must have the specified number of - // items at a maximum - optional uint64 max_items = 2; - - // Unique specifies that all elements in this field must be unique. This - // contraint is only applicable to scalar and enum types (messages are not - // supported). - optional bool unique = 3; - - // Items specifies the contraints to be applied to each item in the field. - // Repeated message fields will still execute validation against each item - // unless skip is specified here. - optional FieldRules items = 4; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 5; -} - -// MapRules describe the constraints applied to `map` values -message MapRules { - // MinPairs specifies that this field must have the specified number of - // KVs at a minimum - optional uint64 min_pairs = 1; - - // MaxPairs specifies that this field must have the specified number of - // KVs at a maximum - optional uint64 max_pairs = 2; - - // NoSparse specifies values in this field cannot be unset. This only - // applies to map's with message value types. - optional bool no_sparse = 3; - - // Keys specifies the constraints to be applied to each key in the field. - optional FieldRules keys = 4; - - // Values specifies the constraints to be applied to the value of each key - // in the field. Message values will still have their validations evaluated - // unless skip is specified here. - optional FieldRules values = 5; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 6; -} - -// AnyRules describe constraints applied exclusively to the -// `google.protobuf.Any` well-known type -message AnyRules { - // Required specifies that this field must be set - optional bool required = 1; - - // In specifies that this field's `type_url` must be equal to one of the - // specified values. - repeated string in = 2; - - // NotIn specifies that this field's `type_url` must not be equal to any of - // the specified values. - repeated string not_in = 3; -} - -// DurationRules describe the constraints applied exclusively to the -// `google.protobuf.Duration` well-known type -message DurationRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Duration const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Duration lt = 3; - - // Lt specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Duration lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Duration gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Duration gte = 6; - - // In specifies that this field must be equal to one of the specified - // values - repeated google.protobuf.Duration in = 7; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated google.protobuf.Duration not_in = 8; -} - -// TimestampRules describe the constraints applied exclusively to the -// `google.protobuf.Timestamp` well-known type -message TimestampRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Timestamp const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Timestamp lt = 3; - - // Lte specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Timestamp lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Timestamp gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Timestamp gte = 6; - - // LtNow specifies that this must be less than the current time. LtNow - // can only be used with the Within rule. - optional bool lt_now = 7; - - // GtNow specifies that this must be greater than the current time. GtNow - // can only be used with the Within rule. - optional bool gt_now = 8; - - // Within specifies that this field must be within this duration of the - // current time. This constraint can be used alone or with the LtNow and - // GtNow rules. - optional google.protobuf.Duration within = 9; -} diff --git a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto_deps/validate/validate.proto b/FlipcashAPI/Sources/FlipcashAPI/Payments/proto_deps/validate/validate.proto deleted file mode 100644 index 4195ecf9c..000000000 --- a/FlipcashAPI/Sources/FlipcashAPI/Payments/proto_deps/validate/validate.proto +++ /dev/null @@ -1,863 +0,0 @@ -syntax = "proto2"; -package validate; - -option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; -option java_package = "io.envoyproxy.pgv.validate"; - -import "google/protobuf/descriptor.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// Validation rules applied at the message level -extend google.protobuf.MessageOptions { - // Disabled nullifies any validation rules for this message, including any - // message fields associated with it that do support validation. - optional bool disabled = 1071; - // Ignore skips generation of validation methods for this message. - optional bool ignored = 1072; -} - -// Validation rules applied at the oneof level -extend google.protobuf.OneofOptions { - // Required ensures that exactly one the field options in a oneof is set; - // validation fails if no fields in the oneof are set. - optional bool required = 1071; -} - -// Validation rules applied at the field level -extend google.protobuf.FieldOptions { - // Rules specify the validations to be performed on this field. By default, - // no validation is performed against a field. - optional FieldRules rules = 1071; -} - -// FieldRules encapsulates the rules for each type of field. Depending on the -// field, the correct set should be used to ensure proper validations. -message FieldRules { - optional MessageRules message = 17; - oneof type { - // Scalar Field Types - FloatRules float = 1; - DoubleRules double = 2; - Int32Rules int32 = 3; - Int64Rules int64 = 4; - UInt32Rules uint32 = 5; - UInt64Rules uint64 = 6; - SInt32Rules sint32 = 7; - SInt64Rules sint64 = 8; - Fixed32Rules fixed32 = 9; - Fixed64Rules fixed64 = 10; - SFixed32Rules sfixed32 = 11; - SFixed64Rules sfixed64 = 12; - BoolRules bool = 13; - StringRules string = 14; - BytesRules bytes = 15; - - // Complex Field Types - EnumRules enum = 16; - RepeatedRules repeated = 18; - MapRules map = 19; - - // Well-Known Field Types - AnyRules any = 20; - DurationRules duration = 21; - TimestampRules timestamp = 22; - } -} - -// FloatRules describes the constraints applied to `float` values -message FloatRules { - // Const specifies that this field must be exactly the specified value - optional float const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional float lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional float lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional float gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional float gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated float in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated float not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// DoubleRules describes the constraints applied to `double` values -message DoubleRules { - // Const specifies that this field must be exactly the specified value - optional double const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional double lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional double lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional double gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional double gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated double in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated double not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int32Rules describes the constraints applied to `int32` values -message Int32Rules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int64Rules describes the constraints applied to `int64` values -message Int64Rules { - // Const specifies that this field must be exactly the specified value - optional int64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt32Rules describes the constraints applied to `uint32` values -message UInt32Rules { - // Const specifies that this field must be exactly the specified value - optional uint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt64Rules describes the constraints applied to `uint64` values -message UInt64Rules { - // Const specifies that this field must be exactly the specified value - optional uint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt32Rules describes the constraints applied to `sint32` values -message SInt32Rules { - // Const specifies that this field must be exactly the specified value - optional sint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt64Rules describes the constraints applied to `sint64` values -message SInt64Rules { - // Const specifies that this field must be exactly the specified value - optional sint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed32Rules describes the constraints applied to `fixed32` values -message Fixed32Rules { - // Const specifies that this field must be exactly the specified value - optional fixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed64Rules describes the constraints applied to `fixed64` values -message Fixed64Rules { - // Const specifies that this field must be exactly the specified value - optional fixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed32Rules describes the constraints applied to `sfixed32` values -message SFixed32Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed64Rules describes the constraints applied to `sfixed64` values -message SFixed64Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// BoolRules describes the constraints applied to `bool` values -message BoolRules { - // Const specifies that this field must be exactly the specified value - optional bool const = 1; -} - -// StringRules describe the constraints applied to `string` values -message StringRules { - // Const specifies that this field must be exactly the specified value - optional string const = 1; - - // Len specifies that this field must be the specified number of - // characters (Unicode code points). Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 len = 19; - - // MinLen specifies that this field must be the specified number of - // characters (Unicode code points) at a minimum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of - // characters (Unicode code points) at a maximum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 max_len = 3; - - // LenBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 len_bytes = 20; - - // MinBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_bytes = 4; - - // MaxBytes specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_bytes = 5; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 6; - - // Prefix specifies that this field must have the specified substring at - // the beginning of the string. - optional string prefix = 7; - - // Suffix specifies that this field must have the specified substring at - // the end of the string. - optional string suffix = 8; - - // Contains specifies that this field must have the specified substring - // anywhere in the string. - optional string contains = 9; - - // NotContains specifies that this field cannot have the specified substring - // anywhere in the string. - optional string not_contains = 23; - - // In specifies that this field must be equal to one of the specified - // values - repeated string in = 10; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated string not_in = 11; - - // WellKnown rules provide advanced constraints against common string - // patterns - oneof well_known { - // Email specifies that the field must be a valid email address as - // defined by RFC 5322 - bool email = 12; - - // Hostname specifies that the field must be a valid hostname as - // defined by RFC 1034. This constraint does not support - // internationalized domain names (IDNs). - bool hostname = 13; - - // Ip specifies that the field must be a valid IP (v4 or v6) address. - // Valid IPv6 addresses should not include surrounding square brackets. - bool ip = 14; - - // Ipv4 specifies that the field must be a valid IPv4 address. - bool ipv4 = 15; - - // Ipv6 specifies that the field must be a valid IPv6 address. Valid - // IPv6 addresses should not include surrounding square brackets. - bool ipv6 = 16; - - // Uri specifies that the field must be a valid, absolute URI as defined - // by RFC 3986 - bool uri = 17; - - // UriRef specifies that the field must be a valid URI as defined by RFC - // 3986 and may be relative or absolute. - bool uri_ref = 18; - - // Address specifies that the field must be either a valid hostname as - // defined by RFC 1034 (which does not support internationalized domain - // names or IDNs), or it can be a valid IP (v4 or v6). - bool address = 21; - - // Uuid specifies that the field must be a valid UUID as defined by - // RFC 4122 - bool uuid = 22; - - // WellKnownRegex specifies a common well known pattern defined as a regex. - KnownRegex well_known_regex = 24; - } - - // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - // strict header validation. - // By default, this is true, and HTTP header validations are RFC-compliant. - // Setting to false will enable a looser validations that only disallows - // \r\n\0 characters, which can be used to bypass header matching rules. - optional bool strict = 25 [default = true]; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 26; -} - -// WellKnownRegex contain some well-known patterns. -enum KnownRegex { - UNKNOWN = 0; - - // HTTP header name as defined by RFC 7230. - HTTP_HEADER_NAME = 1; - - // HTTP header value as defined by RFC 7230. - HTTP_HEADER_VALUE = 2; -} - -// BytesRules describe the constraints applied to `bytes` values -message BytesRules { - // Const specifies that this field must be exactly the specified value - optional bytes const = 1; - - // Len specifies that this field must be the specified number of bytes - optional uint64 len = 13; - - // MinLen specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_len = 3; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 4; - - // Prefix specifies that this field must have the specified bytes at the - // beginning of the string. - optional bytes prefix = 5; - - // Suffix specifies that this field must have the specified bytes at the - // end of the string. - optional bytes suffix = 6; - - // Contains specifies that this field must have the specified bytes - // anywhere in the string. - optional bytes contains = 7; - - // In specifies that this field must be equal to one of the specified - // values - repeated bytes in = 8; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated bytes not_in = 9; - - // WellKnown rules provide advanced constraints against common byte - // patterns - oneof well_known { - // Ip specifies that the field must be a valid IP (v4 or v6) address in - // byte format - bool ip = 10; - - // Ipv4 specifies that the field must be a valid IPv4 address in byte - // format - bool ipv4 = 11; - - // Ipv6 specifies that the field must be a valid IPv6 address in byte - // format - bool ipv6 = 12; - } - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 14; -} - -// EnumRules describe the constraints applied to enum values -message EnumRules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // DefinedOnly specifies that this field must be only one of the defined - // values for this enum, failing on any undefined value. - optional bool defined_only = 2; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 3; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 4; -} - -// MessageRules describe the constraints applied to embedded message values. -// For message-type fields, validation is performed recursively. -message MessageRules { - // Skip specifies that the validation rules of this field should not be - // evaluated - optional bool skip = 1; - - // Required specifies that this field must be set - optional bool required = 2; -} - -// RepeatedRules describe the constraints applied to `repeated` values -message RepeatedRules { - // MinItems specifies that this field must have the specified number of - // items at a minimum - optional uint64 min_items = 1; - - // MaxItems specifies that this field must have the specified number of - // items at a maximum - optional uint64 max_items = 2; - - // Unique specifies that all elements in this field must be unique. This - // contraint is only applicable to scalar and enum types (messages are not - // supported). - optional bool unique = 3; - - // Items specifies the contraints to be applied to each item in the field. - // Repeated message fields will still execute validation against each item - // unless skip is specified here. - optional FieldRules items = 4; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 5; -} - -// MapRules describe the constraints applied to `map` values -message MapRules { - // MinPairs specifies that this field must have the specified number of - // KVs at a minimum - optional uint64 min_pairs = 1; - - // MaxPairs specifies that this field must have the specified number of - // KVs at a maximum - optional uint64 max_pairs = 2; - - // NoSparse specifies values in this field cannot be unset. This only - // applies to map's with message value types. - optional bool no_sparse = 3; - - // Keys specifies the constraints to be applied to each key in the field. - optional FieldRules keys = 4; - - // Values specifies the constraints to be applied to the value of each key - // in the field. Message values will still have their validations evaluated - // unless skip is specified here. - optional FieldRules values = 5; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 6; -} - -// AnyRules describe constraints applied exclusively to the -// `google.protobuf.Any` well-known type -message AnyRules { - // Required specifies that this field must be set - optional bool required = 1; - - // In specifies that this field's `type_url` must be equal to one of the - // specified values. - repeated string in = 2; - - // NotIn specifies that this field's `type_url` must not be equal to any of - // the specified values. - repeated string not_in = 3; -} - -// DurationRules describe the constraints applied exclusively to the -// `google.protobuf.Duration` well-known type -message DurationRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Duration const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Duration lt = 3; - - // Lt specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Duration lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Duration gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Duration gte = 6; - - // In specifies that this field must be equal to one of the specified - // values - repeated google.protobuf.Duration in = 7; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated google.protobuf.Duration not_in = 8; -} - -// TimestampRules describe the constraints applied exclusively to the -// `google.protobuf.Timestamp` well-known type -message TimestampRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Timestamp const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Timestamp lt = 3; - - // Lte specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Timestamp lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Timestamp gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Timestamp gte = 6; - - // LtNow specifies that this must be less than the current time. LtNow - // can only be used with the Within rule. - optional bool lt_now = 7; - - // GtNow specifies that this must be greater than the current time. GtNow - // can only be used with the Within rule. - optional bool gt_now = 8; - - // Within specifies that this field must be within this duration of the - // current time. This constraint can be used alone or with the LtNow and - // GtNow rules. - optional google.protobuf.Duration within = 9; -} diff --git a/Scripts/generate b/Scripts/generate deleted file mode 100755 index 54138ea1b..000000000 --- a/Scripts/generate +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env bash - -# This script requires protoc and Swift protobuf plugins to be installed. -# -# Install with Homebrew: -# brew install protobuf swift-protobuf -# -# Install the grpc-swift 2.x plugin: -# ./Scripts/install-grpc-swift-2-plugin.sh -# -# After installation, you may need to restart your terminal or IDE. - -set -euo pipefail - -# Add Homebrew paths to ensure protoc and plugins are found -export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" - -MISSING=0 - -# Check if protoc is available -if ! command -v protoc &> /dev/null; then - echo "Error: protoc is not installed or not in PATH" - echo "Install it with: brew install protobuf" - MISSING=1 -fi - -# Check if Swift protobuf plugin is available -if ! command -v protoc-gen-swift &> /dev/null; then - echo "Error: protoc-gen-swift is not installed or not in PATH" - echo "Install it with: brew install swift-protobuf" - MISSING=1 -fi - -# Check if the gRPC Swift 2.x plugin is available -if ! command -v protoc-gen-grpc-swift-2 &> /dev/null; then - echo "Error: protoc-gen-grpc-swift-2 is not installed or not in PATH" - echo "Install it with: ./Scripts/install-grpc-swift-2-plugin.sh" - MISSING=1 -fi - -if [[ $MISSING -ne 0 ]]; then - exit 1 -fi - -echo "Using protoc $(protoc --version), protoc-gen-swift $(protoc-gen-swift --version 2>&1), protoc-gen-grpc-swift-2 $(protoc-gen-grpc-swift-2 --version 2>&1)" - -CURRENT_DIR=$(pwd) -PROTO_DIR="${1:-}" -OUTPUT_DIR="${2:-}" -PREFIX="${3:-}" - -if [ ! -d "$PROTO_DIR" ] -then - echo "No proto directory provided." - exit -fi - -if [ ! -d "$OUTPUT_DIR" ] -then - echo "No output directory provided." - exit -fi - -echo "Proto dir: ${PROTO_DIR}" -echo "Output dir: ${OUTPUT_DIR}" - -rm -rf "${OUTPUT_DIR}" -mkdir "${OUTPUT_DIR}" - -# SwiftProtobuf Options -# https://github.com/apple/swift-protobuf/blob/main/Documentation/PLUGIN.md -# -# gRPC Swift 2.x Options -# https://github.com/grpc/grpc-swift-protobuf/blob/main/Sources/GRPCProtobufGenerator/Documentation.docc - -find "$PROTO_DIR" -name "*.proto" | while read PROTO_FILE -do - # SwiftProtobuf messages for every proto. - protoc \ - -I"$PROTO_DIR" \ - "$PROTO_FILE" \ - --swift_opt=Visibility=Public \ - --swift_opt=FileNaming=PathToUnderscores \ - --swift_out="$OUTPUT_DIR" - - # gRPC v2 client bindings only for protos that declare a service. - if grep -q '^service ' "$PROTO_FILE"; then - protoc \ - -I"$PROTO_DIR" \ - "$PROTO_FILE" \ - --grpc-swift-2_opt=Visibility=Public \ - --grpc-swift-2_opt=Server=false \ - --grpc-swift-2_opt=Client=true \ - --grpc-swift-2_opt=FileNaming=PathToUnderscores \ - --grpc-swift-2_out="$OUTPUT_DIR" - fi -done - -# Rename generated files to include the custom prefix -find "$OUTPUT_DIR" -type f -name "*.swift" | while read GENERATED_FILE -do - BASENAME=$(basename "$GENERATED_FILE") - NEW_NAME="${PREFIX}${BASENAME}" - mv "$GENERATED_FILE" "$OUTPUT_DIR/$NEW_NAME" - echo "Renamed $BASENAME to $NEW_NAME" -done diff --git a/Scripts/install-grpc-swift-2-plugin.sh b/Scripts/install-grpc-swift-2-plugin.sh deleted file mode 100755 index 8baa8c453..000000000 --- a/Scripts/install-grpc-swift-2-plugin.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash - -# Install the grpc-swift 2.x protoc plugin from source. -# -# The plugin moved to the grpc-swift-protobuf repo in v2 and its executable -# product is named `protoc-gen-grpc-swift-2` — so it coexists with the v1 -# `protoc-gen-grpc-swift` binary installed by install-grpc-swift-1-plugin.sh. -# protoc derives the `--grpc-swift-2_out` / `--grpc-swift-2_opt` flags from the -# binary name. Keep both installed during the v1 -> v2 migration; the v1 plugin -# is retired in the final teardown phase. - -set -e - -# Pin to the version validated during the migration spike. -GRPC_PROTOBUF_TAG="2.4.0" - -TEMP_DIR=$(mktemp -d) - -# Prefer Homebrew bin (no sudo needed), fall back to /usr/local/bin -if [ -d "/opt/homebrew/bin" ]; then - INSTALL_DIR="/opt/homebrew/bin" -else - INSTALL_DIR="/usr/local/bin" -fi - -echo "Installing grpc-swift 2.x plugin (grpc-swift-protobuf $GRPC_PROTOBUF_TAG)..." -echo "Temporary directory: $TEMP_DIR" - -cd "$TEMP_DIR" - -git clone https://github.com/grpc/grpc-swift-protobuf.git -cd grpc-swift-protobuf -git checkout "$GRPC_PROTOBUF_TAG" - -# Build the plugin -swift build -c release --product protoc-gen-grpc-swift-2 - -# Copy to install location -echo "Installing protoc-gen-grpc-swift-2 to $INSTALL_DIR" -cp .build/release/protoc-gen-grpc-swift-2 "$INSTALL_DIR/protoc-gen-grpc-swift-2" -chmod +x "$INSTALL_DIR/protoc-gen-grpc-swift-2" - -# Clean up -cd / -rm -rf "$TEMP_DIR" - -echo "✓ Successfully installed grpc-swift 2.x plugin" -echo "Location: $INSTALL_DIR/protoc-gen-grpc-swift-2" -protoc-gen-grpc-swift-2 --version diff --git a/Scripts/pull_protos b/Scripts/pull_protos deleted file mode 100755 index a1332a404..000000000 --- a/Scripts/pull_protos +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -# ========================= -# Exit if any command fails -set -e - -REPO_NAME="$1" -BRANCH="$2" -DESTINATION_PATH="$3" - -if [ ! -d "$DESTINATION_PATH" ] -then - echo "No destination directory provided." - exit -fi - -GIT_TEMP_PATH=$(mktemp -d -t "${REPO_NAME/\//_}") -TEMP_DIR="$DESTINATION_PATH/.temp" - -mkdir -p $TEMP_DIR - -# ============================= -# Register the cleanup function -# to be called on EXIT signal - -function cleanup { - echo "Cleaning up..." - rm -rf ${GIT_TEMP_PATH} - rm -rf ${TEMP_DIR} - echo "Done." -} - -trap cleanup EXIT - -# ================== -# Clone repositories - -echo "Cloning '${REPO_NAME}'..." -git clone -b ${BRANCH} --single-branch "git@github.com:${REPO_NAME}.git" ${GIT_TEMP_PATH} - -# ================================ -# Generate protos - -echo "Importing protos in '${GIT_TEMP_PATH}'..." - -for path in $(find ${GIT_TEMP_PATH} -name '*.proto' | xargs -0 -n1); do - PROTO_PATH="${path/$GIT_TEMP_PATH\//}" - DST_DIR="${DESTINATION_PATH}/${PROTO_PATH}" - - mkdir -p "$(dirname $DST_DIR)" - cp -rf ${path} ${DST_DIR} - - echo "Copied ${DST_DIR}" -done - -echo "Done." diff --git a/Scripts/run b/Scripts/run deleted file mode 100755 index b8c33775d..000000000 --- a/Scripts/run +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash - -# Always resolve paths relative to this script's own directory, not the -# caller's cwd. The PROTOS_*/GENERATED_DIR/DEPS_DIR vars below use -# `../FlipcashAPI/...` — without this cd, running the script from a -# sibling checkout (e.g. invoking ../main-repo/Scripts/run while cwd is -# inside a worktree, or vice versa) would silently regenerate protos -# against the wrong tree. Anchoring to the script's directory makes the -# target tree unambiguous: it is whichever checkout this `run` lives in. -cd "$(dirname "$0")" - -APP="" - -while getopts s:a: flag -do - case "${flag}" in - s) SKIP_PULL=1;; - a) APP=${OPTARG};; - esac -done - -# Pre-flight: verify required tools before doing anything destructive -export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" - -MISSING=0 - -if ! command -v protoc &> /dev/null; then - echo "Error: protoc is not installed. Install with: brew install protobuf" - MISSING=1 -fi - -if ! command -v protoc-gen-swift &> /dev/null; then - echo "Error: protoc-gen-swift is not installed. Install with: brew install swift-protobuf" - MISSING=1 -fi - -if ! command -v protoc-gen-grpc-swift-2 &> /dev/null; then - echo "Error: protoc-gen-grpc-swift-2 is not installed. Install with: ./Scripts/install-grpc-swift-2-plugin.sh" - MISSING=1 -fi - -if [[ $MISSING -ne 0 ]]; then - echo "" - echo "Aborting: required tools are missing. No files were modified." - exit 1 -fi - -# Set directories based on app -if [[ "$APP" == "flipcashCore" ]]; then - PROTOS_ROOT_DIR="../FlipcashAPI/Sources/FlipcashAPI/Core" - PROTOS_DIR="../FlipcashAPI/Sources/FlipcashAPI/Core/proto" - DEPS_DIR="../FlipcashAPI/Sources/FlipcashAPI/Core/proto_deps" - GENERATED_DIR="../FlipcashAPI/Sources/FlipcashAPI/Core/Generated" - PULL_REPO="code-payments/flipcash2-protobuf-api" - PULL_BRANCH="main" - PREFIX="" - -elif [[ "$APP" == "flipcashPayments" ]]; then - PROTOS_ROOT_DIR="../FlipcashAPI/Sources/FlipcashAPI/Payments" - PROTOS_DIR="../FlipcashAPI/Sources/FlipcashAPI/Payments/proto" - DEPS_DIR="../FlipcashAPI/Sources/FlipcashAPI/Payments/proto_deps" - GENERATED_DIR="../FlipcashAPI/Sources/FlipcashAPI/Payments/Generated" - PULL_REPO="code-payments/ocp-protobuf-api" - PULL_BRANCH="main" - PREFIX="" - -else - echo "error: Unknown app type '$APP'. Use 'flipcashCore' or 'flipcashPayments'." - exit 1 -fi - -# Skip pull logic if needed -if [[ SKIP_PULL -eq 0 ]]; -then - # Pull protos - rm -rf $PROTOS_DIR - ./pull_protos $PULL_REPO $PULL_BRANCH $PROTOS_ROOT_DIR - - # Copy over proto dependencies - cp -a "$DEPS_DIR/." $PROTOS_DIR -else - echo "warning: Skipping proto update from repo, just running code generator." -fi - -# Generate Swift models -rm -rf $GENERATED_DIR -mkdir -p $GENERATED_DIR - -./generate $PROTOS_DIR $GENERATED_DIR $PREFIX - -# validate.proto is a transitive import for field-rule annotations consumed -# at the descriptor level by server-side validation middleware. The generated -# Swift mirror is unused on the client and would also create a duplicate -# filename in the merged FlipcashAPI module. Drop it for both domains. -if [[ "$APP" == "flipcashCore" || "$APP" == "flipcashPayments" ]]; then - rm -f "$GENERATED_DIR/validate_validate.pb.swift" -fi - -# The OCP Payments domain generates its own messaging/v1 service files into the -# same merged FlipcashAPI module. Prefix the Core (flipcash2) copies so the -# basenames don't collide — the Swift types already differ -# (Flipcash_Messaging_V1_* vs Ocp_Messaging_V1_*). -if [[ "$APP" == "flipcashCore" ]]; then - for suffix in grpc.swift pb.swift; do - SRC="$GENERATED_DIR/messaging_v1_messaging_service.$suffix" - if [[ -f "$SRC" ]]; then - mv "$SRC" "$GENERATED_DIR/flipcash_messaging_v1_messaging_service.$suffix" - fi - done -fi From 373f0932f8ce4568ce5668b300f32d3a5e62ea7a Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Tue, 25 Aug 2026 12:07:30 -0400 Subject: [PATCH 2/2] chore: remove the local proto codegen pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scripts/run cloned the upstream contract repos into FlipcashAPI/Sources and drove protoc over the result. Those directories are gone, so the script and the three it calls now write into nothing. Scripts/gengoogle stays — it builds the Firebase plist and has never had anything to do with protos. Docs that described the local pipeline described a pipeline that no longer exists: technology-stack.md, hard-rules.md, the CLAUDE.md index and generated-files rule, the proto-change-tracer agent's chain diagram, and the fetch-protos skill. The skill keeps its name and its useful half — trace the impact, scaffold the service stubs — but its first four steps are now a version bump rather than a regeneration, and its release step points at the package repos, where releasing is a deliberate human step. --- .claude/agents/proto-change-tracer.md | 17 +++-- .claude/docs/hard-rules.md | 8 ++- .claude/docs/technology-stack.md | 29 ++++----- .claude/skills/fetch-protos/SKILL.md | 92 +++++++++++++-------------- CLAUDE.md | 4 +- 5 files changed, 74 insertions(+), 76 deletions(-) diff --git a/.claude/agents/proto-change-tracer.md b/.claude/agents/proto-change-tracer.md index 2a37b9072..ef158cbc0 100644 --- a/.claude/agents/proto-change-tracer.md +++ b/.claude/agents/proto-change-tracer.md @@ -1,6 +1,6 @@ --- name: proto-change-tracer -description: "Use this agent after regenerating protobuf definitions (e.g., after /fetch-protos) to trace the impact of proto changes through the codebase: generated Swift → service wrappers → client extensions → session/controllers → screens/viewmodels → tests.\n\nExamples:\n\n- user: \"what changed in the protos and what needs updating?\"\n assistant: \"I'll trace the proto changes through the service layer to identify what needs updating.\"\n The user wants to understand proto change impact. Use the proto-change-tracer agent.\n\n- user: \"I just regenerated the protos, what broke?\"\n assistant: \"I'll trace the updated proto definitions through the codebase to find affected code.\"\n Proto definitions were updated. Use the proto-change-tracer agent to trace impact." +description: "Use this agent after bumping the contract packages (e.g., after /fetch-protos) to trace the impact of proto changes through the codebase: generated Swift → service wrappers → client extensions → session/controllers → screens/viewmodels → tests.\n\nExamples:\n\n- user: \"what changed in the protos and what needs updating?\"\n assistant: \"I'll trace the proto changes through the service layer to identify what needs updating.\"\n The user wants to understand proto change impact. Use the proto-change-tracer agent.\n\n- user: \"I just bumped the protos, what broke?\"\n assistant: \"I'll trace the updated proto definitions through the codebase to find affected code.\"\n Proto definitions were updated. Use the proto-change-tracer agent to trace impact." model: sonnet --- @@ -16,12 +16,11 @@ identify every file that needs updating. You only analyze — you do not edit. ## Architecture: Proto → Screen Chain ``` -FlipcashAPI/Sources/FlipcashAPI/{Core,Payments}/proto/*.proto ← .proto files - [protoc via Scripts/run] +flipcash2-client-protocol / ocp-client-protocol ← published packages, + _v1_.pb.swift (messages, request/response, result enums) generated + _v1_.grpc.swift (the .Client wrapper) upstream ↓ -FlipcashAPI/Sources/FlipcashAPI/{Core,Payments}/Generated/ ← generated stubs - _v1_.pb.swift (messages, request/response, result enums) - _v1_.grpc.swift (the .Client wrapper) +FlipcashAPI/Sources/FlipcashAPI/Exports.swift ← @_exported umbrella ↓ FlipcashCore/.../Clients/{Flip API,Payments API}/Services/*Service.swift ← wraps the generated .Client, builds requests, maps proto result enums to a @@ -39,8 +38,8 @@ Flipcash/Core/Session/, Flipcash/Core/Controllers/, Flipcash/Core/Screens/** - Payments: `Ocp__V1_*` — account, currency, messaging, transaction, common **Package/tool boundaries:** -- Generated Swift lives in the `FlipcashAPI` package; service wrappers live in `FlipcashCore`; screens live in the `Flipcash` app target. -- The Core and Payments messaging services share basenames — the fetch script renames the Core copy to `flipcash_messaging_v1_*` to avoid a collision in the merged module. +- Generated Swift arrives from the two published packages, which `FlipcashAPI` re-exports; service wrappers live in `FlipcashCore`; screens live in the `Flipcash` app target. Read generated sources from the resolved checkouts under `.build/checkouts/` (or `~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts/`), not from this repo. +- The Core and Payments messaging services share basenames, but they are separate modules now, so the Swift type prefixes (`Flipcash_` vs `Ocp_`) are the only thing keeping them apart. ## Analysis Process @@ -124,5 +123,5 @@ Prioritized checklist of files to modify, grouped by layer. classification — an unmapped case silently degrades to `.error`-level `.unknown`. - Confirm unary calls use `options: .unaryDefault` and streaming calls use `.defaults` (never a deadline on a stream). -- Never edit generated files under `Generated/` — flag the wrapping `*Service.swift` instead. +- Never propose edits to generated package sources — they are read-only checkouts. Flag the wrapping `*Service.swift`, or a version bump, instead. - You are read-only: produce the impact report and checklist; do not modify files. diff --git a/.claude/docs/hard-rules.md b/.claude/docs/hard-rules.md index a50b30aff..d98863349 100644 --- a/.claude/docs/hard-rules.md +++ b/.claude/docs/hard-rules.md @@ -59,9 +59,13 @@ case .insufficient(let shortfall): Existing `ObservableObject` classes (`Client`, `FlipClient`) stay as-is until their dependents are migrated. A single class must use one system — either `ObservableObject` with `@Published`, or `@Observable`. Mixing causes silent observation failures. -## Generated Files +## Generated Protos -**Never modify files under `Generated/` directly** — they're regenerated from upstream protos by the scripts in [Regenerating Protos](technology-stack.md#regenerating-protos), and any local edits will be overwritten. Update the service files that wrap the generated code instead. +**Generated proto code is not in this repo.** `FlipcashAPI` re-exports `OCPClientProtocol` and +`Flipcash2ClientProtocol`, which are published from their own repos (see +[Protos: consumed, not generated here](technology-stack.md#protos-consumed-not-generated-here)). +A contract fix belongs in the package repo and reaches the app as a version bump; anything the +app can fix itself belongs in the service files that wrap the generated code. ## Database Schema Changes diff --git a/.claude/docs/technology-stack.md b/.claude/docs/technology-stack.md index c61fd2428..c07ce43a8 100644 --- a/.claude/docs/technology-stack.md +++ b/.claude/docs/technology-stack.md @@ -4,24 +4,23 @@ Open `Code.xcodeproj` in Xcode 16.x. Swift packages resolve automatically on first open. Build and run the `Flipcash` scheme. -## Regenerating Protos +## Protos: consumed, not generated here -Swift gRPC bindings in `FlipcashAPI/Sources/FlipcashAPI/Payments/Generated` and `FlipcashAPI/Sources/FlipcashAPI/Core/Generated` are generated from `.proto` files pulled from the server-protobuf repos. To regenerate: +This repo no longer vendors `.proto` files or runs protoc. The generated Swift ships from two +published packages, and `FlipcashAPI` is a thin umbrella that `@_exported import`s both so +`import FlipcashAPI` keeps working: -``` -cd Scripts -./run -a flipcashPayments -./run -a flipcashCore -``` - -Each invocation clones the latest `.proto` files from the upstream repo, replaces the local `proto/` directory, and regenerates the Swift code in `Generated/`. +| Module | Package | Contract | +|---|---|---| +| `OCPClientProtocol` | [`ocp-client-protocol`](https://github.com/code-payments/ocp-client-protocol) | `ocp-protobuf-api` | +| `Flipcash2ClientProtocol` | [`flipcash2-client-protocol`](https://github.com/code-payments/flipcash2-client-protocol) | `flipcash2-protobuf-api` | -**Required tools** (checked by the script; aborts if missing): -- `protoc` — `brew install protobuf` -- `protoc-gen-swift` — `brew install swift-protobuf` -- `protoc-gen-grpc-swift-2` (grpc-swift **2.x**) — `./Scripts/install-grpc-swift-2-plugin.sh` +Android consumes the Kotlin half of the same two packages, so both apps now generate from one +place instead of each vendoring the contract. -**Never modify files under `Generated/` directly** — changes will be overwritten on the next regen. +**To pick up a contract change:** sync and release it in the client-protocol repo (its README has +the steps), then bump the `exact:` version in `FlipcashAPI/Package.swift`. Nothing in this repo +needs protoc, swift-protobuf, or the grpc-swift plugin installed. ## Required Technologies @@ -41,7 +40,7 @@ Each invocation clones the latest `.proto` files from the upstream repo, replace Flipcash/ # Main app - focus here FlipcashCore/ # Business logic, models, clients FlipcashUI/ # UI components, theme -FlipcashAPI/ # gRPC proto definitions + generated v2 bindings (Payments/ + Core/) +FlipcashAPI/ # umbrella over the two published contract packages CodeCurves/ # Ed25519 cryptography CodeScanner/ # C++/OpenCV circular code scanning (see below) ``` diff --git a/.claude/skills/fetch-protos/SKILL.md b/.claude/skills/fetch-protos/SKILL.md index fb1db448c..d0d5aabd0 100644 --- a/.claude/skills/fetch-protos/SKILL.md +++ b/.claude/skills/fetch-protos/SKILL.md @@ -1,8 +1,8 @@ --- name: fetch-protos description: > - Fetch latest protobuf definitions, regenerate Swift bindings, verify the build, - summarize API changes, and scaffold new service stubs. Usage: /fetch-protos [core|payments] [both] + Bump the published contract packages, verify the build, summarize API changes, + and scaffold new service stubs. Usage: /fetch-protos [core|payments] [both] argument-hint: "[core|payments] (default: both)" allowed-tools: - Bash @@ -16,74 +16,70 @@ allowed-tools: # Fetch Protos -Pull `.proto` files from upstream, regenerate the Swift gRPC bindings under -`FlipcashAPI/Sources/FlipcashAPI/{Core,Payments}/Generated`, verify they compile, -summarize the API changes, and scaffold missing service-layer implementations. +Move the app onto newer contract packages, verify they compile, summarize the API changes, +and scaffold missing service-layer implementations. + +This repo does not generate protos. `FlipcashAPI` is an umbrella that re-exports two published +packages, and picking up a contract change means bumping their versions — the generation itself +happens in the package repos. ## Pre-flight context -- Core protos: !`find FlipcashAPI/Sources/FlipcashAPI/Core/proto -name "*.proto" 2>/dev/null | wc -l | tr -d ' '` -- Payments protos: !`find FlipcashAPI/Sources/FlipcashAPI/Payments/proto -name "*.proto" 2>/dev/null | wc -l | tr -d ' '` +- Pinned versions: !`grep -E 'client-protocol' FlipcashAPI/Package.swift` - Git status: !`git status --short FlipcashAPI/` ## Input -Parse `$ARGUMENTS` to determine which domain(s) to fetch. +Parse `$ARGUMENTS` to determine which domain(s) to bump. **Rules:** -- Known targets: `core` (→ `flipcashCore`), `payments` (→ `flipcashPayments`) -- If no target specified, fetch **both** -- `both` explicitly fetches both +- Known targets: `core` (→ flipcash2), `payments` (→ ocp) +- If no target specified, bump **both** +- `both` explicitly bumps both - Examples: - - `/fetch-protos` → fetch core + payments - - `/fetch-protos core` → fetch core only - - `/fetch-protos payments` → fetch payments only - -Target-to-repo mapping (handled by `Scripts/run`): + - `/fetch-protos` → bump core + payments + - `/fetch-protos core` → bump core only + - `/fetch-protos payments` → bump payments only -| Target | App flag | Upstream repo | -|--------|----------|---------------| -| `core` | `flipcashCore` | `code-payments/flipcash2-protobuf-api` | -| `payments` | `flipcashPayments` | `code-payments/ocp-protobuf-api` | +| Target | Swift module | Package | Upstream contract | +|--------|--------------|---------|-------------------| +| `core` | `Flipcash2ClientProtocol` | `code-payments/flipcash2-client-protocol` | `code-payments/flipcash2-protobuf-api` | +| `payments` | `OCPClientProtocol` | `code-payments/ocp-client-protocol` | `code-payments/ocp-protobuf-api` | ## Steps -### Step 1 — Pre-flight tool check - -The script aborts if any generator is missing, but confirm first so the user can -install before anything destructive runs: +### Step 1 — Find the release to move to ```bash -command -v protoc protoc-gen-swift protoc-gen-grpc-swift-2 +gh release list --repo code-payments/ocp-client-protocol --limit 5 +gh release list --repo code-payments/flipcash2-client-protocol --limit 5 ``` -If any are missing, install and stop: -- `protoc` → `brew install protobuf` -- `protoc-gen-swift` → `brew install swift-protobuf` -- `protoc-gen-grpc-swift-2` → `./Scripts/install-grpc-swift-2-plugin.sh` +If the contract change you want is not released yet, stop: it has to be synced and published +from the package repo first (see that repo's README — `scripts/sync-protos.sh`, then the +`publish.yml` workflow). Releasing is a deliberate, human-gated step; do not start it from here. + +Android pins the same two packages in its `gradle/libs.versions.toml`. The versions are not +required to match across platforms, but a contract change that matters to both should land on +both — flag it if only one side is moving. -### Step 2 — Fetch protos and regenerate +### Step 2 — Bump the pin -For each target, run from the repo root: +Edit the `exact:` requirement in `FlipcashAPI/Package.swift` for each target, then resolve: ```bash -cd Scripts && ./run -a flipcashCore # core -cd Scripts && ./run -a flipcashPayments # payments +xcodebuild -resolvePackageDependencies -project Code.xcodeproj -scheme Flipcash ``` -Each invocation clones the latest `.proto` files from upstream, replaces the local -`proto/` directory, copies `proto_deps/` back in, and regenerates the Swift bindings -in `Generated/`. It also drops `validate_validate.pb.swift` (unused client mirror) -and, for core, renames the messaging service files to avoid a basename collision with -the payments messaging service in the merged `FlipcashAPI` module. Show the output. +Show the resulting `Package.resolved` diff — it should change only the bumped package's +`version` and `revision`. ### Step 3 — Diff and summarize changes -The meaningful diff is the regenerated Swift, since `proto/` is wiped and re-cloned: +The packages ship their generated Swift committed, so the API diff is readable directly: ```bash -git diff --stat FlipcashAPI/Sources/FlipcashAPI/Core/Generated FlipcashAPI/Sources/FlipcashAPI/Payments/Generated -git diff FlipcashAPI/Sources/FlipcashAPI/*/proto +gh api repos/code-payments//compare/... --jq '.files[].filename' ``` For each changed service, summarize: @@ -92,19 +88,19 @@ For each changed service, summarize: - **Removed RPCs** - **New/modified messages, fields, and enum result cases** -Present a structured change summary. If nothing changed, report that protos are -already up to date and stop here. +Present a structured change summary. If nothing changed, report that the app is already on the +latest release and stop here. ### Step 4 — Build verification -Verify the regenerated code compiles before touching anything else: +Verify the app compiles against the new packages before touching anything else: ```bash ./Scripts/build.sh ``` -If the build fails, show errors and stop — a broken generation must be resolved -(usually a proto rename that orphaned a Swift type reference) before proceeding. +If the build fails, show errors and stop — a broken bump must be resolved (usually a proto +rename that orphaned a Swift type reference) before proceeding. ### Step 5 — Trace service-layer impact @@ -226,7 +222,7 @@ Show the user a summary of all changes (proto/generated updates + any scaffolded service code). Offer to commit only after approval, with a conventional message: ``` -chore: sync protos +chore: bump client-protocol to ``` If service stubs were scaffolded, suggest a separate commit: @@ -237,7 +233,7 @@ feat: scaffold service for new RPCs ## Never -- Edit generated files under `Generated/` directly — they are overwritten on the next regen. Update the wrapping `*Service.swift` instead. +- Patch generated code locally to work around a contract problem. It lives in the package repos; fix it there and cut a release. Update the wrapping `*Service.swift` instead when the gap is app-side. - Give a streaming RPC a deadline (`.unaryDefault`). Streaming passes `.defaults`. - Interpolate variables (especially base58/keys) into log message strings — variables go in `metadata`. - Skip the build verification in Step 4. diff --git a/CLAUDE.md b/CLAUDE.md index 6694b69a1..a21572697 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -12,7 +12,7 @@ and is linked from the map below. **Read the relevant doc before working in that |---|---| | About to write/change any code | [Hard Rules](.claude/docs/hard-rules.md) — full text, rationale, examples (checklist below) | | Working on DI, gRPC, navigation, transport errors, or core concepts | [Architecture & Patterns](.claude/docs/architecture.md) | -| Setting up, building, or regenerating protos; touching SQLite/CodeScanner | [Technology Stack, Setup & Tooling](.claude/docs/technology-stack.md) | +| Setting up, building, or bumping the contract packages; touching SQLite/CodeScanner | [Technology Stack, Setup & Tooling](.claude/docs/technology-stack.md) | | Writing or running tests | [Testing](.claude/docs/testing.md) | | Naming, file placement, imports, or committing | [Code Style & Git Workflow](.claude/docs/code-style.md) | | About to touch cash bills, navigation, dialogs, amounts, or DI | [Common Pitfalls](.claude/docs/common-pitfalls.md) | @@ -93,7 +93,7 @@ it before touching the relevant area. - **Testing framework** — Swift Testing (`import Testing`, `@Suite`/`@Test`), never XCTest. - **Exhaustive switches** — Prefer `switch` over `if case` for enums so the compiler flags new cases. - **Modernize incrementally** — Use modern Swift/SwiftUI APIs in net-new/isolated code; don't refactor working code just to modernize. One observation system per class. -- **Generated files** — Never edit files under `Generated/`; change the wrapping service files instead. +- **Generated protos** — `FlipcashAPI` only re-exports the published contract packages; there is no generated code to edit here. Change the wrapping service files instead. - **Database schema** — Bump `SQLiteVersion` in Info.plist on every schema change (no migrations; DB is rebuilt from server). - **Logging** — Message string is a constant; every variable goes in structured `metadata`. Never log proto blobs whole. - **Error reporting** — Call `ErrorReporting.captureError(...)` unconditionally; classify via `ServerError.reportingLevel`, never gate at the call site. Best-effort chatter never reports.