From 77db10f6523fa208a12b42a343c80d3f8a027878 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Fri, 23 Oct 2026 15:47:50 -0400 Subject: [PATCH 1/2] chore(contract): sync flipcash2 protos to b77bf78f --- .../ContractInfo.swift | 2 +- .../activity_v1_model.pb.swift | 10 +- .../chat_v1_chat_service.grpc.swift | 878 ++++++- .../chat_v1_chat_service.pb.swift | 2310 ++++++++++++----- .../chat_v1_model.pb.swift | 501 +++- .../intent_v1_model.pb.swift | 151 +- .../messaging_v1_messaging_service.pb.swift | 4 +- .../messaging_v1_model.pb.swift | 362 ++- .../paymentrequest_v1_model.pb.swift | 1145 ++++++++ ...quest_v1_paymentrequest_service.grpc.swift | 959 +++++++ ...request_v1_paymentrequest_service.pb.swift | 1357 ++++++++++ flipcash2.lock | 4 +- proto/activity/v1/model.proto | 10 +- proto/chat/v1/chat_service.proto | 189 ++ proto/chat/v1/model.proto | 72 + proto/intent/v1/model.proto | 82 +- proto/messaging/v1/messaging_service.proto | 4 +- proto/messaging/v1/model.proto | 88 +- proto/paymentrequest/v1/model.proto | 320 +++ .../v1/paymentrequest_service.proto | 315 +++ 20 files changed, 7991 insertions(+), 772 deletions(-) create mode 100644 Sources/Flipcash2ClientProtocol/paymentrequest_v1_model.pb.swift create mode 100644 Sources/Flipcash2ClientProtocol/paymentrequest_v1_paymentrequest_service.grpc.swift create mode 100644 Sources/Flipcash2ClientProtocol/paymentrequest_v1_paymentrequest_service.pb.swift create mode 100644 proto/paymentrequest/v1/model.proto create mode 100644 proto/paymentrequest/v1/paymentrequest_service.proto diff --git a/Sources/Flipcash2ClientProtocol/ContractInfo.swift b/Sources/Flipcash2ClientProtocol/ContractInfo.swift index a6342af..af0d461 100644 --- a/Sources/Flipcash2ClientProtocol/ContractInfo.swift +++ b/Sources/Flipcash2ClientProtocol/ContractInfo.swift @@ -2,7 +2,7 @@ public enum Flipcash2ContractInfo { public static let version = "0.20.0-dev" - public static let protoCommit = "733ea7f9f33291b9631f0176fab5485acf161fab" + public static let protoCommit = "b77bf78ff8d9ea1bcbf9aa3afa6696ba7edd37a9" public static var isLocal: Bool { protoCommit == localSentinel } diff --git a/Sources/Flipcash2ClientProtocol/activity_v1_model.pb.swift b/Sources/Flipcash2ClientProtocol/activity_v1_model.pb.swift index 80f3501..b629858 100644 --- a/Sources/Flipcash2ClientProtocol/activity_v1_model.pb.swift +++ b/Sources/Flipcash2ClientProtocol/activity_v1_model.pb.swift @@ -387,7 +387,7 @@ public struct Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata: Sendable /// Set when the payment was the recipient's share of a boost of a /// reaction (see BoostedReaction), paid to them as the boosted message's - /// sender or the group's creator. source_identifier names the payer, and + /// sender or its group's creator. source_identifier names the payer, and /// payment_amount is the recipient's share alone. public var boostedReaction: Flipcash_Activity_V1_BoostedReaction { get {return _boostedReaction ?? Flipcash_Activity_V1_BoostedReaction()} @@ -412,16 +412,16 @@ public struct Flipcash_Activity_V1_ReceivedCryptoNotificationMetadata: Sendable } /// The reaction a payment boosted: the payer's reaction with emoji on a -/// message in a group chat (see intent.v1.ChatMetadata.ReactionBoost). It is -/// what the payment was for when it was made and is not kept up to date: the -/// message may since have been deleted, and the viewer may no longer be a +/// message in a group chat or a DM (see intent.v1.ChatMetadata.ReactionBoost). +/// It is what the payment was for when it was made and is not kept up to date: +/// the message may since have been deleted, and the viewer may no longer be a /// member of the chat. public struct Flipcash_Activity_V1_BoostedReaction: Sendable { // SwiftProtobuf.Message 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 group chat the boosted message is in. + /// The chat, a group or a DM, the boosted message is in. public var chatID: Flipcash_Common_V1_ChatId { get {return _chatID ?? Flipcash_Common_V1_ChatId()} set {_chatID = newValue} diff --git a/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.grpc.swift b/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.grpc.swift index a07c649..607732a 100644 --- a/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.grpc.swift +++ b/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.grpc.swift @@ -272,6 +272,66 @@ public enum Flipcash_Chat_V1_Chat { method: "GetFeaturedGroups" ) } + /// Namespace for "SilenceUser" metadata. + public enum SilenceUser { + /// Request type for "SilenceUser". + public typealias Input = Flipcash_Chat_V1_SilenceUserRequest + /// Response type for "SilenceUser". + public typealias Output = Flipcash_Chat_V1_SilenceUserResponse + /// Descriptor for "SilenceUser". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat"), + method: "SilenceUser" + ) + } + /// Namespace for "UnsilenceUser" metadata. + public enum UnsilenceUser { + /// Request type for "UnsilenceUser". + public typealias Input = Flipcash_Chat_V1_UnsilenceUserRequest + /// Response type for "UnsilenceUser". + public typealias Output = Flipcash_Chat_V1_UnsilenceUserResponse + /// Descriptor for "UnsilenceUser". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat"), + method: "UnsilenceUser" + ) + } + /// Namespace for "BanUser" metadata. + public enum BanUser { + /// Request type for "BanUser". + public typealias Input = Flipcash_Chat_V1_BanUserRequest + /// Response type for "BanUser". + public typealias Output = Flipcash_Chat_V1_BanUserResponse + /// Descriptor for "BanUser". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat"), + method: "BanUser" + ) + } + /// Namespace for "UnbanUser" metadata. + public enum UnbanUser { + /// Request type for "UnbanUser". + public typealias Input = Flipcash_Chat_V1_UnbanUserRequest + /// Response type for "UnbanUser". + public typealias Output = Flipcash_Chat_V1_UnbanUserResponse + /// Descriptor for "UnbanUser". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat"), + method: "UnbanUser" + ) + } + /// Namespace for "GetRestrictedUsers" metadata. + public enum GetRestrictedUsers { + /// Request type for "GetRestrictedUsers". + public typealias Input = Flipcash_Chat_V1_GetRestrictedUsersRequest + /// Response type for "GetRestrictedUsers". + public typealias Output = Flipcash_Chat_V1_GetRestrictedUsersResponse + /// Descriptor for "GetRestrictedUsers". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.chat.v1.Chat"), + method: "GetRestrictedUsers" + ) + } /// Descriptors for all methods in the "flipcash.chat.v1.Chat" service. public static let descriptors: [GRPCCore.MethodDescriptor] = [ GetChat.descriptor, @@ -294,7 +354,12 @@ public enum Flipcash_Chat_V1_Chat { SetKeyEnvelope.descriptor, GetKeyEnvelope.descriptor, SetFeaturedGroups.descriptor, - GetFeaturedGroups.descriptor + GetFeaturedGroups.descriptor, + SilenceUser.descriptor, + UnsilenceUser.descriptor, + BanUser.descriptor, + UnbanUser.descriptor, + GetRestrictedUsers.descriptor ] } } @@ -1093,6 +1158,175 @@ extension Flipcash_Chat_V1_Chat { options: GRPCCore.CallOptions, onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result ) async throws -> Result where Result: Sendable + + /// Call the "SilenceUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > SilenceUser silences a user in a group chat, until a time or + /// > indefinitely: they may still read the chat, react and vote, but not + /// > send, edit, show typing, or do anything else that requires speaking + /// > in it (see ViewerState.Restrictions.silence). They may still delete + /// > their own messages. + /// > + /// > Public and private groups alike. Only a member the server permits to + /// > silence users in the chat may call it, as reported by + /// > ViewerState.Permissions.moderation.can_silence; anyone else, and any + /// > DM, is DENIED. The chat's creator cannot be silenced. + /// > + /// > The user need not be a member: a silence survives leaving and + /// > rejoining, and may be set before the user ever joins. Calling it again + /// > with a different duration replaces the silence; an identical request + /// > is a no-op that returns OK. A timed silence must end in the future; + /// > the server rejects one that does not. + /// > + /// > A real change reaches the silenced user's devices, while they are a + /// > member, as a MetadataUpdate.ViewerStateChanged on the event stream. + /// > Nobody else is told. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_SilenceUserRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_SilenceUserRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_SilenceUserResponse` 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 silenceUser( + 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 "UnsilenceUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > UnsilenceUser clears a user's silence in a group chat. Gated as + /// > SilenceUser. Unsilencing a user who is not silenced is a no-op that + /// > returns OK. A real change reaches the user's devices as SilenceUser's + /// > does. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_UnsilenceUserRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_UnsilenceUserRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_UnsilenceUserResponse` 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 unsilenceUser( + 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 "BanUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > BanUser bans a user from a group chat: a member is removed from its + /// > roster, a user waiting in a private group's lobby is removed from it, + /// > and the user cannot join, enter the lobby or be admitted until they + /// > are unbanned. A banned user may not read the chat as a non-member + /// > either (see the listener rules), though anyone may still see its + /// > redacted public view. Only a member the server permits to ban users + /// > in the chat may call it, as reported by + /// > ViewerState.Permissions.moderation.can_ban; anyone else, and any DM, + /// > is DENIED. The chat's creator cannot be banned. + /// > + /// > The user need not be a member, so a creator can ban someone before + /// > they join. Banning a user who is already banned is a no-op that + /// > returns OK. A ban leaves a silence as it is, and the user's messages + /// > stay in the chat. + /// > + /// > Removing a member is announced exactly like a departure: a + /// > RosterUpdate.MemberLeft to the banned user's devices, which does not + /// > say why, and the roster change to the chat's other members. A banned + /// > member of a private group loses their key envelope (see KeyEnvelope), + /// > as when leaving. They cannot fetch anything from the chat afterwards, + /// > but the server cannot take back the chat key they already opened: + /// > ciphertext of later messages that reached them some other way is + /// > readable to them, since the key is not rotated. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_BanUserRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_BanUserRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_BanUserResponse` 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 banUser( + 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 "UnbanUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > UnbanUser lifts a user's ban from a group chat. Gated as BanUser. + /// > It does not return them to the chat: they join (or enter a private + /// > group's lobby) again like anyone else. Unbanning a user who is not + /// > banned is a no-op that returns OK. Nothing is published. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_UnbanUserRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_UnbanUserRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_UnbanUserResponse` 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 unbanUser( + 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 "GetRestrictedUsers" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetRestrictedUsers pages the users silenced or banned in a group chat, + /// > most recently restricted first, by the time of the latest silence or + /// > ban set on them. A silence that has lapsed is left out. Only a member + /// > the server permits to silence or to ban users in the chat may call it + /// > (see ViewerState.Permissions.moderation); anyone else, and any DM, is + /// > DENIED. The page is read from an index that trails writes + /// > briefly, so a user just restricted may be absent and one just + /// > released may be present. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_GetRestrictedUsersRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_GetRestrictedUsersRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_GetRestrictedUsersResponse` 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 getRestrictedUsers( + 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. @@ -2121,6 +2355,230 @@ extension Flipcash_Chat_V1_Chat { onResponse: handleResponse ) } + + /// Call the "SilenceUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > SilenceUser silences a user in a group chat, until a time or + /// > indefinitely: they may still read the chat, react and vote, but not + /// > send, edit, show typing, or do anything else that requires speaking + /// > in it (see ViewerState.Restrictions.silence). They may still delete + /// > their own messages. + /// > + /// > Public and private groups alike. Only a member the server permits to + /// > silence users in the chat may call it, as reported by + /// > ViewerState.Permissions.moderation.can_silence; anyone else, and any + /// > DM, is DENIED. The chat's creator cannot be silenced. + /// > + /// > The user need not be a member: a silence survives leaving and + /// > rejoining, and may be set before the user ever joins. Calling it again + /// > with a different duration replaces the silence; an identical request + /// > is a no-op that returns OK. A timed silence must end in the future; + /// > the server rejects one that does not. + /// > + /// > A real change reaches the silenced user's devices, while they are a + /// > member, as a MetadataUpdate.ViewerStateChanged on the event stream. + /// > Nobody else is told. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_SilenceUserRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_SilenceUserRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_SilenceUserResponse` 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 silenceUser( + 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.SilenceUser.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "UnsilenceUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > UnsilenceUser clears a user's silence in a group chat. Gated as + /// > SilenceUser. Unsilencing a user who is not silenced is a no-op that + /// > returns OK. A real change reaches the user's devices as SilenceUser's + /// > does. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_UnsilenceUserRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_UnsilenceUserRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_UnsilenceUserResponse` 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 unsilenceUser( + 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.UnsilenceUser.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "BanUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > BanUser bans a user from a group chat: a member is removed from its + /// > roster, a user waiting in a private group's lobby is removed from it, + /// > and the user cannot join, enter the lobby or be admitted until they + /// > are unbanned. A banned user may not read the chat as a non-member + /// > either (see the listener rules), though anyone may still see its + /// > redacted public view. Only a member the server permits to ban users + /// > in the chat may call it, as reported by + /// > ViewerState.Permissions.moderation.can_ban; anyone else, and any DM, + /// > is DENIED. The chat's creator cannot be banned. + /// > + /// > The user need not be a member, so a creator can ban someone before + /// > they join. Banning a user who is already banned is a no-op that + /// > returns OK. A ban leaves a silence as it is, and the user's messages + /// > stay in the chat. + /// > + /// > Removing a member is announced exactly like a departure: a + /// > RosterUpdate.MemberLeft to the banned user's devices, which does not + /// > say why, and the roster change to the chat's other members. A banned + /// > member of a private group loses their key envelope (see KeyEnvelope), + /// > as when leaving. They cannot fetch anything from the chat afterwards, + /// > but the server cannot take back the chat key they already opened: + /// > ciphertext of later messages that reached them some other way is + /// > readable to them, since the key is not rotated. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_BanUserRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_BanUserRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_BanUserResponse` 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 banUser( + 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.BanUser.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "UnbanUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > UnbanUser lifts a user's ban from a group chat. Gated as BanUser. + /// > It does not return them to the chat: they join (or enter a private + /// > group's lobby) again like anyone else. Unbanning a user who is not + /// > banned is a no-op that returns OK. Nothing is published. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_UnbanUserRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_UnbanUserRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_UnbanUserResponse` 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 unbanUser( + 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.UnbanUser.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetRestrictedUsers" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetRestrictedUsers pages the users silenced or banned in a group chat, + /// > most recently restricted first, by the time of the latest silence or + /// > ban set on them. A silence that has lapsed is left out. Only a member + /// > the server permits to silence or to ban users in the chat may call it + /// > (see ViewerState.Permissions.moderation); anyone else, and any DM, is + /// > DENIED. The page is read from an index that trails writes + /// > briefly, so a user just restricted may be absent and one just + /// > released may be present. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_GetRestrictedUsersRequest` message. + /// - serializer: A serializer for `Flipcash_Chat_V1_GetRestrictedUsersRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Chat_V1_GetRestrictedUsersResponse` 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 getRestrictedUsers( + 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.GetRestrictedUsers.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } } } @@ -3032,6 +3490,205 @@ extension Flipcash_Chat_V1_Chat.ClientProtocol { onResponse: handleResponse ) } + + /// Call the "SilenceUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > SilenceUser silences a user in a group chat, until a time or + /// > indefinitely: they may still read the chat, react and vote, but not + /// > send, edit, show typing, or do anything else that requires speaking + /// > in it (see ViewerState.Restrictions.silence). They may still delete + /// > their own messages. + /// > + /// > Public and private groups alike. Only a member the server permits to + /// > silence users in the chat may call it, as reported by + /// > ViewerState.Permissions.moderation.can_silence; anyone else, and any + /// > DM, is DENIED. The chat's creator cannot be silenced. + /// > + /// > The user need not be a member: a silence survives leaving and + /// > rejoining, and may be set before the user ever joins. Calling it again + /// > with a different duration replaces the silence; an identical request + /// > is a no-op that returns OK. A timed silence must end in the future; + /// > the server rejects one that does not. + /// > + /// > A real change reaches the silenced user's devices, while they are a + /// > member, as a MetadataUpdate.ViewerStateChanged on the event stream. + /// > Nobody else is told. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_SilenceUserRequest` 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 silenceUser( + 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.silenceUser( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } + + /// Call the "UnsilenceUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > UnsilenceUser clears a user's silence in a group chat. Gated as + /// > SilenceUser. Unsilencing a user who is not silenced is a no-op that + /// > returns OK. A real change reaches the user's devices as SilenceUser's + /// > does. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_UnsilenceUserRequest` 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 unsilenceUser( + 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.unsilenceUser( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } + + /// Call the "BanUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > BanUser bans a user from a group chat: a member is removed from its + /// > roster, a user waiting in a private group's lobby is removed from it, + /// > and the user cannot join, enter the lobby or be admitted until they + /// > are unbanned. A banned user may not read the chat as a non-member + /// > either (see the listener rules), though anyone may still see its + /// > redacted public view. Only a member the server permits to ban users + /// > in the chat may call it, as reported by + /// > ViewerState.Permissions.moderation.can_ban; anyone else, and any DM, + /// > is DENIED. The chat's creator cannot be banned. + /// > + /// > The user need not be a member, so a creator can ban someone before + /// > they join. Banning a user who is already banned is a no-op that + /// > returns OK. A ban leaves a silence as it is, and the user's messages + /// > stay in the chat. + /// > + /// > Removing a member is announced exactly like a departure: a + /// > RosterUpdate.MemberLeft to the banned user's devices, which does not + /// > say why, and the roster change to the chat's other members. A banned + /// > member of a private group loses their key envelope (see KeyEnvelope), + /// > as when leaving. They cannot fetch anything from the chat afterwards, + /// > but the server cannot take back the chat key they already opened: + /// > ciphertext of later messages that reached them some other way is + /// > readable to them, since the key is not rotated. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_BanUserRequest` 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 banUser( + 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.banUser( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } + + /// Call the "UnbanUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > UnbanUser lifts a user's ban from a group chat. Gated as BanUser. + /// > It does not return them to the chat: they join (or enter a private + /// > group's lobby) again like anyone else. Unbanning a user who is not + /// > banned is a no-op that returns OK. Nothing is published. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_UnbanUserRequest` 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 unbanUser( + 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.unbanUser( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetRestrictedUsers" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetRestrictedUsers pages the users silenced or banned in a group chat, + /// > most recently restricted first, by the time of the latest silence or + /// > ban set on them. A silence that has lapsed is left out. Only a member + /// > the server permits to silence or to ban users in the chat may call it + /// > (see ViewerState.Permissions.moderation); anyone else, and any DM, is + /// > DENIED. The page is read from an index that trails writes + /// > briefly, so a user just restricted may be absent and one just + /// > released may be present. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Chat_V1_GetRestrictedUsersRequest` 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 getRestrictedUsers( + 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.getRestrictedUsers( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } } // Helpers providing sugared APIs for 'ClientProtocol' methods. @@ -4026,4 +4683,223 @@ extension Flipcash_Chat_V1_Chat.ClientProtocol { onResponse: handleResponse ) } + + /// Call the "SilenceUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > SilenceUser silences a user in a group chat, until a time or + /// > indefinitely: they may still read the chat, react and vote, but not + /// > send, edit, show typing, or do anything else that requires speaking + /// > in it (see ViewerState.Restrictions.silence). They may still delete + /// > their own messages. + /// > + /// > Public and private groups alike. Only a member the server permits to + /// > silence users in the chat may call it, as reported by + /// > ViewerState.Permissions.moderation.can_silence; anyone else, and any + /// > DM, is DENIED. The chat's creator cannot be silenced. + /// > + /// > The user need not be a member: a silence survives leaving and + /// > rejoining, and may be set before the user ever joins. Calling it again + /// > with a different duration replaces the silence; an identical request + /// > is a no-op that returns OK. A timed silence must end in the future; + /// > the server rejects one that does not. + /// > + /// > A real change reaches the silenced user's devices, while they are a + /// > member, as a MetadataUpdate.ViewerStateChanged on the event stream. + /// > Nobody else is told. + /// + /// - 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 silenceUser( + _ message: Flipcash_Chat_V1_SilenceUserRequest, + 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.silenceUser( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "UnsilenceUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > UnsilenceUser clears a user's silence in a group chat. Gated as + /// > SilenceUser. Unsilencing a user who is not silenced is a no-op that + /// > returns OK. A real change reaches the user's devices as SilenceUser's + /// > does. + /// + /// - 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 unsilenceUser( + _ message: Flipcash_Chat_V1_UnsilenceUserRequest, + 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.unsilenceUser( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "BanUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > BanUser bans a user from a group chat: a member is removed from its + /// > roster, a user waiting in a private group's lobby is removed from it, + /// > and the user cannot join, enter the lobby or be admitted until they + /// > are unbanned. A banned user may not read the chat as a non-member + /// > either (see the listener rules), though anyone may still see its + /// > redacted public view. Only a member the server permits to ban users + /// > in the chat may call it, as reported by + /// > ViewerState.Permissions.moderation.can_ban; anyone else, and any DM, + /// > is DENIED. The chat's creator cannot be banned. + /// > + /// > The user need not be a member, so a creator can ban someone before + /// > they join. Banning a user who is already banned is a no-op that + /// > returns OK. A ban leaves a silence as it is, and the user's messages + /// > stay in the chat. + /// > + /// > Removing a member is announced exactly like a departure: a + /// > RosterUpdate.MemberLeft to the banned user's devices, which does not + /// > say why, and the roster change to the chat's other members. A banned + /// > member of a private group loses their key envelope (see KeyEnvelope), + /// > as when leaving. They cannot fetch anything from the chat afterwards, + /// > but the server cannot take back the chat key they already opened: + /// > ciphertext of later messages that reached them some other way is + /// > readable to them, since the key is not rotated. + /// + /// - 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 banUser( + _ message: Flipcash_Chat_V1_BanUserRequest, + 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.banUser( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "UnbanUser" method. + /// + /// > Source IDL Documentation: + /// > + /// > UnbanUser lifts a user's ban from a group chat. Gated as BanUser. + /// > It does not return them to the chat: they join (or enter a private + /// > group's lobby) again like anyone else. Unbanning a user who is not + /// > banned is a no-op that returns OK. Nothing is published. + /// + /// - 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 unbanUser( + _ message: Flipcash_Chat_V1_UnbanUserRequest, + 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.unbanUser( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetRestrictedUsers" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetRestrictedUsers pages the users silenced or banned in a group chat, + /// > most recently restricted first, by the time of the latest silence or + /// > ban set on them. A silence that has lapsed is left out. Only a member + /// > the server permits to silence or to ban users in the chat may call it + /// > (see ViewerState.Permissions.moderation); anyone else, and any DM, is + /// > DENIED. The page is read from an index that trails writes + /// > briefly, so a user just restricted may be absent and one just + /// > released may be present. + /// + /// - 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 getRestrictedUsers( + _ message: Flipcash_Chat_V1_GetRestrictedUsersRequest, + 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.getRestrictedUsers( + request: request, + options: options, + onResponse: handleResponse + ) + } } \ No newline at end of file diff --git a/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.pb.swift b/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.pb.swift index 29ca7a2..f39b381 100644 --- a/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.pb.swift +++ b/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.pb.swift @@ -1024,6 +1024,9 @@ public struct Flipcash_Chat_V1_JoinChatResponse: Sendable { case denied // = 1 case notFound // = 2 case rulesNotSatisfied // = 3 + + /// The chat's creator banned the caller (see BanUser) + case banned // = 4 case UNRECOGNIZED(Int) public init() { @@ -1036,6 +1039,7 @@ public struct Flipcash_Chat_V1_JoinChatResponse: Sendable { case 1: self = .denied case 2: self = .notFound case 3: self = .rulesNotSatisfied + case 4: self = .banned default: self = .UNRECOGNIZED(rawValue) } } @@ -1046,6 +1050,7 @@ public struct Flipcash_Chat_V1_JoinChatResponse: Sendable { case .denied: return 1 case .notFound: return 2 case .rulesNotSatisfied: return 3 + case .banned: return 4 case .UNRECOGNIZED(let i): return i } } @@ -1056,6 +1061,7 @@ public struct Flipcash_Chat_V1_JoinChatResponse: Sendable { .denied, .notFound, .rulesNotSatisfied, + .banned, ] } @@ -1647,6 +1653,9 @@ public struct Flipcash_Chat_V1_EnterLobbyResponse: Sendable { /// Caller is waiting in as many lobbies as the server allows case tooManyLobbies // = 5 + + /// The chat's creator banned the caller (see BanUser) + case banned // = 6 case UNRECOGNIZED(Int) public init() { @@ -1661,6 +1670,7 @@ public struct Flipcash_Chat_V1_EnterLobbyResponse: Sendable { case 3: self = .alreadyMember case 4: self = .lobbyFull case 5: self = .tooManyLobbies + case 6: self = .banned default: self = .UNRECOGNIZED(rawValue) } } @@ -1673,6 +1683,7 @@ public struct Flipcash_Chat_V1_EnterLobbyResponse: Sendable { case .alreadyMember: return 3 case .lobbyFull: return 4 case .tooManyLobbies: return 5 + case .banned: return 6 case .UNRECOGNIZED(let i): return i } } @@ -1685,6 +1696,7 @@ public struct Flipcash_Chat_V1_EnterLobbyResponse: Sendable { .alreadyMember, .lobbyFull, .tooManyLobbies, + .banned, ] } @@ -2501,197 +2513,1151 @@ public struct Flipcash_Chat_V1_GetFeaturedGroupsResponse: Sendable { public init() {} } -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "flipcash.chat.v1" +public struct Flipcash_Chat_V1_SilenceUserRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. -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{3}view_mode\0\u{2}\u{8}auth\0") + 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 mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space 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.viewMode) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() - default: break - } - } + /// The user to silence. + 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 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.viewMode != .full { - try visitor.visitSingularEnumField(value: self.viewMode, fieldNumber: 2) - } - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try unknownFields.traverse(visitor: &visitor) + /// How long to silence them for. A timed silence must end in the future; + /// the server rejects one that does not. + public var silence: Flipcash_Chat_V1_SilenceState { + get {return _silence ?? Flipcash_Chat_V1_SilenceState()} + set {_silence = newValue} } + /// Returns true if `silence` has been explicitly set. + public var hasSilence: Bool {return self._silence != nil} + /// Clears the value of `silence`. Subsequent reads from it will return its default value. + public mutating func clearSilence() {self._silence = nil} - public static func ==(lhs: Flipcash_Chat_V1_GetChatRequest, rhs: Flipcash_Chat_V1_GetChatRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs.viewMode != rhs.viewMode {return false} - if lhs._auth != rhs._auth {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + 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 _userID: Flipcash_Common_V1_UserId? = nil + fileprivate var _silence: Flipcash_Chat_V1_SilenceState? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil } -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 struct Flipcash_Chat_V1_SilenceUserResponse: Sendable { + // SwiftProtobuf.Message 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 mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space 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 var result: Flipcash_Chat_V1_SilenceUserResponse.Result = .ok - 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 var unknownFields = SwiftProtobuf.UnknownStorage() - 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 - } -} + public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case ok // = 0 -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") -} + /// Caller may not silence users in this chat (see SilenceUser) + case denied // = 1 + case notFound // = 2 -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") + /// The user is the chat's creator + case cannotRestrictCreator // = 3 + case UNRECOGNIZED(Int) - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space 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 init() { + self = .ok + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .ok + case 1: self = .denied + case 2: self = .notFound + case 3: self = .cannotRestrictCreator + default: self = .UNRECOGNIZED(rawValue) } } - } - 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) + public var rawValue: Int { + switch self { + case .ok: return 0 + case .denied: return 1 + case .notFound: return 2 + case .cannotRestrictCreator: return 3 + case .UNRECOGNIZED(let i): return i + } } - 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 + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [Flipcash_Chat_V1_SilenceUserResponse.Result] = [ + .ok, + .denied, + .notFound, + .cannotRestrictCreator, + ] + } + + public init() {} } -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 struct Flipcash_Chat_V1_UnsilenceUserRequest: Sendable { + // SwiftProtobuf.Message 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 mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space 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 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 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) + /// The user to unsilence. + 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 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 + 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} -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") -} + public var unknownFields = SwiftProtobuf.UnknownStorage() -extension Flipcash_Chat_V1_GetGroupChatFeedRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetGroupChatFeedRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}query_options\0\u{2}\u{9}auth\0") + public init() {} + + fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil + fileprivate var _userID: Flipcash_Common_V1_UserId? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Chat_V1_UnsilenceUserResponse: Sendable { + // SwiftProtobuf.Message 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_UnsilenceUserResponse.Result = .ok + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case ok // = 0 + + /// Caller may not silence users in this chat (see SilenceUser) + 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_UnsilenceUserResponse.Result] = [ + .ok, + .denied, + .notFound, + ] + + } + + public init() {} +} + +public struct Flipcash_Chat_V1_BanUserRequest: Sendable { + // SwiftProtobuf.Message 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 user to ban. + 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 _chatID: Flipcash_Common_V1_ChatId? = nil + fileprivate var _userID: Flipcash_Common_V1_UserId? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Chat_V1_BanUserResponse: Sendable { + // SwiftProtobuf.Message 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_BanUserResponse.Result = .ok + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case ok // = 0 + + /// Caller may not ban users in this chat (see BanUser) + case denied // = 1 + case notFound // = 2 + + /// The user is the chat's creator + case cannotRestrictCreator // = 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 = .cannotRestrictCreator + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .ok: return 0 + case .denied: return 1 + case .notFound: return 2 + case .cannotRestrictCreator: 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_BanUserResponse.Result] = [ + .ok, + .denied, + .notFound, + .cannotRestrictCreator, + ] + + } + + public init() {} +} + +public struct Flipcash_Chat_V1_UnbanUserRequest: Sendable { + // SwiftProtobuf.Message 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 user to unban. + 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 _chatID: Flipcash_Common_V1_ChatId? = nil + fileprivate var _userID: Flipcash_Common_V1_UserId? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Chat_V1_UnbanUserResponse: Sendable { + // SwiftProtobuf.Message 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_UnbanUserResponse.Result = .ok + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case ok // = 0 + + /// Caller may not ban users in this chat (see BanUser) + 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_UnbanUserResponse.Result] = [ + .ok, + .denied, + .notFound, + ] + + } + + public init() {} +} + +public struct Flipcash_Chat_V1_GetRestrictedUsersRequest: Sendable { + // SwiftProtobuf.Message 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} + + /// QueryOptions controls page_size, capped at 100. Ordering is fixed to + /// most recently restricted first and is not client-selectable. + /// + /// Leave query_options.paging_token unset on the first request. On every + /// subsequent request, set it to the paging_token from the most recent + /// response. The token is opaque and server-generated; do not construct + /// it. It is bound to chat_id and refused with another chat. + 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 _chatID: Flipcash_Common_V1_ChatId? = nil + fileprivate var _queryOptions: Flipcash_Common_V1_QueryOptions? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Chat_V1_GetRestrictedUsersResponse: Sendable { + // SwiftProtobuf.Message 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_GetRestrictedUsersResponse.Result = .ok + + /// The page, most recently restricted first. Set when result is OK. + public var users: [Flipcash_Chat_V1_RestrictedUser] = [] + + /// PagingToken carries the cursor after the last user returned. The + /// client MUST send it back in query_options.paging_token on the next + /// GetRestrictedUsersRequest. 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 remain. When true, the client + /// should issue another GetRestrictedUsersRequest 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 + + /// Caller may neither silence nor ban users in this chat (see GetRestrictedUsers) + 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_GetRestrictedUsersResponse.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{3}view_mode\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.viewMode) }() + 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.viewMode != .full { + try visitor.visitSingularEnumField(value: self.viewMode, 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_GetChatRequest, rhs: Flipcash_Chat_V1_GetChatRequest) -> Bool { + if lhs._chatID != rhs._chatID {return false} + if lhs.viewMode != rhs.viewMode {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") +} + +extension Flipcash_Chat_V1_GetGroupChatFeedRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetGroupChatFeedRequest" + 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_Chat_V1_GetGroupChatFeedRequest, rhs: Flipcash_Chat_V1_GetGroupChatFeedRequest) -> 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_Chat_V1_GetGroupChatFeedResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetGroupChatFeedResponse" + 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_GetGroupChatFeedResponse, rhs: Flipcash_Chat_V1_GetGroupChatFeedResponse) -> 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_GetGroupChatFeedResponse.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_GetRosterRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetRosterRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}query_options\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._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._chatID { + try visitor.visitSingularMessageField(value: v, 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: 10) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_GetRosterRequest, rhs: Flipcash_Chat_V1_GetRosterRequest) -> Bool { + if lhs._chatID != rhs._chatID {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_Chat_V1_GetRosterResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetRosterResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}members\0\u{3}roster_summary\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.members) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._rosterSummary) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._pagingToken) }() + case 5: 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.members.isEmpty { + try visitor.visitRepeatedMessageField(value: self.members, fieldNumber: 2) + } + try { if let v = self._rosterSummary { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = self._pagingToken { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + if self.hasMore_p != false { + try visitor.visitSingularBoolField(value: self.hasMore_p, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_GetRosterResponse, rhs: Flipcash_Chat_V1_GetRosterResponse) -> Bool { + if lhs.result != rhs.result {return false} + if lhs.members != rhs.members {return false} + if lhs._rosterSummary != rhs._rosterSummary {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_GetRosterResponse.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_SampleChattersRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SampleChattersRequest" + 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_SampleChattersRequest, rhs: Flipcash_Chat_V1_SampleChattersRequest) -> 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_SampleChattersResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SampleChattersResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}chatters\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.chatters) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self.hasMore_p) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.result != .ok { + try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) + } + if !self.chatters.isEmpty { + try visitor.visitRepeatedMessageField(value: self.chatters, fieldNumber: 2) + } + if self.hasMore_p != false { + try visitor.visitSingularBoolField(value: self.hasMore_p, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_SampleChattersResponse, rhs: Flipcash_Chat_V1_SampleChattersResponse) -> Bool { + if lhs.result != rhs.result {return false} + if lhs.chatters != rhs.chatters {return false} + if lhs.hasMore_p != rhs.hasMore_p {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_SampleChattersResponse.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_GetMentionSuggestionsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetMentionSuggestionsRequest" + 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_GetMentionSuggestionsRequest, rhs: Flipcash_Chat_V1_GetMentionSuggestionsRequest) -> 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_GetMentionSuggestionsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetMentionSuggestionsResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}suggestions\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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.suggestions) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.result != .ok { + try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) + } + if !self.suggestions.isEmpty { + try visitor.visitRepeatedMessageField(value: self.suggestions, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_GetMentionSuggestionsResponse, rhs: Flipcash_Chat_V1_GetMentionSuggestionsResponse) -> Bool { + if lhs.result != rhs.result {return false} + if lhs.suggestions != rhs.suggestions {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_GetMentionSuggestionsResponse.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_StartChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".StartChatRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}public_group\0\u{3}private_group\0\u{4}\u{7}idempotency_key\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 { + var v: Flipcash_Chat_V1_StartChatRequest.PublicGroupChatParameters? + var hadOneofValue = false + if let current = self.parameters { + hadOneofValue = true + if case .publicGroup(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.parameters = .publicGroup(v) + } + }() + case 2: try { + var v: Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters? + var hadOneofValue = false + if let current = self.parameters { + hadOneofValue = true + if case .privateGroup(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.parameters = .privateGroup(v) + } + }() + case 9: try { try decoder.decodeSingularMessageField(value: &self._idempotencyKey) }() + 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 + switch self.parameters { + case .publicGroup?: try { + guard case .publicGroup(let v)? = self.parameters else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + }() + case .privateGroup?: try { + guard case .privateGroup(let v)? = self.parameters else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case nil: break + } + try { if let v = self._idempotencyKey { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + 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_StartChatRequest, rhs: Flipcash_Chat_V1_StartChatRequest) -> Bool { + if lhs.parameters != rhs.parameters {return false} + if lhs._idempotencyKey != rhs._idempotencyKey {return false} + if lhs._auth != rhs._auth {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_StartChatRequest.PublicGroupChatParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_StartChatRequest.protoMessageName + ".PublicGroupChatParameters" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}title\0\u{3}profile_picture\0\u{1}rules\0\u{1}description\0\u{3}cover_picture\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2699,8 +3665,11 @@ extension Flipcash_Chat_V1_GetGroupChatFeedRequest: SwiftProtobuf.Message, Swift // allocates stack space 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) }() + case 1: try { try decoder.decodeSingularStringField(value: &self.title) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._rules) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.description_p) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._coverPicture) }() default: break } } @@ -2711,26 +3680,87 @@ extension Flipcash_Chat_V1_GetGroupChatFeedRequest: SwiftProtobuf.Message, Swift // 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.title.isEmpty { + try visitor.visitSingularStringField(value: self.title, fieldNumber: 1) + } + try { if let v = self._profilePicture { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() - try { if let v = self._auth { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + try { if let v = self._rules { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if !self.description_p.isEmpty { + try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 4) + } + try { if let v = self._coverPicture { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_GetGroupChatFeedRequest, rhs: Flipcash_Chat_V1_GetGroupChatFeedRequest) -> Bool { - if lhs._queryOptions != rhs._queryOptions {return false} - if lhs._auth != rhs._auth {return false} + public static func ==(lhs: Flipcash_Chat_V1_StartChatRequest.PublicGroupChatParameters, rhs: Flipcash_Chat_V1_StartChatRequest.PublicGroupChatParameters) -> Bool { + if lhs.title != rhs.title {return false} + if lhs._profilePicture != rhs._profilePicture {return false} + if lhs._rules != rhs._rules {return false} + if lhs.description_p != rhs.description_p {return false} + if lhs._coverPicture != rhs._coverPicture {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_GetGroupChatFeedResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetGroupChatFeedResponse" - 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") +extension Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_StartChatRequest.protoMessageName + ".PrivateGroupChatParameters" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}title\0\u{3}profile_picture\0\u{1}description\0\u{3}cover_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.decodeSingularStringField(value: &self.title) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.description_p) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._coverPicture) }() + 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.title.isEmpty { + try visitor.visitSingularStringField(value: self.title, fieldNumber: 1) + } + try { if let v = self._profilePicture { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !self.description_p.isEmpty { + try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 3) + } + try { if let v = self._coverPicture { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters, rhs: Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters) -> Bool { + if lhs.title != rhs.title {return false} + if lhs._profilePicture != rhs._profilePicture {return false} + if lhs.description_p != rhs.description_p {return false} + if lhs._coverPicture != rhs._coverPicture {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_StartChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".StartChatResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}chat\0\u{3}flagged_category\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2739,9 +3769,8 @@ extension Flipcash_Chat_V1_GetGroupChatFeedResponse: SwiftProtobuf.Message, Swif // 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) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._chat) }() + case 3: try { try decoder.decodeSingularEnumField(value: &self.flaggedCategory) }() default: break } } @@ -2755,35 +3784,31 @@ extension Flipcash_Chat_V1_GetGroupChatFeedResponse: SwiftProtobuf.Message, Swif 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) + try { if let v = self._chat { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() - if self.hasMore_p != false { - try visitor.visitSingularBoolField(value: self.hasMore_p, fieldNumber: 4) + if self.flaggedCategory != .none { + try visitor.visitSingularEnumField(value: self.flaggedCategory, fieldNumber: 3) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_GetGroupChatFeedResponse, rhs: Flipcash_Chat_V1_GetGroupChatFeedResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_StartChatResponse, rhs: Flipcash_Chat_V1_StartChatResponse) -> 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._chat != rhs._chat {return false} + if lhs.flaggedCategory != rhs.flaggedCategory {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_GetGroupChatFeedResponse.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_StartChatResponse.Result: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}TITLE_MODERATED\0\u{1}PROFILE_PICTURE_BLOB_NOT_ACCEPTED\0\u{1}INVALID_RULES\0\u{1}RULES_NOT_SATISFIED\0\u{1}DESCRIPTION_MODERATED\0\u{1}COVER_PICTURE_BLOB_NOT_ACCEPTED\0") } -extension Flipcash_Chat_V1_GetRosterRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetRosterRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}query_options\0\u{2}\u{8}auth\0") +extension Flipcash_Chat_V1_JoinChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".JoinChatRequest" + 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() { @@ -2792,7 +3817,6 @@ extension Flipcash_Chat_V1_GetRosterRequest: SwiftProtobuf.Message, SwiftProtobu // 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._queryOptions) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -2807,27 +3831,23 @@ extension Flipcash_Chat_V1_GetRosterRequest: SwiftProtobuf.Message, SwiftProtobu try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, 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: 10) } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_GetRosterRequest, rhs: Flipcash_Chat_V1_GetRosterRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_JoinChatRequest, rhs: Flipcash_Chat_V1_JoinChatRequest) -> Bool { if lhs._chatID != rhs._chatID {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_Chat_V1_GetRosterResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetRosterResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}members\0\u{3}roster_summary\0\u{3}paging_token\0\u{3}has_more\0") +extension Flipcash_Chat_V1_JoinChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".JoinChatResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}chat\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2836,10 +3856,7 @@ extension Flipcash_Chat_V1_GetRosterResponse: SwiftProtobuf.Message, SwiftProtob // 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.members) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._rosterSummary) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._pagingToken) }() - case 5: try { try decoder.decodeSingularBoolField(value: &self.hasMore_p) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._chat) }() default: break } } @@ -2853,38 +3870,26 @@ extension Flipcash_Chat_V1_GetRosterResponse: SwiftProtobuf.Message, SwiftProtob if self.result != .ok { try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) } - if !self.members.isEmpty { - try visitor.visitRepeatedMessageField(value: self.members, fieldNumber: 2) - } - try { if let v = self._rosterSummary { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._pagingToken { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + try { if let v = self._chat { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() - if self.hasMore_p != false { - try visitor.visitSingularBoolField(value: self.hasMore_p, fieldNumber: 5) - } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_GetRosterResponse, rhs: Flipcash_Chat_V1_GetRosterResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_JoinChatResponse, rhs: Flipcash_Chat_V1_JoinChatResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs.members != rhs.members {return false} - if lhs._rosterSummary != rhs._rosterSummary {return false} - if lhs._pagingToken != rhs._pagingToken {return false} - if lhs.hasMore_p != rhs.hasMore_p {return false} + if lhs._chat != rhs._chat {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_GetRosterResponse.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_JoinChatResponse.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}RULES_NOT_SATISFIED\0\u{1}BANNED\0") } -extension Flipcash_Chat_V1_SampleChattersRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SampleChattersRequest" +extension Flipcash_Chat_V1_LeaveChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".LeaveChatRequest" 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 { @@ -2914,7 +3919,7 @@ extension Flipcash_Chat_V1_SampleChattersRequest: SwiftProtobuf.Message, SwiftPr try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_SampleChattersRequest, rhs: Flipcash_Chat_V1_SampleChattersRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_LeaveChatRequest, rhs: Flipcash_Chat_V1_LeaveChatRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -2922,9 +3927,9 @@ extension Flipcash_Chat_V1_SampleChattersRequest: SwiftProtobuf.Message, SwiftPr } } -extension Flipcash_Chat_V1_SampleChattersResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SampleChattersResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}chatters\0\u{3}has_more\0") +extension Flipcash_Chat_V1_LeaveChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".LeaveChatResponse" + 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() { @@ -2933,8 +3938,6 @@ extension Flipcash_Chat_V1_SampleChattersResponse: SwiftProtobuf.Message, SwiftP // 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.chatters) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self.hasMore_p) }() default: break } } @@ -2944,31 +3947,23 @@ extension Flipcash_Chat_V1_SampleChattersResponse: SwiftProtobuf.Message, SwiftP if self.result != .ok { try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) } - if !self.chatters.isEmpty { - try visitor.visitRepeatedMessageField(value: self.chatters, fieldNumber: 2) - } - if self.hasMore_p != false { - try visitor.visitSingularBoolField(value: self.hasMore_p, fieldNumber: 3) - } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_SampleChattersResponse, rhs: Flipcash_Chat_V1_SampleChattersResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_LeaveChatResponse, rhs: Flipcash_Chat_V1_LeaveChatResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs.chatters != rhs.chatters {return false} - if lhs.hasMore_p != rhs.hasMore_p {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_SampleChattersResponse.Result: SwiftProtobuf._ProtoNameProviding { +extension Flipcash_Chat_V1_LeaveChatResponse.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_GetMentionSuggestionsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetMentionSuggestionsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{2}\u{9}auth\0") +extension Flipcash_Chat_V1_EditChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".EditChatRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}title\0\u{3}profile_picture\0\u{1}description\0\u{3}cover_picture\0\u{2}\u{5}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2977,6 +3972,10 @@ extension Flipcash_Chat_V1_GetMentionSuggestionsRequest: SwiftProtobuf.Message, // 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._title) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._description_p) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._coverPicture) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -2991,23 +3990,39 @@ extension Flipcash_Chat_V1_GetMentionSuggestionsRequest: SwiftProtobuf.Message, try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() + try { if let v = self._title { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = self._profilePicture { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = self._description_p { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = self._coverPicture { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() 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_GetMentionSuggestionsRequest, rhs: Flipcash_Chat_V1_GetMentionSuggestionsRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_EditChatRequest, rhs: Flipcash_Chat_V1_EditChatRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} + if lhs._title != rhs._title {return false} + if lhs._profilePicture != rhs._profilePicture {return false} + if lhs._description_p != rhs._description_p {return false} + if lhs._coverPicture != rhs._coverPicture {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_GetMentionSuggestionsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetMentionSuggestionsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}suggestions\0") +extension Flipcash_Chat_V1_EditChatRequest.Title: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_EditChatRequest.protoMessageName + ".Title" + 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() { @@ -3015,38 +4030,29 @@ extension Flipcash_Chat_V1_GetMentionSuggestionsResponse: SwiftProtobuf.Message, // allocates stack space 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.suggestions) }() + case 1: try { try decoder.decodeSingularStringField(value: &self.value) }() default: break } } } public func traverse(visitor: inout V) throws { - if self.result != .ok { - try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) - } - if !self.suggestions.isEmpty { - try visitor.visitRepeatedMessageField(value: self.suggestions, fieldNumber: 2) + if !self.value.isEmpty { + try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_GetMentionSuggestionsResponse, rhs: Flipcash_Chat_V1_GetMentionSuggestionsResponse) -> Bool { - if lhs.result != rhs.result {return false} - if lhs.suggestions != rhs.suggestions {return false} + public static func ==(lhs: Flipcash_Chat_V1_EditChatRequest.Title, rhs: Flipcash_Chat_V1_EditChatRequest.Title) -> Bool { + if lhs.value != rhs.value {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_GetMentionSuggestionsResponse.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_StartChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StartChatRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}public_group\0\u{3}private_group\0\u{4}\u{7}idempotency_key\0\u{1}auth\0") +extension Flipcash_Chat_V1_EditChatRequest.ProfilePicture: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_EditChatRequest.protoMessageName + ".ProfilePicture" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}blob_id\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3054,34 +4060,7 @@ extension Flipcash_Chat_V1_StartChatRequest: SwiftProtobuf.Message, SwiftProtobu // allocates 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_StartChatRequest.PublicGroupChatParameters? - var hadOneofValue = false - if let current = self.parameters { - hadOneofValue = true - if case .publicGroup(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.parameters = .publicGroup(v) - } - }() - case 2: try { - var v: Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters? - var hadOneofValue = false - if let current = self.parameters { - hadOneofValue = true - if case .privateGroup(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.parameters = .privateGroup(v) - } - }() - case 9: try { try decoder.decodeSingularMessageField(value: &self._idempotencyKey) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() + case 1: try { try decoder.decodeSingularMessageField(value: &self._blobID) }() default: break } } @@ -3092,38 +4071,22 @@ extension Flipcash_Chat_V1_StartChatRequest: SwiftProtobuf.Message, SwiftProtobu // 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.parameters { - case .publicGroup?: try { - guard case .publicGroup(let v)? = self.parameters else { preconditionFailure() } + try { if let v = self._blobID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .privateGroup?: try { - guard case .privateGroup(let v)? = self.parameters else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try { if let v = self._idempotencyKey { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - 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_StartChatRequest, rhs: Flipcash_Chat_V1_StartChatRequest) -> Bool { - if lhs.parameters != rhs.parameters {return false} - if lhs._idempotencyKey != rhs._idempotencyKey {return false} - if lhs._auth != rhs._auth {return false} + public static func ==(lhs: Flipcash_Chat_V1_EditChatRequest.ProfilePicture, rhs: Flipcash_Chat_V1_EditChatRequest.ProfilePicture) -> Bool { + if lhs._blobID != rhs._blobID {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_StartChatRequest.PublicGroupChatParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Chat_V1_StartChatRequest.protoMessageName + ".PublicGroupChatParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}title\0\u{3}profile_picture\0\u{1}rules\0\u{1}description\0\u{3}cover_picture\0") +extension Flipcash_Chat_V1_EditChatRequest.Description: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_EditChatRequest.protoMessageName + ".Description" + 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() { @@ -3131,53 +4094,29 @@ extension Flipcash_Chat_V1_StartChatRequest.PublicGroupChatParameters: SwiftProt // allocates stack space 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.title) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._rules) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.description_p) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._coverPicture) }() + case 1: try { try decoder.decodeSingularStringField(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 - if !self.title.isEmpty { - try visitor.visitSingularStringField(value: self.title, fieldNumber: 1) - } - try { if let v = self._profilePicture { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._rules { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !self.description_p.isEmpty { - try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 4) + if !self.value.isEmpty { + try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) } - try { if let v = self._coverPicture { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_StartChatRequest.PublicGroupChatParameters, rhs: Flipcash_Chat_V1_StartChatRequest.PublicGroupChatParameters) -> Bool { - if lhs.title != rhs.title {return false} - if lhs._profilePicture != rhs._profilePicture {return false} - if lhs._rules != rhs._rules {return false} - if lhs.description_p != rhs.description_p {return false} - if lhs._coverPicture != rhs._coverPicture {return false} + public static func ==(lhs: Flipcash_Chat_V1_EditChatRequest.Description, rhs: Flipcash_Chat_V1_EditChatRequest.Description) -> Bool { + if lhs.value != rhs.value {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Chat_V1_StartChatRequest.protoMessageName + ".PrivateGroupChatParameters" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}title\0\u{3}profile_picture\0\u{1}description\0\u{3}cover_picture\0") +extension Flipcash_Chat_V1_EditChatRequest.CoverPicture: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_EditChatRequest.protoMessageName + ".CoverPicture" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}blob_id\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3185,10 +4124,7 @@ extension Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters: SwiftPro // allocates stack space 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.title) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.description_p) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._coverPicture) }() + case 1: try { try decoder.decodeSingularMessageField(value: &self._blobID) }() default: break } } @@ -3199,33 +4135,21 @@ extension Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters: SwiftPro // 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.title.isEmpty { - try visitor.visitSingularStringField(value: self.title, fieldNumber: 1) - } - try { if let v = self._profilePicture { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.description_p.isEmpty { - try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 3) - } - try { if let v = self._coverPicture { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + try { if let v = self._blobID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters, rhs: Flipcash_Chat_V1_StartChatRequest.PrivateGroupChatParameters) -> Bool { - if lhs.title != rhs.title {return false} - if lhs._profilePicture != rhs._profilePicture {return false} - if lhs.description_p != rhs.description_p {return false} - if lhs._coverPicture != rhs._coverPicture {return false} + public static func ==(lhs: Flipcash_Chat_V1_EditChatRequest.CoverPicture, rhs: Flipcash_Chat_V1_EditChatRequest.CoverPicture) -> Bool { + if lhs._blobID != rhs._blobID {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_StartChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StartChatResponse" +extension Flipcash_Chat_V1_EditChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".EditChatResponse" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}chat\0\u{3}flagged_category\0") public mutating func decodeMessage(decoder: inout D) throws { @@ -3259,7 +4183,7 @@ extension Flipcash_Chat_V1_StartChatResponse: SwiftProtobuf.Message, SwiftProtob try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_StartChatResponse, rhs: Flipcash_Chat_V1_StartChatResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_EditChatResponse, rhs: Flipcash_Chat_V1_EditChatResponse) -> Bool { if lhs.result != rhs.result {return false} if lhs._chat != rhs._chat {return false} if lhs.flaggedCategory != rhs.flaggedCategory {return false} @@ -3268,13 +4192,13 @@ extension Flipcash_Chat_V1_StartChatResponse: SwiftProtobuf.Message, SwiftProtob } } -extension Flipcash_Chat_V1_StartChatResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}TITLE_MODERATED\0\u{1}PROFILE_PICTURE_BLOB_NOT_ACCEPTED\0\u{1}INVALID_RULES\0\u{1}RULES_NOT_SATISFIED\0\u{1}DESCRIPTION_MODERATED\0\u{1}COVER_PICTURE_BLOB_NOT_ACCEPTED\0") +extension Flipcash_Chat_V1_EditChatResponse.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}TITLE_MODERATED\0\u{1}PROFILE_PICTURE_BLOB_NOT_ACCEPTED\0\u{1}COVER_PICTURE_BLOB_NOT_ACCEPTED\0\u{1}DESCRIPTION_MODERATED\0") } -extension Flipcash_Chat_V1_JoinChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".JoinChatRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{2}\u{9}auth\0") +extension Flipcash_Chat_V1_MuteChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".MuteChatRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}mute\0\u{2}\u{8}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3283,6 +4207,7 @@ extension Flipcash_Chat_V1_JoinChatRequest: SwiftProtobuf.Message, SwiftProtobuf // 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._mute) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -3297,23 +4222,27 @@ extension Flipcash_Chat_V1_JoinChatRequest: SwiftProtobuf.Message, SwiftProtobuf try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() + try { if let v = self._mute { + 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_Chat_V1_JoinChatRequest, rhs: Flipcash_Chat_V1_JoinChatRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_MuteChatRequest, rhs: Flipcash_Chat_V1_MuteChatRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} + if lhs._mute != rhs._mute {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_JoinChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".JoinChatResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}chat\0") +extension Flipcash_Chat_V1_MuteChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".MuteChatResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}viewer_state\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3322,7 +4251,7 @@ extension Flipcash_Chat_V1_JoinChatResponse: SwiftProtobuf.Message, SwiftProtobu // 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._chat) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._viewerState) }() default: break } } @@ -3336,26 +4265,26 @@ extension Flipcash_Chat_V1_JoinChatResponse: SwiftProtobuf.Message, SwiftProtobu if self.result != .ok { try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) } - try { if let v = self._chat { + try { if let v = self._viewerState { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_JoinChatResponse, rhs: Flipcash_Chat_V1_JoinChatResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_MuteChatResponse, rhs: Flipcash_Chat_V1_MuteChatResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs._chat != rhs._chat {return false} + if lhs._viewerState != rhs._viewerState {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_JoinChatResponse.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}RULES_NOT_SATISFIED\0") +extension Flipcash_Chat_V1_MuteChatResponse.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_LeaveChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LeaveChatRequest" +extension Flipcash_Chat_V1_UnmuteChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".UnmuteChatRequest" 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 { @@ -3385,7 +4314,7 @@ extension Flipcash_Chat_V1_LeaveChatRequest: SwiftProtobuf.Message, SwiftProtobu try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_LeaveChatRequest, rhs: Flipcash_Chat_V1_LeaveChatRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_UnmuteChatRequest, rhs: Flipcash_Chat_V1_UnmuteChatRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -3393,9 +4322,9 @@ extension Flipcash_Chat_V1_LeaveChatRequest: SwiftProtobuf.Message, SwiftProtobu } } -extension Flipcash_Chat_V1_LeaveChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LeaveChatResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") +extension Flipcash_Chat_V1_UnmuteChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".UnmuteChatResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}viewer_state\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3404,32 +4333,41 @@ extension Flipcash_Chat_V1_LeaveChatResponse: SwiftProtobuf.Message, SwiftProtob // 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._viewerState) }() 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._viewerState { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_LeaveChatResponse, rhs: Flipcash_Chat_V1_LeaveChatResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_UnmuteChatResponse, rhs: Flipcash_Chat_V1_UnmuteChatResponse) -> Bool { if lhs.result != rhs.result {return false} + if lhs._viewerState != rhs._viewerState {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_LeaveChatResponse.Result: SwiftProtobuf._ProtoNameProviding { +extension Flipcash_Chat_V1_UnmuteChatResponse.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_EditChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EditChatRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}title\0\u{3}profile_picture\0\u{1}description\0\u{3}cover_picture\0\u{2}\u{5}auth\0") +extension Flipcash_Chat_V1_EnterLobbyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".EnterLobbyRequest" + 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() { @@ -3438,10 +4376,6 @@ extension Flipcash_Chat_V1_EditChatRequest: SwiftProtobuf.Message, SwiftProtobuf // 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._title) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._description_p) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._coverPicture) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -3456,39 +4390,23 @@ extension Flipcash_Chat_V1_EditChatRequest: SwiftProtobuf.Message, SwiftProtobuf try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() - try { if let v = self._title { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._profilePicture { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._description_p { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._coverPicture { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() 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_EditChatRequest, rhs: Flipcash_Chat_V1_EditChatRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_EnterLobbyRequest, rhs: Flipcash_Chat_V1_EnterLobbyRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} - if lhs._title != rhs._title {return false} - if lhs._profilePicture != rhs._profilePicture {return false} - if lhs._description_p != rhs._description_p {return false} - if lhs._coverPicture != rhs._coverPicture {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_EditChatRequest.Title: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Chat_V1_EditChatRequest.protoMessageName + ".Title" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") +extension Flipcash_Chat_V1_EnterLobbyResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".EnterLobbyResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}lobby\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3496,29 +4414,42 @@ extension Flipcash_Chat_V1_EditChatRequest.Title: SwiftProtobuf.Message, SwiftPr // allocates stack space 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 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._lobby) }() default: break } } } public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) + // 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._lobby { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_EditChatRequest.Title, rhs: Flipcash_Chat_V1_EditChatRequest.Title) -> Bool { - if lhs.value != rhs.value {return false} + public static func ==(lhs: Flipcash_Chat_V1_EnterLobbyResponse, rhs: Flipcash_Chat_V1_EnterLobbyResponse) -> Bool { + if lhs.result != rhs.result {return false} + if lhs._lobby != rhs._lobby {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_EditChatRequest.ProfilePicture: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Chat_V1_EditChatRequest.protoMessageName + ".ProfilePicture" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}blob_id\0") +extension Flipcash_Chat_V1_EnterLobbyResponse.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}ALREADY_MEMBER\0\u{1}LOBBY_FULL\0\u{1}TOO_MANY_LOBBIES\0\u{1}BANNED\0") +} + +extension Flipcash_Chat_V1_LeaveLobbyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".LeaveLobbyRequest" + 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() { @@ -3526,7 +4457,8 @@ extension Flipcash_Chat_V1_EditChatRequest.ProfilePicture: SwiftProtobuf.Message // allocates stack space 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 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() + case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } } @@ -3537,22 +4469,26 @@ extension Flipcash_Chat_V1_EditChatRequest.ProfilePicture: SwiftProtobuf.Message // 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 { 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_EditChatRequest.ProfilePicture, rhs: Flipcash_Chat_V1_EditChatRequest.ProfilePicture) -> Bool { - if lhs._blobID != rhs._blobID {return false} + public static func ==(lhs: Flipcash_Chat_V1_LeaveLobbyRequest, rhs: Flipcash_Chat_V1_LeaveLobbyRequest) -> 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_EditChatRequest.Description: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Chat_V1_EditChatRequest.protoMessageName + ".Description" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}value\0") +extension Flipcash_Chat_V1_LeaveLobbyResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".LeaveLobbyResponse" + 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() { @@ -3560,29 +4496,33 @@ extension Flipcash_Chat_V1_EditChatRequest.Description: SwiftProtobuf.Message, S // allocates stack space 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 1: try { try decoder.decodeSingularEnumField(value: &self.result) }() default: break } } } public func traverse(visitor: inout V) throws { - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 1) + if self.result != .ok { + try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_EditChatRequest.Description, rhs: Flipcash_Chat_V1_EditChatRequest.Description) -> Bool { - if lhs.value != rhs.value {return false} + public static func ==(lhs: Flipcash_Chat_V1_LeaveLobbyResponse, rhs: Flipcash_Chat_V1_LeaveLobbyResponse) -> Bool { + if lhs.result != rhs.result {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_EditChatRequest.CoverPicture: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Flipcash_Chat_V1_EditChatRequest.protoMessageName + ".CoverPicture" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}blob_id\0") +extension Flipcash_Chat_V1_LeaveLobbyResponse.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_GetLobbyMembersRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetLobbyMembersRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}query_options\0\u{2}\u{8}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3590,7 +4530,9 @@ extension Flipcash_Chat_V1_EditChatRequest.CoverPicture: SwiftProtobuf.Message, // allocates stack space 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 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._queryOptions) }() + case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } } @@ -3601,22 +4543,30 @@ extension Flipcash_Chat_V1_EditChatRequest.CoverPicture: SwiftProtobuf.Message, // 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 { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, 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: 10) + } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_EditChatRequest.CoverPicture, rhs: Flipcash_Chat_V1_EditChatRequest.CoverPicture) -> Bool { - if lhs._blobID != rhs._blobID {return false} + public static func ==(lhs: Flipcash_Chat_V1_GetLobbyMembersRequest, rhs: Flipcash_Chat_V1_GetLobbyMembersRequest) -> Bool { + if lhs._chatID != rhs._chatID {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_Chat_V1_EditChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EditChatResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}chat\0\u{3}flagged_category\0") +extension Flipcash_Chat_V1_GetLobbyMembersResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetLobbyMembersResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}members\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() { @@ -3625,8 +4575,9 @@ extension Flipcash_Chat_V1_EditChatResponse: SwiftProtobuf.Message, SwiftProtobu // 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._chat) }() - case 3: try { try decoder.decodeSingularEnumField(value: &self.flaggedCategory) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.members) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._pagingToken) }() + case 4: try { try decoder.decodeSingularBoolField(value: &self.hasMore_p) }() default: break } } @@ -3640,31 +4591,35 @@ extension Flipcash_Chat_V1_EditChatResponse: SwiftProtobuf.Message, SwiftProtobu if self.result != .ok { try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) } - try { if let v = self._chat { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + if !self.members.isEmpty { + try visitor.visitRepeatedMessageField(value: self.members, fieldNumber: 2) + } + try { if let v = self._pagingToken { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) } }() - if self.flaggedCategory != .none { - try visitor.visitSingularEnumField(value: self.flaggedCategory, 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_EditChatResponse, rhs: Flipcash_Chat_V1_EditChatResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_GetLobbyMembersResponse, rhs: Flipcash_Chat_V1_GetLobbyMembersResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs._chat != rhs._chat {return false} - if lhs.flaggedCategory != rhs.flaggedCategory {return false} + if lhs.members != rhs.members {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_EditChatResponse.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}TITLE_MODERATED\0\u{1}PROFILE_PICTURE_BLOB_NOT_ACCEPTED\0\u{1}COVER_PICTURE_BLOB_NOT_ACCEPTED\0\u{1}DESCRIPTION_MODERATED\0") +extension Flipcash_Chat_V1_GetLobbyMembersResponse.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_MuteChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MuteChatRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}mute\0\u{2}\u{8}auth\0") +extension Flipcash_Chat_V1_AdmitLobbyMemberRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".AdmitLobbyMemberRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}user_id\0\u{3}key_envelope\0\u{2}\u{7}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3673,7 +4628,8 @@ extension Flipcash_Chat_V1_MuteChatRequest: SwiftProtobuf.Message, SwiftProtobuf // 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._mute) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._userID) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._keyEnvelope) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -3688,27 +4644,31 @@ extension Flipcash_Chat_V1_MuteChatRequest: SwiftProtobuf.Message, SwiftProtobuf try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() - try { if let v = self._mute { + try { if let v = self._userID { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() + try { if let v = self._keyEnvelope { + 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_Chat_V1_MuteChatRequest, rhs: Flipcash_Chat_V1_MuteChatRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_AdmitLobbyMemberRequest, rhs: Flipcash_Chat_V1_AdmitLobbyMemberRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} - if lhs._mute != rhs._mute {return false} + if lhs._userID != rhs._userID {return false} + if lhs._keyEnvelope != rhs._keyEnvelope {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_MuteChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MuteChatResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}viewer_state\0") +extension Flipcash_Chat_V1_AdmitLobbyMemberResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".AdmitLobbyMemberResponse" + 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() { @@ -3717,41 +4677,32 @@ extension Flipcash_Chat_V1_MuteChatResponse: SwiftProtobuf.Message, SwiftProtobu // 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._viewerState) }() 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._viewerState { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_MuteChatResponse, rhs: Flipcash_Chat_V1_MuteChatResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_AdmitLobbyMemberResponse, rhs: Flipcash_Chat_V1_AdmitLobbyMemberResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs._viewerState != rhs._viewerState {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_MuteChatResponse.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_AdmitLobbyMemberResponse.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}NOT_IN_LOBBY\0") } -extension Flipcash_Chat_V1_UnmuteChatRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnmuteChatRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{2}\u{9}auth\0") +extension Flipcash_Chat_V1_DenyLobbyMemberRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".DenyLobbyMemberRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}user_id\0\u{2}\u{8}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3760,6 +4711,7 @@ extension Flipcash_Chat_V1_UnmuteChatRequest: SwiftProtobuf.Message, SwiftProtob // 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._userID) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -3774,23 +4726,27 @@ extension Flipcash_Chat_V1_UnmuteChatRequest: SwiftProtobuf.Message, SwiftProtob try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() + try { if let v = self._userID { + 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_Chat_V1_UnmuteChatRequest, rhs: Flipcash_Chat_V1_UnmuteChatRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_DenyLobbyMemberRequest, rhs: Flipcash_Chat_V1_DenyLobbyMemberRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} + 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_Chat_V1_UnmuteChatResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UnmuteChatResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}viewer_state\0") +extension Flipcash_Chat_V1_DenyLobbyMemberResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".DenyLobbyMemberResponse" + 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() { @@ -3799,41 +4755,32 @@ extension Flipcash_Chat_V1_UnmuteChatResponse: SwiftProtobuf.Message, SwiftProto // 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._viewerState) }() 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._viewerState { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_UnmuteChatResponse, rhs: Flipcash_Chat_V1_UnmuteChatResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_DenyLobbyMemberResponse, rhs: Flipcash_Chat_V1_DenyLobbyMemberResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs._viewerState != rhs._viewerState {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_UnmuteChatResponse.Result: SwiftProtobuf._ProtoNameProviding { +extension Flipcash_Chat_V1_DenyLobbyMemberResponse.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_EnterLobbyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EnterLobbyRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{2}\u{9}auth\0") +extension Flipcash_Chat_V1_SetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SetKeyEnvelopeRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}key_envelope\0\u{2}\u{8}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3842,6 +4789,7 @@ extension Flipcash_Chat_V1_EnterLobbyRequest: SwiftProtobuf.Message, SwiftProtob // 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._keyEnvelope) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -3856,23 +4804,27 @@ extension Flipcash_Chat_V1_EnterLobbyRequest: SwiftProtobuf.Message, SwiftProtob try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() + try { if let v = self._keyEnvelope { + 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_Chat_V1_EnterLobbyRequest, rhs: Flipcash_Chat_V1_EnterLobbyRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_SetKeyEnvelopeRequest, rhs: Flipcash_Chat_V1_SetKeyEnvelopeRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} + if lhs._keyEnvelope != rhs._keyEnvelope {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_EnterLobbyResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EnterLobbyResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}lobby\0") +extension Flipcash_Chat_V1_SetKeyEnvelopeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SetKeyEnvelopeResponse" + 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() { @@ -3881,40 +4833,31 @@ extension Flipcash_Chat_V1_EnterLobbyResponse: SwiftProtobuf.Message, SwiftProto // 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._lobby) }() 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._lobby { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_EnterLobbyResponse, rhs: Flipcash_Chat_V1_EnterLobbyResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_SetKeyEnvelopeResponse, rhs: Flipcash_Chat_V1_SetKeyEnvelopeResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs._lobby != rhs._lobby {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_EnterLobbyResponse.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}ALREADY_MEMBER\0\u{1}LOBBY_FULL\0\u{1}TOO_MANY_LOBBIES\0") +extension Flipcash_Chat_V1_SetKeyEnvelopeResponse.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}ALREADY_SET\0") } -extension Flipcash_Chat_V1_LeaveLobbyRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LeaveLobbyRequest" +extension Flipcash_Chat_V1_GetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetKeyEnvelopeRequest" 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 { @@ -3944,7 +4887,7 @@ extension Flipcash_Chat_V1_LeaveLobbyRequest: SwiftProtobuf.Message, SwiftProtob try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_LeaveLobbyRequest, rhs: Flipcash_Chat_V1_LeaveLobbyRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_GetKeyEnvelopeRequest, rhs: Flipcash_Chat_V1_GetKeyEnvelopeRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -3952,9 +4895,9 @@ extension Flipcash_Chat_V1_LeaveLobbyRequest: SwiftProtobuf.Message, SwiftProtob } } -extension Flipcash_Chat_V1_LeaveLobbyResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LeaveLobbyResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") +extension Flipcash_Chat_V1_GetKeyEnvelopeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetKeyEnvelopeResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}key_envelope\0\u{3}wrapped_by\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3963,32 +4906,46 @@ extension Flipcash_Chat_V1_LeaveLobbyResponse: SwiftProtobuf.Message, SwiftProto // 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._keyEnvelope) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._wrappedBy) }() 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._keyEnvelope { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = self._wrappedBy { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_LeaveLobbyResponse, rhs: Flipcash_Chat_V1_LeaveLobbyResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_GetKeyEnvelopeResponse, rhs: Flipcash_Chat_V1_GetKeyEnvelopeResponse) -> Bool { if lhs.result != rhs.result {return false} + if lhs._keyEnvelope != rhs._keyEnvelope {return false} + if lhs._wrappedBy != rhs._wrappedBy {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_LeaveLobbyResponse.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_GetKeyEnvelopeResponse.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}NO_ENVELOPE\0") } -extension Flipcash_Chat_V1_GetLobbyMembersRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetLobbyMembersRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}query_options\0\u{2}\u{8}auth\0") +extension Flipcash_Chat_V1_SetFeaturedGroupsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SetFeaturedGroupsRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_ids\0\u{2}\u{9}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3996,8 +4953,7 @@ extension Flipcash_Chat_V1_GetLobbyMembersRequest: SwiftProtobuf.Message, SwiftP // allocates stack space 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._queryOptions) }() + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.chatIds) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -4009,30 +4965,26 @@ extension Flipcash_Chat_V1_GetLobbyMembersRequest: SwiftProtobuf.Message, SwiftP // 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._queryOptions { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() + if !self.chatIds.isEmpty { + try visitor.visitRepeatedMessageField(value: self.chatIds, 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_GetLobbyMembersRequest, rhs: Flipcash_Chat_V1_GetLobbyMembersRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._queryOptions != rhs._queryOptions {return false} + public static func ==(lhs: Flipcash_Chat_V1_SetFeaturedGroupsRequest, rhs: Flipcash_Chat_V1_SetFeaturedGroupsRequest) -> Bool { + if lhs.chatIds != rhs.chatIds {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_GetLobbyMembersResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetLobbyMembersResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}members\0\u{3}paging_token\0\u{3}has_more\0") +extension Flipcash_Chat_V1_SetFeaturedGroupsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SetFeaturedGroupsResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}featured_groups\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4041,51 +4993,37 @@ extension Flipcash_Chat_V1_GetLobbyMembersResponse: SwiftProtobuf.Message, Swift // 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.members) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._pagingToken) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.hasMore_p) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.featuredGroups) }() 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.members.isEmpty { - try visitor.visitRepeatedMessageField(value: self.members, 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) + if !self.featuredGroups.isEmpty { + try visitor.visitRepeatedMessageField(value: self.featuredGroups, fieldNumber: 2) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_GetLobbyMembersResponse, rhs: Flipcash_Chat_V1_GetLobbyMembersResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_SetFeaturedGroupsResponse, rhs: Flipcash_Chat_V1_SetFeaturedGroupsResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs.members != rhs.members {return false} - if lhs._pagingToken != rhs._pagingToken {return false} - if lhs.hasMore_p != rhs.hasMore_p {return false} + if lhs.featuredGroups != rhs.featuredGroups {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_GetLobbyMembersResponse.Result: SwiftProtobuf._ProtoNameProviding { +extension Flipcash_Chat_V1_SetFeaturedGroupsResponse.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_AdmitLobbyMemberRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AdmitLobbyMemberRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}user_id\0\u{3}key_envelope\0\u{2}\u{7}auth\0") +extension Flipcash_Chat_V1_GetFeaturedGroupsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetFeaturedGroupsRequest" + 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() { @@ -4093,9 +5031,19 @@ extension Flipcash_Chat_V1_AdmitLobbyMemberRequest: SwiftProtobuf.Message, Swift // allocates stack space 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._userID) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._keyEnvelope) }() + case 1: 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) + } + }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -4107,34 +5055,26 @@ extension Flipcash_Chat_V1_AdmitLobbyMemberRequest: SwiftProtobuf.Message, Swift // 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 { if case .username(let v)? = self.identifier { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() - try { if let v = self._userID { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._keyEnvelope { - 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_Chat_V1_AdmitLobbyMemberRequest, rhs: Flipcash_Chat_V1_AdmitLobbyMemberRequest) -> Bool { - if lhs._chatID != rhs._chatID {return false} - if lhs._userID != rhs._userID {return false} - if lhs._keyEnvelope != rhs._keyEnvelope {return false} + public static func ==(lhs: Flipcash_Chat_V1_GetFeaturedGroupsRequest, rhs: Flipcash_Chat_V1_GetFeaturedGroupsRequest) -> 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_Chat_V1_AdmitLobbyMemberResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".AdmitLobbyMemberResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") +extension Flipcash_Chat_V1_GetFeaturedGroupsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetFeaturedGroupsResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}featured_groups\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4143,6 +5083,7 @@ extension Flipcash_Chat_V1_AdmitLobbyMemberResponse: SwiftProtobuf.Message, Swif // 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.featuredGroups) }() default: break } } @@ -4152,23 +5093,27 @@ extension Flipcash_Chat_V1_AdmitLobbyMemberResponse: SwiftProtobuf.Message, Swif if self.result != .ok { try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) } + if !self.featuredGroups.isEmpty { + try visitor.visitRepeatedMessageField(value: self.featuredGroups, fieldNumber: 2) + } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_AdmitLobbyMemberResponse, rhs: Flipcash_Chat_V1_AdmitLobbyMemberResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_GetFeaturedGroupsResponse, rhs: Flipcash_Chat_V1_GetFeaturedGroupsResponse) -> Bool { if lhs.result != rhs.result {return false} + if lhs.featuredGroups != rhs.featuredGroups {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_AdmitLobbyMemberResponse.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}NOT_IN_LOBBY\0") +extension Flipcash_Chat_V1_GetFeaturedGroupsResponse.Result: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0") } -extension Flipcash_Chat_V1_DenyLobbyMemberRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DenyLobbyMemberRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}user_id\0\u{2}\u{8}auth\0") +extension Flipcash_Chat_V1_SilenceUserRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SilenceUserRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}user_id\0\u{1}silence\0\u{2}\u{7}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4178,6 +5123,7 @@ extension Flipcash_Chat_V1_DenyLobbyMemberRequest: SwiftProtobuf.Message, SwiftP switch fieldNumber { case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() case 2: try { try decoder.decodeSingularMessageField(value: &self._userID) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._silence) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -4195,23 +5141,27 @@ extension Flipcash_Chat_V1_DenyLobbyMemberRequest: SwiftProtobuf.Message, SwiftP try { if let v = self._userID { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() + try { if let v = self._silence { + 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_Chat_V1_DenyLobbyMemberRequest, rhs: Flipcash_Chat_V1_DenyLobbyMemberRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_SilenceUserRequest, rhs: Flipcash_Chat_V1_SilenceUserRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} if lhs._userID != rhs._userID {return false} + if lhs._silence != rhs._silence {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_DenyLobbyMemberResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DenyLobbyMemberResponse" +extension Flipcash_Chat_V1_SilenceUserResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SilenceUserResponse" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") public mutating func decodeMessage(decoder: inout D) throws { @@ -4233,20 +5183,20 @@ extension Flipcash_Chat_V1_DenyLobbyMemberResponse: SwiftProtobuf.Message, Swift try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_DenyLobbyMemberResponse, rhs: Flipcash_Chat_V1_DenyLobbyMemberResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_SilenceUserResponse, rhs: Flipcash_Chat_V1_SilenceUserResponse) -> Bool { if lhs.result != rhs.result {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_DenyLobbyMemberResponse.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_SilenceUserResponse.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}CANNOT_RESTRICT_CREATOR\0") } -extension Flipcash_Chat_V1_SetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetKeyEnvelopeRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}key_envelope\0\u{2}\u{8}auth\0") +extension Flipcash_Chat_V1_UnsilenceUserRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".UnsilenceUserRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}user_id\0\u{2}\u{8}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4255,7 +5205,7 @@ extension Flipcash_Chat_V1_SetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftPr // 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._keyEnvelope) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._userID) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -4270,7 +5220,7 @@ extension Flipcash_Chat_V1_SetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftPr try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() - try { if let v = self._keyEnvelope { + try { if let v = self._userID { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() try { if let v = self._auth { @@ -4279,17 +5229,17 @@ extension Flipcash_Chat_V1_SetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftPr try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_SetKeyEnvelopeRequest, rhs: Flipcash_Chat_V1_SetKeyEnvelopeRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_UnsilenceUserRequest, rhs: Flipcash_Chat_V1_UnsilenceUserRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} - if lhs._keyEnvelope != rhs._keyEnvelope {return false} + 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_Chat_V1_SetKeyEnvelopeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetKeyEnvelopeResponse" +extension Flipcash_Chat_V1_UnsilenceUserResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".UnsilenceUserResponse" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") public mutating func decodeMessage(decoder: inout D) throws { @@ -4311,20 +5261,20 @@ extension Flipcash_Chat_V1_SetKeyEnvelopeResponse: SwiftProtobuf.Message, SwiftP try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_SetKeyEnvelopeResponse, rhs: Flipcash_Chat_V1_SetKeyEnvelopeResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_UnsilenceUserResponse, rhs: Flipcash_Chat_V1_UnsilenceUserResponse) -> Bool { if lhs.result != rhs.result {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_SetKeyEnvelopeResponse.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}ALREADY_SET\0") +extension Flipcash_Chat_V1_UnsilenceUserResponse.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_GetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetKeyEnvelopeRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{2}\u{9}auth\0") +extension Flipcash_Chat_V1_BanUserRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".BanUserRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}user_id\0\u{2}\u{8}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4333,6 +5283,7 @@ extension Flipcash_Chat_V1_GetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftPr // 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._userID) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -4347,23 +5298,27 @@ extension Flipcash_Chat_V1_GetKeyEnvelopeRequest: SwiftProtobuf.Message, SwiftPr try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() + try { if let v = self._userID { + 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_Chat_V1_GetKeyEnvelopeRequest, rhs: Flipcash_Chat_V1_GetKeyEnvelopeRequest) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_BanUserRequest, rhs: Flipcash_Chat_V1_BanUserRequest) -> Bool { if lhs._chatID != rhs._chatID {return false} + 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_Chat_V1_GetKeyEnvelopeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetKeyEnvelopeResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}key_envelope\0\u{3}wrapped_by\0") +extension Flipcash_Chat_V1_BanUserResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".BanUserResponse" + 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() { @@ -4372,46 +5327,32 @@ extension Flipcash_Chat_V1_GetKeyEnvelopeResponse: SwiftProtobuf.Message, SwiftP // 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._keyEnvelope) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._wrappedBy) }() 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._keyEnvelope { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._wrappedBy { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_GetKeyEnvelopeResponse, rhs: Flipcash_Chat_V1_GetKeyEnvelopeResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_BanUserResponse, rhs: Flipcash_Chat_V1_BanUserResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs._keyEnvelope != rhs._keyEnvelope {return false} - if lhs._wrappedBy != rhs._wrappedBy {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_GetKeyEnvelopeResponse.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}NO_ENVELOPE\0") +extension Flipcash_Chat_V1_BanUserResponse.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}CANNOT_RESTRICT_CREATOR\0") } -extension Flipcash_Chat_V1_SetFeaturedGroupsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetFeaturedGroupsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_ids\0\u{2}\u{9}auth\0") +extension Flipcash_Chat_V1_UnbanUserRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".UnbanUserRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}user_id\0\u{2}\u{8}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4419,7 +5360,8 @@ extension Flipcash_Chat_V1_SetFeaturedGroupsRequest: SwiftProtobuf.Message, Swif // allocates stack space 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.chatIds) }() + case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._userID) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -4431,26 +5373,30 @@ extension Flipcash_Chat_V1_SetFeaturedGroupsRequest: SwiftProtobuf.Message, Swif // 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.chatIds.isEmpty { - try visitor.visitRepeatedMessageField(value: self.chatIds, fieldNumber: 1) - } + try { if let v = self._chatID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._userID { + 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_Chat_V1_SetFeaturedGroupsRequest, rhs: Flipcash_Chat_V1_SetFeaturedGroupsRequest) -> Bool { - if lhs.chatIds != rhs.chatIds {return false} + public static func ==(lhs: Flipcash_Chat_V1_UnbanUserRequest, rhs: Flipcash_Chat_V1_UnbanUserRequest) -> Bool { + if lhs._chatID != rhs._chatID {return false} + 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_Chat_V1_SetFeaturedGroupsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetFeaturedGroupsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}featured_groups\0") +extension Flipcash_Chat_V1_UnbanUserResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".UnbanUserResponse" + 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() { @@ -4459,7 +5405,6 @@ extension Flipcash_Chat_V1_SetFeaturedGroupsResponse: SwiftProtobuf.Message, Swi // 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.featuredGroups) }() default: break } } @@ -4469,27 +5414,23 @@ extension Flipcash_Chat_V1_SetFeaturedGroupsResponse: SwiftProtobuf.Message, Swi if self.result != .ok { try visitor.visitSingularEnumField(value: self.result, fieldNumber: 1) } - if !self.featuredGroups.isEmpty { - try visitor.visitRepeatedMessageField(value: self.featuredGroups, fieldNumber: 2) - } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_SetFeaturedGroupsResponse, rhs: Flipcash_Chat_V1_SetFeaturedGroupsResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_UnbanUserResponse, rhs: Flipcash_Chat_V1_UnbanUserResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs.featuredGroups != rhs.featuredGroups {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Chat_V1_SetFeaturedGroupsResponse.Result: SwiftProtobuf._ProtoNameProviding { +extension Flipcash_Chat_V1_UnbanUserResponse.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_GetFeaturedGroupsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetFeaturedGroupsRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}username\0\u{2}\u{9}auth\0") +extension Flipcash_Chat_V1_GetRestrictedUsersRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetRestrictedUsersRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}query_options\0\u{2}\u{8}auth\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -4497,19 +5438,8 @@ extension Flipcash_Chat_V1_GetFeaturedGroupsRequest: SwiftProtobuf.Message, Swif // allocates 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_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) - } - }() + case 1: try { try decoder.decodeSingularMessageField(value: &self._chatID) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._queryOptions) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._auth) }() default: break } @@ -4521,26 +5451,30 @@ extension Flipcash_Chat_V1_GetFeaturedGroupsRequest: SwiftProtobuf.Message, Swif // 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 .username(let v)? = self.identifier { + try { if let v = self._chatID { try visitor.visitSingularMessageField(value: v, 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: 10) } }() try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Chat_V1_GetFeaturedGroupsRequest, rhs: Flipcash_Chat_V1_GetFeaturedGroupsRequest) -> Bool { - if lhs.identifier != rhs.identifier {return false} + public static func ==(lhs: Flipcash_Chat_V1_GetRestrictedUsersRequest, rhs: Flipcash_Chat_V1_GetRestrictedUsersRequest) -> Bool { + if lhs._chatID != rhs._chatID {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_Chat_V1_GetFeaturedGroupsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetFeaturedGroupsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}featured_groups\0") +extension Flipcash_Chat_V1_GetRestrictedUsersResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetRestrictedUsersResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{1}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() { @@ -4549,30 +5483,44 @@ extension Flipcash_Chat_V1_GetFeaturedGroupsResponse: SwiftProtobuf.Message, Swi // 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.featuredGroups) }() + case 2: try { try decoder.decodeRepeatedMessageField(value: &self.users) }() + 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.featuredGroups.isEmpty { - try visitor.visitRepeatedMessageField(value: self.featuredGroups, fieldNumber: 2) + if !self.users.isEmpty { + try visitor.visitRepeatedMessageField(value: self.users, 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_GetFeaturedGroupsResponse, rhs: Flipcash_Chat_V1_GetFeaturedGroupsResponse) -> Bool { + public static func ==(lhs: Flipcash_Chat_V1_GetRestrictedUsersResponse, rhs: Flipcash_Chat_V1_GetRestrictedUsersResponse) -> Bool { if lhs.result != rhs.result {return false} - if lhs.featuredGroups != rhs.featuredGroups {return false} + if lhs.users != rhs.users {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_GetFeaturedGroupsResponse.Result: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}NOT_FOUND\0") +extension Flipcash_Chat_V1_GetRestrictedUsersResponse.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/Sources/Flipcash2ClientProtocol/chat_v1_model.pb.swift b/Sources/Flipcash2ClientProtocol/chat_v1_model.pb.swift index 6478c93..19065cc 100644 --- a/Sources/Flipcash2ClientProtocol/chat_v1_model.pb.swift +++ b/Sources/Flipcash2ClientProtocol/chat_v1_model.pb.swift @@ -1189,6 +1189,17 @@ public struct Flipcash_Chat_V1_ViewerState: Sendable { /// Clears the value of `permissions`. Subsequent reads from it will return its default value. public mutating func clearPermissions() {self._permissions = nil} + /// State the chat's creator set on the viewer (see Chat.SilenceUser). + /// Absent when the creator has set none. + public var restrictions: Flipcash_Chat_V1_ViewerState.Restrictions { + get {return _restrictions ?? Flipcash_Chat_V1_ViewerState.Restrictions()} + set {_restrictions = newValue} + } + /// Returns true if `restrictions` has been explicitly set. + public var hasRestrictions: Bool {return self._restrictions != nil} + /// Clears the value of `restrictions`. Subsequent reads from it will return its default value. + public mutating func clearRestrictions() {self._restrictions = nil} + /// Advanced by exactly one on every real change to any field of this /// message, never by a no-op. Compared like RosterSummary.version: apply /// the greater value and drop the rest, so delivery order does not matter. @@ -1234,15 +1245,207 @@ public struct Flipcash_Chat_V1_ViewerState: Sendable { /// edit it. public var canEdit: Bool = false + /// What the viewer may do to moderate the chat's users. Unset when + /// they may do none of it, as for every DM. + public var moderation: Flipcash_Chat_V1_ViewerState.ModerationPermissions { + get {return _moderation ?? Flipcash_Chat_V1_ViewerState.ModerationPermissions()} + set {_moderation = newValue} + } + /// Returns true if `moderation` has been explicitly set. + public var hasModeration: Bool {return self._moderation != nil} + /// Clears the value of `moderation`. Subsequent reads from it will return its default value. + public mutating func clearModeration() {self._moderation = nil} + public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} + + fileprivate var _moderation: Flipcash_Chat_V1_ViewerState.ModerationPermissions? = nil + } + + /// ModerationPermissions are the moderation actions the viewer may take + /// in the chat. Like Permissions, each flag defaults to false. A viewer + /// holding either may call Chat.GetRestrictedUsers. + public struct ModerationPermissions: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Whether the viewer may call Chat.SilenceUser and + /// Chat.UnsilenceUser on this chat. + public var canSilence: Bool = false + + /// Whether the viewer may call Chat.BanUser and Chat.UnbanUser on + /// this chat. + public var canBan: Bool = false + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + } + + /// Restrictions are what the chat's creator has imposed on the viewer. + /// A ban is not carried here: a banned user is not a member, and a + /// non-member is shown no ViewerState. A banned member's devices receive + /// the RosterUpdate.MemberLeft of any departure, which does not say why; + /// they learn of the ban from a BANNED result when they try to return. + public struct Restrictions: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Present if and only if the viewer is silenced in the chat: they + /// may read, react and vote, but not send, edit, show typing, or do + /// anything else that requires speaking in the chat. They may still + /// delete their own messages. A client hides the composer while a + /// silence is in force. A timed silence lapses on its own and nothing + /// is sent when it does, so the client owns the countdown. + public var silence: Flipcash_Chat_V1_SilenceState { + get {return _silence ?? Flipcash_Chat_V1_SilenceState()} + set {_silence = newValue} + } + /// Returns true if `silence` has been explicitly set. + public var hasSilence: Bool {return self._silence != nil} + /// Clears the value of `silence`. Subsequent reads from it will return its default value. + public mutating func clearSilence() {self._silence = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _silence: Flipcash_Chat_V1_SilenceState? = nil } public init() {} fileprivate var _settings: Flipcash_Chat_V1_ViewerState.Settings? = nil fileprivate var _permissions: Flipcash_Chat_V1_ViewerState.Permissions? = nil + fileprivate var _restrictions: Flipcash_Chat_V1_ViewerState.Restrictions? = nil +} + +public struct Flipcash_Chat_V1_SilenceState: Sendable { + // SwiftProtobuf.Message 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 duration: Flipcash_Chat_V1_SilenceState.OneOf_Duration? = nil + + /// Silenced until this time, after which the silence lapses. + public var until: SwiftProtobuf.Google_Protobuf_Timestamp { + get { + if case .until(let v)? = duration {return v} + return SwiftProtobuf.Google_Protobuf_Timestamp() + } + set {duration = .until(newValue)} + } + + /// Silenced until explicitly unsilenced. + public var forever: Flipcash_Chat_V1_SilenceState.Forever { + get { + if case .forever(let v)? = duration {return v} + return Flipcash_Chat_V1_SilenceState.Forever() + } + set {duration = .forever(newValue)} + } + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum OneOf_Duration: Equatable, Sendable { + /// Silenced until this time, after which the silence lapses. + case until(SwiftProtobuf.Google_Protobuf_Timestamp) + /// Silenced until explicitly unsilenced. + case forever(Flipcash_Chat_V1_SilenceState.Forever) + + } + + public struct Forever: Sendable { + // SwiftProtobuf.Message 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 init() {} +} + +/// BanState is a ban the chat's creator has set on a user (see Chat.BanUser). +/// A ban lasts until it is lifted (see Chat.UnbanUser). +public struct Flipcash_Chat_V1_BanState: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// When the ban was made. + public var bannedAt: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _bannedAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_bannedAt = newValue} + } + /// Returns true if `bannedAt` has been explicitly set. + public var hasBannedAt: Bool {return self._bannedAt != nil} + /// Clears the value of `bannedAt`. Subsequent reads from it will return its default value. + public mutating func clearBannedAt() {self._bannedAt = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _bannedAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil +} + +/// RestrictedUser is a user the chat's creator has silenced or banned, as +/// listed by Chat.GetRestrictedUsers. At least one of silence and ban is set. +public struct Flipcash_Chat_V1_RestrictedUser: @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 userID: Flipcash_Common_V1_UserId { + get {return _storage._userID ?? Flipcash_Common_V1_UserId()} + set {_uniqueStorage()._userID = newValue} + } + /// Returns true if `userID` has been explicitly set. + public var hasUserID: Bool {return _storage._userID != nil} + /// Clears the value of `userID`. Subsequent reads from it will return its default value. + public mutating func clearUserID() {_uniqueStorage()._userID = nil} + + /// The user's public profile. + public var userProfile: Flipcash_Profile_V1_UserProfile { + get {return _storage._userProfile ?? Flipcash_Profile_V1_UserProfile()} + set {_uniqueStorage()._userProfile = newValue} + } + /// Returns true if `userProfile` has been explicitly set. + public var hasUserProfile: Bool {return _storage._userProfile != nil} + /// Clears the value of `userProfile`. Subsequent reads from it will return its default value. + public mutating func clearUserProfile() {_uniqueStorage()._userProfile = nil} + + /// Set when the user is silenced (see Chat.SilenceUser). + public var silence: Flipcash_Chat_V1_SilenceState { + get {return _storage._silence ?? Flipcash_Chat_V1_SilenceState()} + set {_uniqueStorage()._silence = newValue} + } + /// Returns true if `silence` has been explicitly set. + public var hasSilence: Bool {return _storage._silence != nil} + /// Clears the value of `silence`. Subsequent reads from it will return its default value. + public mutating func clearSilence() {_uniqueStorage()._silence = nil} + + /// Set when the user is banned (see Chat.BanUser). + public var ban: Flipcash_Chat_V1_BanState { + get {return _storage._ban ?? Flipcash_Chat_V1_BanState()} + set {_uniqueStorage()._ban = newValue} + } + /// Returns true if `ban` has been explicitly set. + public var hasBan: Bool {return _storage._ban != nil} + /// Clears the value of `ban`. Subsequent reads from it will return its default value. + public mutating func clearBan() {_uniqueStorage()._ban = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance } public struct Flipcash_Chat_V1_MuteState: Sendable { @@ -3082,7 +3285,7 @@ extension Flipcash_Chat_V1_RosterUpdateBatch: SwiftProtobuf.Message, SwiftProtob extension Flipcash_Chat_V1_ViewerState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".ViewerState" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}settings\0\u{1}permissions\0\u{2}\u{8}version\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}settings\0\u{1}permissions\0\u{1}restrictions\0\u{2}\u{7}version\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3092,6 +3295,7 @@ extension Flipcash_Chat_V1_ViewerState: SwiftProtobuf.Message, SwiftProtobuf._Me switch fieldNumber { case 1: try { try decoder.decodeSingularMessageField(value: &self._settings) }() case 2: try { try decoder.decodeSingularMessageField(value: &self._permissions) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._restrictions) }() case 10: try { try decoder.decodeSingularUInt64Field(value: &self.version) }() default: break } @@ -3109,6 +3313,9 @@ extension Flipcash_Chat_V1_ViewerState: SwiftProtobuf.Message, SwiftProtobuf._Me try { if let v = self._permissions { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() + try { if let v = self._restrictions { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() if self.version != 0 { try visitor.visitSingularUInt64Field(value: self.version, fieldNumber: 10) } @@ -3118,6 +3325,7 @@ extension Flipcash_Chat_V1_ViewerState: SwiftProtobuf.Message, SwiftProtobuf._Me public static func ==(lhs: Flipcash_Chat_V1_ViewerState, rhs: Flipcash_Chat_V1_ViewerState) -> Bool { if lhs._settings != rhs._settings {return false} if lhs._permissions != rhs._permissions {return false} + if lhs._restrictions != rhs._restrictions {return false} if lhs.version != rhs.version {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true @@ -3160,7 +3368,7 @@ extension Flipcash_Chat_V1_ViewerState.Settings: SwiftProtobuf.Message, SwiftPro extension Flipcash_Chat_V1_ViewerState.Permissions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = Flipcash_Chat_V1_ViewerState.protoMessageName + ".Permissions" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}can_edit\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}can_edit\0\u{1}moderation\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -3169,20 +3377,309 @@ extension Flipcash_Chat_V1_ViewerState.Permissions: SwiftProtobuf.Message, Swift // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularBoolField(value: &self.canEdit) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._moderation) }() 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.canEdit != false { try visitor.visitSingularBoolField(value: self.canEdit, fieldNumber: 1) } + try { if let v = self._moderation { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Flipcash_Chat_V1_ViewerState.Permissions, rhs: Flipcash_Chat_V1_ViewerState.Permissions) -> Bool { if lhs.canEdit != rhs.canEdit {return false} + if lhs._moderation != rhs._moderation {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_ViewerState.ModerationPermissions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_ViewerState.protoMessageName + ".ModerationPermissions" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}can_silence\0\u{3}can_ban\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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.canSilence) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self.canBan) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.canSilence != false { + try visitor.visitSingularBoolField(value: self.canSilence, fieldNumber: 1) + } + if self.canBan != false { + try visitor.visitSingularBoolField(value: self.canBan, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_ViewerState.ModerationPermissions, rhs: Flipcash_Chat_V1_ViewerState.ModerationPermissions) -> Bool { + if lhs.canSilence != rhs.canSilence {return false} + if lhs.canBan != rhs.canBan {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_ViewerState.Restrictions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_ViewerState.protoMessageName + ".Restrictions" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}silence\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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._silence) }() + 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._silence { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_ViewerState.Restrictions, rhs: Flipcash_Chat_V1_ViewerState.Restrictions) -> Bool { + if lhs._silence != rhs._silence {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_SilenceState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SilenceState" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}until\0\u{1}forever\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates 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: SwiftProtobuf.Google_Protobuf_Timestamp? + var hadOneofValue = false + if let current = self.duration { + hadOneofValue = true + if case .until(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.duration = .until(v) + } + }() + case 2: try { + var v: Flipcash_Chat_V1_SilenceState.Forever? + var hadOneofValue = false + if let current = self.duration { + hadOneofValue = true + if case .forever(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.duration = .forever(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.duration { + case .until?: try { + guard case .until(let v)? = self.duration else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + }() + case .forever?: try { + guard case .forever(let v)? = self.duration else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_SilenceState, rhs: Flipcash_Chat_V1_SilenceState) -> Bool { + if lhs.duration != rhs.duration {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_SilenceState.Forever: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Chat_V1_SilenceState.protoMessageName + ".Forever" + 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_Chat_V1_SilenceState.Forever, rhs: Flipcash_Chat_V1_SilenceState.Forever) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_BanState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".BanState" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}banned_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._bannedAt) }() + 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._bannedAt { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_BanState, rhs: Flipcash_Chat_V1_BanState) -> Bool { + if lhs._bannedAt != rhs._bannedAt {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Chat_V1_RestrictedUser: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".RestrictedUser" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{3}user_profile\0\u{1}silence\0\u{1}ban\0") + + fileprivate class _StorageClass { + var _userID: Flipcash_Common_V1_UserId? = nil + var _userProfile: Flipcash_Profile_V1_UserProfile? = nil + var _silence: Flipcash_Chat_V1_SilenceState? = nil + var _ban: Flipcash_Chat_V1_BanState? = 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) { + _userID = source._userID + _userProfile = source._userProfile + _silence = source._silence + _ban = source._ban + } + } + + 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._userID) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._userProfile) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._silence) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._ban) }() + 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._userID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._userProfile { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._silence { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._ban { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Chat_V1_RestrictedUser, rhs: Flipcash_Chat_V1_RestrictedUser) -> 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._userID != rhs_storage._userID {return false} + if _storage._userProfile != rhs_storage._userProfile {return false} + if _storage._silence != rhs_storage._silence {return false} + if _storage._ban != rhs_storage._ban {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/Sources/Flipcash2ClientProtocol/intent_v1_model.pb.swift b/Sources/Flipcash2ClientProtocol/intent_v1_model.pb.swift index 7fb3adc..ddf5187 100644 --- a/Sources/Flipcash2ClientProtocol/intent_v1_model.pb.swift +++ b/Sources/Flipcash2ClientProtocol/intent_v1_model.pb.swift @@ -135,6 +135,14 @@ public struct Flipcash_Intent_V1_ChatMetadata: Sendable { set {type = .reactionBoost(newValue)} } + public var requestedPayment: Flipcash_Intent_V1_ChatMetadata.RequestedPayment { + get { + if case .requestedPayment(let v)? = type {return v} + return Flipcash_Intent_V1_ChatMetadata.RequestedPayment() + } + set {type = .requestedPayment(newValue)} + } + public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_Type: Equatable, Sendable { @@ -142,6 +150,7 @@ public struct Flipcash_Intent_V1_ChatMetadata: Sendable { case dmPayment(Flipcash_Intent_V1_ChatMetadata.DmPayment) case groupPayment(Flipcash_Intent_V1_ChatMetadata.GroupPayment) case reactionBoost(Flipcash_Intent_V1_ChatMetadata.ReactionBoost) + case requestedPayment(Flipcash_Intent_V1_ChatMetadata.RequestedPayment) } @@ -231,12 +240,20 @@ public struct Flipcash_Intent_V1_ChatMetadata: Sendable { public init() {} } - /// For sending a payment directly to another member of a group chat. The - /// chat_id must be a group, and the payment's destination owner account - /// names the recipient, who must be a Flipcash user and a member of the - /// group. The sender must be able to speak in the group: the payment posts - /// a CashContent message into it as the sender, naming the recipient as - /// its receiver. + /// For sending a payment directly to other members of a group chat. The + /// chat_id must be a group, and the sender must be able to speak in it: + /// the payment posts one CashContent message into the group as the sender. + /// + /// - A payment to one member is a SendPublicPayment, whose destination + /// owner account names the recipient. The message names them as its + /// single_receiver. + /// - A payment to several members at once is a SendPublicMultiPayment + /// to 2 to 10 of them, each a distinct destination owner account and + /// none the sender. The message lists each recipient with their part + /// in its multi_receiver, and carries the whole payment as its + /// total_amount. + /// + /// Every recipient must be a Flipcash user and a member of the group. public struct GroupPayment: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -252,18 +269,23 @@ public struct Flipcash_Intent_V1_ChatMetadata: Sendable { public init() {} } - /// For paying to boost a reaction on a message in a group chat: the - /// payer's reaction with the emoji carries money, shown as + /// For paying to boost a reaction on a message in a group chat or a DM: + /// the payer's reaction with the emoji carries money, shown as /// messaging.v1.Reactor.boost_usd and summed into /// messaging.v1.EmojiReaction.boost_usd, which orders a message's - /// reactions. The chat_id must be a group the payer is a member + /// reactions. The chat_id must be a group or a DM the payer is a member /// of, the message one of its reactable messages, and the payer must /// already have reacted to it with the emoji: a boost puts money behind /// a reaction the payer holds, so a client adds the reaction first /// (messaging.v1.AddReaction) and pays after. No one boosts their own - /// message, the group's creator included. The payment is divided - /// between the message's sender and the group's creator by a fixed rule - /// the server enforces; the payer does not choose it: + /// message, a group's creator included. Who is paid is a fixed rule the + /// server enforces; the payer does not choose it. + /// + /// In a DM, the payer boosts the other member's message, and the + /// payment pays them the whole, as one SendPublicPayment. + /// + /// In a group, the payment is divided between the message's sender and + /// the group's creator: /// /// - A boost by anyone but the creator of a message the creator did /// not send pays the creator 20% of the whole and the sender the @@ -323,6 +345,58 @@ public struct Flipcash_Intent_V1_ChatMetadata: Sendable { fileprivate var _emoji: Flipcash_Messaging_V1_Emoji? = nil } + /// For paying the payer's share of a payment request made in a group chat, + /// today a paymentrequest.v1.Split (see paymentrequest.v1.PaymentRequest; a + /// kind with no shares takes no such payment). The payment is a + /// SendPublicPayment, never a multi payment, from a debtor of the request + /// to its creator, and pays the debtor's own unpaid share exactly: + /// + /// - The chat_id must be the group the request was created for. + /// - The payment's one destination must be the creator's owner account. + /// - The payment's currency must be the request's, and its native amount + /// (its exchange data's native_amount) must be the share's + /// native_amount to within half the currency's smallest unit. Any mint + /// may pay. A partial payment or an overpayment is refused: a share is + /// paid all at once. + /// - The request must be OPEN: not COMPLETED, not closed, and not past + /// its ends_at. + /// - The payer must hold an unpaid share of the request. + /// - The intent's ID must be the one the server generated for the + /// payer's share, which paymentrequest.v1.GetPaymentRequest gives the + /// payer alone (GetPaymentRequestResponse.payment_intent_id). An intent + /// ID is used at most once, so this is what makes a share payable at + /// most once. + /// - Neither the payer nor the creator may be the Flipcash team account. + /// + /// Once the payment is made the server marks the share paid (a + /// paymentrequest.v1.PaidShare carrying the payment's intent), posts one + /// messaging.v1.CashContent message into the group as the payer, with the + /// creator as its single_receiver and the request's ID in its + /// payment_request_id. If it was the last unpaid share, the request becomes + /// COMPLETED. No event announces the change; clients see it by refetching + /// the request. + public struct RequestedPayment: Sendable { + // SwiftProtobuf.Message 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 payment request whose share is paid. + public var paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId { + get {return _paymentRequestID ?? Flipcash_Paymentrequest_V1_PaymentRequestId()} + set {_paymentRequestID = newValue} + } + /// Returns true if `paymentRequestID` has been explicitly set. + public var hasPaymentRequestID: Bool {return self._paymentRequestID != nil} + /// Clears the value of `paymentRequestID`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequestID() {self._paymentRequestID = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId? = nil + } + public init() {} fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil @@ -384,7 +458,7 @@ extension Flipcash_Intent_V1_AppMetadata: SwiftProtobuf.Message, SwiftProtobuf._ 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}dm_payment\0\u{3}group_payment\0\u{3}reaction_boost\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{3}contact_dm_payment\0\u{3}dm_payment\0\u{3}group_payment\0\u{3}reaction_boost\0\u{3}requested_payment\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -445,6 +519,19 @@ extension Flipcash_Intent_V1_ChatMetadata: SwiftProtobuf.Message, SwiftProtobuf. self.type = .reactionBoost(v) } }() + case 6: try { + var v: Flipcash_Intent_V1_ChatMetadata.RequestedPayment? + var hadOneofValue = false + if let current = self.type { + hadOneofValue = true + if case .requestedPayment(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.type = .requestedPayment(v) + } + }() default: break } } @@ -475,6 +562,10 @@ extension Flipcash_Intent_V1_ChatMetadata: SwiftProtobuf.Message, SwiftProtobuf. guard case .reactionBoost(let v)? = self.type else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 5) }() + case .requestedPayment?: try { + guard case .requestedPayment(let v)? = self.type else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + }() case nil: break } try unknownFields.traverse(visitor: &visitor) @@ -634,3 +725,37 @@ extension Flipcash_Intent_V1_ChatMetadata.ReactionBoost: SwiftProtobuf.Message, return true } } + +extension Flipcash_Intent_V1_ChatMetadata.RequestedPayment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Intent_V1_ChatMetadata.protoMessageName + ".RequestedPayment" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}payment_request_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._paymentRequestID) }() + 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._paymentRequestID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Intent_V1_ChatMetadata.RequestedPayment, rhs: Flipcash_Intent_V1_ChatMetadata.RequestedPayment) -> Bool { + if lhs._paymentRequestID != rhs._paymentRequestID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Sources/Flipcash2ClientProtocol/messaging_v1_messaging_service.pb.swift b/Sources/Flipcash2ClientProtocol/messaging_v1_messaging_service.pb.swift index aa7eb08..1521826 100644 --- a/Sources/Flipcash2ClientProtocol/messaging_v1_messaging_service.pb.swift +++ b/Sources/Flipcash2ClientProtocol/messaging_v1_messaging_service.pb.swift @@ -477,7 +477,7 @@ public struct Flipcash_Messaging_V1_SendMessageResponse: Sendable { /// private group, or its scheme is not the one the chat uses. case encryptionNotAllowed // = 2 - /// The chat is a private group and the content is not EncryptedContent. + /// The chat is a DM or a private group and the content is not EncryptedContent. case encryptionRequired // = 3 case UNRECOGNIZED(Int) @@ -614,7 +614,7 @@ public struct Flipcash_Messaging_V1_EditMessageResponse: Sendable { /// private group, or its scheme is not the one the chat uses. case encryptionNotAllowed // = 5 - /// The chat is a private group and the content is not EncryptedContent. + /// The chat is a DM or a private group and the content is not EncryptedContent. case encryptionRequired // = 6 case UNRECOGNIZED(Int) diff --git a/Sources/Flipcash2ClientProtocol/messaging_v1_model.pb.swift b/Sources/Flipcash2ClientProtocol/messaging_v1_model.pb.swift index fa39242..620882f 100644 --- a/Sources/Flipcash2ClientProtocol/messaging_v1_model.pb.swift +++ b/Sources/Flipcash2ClientProtocol/messaging_v1_model.pb.swift @@ -490,34 +490,79 @@ public struct Flipcash_Messaging_V1_CashContent: Sendable { /// 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} - - /// The user who received the cash. Always set in a group chat, where it - /// names which member was paid. In a DM it is set on new messages but unset - /// on older ones, whose receiver is the DM member who is not the sender. - public var receiver: Flipcash_Common_V1_UserId { - get {return _receiver ?? Flipcash_Common_V1_UserId()} - set {_receiver = newValue} - } - /// Returns true if `receiver` has been explicitly set. - public var hasReceiver: Bool {return self._receiver != nil} - /// Clears the value of `receiver`. Subsequent reads from it will return its default value. - public mutating func clearReceiver() {self._receiver = nil} + /// The total amount of cash that was sent. For a payment to several people + /// (see multi_receiver), the whole payment, every receiver's part together. + public var totalAmount: Flipcash_Common_V1_CryptoPaymentAmount { + get {return _totalAmount ?? Flipcash_Common_V1_CryptoPaymentAmount()} + set {_totalAmount = newValue} + } + /// Returns true if `totalAmount` has been explicitly set. + public var hasTotalAmount: Bool {return self._totalAmount != nil} + /// Clears the value of `totalAmount`. Subsequent reads from it will return its default value. + public mutating func clearTotalAmount() {self._totalAmount = nil} + + /// Who received the cash. Always set in a group chat. In a DM, + /// single_receiver is set on new messages, and neither is set on older + /// ones, whose receiver is the DM member who is not the sender. + public var recipient: Flipcash_Messaging_V1_CashContent.OneOf_Recipient? = nil + + /// The user who received the cash, for a payment to one person + public var singleReceiver: Flipcash_Common_V1_UserId { + get { + if case .singleReceiver(let v)? = recipient {return v} + return Flipcash_Common_V1_UserId() + } + set {recipient = .singleReceiver(newValue)} + } + + /// Who was paid and how much, for a payment to several people at once, + /// made in a group chat alone. total_amount is the whole payment, so a + /// client that does not know this field shows the sender paying the + /// total to no one in particular. + public var multiReceiver: Flipcash_Messaging_V1_CashContent.Payments { + get { + if case .multiReceiver(let v)? = recipient {return v} + return Flipcash_Messaging_V1_CashContent.Payments() + } + set {recipient = .multiReceiver(newValue)} + } public var verb: Flipcash_Messaging_V1_CashContent.Verb = .sent + /// The payment request whose share this payment paid. Set only on the cash + /// message posted when a debtor pays their share with a payment (see + /// intent.v1.ChatMetadata.RequestedPayment), so clients render it + /// against the request; such a message is from the debtor, with the + /// request's creator as its single_receiver. Unset on every other cash + /// message. + public var paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId { + get {return _paymentRequestID ?? Flipcash_Paymentrequest_V1_PaymentRequestId()} + set {_paymentRequestID = newValue} + } + /// Returns true if `paymentRequestID` has been explicitly set. + public var hasPaymentRequestID: Bool {return self._paymentRequestID != nil} + /// Clears the value of `paymentRequestID`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequestID() {self._paymentRequestID = nil} + public var unknownFields = SwiftProtobuf.UnknownStorage() + /// Who received the cash. Always set in a group chat. In a DM, + /// single_receiver is set on new messages, and neither is set on older + /// ones, whose receiver is the DM member who is not the sender. + public enum OneOf_Recipient: Equatable, Sendable { + /// The user who received the cash, for a payment to one person + case singleReceiver(Flipcash_Common_V1_UserId) + /// Who was paid and how much, for a payment to several people at once, + /// made in a group chat alone. total_amount is the whole payment, so a + /// client that does not know this field shows the sender paying the + /// total to no one in particular. + case multiReceiver(Flipcash_Messaging_V1_CashContent.Payments) + + } + /// Verb for how the cash was sent. Clients should always show SENT as a - /// fallback. + /// fallback. For a payment to several people, it applies to every one of + /// them. public enum Verb: SwiftProtobuf.Enum, Swift.CaseIterable { public typealias RawValue = Int case sent // = 0 @@ -552,11 +597,57 @@ public struct Flipcash_Messaging_V1_CashContent: Sendable { } + /// The receivers of a payment to several people at once + public struct Payments: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// One entry per receiver, in the payment's own order. Each receiver is + /// a distinct member of the group other than the sender, and every + /// entry is in total_amount's currency and mint. + public var items: [Flipcash_Messaging_V1_CashContent.Payment] = [] + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + } + + /// One receiver's part of a payment to several people (see Payments). The + /// currency and mint are total_amount's. + public struct Payment: Sendable { + // SwiftProtobuf.Message 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 who received this part + public var receiver: Flipcash_Common_V1_UserId { + get {return _receiver ?? Flipcash_Common_V1_UserId()} + set {_receiver = newValue} + } + /// Returns true if `receiver` has been explicitly set. + public var hasReceiver: Bool {return self._receiver != nil} + /// Clears the value of `receiver`. Subsequent reads from it will return its default value. + public mutating func clearReceiver() {self._receiver = nil} + + /// The amount this receiver was paid, in total_amount's currency + public var nativeAmount: Double = 0 + + /// The amount in quarks of total_amount's mint this receiver was paid + public var quarks: UInt64 = 0 + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _receiver: Flipcash_Common_V1_UserId? = nil + } + public init() {} fileprivate var _intentID: Flipcash_Common_V1_IntentId? = nil - fileprivate var _amount: Flipcash_Common_V1_CryptoPaymentAmount? = nil - fileprivate var _receiver: Flipcash_Common_V1_UserId? = nil + fileprivate var _totalAmount: Flipcash_Common_V1_CryptoPaymentAmount? = nil + fileprivate var _paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId? = nil } /// Reply content @@ -770,11 +861,20 @@ public struct Flipcash_Messaging_V1_WidgetContent: Sendable { set {type = .poll(newValue)} } + public var paymentRequest: Flipcash_Messaging_V1_PaymentRequestWidget { + get { + if case .paymentRequest(let v)? = type {return v} + return Flipcash_Messaging_V1_PaymentRequestWidget() + } + set {type = .paymentRequest(newValue)} + } + public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_Type: Equatable, Sendable { case shareProfile(Flipcash_Messaging_V1_ShareProfileWidget) case poll(Flipcash_Messaging_V1_PollWidget) + case paymentRequest(Flipcash_Messaging_V1_PaymentRequestWidget) } @@ -840,6 +940,46 @@ public struct Flipcash_Messaging_V1_PollWidget: Sendable { fileprivate var _pollID: Flipcash_Poll_V1_PollId? = nil } +/// A widget that shows a payment request. It carries only the request's ID: +/// clients get the title, shares, and state from +/// paymentrequest.v1.PaymentRequest's GetPaymentRequest. +/// +/// The creator sends it after calling +/// paymentrequest.v1.PaymentRequest.CreatePaymentRequest, and may send the same +/// request in its chat any number of times. The request is live from creation, +/// whether or not it has been sent. Deleting a message that carries it does not +/// touch the request. +/// +/// In a group that is not private, it is sent as plain WidgetContent: +/// SendMessage accepts it only from the request's creator, in the chat the +/// request was created for, whatever the request's status; otherwise the send +/// is DENIED. +/// +/// In a private group, it is sent inside EncryptedContent, so the server cannot +/// check any of this. Clients render the widget as unsupported if the request's +/// chat (GroupChatPaymentRequest.chat_id) is not the chat the message is in, or +/// the request's creator is not the message's sender. +public struct Flipcash_Messaging_V1_PaymentRequestWidget: Sendable { + // SwiftProtobuf.Message 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 paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId { + get {return _paymentRequestID ?? Flipcash_Paymentrequest_V1_PaymentRequestId()} + set {_paymentRequestID = newValue} + } + /// Returns true if `paymentRequestID` has been explicitly set. + public var hasPaymentRequestID: Bool {return self._paymentRequestID != nil} + /// Clears the value of `paymentRequestID`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequestID() {self._paymentRequestID = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId? = nil +} + /// Deleted message content public struct Flipcash_Messaging_V1_DeletedContent: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the @@ -2216,7 +2356,7 @@ extension Flipcash_Messaging_V1_LinkPreview: SwiftProtobuf.Message, SwiftProtobu 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{1}receiver\0\u{1}verb\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}intent_id\0\u{3}total_amount\0\u{3}single_receiver\0\u{1}verb\0\u{3}multi_receiver\0\u{3}payment_request_id\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2225,9 +2365,35 @@ extension Flipcash_Messaging_V1_CashContent: SwiftProtobuf.Message, SwiftProtobu // 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 3: try { try decoder.decodeSingularMessageField(value: &self._receiver) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._totalAmount) }() + case 3: try { + var v: Flipcash_Common_V1_UserId? + var hadOneofValue = false + if let current = self.recipient { + hadOneofValue = true + if case .singleReceiver(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.recipient = .singleReceiver(v) + } + }() case 4: try { try decoder.decodeSingularEnumField(value: &self.verb) }() + case 5: try { + var v: Flipcash_Messaging_V1_CashContent.Payments? + var hadOneofValue = false + if let current = self.recipient { + hadOneofValue = true + if case .multiReceiver(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.recipient = .multiReceiver(v) + } + }() + case 6: try { try decoder.decodeSingularMessageField(value: &self._paymentRequestID) }() default: break } } @@ -2241,23 +2407,30 @@ extension Flipcash_Messaging_V1_CashContent: SwiftProtobuf.Message, SwiftProtobu try { if let v = self._intentID { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() - try { if let v = self._amount { + try { if let v = self._totalAmount { try visitor.visitSingularMessageField(value: v, fieldNumber: 2) } }() - try { if let v = self._receiver { + try { if case .singleReceiver(let v)? = self.recipient { try visitor.visitSingularMessageField(value: v, fieldNumber: 3) } }() if self.verb != .sent { try visitor.visitSingularEnumField(value: self.verb, fieldNumber: 4) } + try { if case .multiReceiver(let v)? = self.recipient { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try { if let v = self._paymentRequestID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() 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._receiver != rhs._receiver {return false} + if lhs._totalAmount != rhs._totalAmount {return false} + if lhs.recipient != rhs.recipient {return false} if lhs.verb != rhs.verb {return false} + if lhs._paymentRequestID != rhs._paymentRequestID {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2267,6 +2440,80 @@ extension Flipcash_Messaging_V1_CashContent.Verb: SwiftProtobuf._ProtoNameProvid public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0SENT\0\u{1}TIPPED\0") } +extension Flipcash_Messaging_V1_CashContent.Payments: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Messaging_V1_CashContent.protoMessageName + ".Payments" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}items\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.items.isEmpty { + try visitor.visitRepeatedMessageField(value: self.items, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Messaging_V1_CashContent.Payments, rhs: Flipcash_Messaging_V1_CashContent.Payments) -> Bool { + if lhs.items != rhs.items {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Messaging_V1_CashContent.Payment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Messaging_V1_CashContent.protoMessageName + ".Payment" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}receiver\0\u{3}native_amount\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._receiver) }() + case 2: try { try decoder.decodeSingularDoubleField(value: &self.nativeAmount) }() + case 3: 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._receiver { + try visitor.visitSingularMessageField(value: v, 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 unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Messaging_V1_CashContent.Payment, rhs: Flipcash_Messaging_V1_CashContent.Payment) -> Bool { + if lhs._receiver != rhs._receiver {return false} + if lhs.nativeAmount != rhs.nativeAmount {return false} + if lhs.quarks != rhs.quarks {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + 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") @@ -2523,7 +2770,7 @@ extension Flipcash_Messaging_V1_SystemContent.UserJoined.Admitted: SwiftProtobuf extension Flipcash_Messaging_V1_WidgetContent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".WidgetContent" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}share_profile\0\u{1}poll\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}share_profile\0\u{1}poll\0\u{3}payment_request\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -2557,6 +2804,19 @@ extension Flipcash_Messaging_V1_WidgetContent: SwiftProtobuf.Message, SwiftProto self.type = .poll(v) } }() + case 3: try { + var v: Flipcash_Messaging_V1_PaymentRequestWidget? + var hadOneofValue = false + if let current = self.type { + hadOneofValue = true + if case .paymentRequest(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.type = .paymentRequest(v) + } + }() default: break } } @@ -2576,6 +2836,10 @@ extension Flipcash_Messaging_V1_WidgetContent: SwiftProtobuf.Message, SwiftProto guard case .poll(let v)? = self.type else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 2) }() + case .paymentRequest?: try { + guard case .paymentRequest(let v)? = self.type else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() case nil: break } try unknownFields.traverse(visitor: &visitor) @@ -2656,6 +2920,40 @@ extension Flipcash_Messaging_V1_PollWidget: SwiftProtobuf.Message, SwiftProtobuf } } +extension Flipcash_Messaging_V1_PaymentRequestWidget: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PaymentRequestWidget" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}payment_request_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._paymentRequestID) }() + 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._paymentRequestID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Messaging_V1_PaymentRequestWidget, rhs: Flipcash_Messaging_V1_PaymentRequestWidget) -> Bool { + if lhs._paymentRequestID != rhs._paymentRequestID {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") diff --git a/Sources/Flipcash2ClientProtocol/paymentrequest_v1_model.pb.swift b/Sources/Flipcash2ClientProtocol/paymentrequest_v1_model.pb.swift new file mode 100644 index 0000000..c29be70 --- /dev/null +++ b/Sources/Flipcash2ClientProtocol/paymentrequest_v1_model.pb.swift @@ -0,0 +1,1145 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// swiftlint:disable all +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: paymentrequest/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 +} + +/// PaymentRequestStatus is where a payment request is in its life (see +/// PaymentRequestMetadata.status). +public enum Flipcash_Paymentrequest_V1_PaymentRequestStatus: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case unknown // = 0 + + /// Accepting payments: the request is before its ends_at and has something + /// left to pay (for a Split, at least one unpaid share). + case `open` // = 1 + + /// Everything asked for is paid (for a Split, every share). Final. + case completed // = 2 + + /// The creator closed the request (PaymentRequest.ClosePaymentRequest) + /// while it was still OPEN. Final. + case closed // = 3 + + /// The request reached its ends_at while still OPEN. Final. Decided by the + /// clock, like poll.v1.PollState's TALLYING: it moves no version, and a + /// client judges an OPEN request past its ends_at as EXPIRED itself rather + /// than waiting for the server to say so. + case expired // = 4 + case UNRECOGNIZED(Int) + + public init() { + self = .unknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .open + case 2: self = .completed + case 3: self = .closed + case 4: self = .expired + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .unknown: return 0 + case .open: return 1 + case .completed: return 2 + case .closed: return 3 + case .expired: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [Flipcash_Paymentrequest_V1_PaymentRequestStatus] = [ + .unknown, + .open, + .completed, + .closed, + .expired, + ] + +} + +/// PaymentRequestId is the server-assigned identity of a payment request, of any +/// kind. It is what a messaging.v1.PaymentRequestWidget carries, and what every +/// PaymentRequest RPC is keyed by. +public struct Flipcash_Paymentrequest_V1_PaymentRequestId: Sendable { + // SwiftProtobuf.Message 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() {} +} + +/// IdempotencyKey lets a client safely retry CreatePaymentRequest. The server +/// derives the request's identity from the caller and this key, so a retry +/// with the same key returns the original request instead of creating a +/// duplicate. Which parameters were sent is not part of the identity: a retry +/// with different parameters, or of a different kind, still returns the +/// original. +/// +/// The key is owned by the client and is typically a randomly generated UUID. +/// It is never exposed as the request's identity. +public struct Flipcash_Paymentrequest_V1_IdempotencyKey: Sendable { + // SwiftProtobuf.Message 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() {} +} + +/// PaymentRequestMetadata is a payment request: what every kind of request +/// shares (its identity, creator, creation time, status and version), and in +/// `kind` what the request is and where it was made. +/// +/// The message is versioned whole: every change to anything in it, a share +/// paid (by payment or by hand) or a close, advances version by exactly one, +/// and an idempotent no-op leaves it alone. Clients keep the copy with the +/// greater version, comparing it like chat.v1.RosterSummary.version, and +/// replace the whole message, so delivery order does not matter. Expiry is +/// not a change: it comes from the clock and moves no version (see +/// PAYMENT_REQUEST_STATUS_EXPIRED), so at an equal version a client keeps +/// EXPIRED over OPEN, and judges an OPEN request past its ends_at as EXPIRED +/// itself. +/// +/// Nothing announces a change in real time: no event carries a payment request +/// today. Clients refetch a request to see payments and closes land, for +/// example when they show its widget. +/// +/// Requests are layered. The first layer is where the request lives: today a +/// group chat (GroupChatPaymentRequest). Within it, the second layer is the +/// type of request: today a split (Split). Kinds and types added later each +/// get a new arm; a client renders a request whose arm it does not know as +/// unsupported. +public struct Flipcash_Paymentrequest_V1_PaymentRequestMetadata: Sendable { + // SwiftProtobuf.Message 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 paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId { + get {return _paymentRequestID ?? Flipcash_Paymentrequest_V1_PaymentRequestId()} + set {_paymentRequestID = newValue} + } + /// Returns true if `paymentRequestID` has been explicitly set. + public var hasPaymentRequestID: Bool {return self._paymentRequestID != nil} + /// Clears the value of `paymentRequestID`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequestID() {self._paymentRequestID = nil} + + /// The user that created the request, who is paid and is the only user + /// that can close it or mark a share paid by hand. + public var creator: Flipcash_Common_V1_UserId { + get {return _creator ?? Flipcash_Common_V1_UserId()} + set {_creator = newValue} + } + /// Returns true if `creator` has been explicitly set. + public var hasCreator: Bool {return self._creator != nil} + /// Clears the value of `creator`. Subsequent reads from it will return its default value. + public mutating func clearCreator() {self._creator = nil} + + /// When the request was created. + public var createdAt: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _createdAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_createdAt = newValue} + } + /// Returns true if `createdAt` has been explicitly set. + public var hasCreatedAt: Bool {return self._createdAt != nil} + /// Clears the value of `createdAt`. Subsequent reads from it will return its default value. + public mutating func clearCreatedAt() {self._createdAt = nil} + + /// Where the request is in its life. It only moves forward: from OPEN to + /// one of COMPLETED, CLOSED or EXPIRED, which are final. + public var status: Flipcash_Paymentrequest_V1_PaymentRequestStatus = .unknown + + /// When the request stopped being OPEN. Set once status is not OPEN: the + /// request's ends_at when EXPIRED, when the creator closed it when CLOSED, + /// and when its last unpaid share was paid when COMPLETED. + public var closedAt: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _closedAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_closedAt = newValue} + } + /// Returns true if `closedAt` has been explicitly set. + public var hasClosedAt: Bool {return self._closedAt != nil} + /// Clears the value of `closedAt`. Subsequent reads from it will return its default value. + public mutating func clearClosedAt() {self._closedAt = nil} + + /// Advances by exactly one on every change to anything in this message + /// (see above). Opaque to clients: compare it against the last value seen + /// and keep the greater. There is no delta to fetch against it, only a + /// refetch of the request. + public var version: UInt64 = 0 + + /// What the request is and where it was made. + public var kind: Flipcash_Paymentrequest_V1_PaymentRequestMetadata.OneOf_Kind? = nil + + /// A request made in a group chat. + public var groupChat: Flipcash_Paymentrequest_V1_GroupChatPaymentRequest { + get { + if case .groupChat(let v)? = kind {return v} + return Flipcash_Paymentrequest_V1_GroupChatPaymentRequest() + } + set {kind = .groupChat(newValue)} + } + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + /// What the request is and where it was made. + public enum OneOf_Kind: Equatable, Sendable { + /// A request made in a group chat. + case groupChat(Flipcash_Paymentrequest_V1_GroupChatPaymentRequest) + + } + + public init() {} + + fileprivate var _paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId? = nil + fileprivate var _creator: Flipcash_Common_V1_UserId? = nil + fileprivate var _createdAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil + fileprivate var _closedAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil +} + +/// GroupChatPaymentRequest is a payment request made in a group chat, private or +/// not. It is shown in that chat as a message carrying a +/// messaging.v1.PaymentRequestWidget, and who may see or act on it is decided +/// by the chat. +public struct Flipcash_Paymentrequest_V1_GroupChatPaymentRequest: Sendable { + // SwiftProtobuf.Message 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 the request was created for. Anyone who can read this chat in + /// full can see the request: its members and anyone who satisfies its + /// listener rules in a group that is not private, and only its members in + /// a private group. Someone who can only preview the chat sees the + /// PaymentRequestWidget but not the request. Clients render a + /// PaymentRequestWidget whose request belongs to a different chat than the + /// message carrying it as unsupported. + 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 type of request. + public var type: Flipcash_Paymentrequest_V1_GroupChatPaymentRequest.OneOf_Type? = nil + + /// Named members each owe the creator a share. + public var split: Flipcash_Paymentrequest_V1_Split { + get { + if case .split(let v)? = type {return v} + return Flipcash_Paymentrequest_V1_Split() + } + set {type = .split(newValue)} + } + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + /// The type of request. + public enum OneOf_Type: Equatable, Sendable { + /// Named members each owe the creator a share. + case split(Flipcash_Paymentrequest_V1_Split) + + } + + public init() {} + + fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil +} + +/// Split asks named members of the chat (its debtors) each to pay the creator +/// an amount (their share) in one currency, for example to split a bill. Each +/// debtor pays their share with a Flipcash payment (see +/// intent.v1.ChatMetadata.RequestedPayment) or the creator marks it paid by +/// hand (PaymentRequest.MarkPaid); the request is COMPLETED once every +/// share is paid. +/// +/// The title and description are in `text`, which is plaintext in a group +/// that is not private and encrypted in a private group. Everything else is +/// plaintext everywhere, because the server needs it to check each payment +/// against its share and to decide when the request is complete. +public struct Flipcash_Paymentrequest_V1_Split: Sendable { + // SwiftProtobuf.Message 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 title and description. + public var text: Flipcash_Paymentrequest_V1_Split.OneOf_Text? = nil + + /// Set in a group that is not private, and moderated. + public var plaintext: Flipcash_Paymentrequest_V1_PaymentRequestText { + get { + if case .plaintext(let v)? = text {return v} + return Flipcash_Paymentrequest_V1_PaymentRequestText() + } + set {text = .plaintext(newValue)} + } + + /// Set in a private group. Not moderated, since the server cannot + /// read it. + public var encrypted: Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText { + get { + if case .encrypted(let v)? = text {return v} + return Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText() + } + set {text = .encrypted(newValue)} + } + + /// ISO 4217 alpha-3 currency code that every share, and every payment of + /// one, is in. The server must be able to value it. + public var currency: String = String() + + /// When the request stops accepting payments. It is in the future when the + /// request is created, and at most 4 weeks after it, and is the request's + /// one deadline: after it, no share can be paid, by payment or by hand, + /// and a request with shares still unpaid is EXPIRED. + public var endsAt: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _endsAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_endsAt = newValue} + } + /// Returns true if `endsAt` has been explicitly set. + public var hasEndsAt: Bool {return self._endsAt != nil} + /// Clears the value of `endsAt`. Subsequent reads from it will return its default value. + public mutating func clearEndsAt() {self._endsAt = nil} + + /// Who is asked to pay, and how much, in the order the creator listed + /// them. Each share names a distinct member of the chat (or one who was a + /// member when the request was created), the creator included: the + /// creator's own share, their part of what is being split, is paid from + /// creation (see PaidShare.Creator), and at least one share names someone + /// else. The shares are fixed at creation: nothing adds, removes or + /// reprices one, and a paid share stays paid (see PaidShare). + /// + /// On CreatePaymentRequest, every share has paid unset. + /// + /// At most 100 shares for now. A request is one record that grows with its + /// shares and is rewritten whole each time one is paid, so the bound keeps + /// that record, and a page of GetChatPaymentRequests, small. It may be + /// raised later. + public var shares: [Flipcash_Paymentrequest_V1_Share] = [] + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + /// The title and description. + public enum OneOf_Text: Equatable, Sendable { + /// Set in a group that is not private, and moderated. + case plaintext(Flipcash_Paymentrequest_V1_PaymentRequestText) + /// Set in a private group. Not moderated, since the server cannot + /// read it. + case encrypted(Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText) + + } + + public init() {} + + fileprivate var _endsAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil +} + +/// PaymentRequestText is the human-readable part of a payment request. +public struct Flipcash_Paymentrequest_V1_PaymentRequestText: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// What the money is for. + public var title: String = String() + + /// More detail about the request. Optional: empty means none. + public var description_p: String = String() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// EncryptedPaymentRequestText is a private group's PaymentRequestText, +/// encrypted with the chat key every member holds. The server stores it as-is +/// and cannot read it. +/// +/// For scheme CHAT_KEY_XCHACHA20POLY1305, the creator encrypts with +/// XChaCha20-Poly1305, as for messaging.v1.EncryptedContent but with its own +/// aad: +/// key = the group's chat key +/// nonce = 24 fresh random bytes, set in `nonce` below +/// plaintext = the serialized PaymentRequestText +/// aad = "flipcash-group-payment-request-e2ee-v1" || chat_id || creator_id +/// chat_id is the raw bytes of common.v1.ChatId.value for the request's chat, +/// and creator_id is the raw bytes of common.v1.UserId.value for +/// PaymentRequestMetadata.creator. Never reuse a nonce, and do not substitute a +/// 12-byte-nonce AEAD. +/// +/// A member decrypts with the chat key and the same aad, so the server cannot +/// move the text to another chat or attribute it to another creator, and the +/// distinct prefix keeps payment request text, poll text and message content +/// from being swapped for each other. The request ID is not bound, since the +/// server assigns it after the text is encrypted. +public struct Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText: Sendable { + // SwiftProtobuf.Message 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 encryption scheme used. Clients render a request with an + /// unrecognized scheme as unsupported. + public var scheme: Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText.Scheme = .unknown + + /// The random XChaCha20-Poly1305 nonce, unique per encryption. + public var nonce: Data = Data() + + /// The encrypted, serialized PaymentRequestText with the 16-byte Poly1305 + /// tag appended. The upper bound fits a PaymentRequestText with a + /// maximum-length title and description: 100 + 500 characters of up to 4 + /// bytes each is 2400 bytes, each field's tag and length prefix add 3 + /// bytes (6 in all), and the tag adds 16, for 2422 bytes, rounded up to + /// 2560. + public var ciphertext: Data = Data() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Scheme: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case unknown // = 0 + + /// The private group's chat key. + case chatKeyXchacha20Poly1305 // = 1 + case UNRECOGNIZED(Int) + + public init() { + self = .unknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .chatKeyXchacha20Poly1305 + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .unknown: return 0 + case .chatKeyXchacha20Poly1305: return 1 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText.Scheme] = [ + .unknown, + .chatKeyXchacha20Poly1305, + ] + + } + + public init() {} +} + +/// Share is one debtor's part of a payment request: who is asked to pay, how +/// much, and whether they have. +public struct Flipcash_Paymentrequest_V1_Share: Sendable { + // SwiftProtobuf.Message 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 member asked to pay. + 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 amount asked of them, in the request's currency. The server + /// requires a whole number, at least one, of the currency's minimum + /// transfer value (its smallest unit, e.g. $0.01): $12.34, not $12.345. + /// A client dividing an amount rounds each share to that unit itself. + public var nativeAmount: Double = 0 + + /// How the share was paid. Unset while it is unpaid. Clients never set it: + /// a share is paid only by a payment (see + /// intent.v1.ChatMetadata.RequestedPayment), by the creator with + /// PaymentRequest.MarkPaid, or, for the creator's own share, from + /// creation. + public var paid: Flipcash_Paymentrequest_V1_PaidShare { + get {return _paid ?? Flipcash_Paymentrequest_V1_PaidShare()} + set {_paid = newValue} + } + /// Returns true if `paid` has been explicitly set. + public var hasPaid: Bool {return self._paid != nil} + /// Clears the value of `paid`. Subsequent reads from it will return its default value. + public mutating func clearPaid() {self._paid = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _userID: Flipcash_Common_V1_UserId? = nil + fileprivate var _paid: Flipcash_Paymentrequest_V1_PaidShare? = nil +} + +/// PaidShare records how a share was paid. A share is paid all at once, for +/// exactly its native_amount (a payment pays the share exactly, all or +/// nothing, and a share marked paid by hand, or the creator's own, is taken +/// as settled in full), and once paid it stays paid. +/// +/// It changes in one case only: a share marked paid by hand (manual) is +/// replaced by a payment (intent) that lands after the mark, one the debtor +/// made while the share was still unpaid. The record then shows the money +/// that arrived, the request's version advances, and its status and +/// closed_at stay as they were. Nothing replaces a payment or the creator's +/// own share, and a hand mark never replaces anything. +public struct Flipcash_Paymentrequest_V1_PaidShare: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// When the share was paid, or marked paid. + public var paidAt: SwiftProtobuf.Google_Protobuf_Timestamp { + get {return _paidAt ?? SwiftProtobuf.Google_Protobuf_Timestamp()} + set {_paidAt = newValue} + } + /// Returns true if `paidAt` has been explicitly set. + public var hasPaidAt: Bool {return self._paidAt != nil} + /// Clears the value of `paidAt`. Subsequent reads from it will return its default value. + public mutating func clearPaidAt() {self._paidAt = nil} + + /// How the share was paid. + public var how: Flipcash_Paymentrequest_V1_PaidShare.OneOf_How? = nil + + /// Paid with a Flipcash payment: the payment's intent. The payment + /// also posted a messaging.v1.CashContent message into the chat, + /// carrying this request's ID in payment_request_id. + public var intent: Flipcash_Common_V1_IntentId { + get { + if case .intent(let v)? = how {return v} + return Flipcash_Common_V1_IntentId() + } + set {how = .intent(newValue)} + } + + /// Marked paid by the creator, for a share settled some other way. + /// Nothing was paid through Flipcash and no message was posted. + public var manual: Flipcash_Paymentrequest_V1_PaidShare.Manual { + get { + if case .manual(let v)? = how {return v} + return Flipcash_Paymentrequest_V1_PaidShare.Manual() + } + set {how = .manual(newValue)} + } + + /// The creator's own share, paid from creation: the creator is owed + /// it by themself. Nothing was paid and no message was posted. + /// paid_at is the request's created_at. + public var creator: Flipcash_Paymentrequest_V1_PaidShare.Creator { + get { + if case .creator(let v)? = how {return v} + return Flipcash_Paymentrequest_V1_PaidShare.Creator() + } + set {how = .creator(newValue)} + } + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + /// How the share was paid. + public enum OneOf_How: Equatable, Sendable { + /// Paid with a Flipcash payment: the payment's intent. The payment + /// also posted a messaging.v1.CashContent message into the chat, + /// carrying this request's ID in payment_request_id. + case intent(Flipcash_Common_V1_IntentId) + /// Marked paid by the creator, for a share settled some other way. + /// Nothing was paid through Flipcash and no message was posted. + case manual(Flipcash_Paymentrequest_V1_PaidShare.Manual) + /// The creator's own share, paid from creation: the creator is owed + /// it by themself. Nothing was paid and no message was posted. + /// paid_at is the request's created_at. + case creator(Flipcash_Paymentrequest_V1_PaidShare.Creator) + + } + + /// A share marked paid by hand (see PaymentRequest.MarkPaid), which only + /// the request's creator can do. + public struct Manual: Sendable { + // SwiftProtobuf.Message 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() {} + } + + /// The creator's own share, paid from creation. + public struct Creator: Sendable { + // SwiftProtobuf.Message 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 init() {} + + fileprivate var _paidAt: SwiftProtobuf.Google_Protobuf_Timestamp? = nil +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "flipcash.paymentrequest.v1" + +extension Flipcash_Paymentrequest_V1_PaymentRequestStatus: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0PAYMENT_REQUEST_STATUS_UNKNOWN\0\u{1}PAYMENT_REQUEST_STATUS_OPEN\0\u{1}PAYMENT_REQUEST_STATUS_COMPLETED\0\u{1}PAYMENT_REQUEST_STATUS_CLOSED\0\u{1}PAYMENT_REQUEST_STATUS_EXPIRED\0") +} + +extension Flipcash_Paymentrequest_V1_PaymentRequestId: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PaymentRequestId" + 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_Paymentrequest_V1_PaymentRequestId, rhs: Flipcash_Paymentrequest_V1_PaymentRequestId) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_IdempotencyKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".IdempotencyKey" + 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_Paymentrequest_V1_IdempotencyKey, rhs: Flipcash_Paymentrequest_V1_IdempotencyKey) -> Bool { + if lhs.value != rhs.value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_PaymentRequestMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PaymentRequestMetadata" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}payment_request_id\0\u{1}creator\0\u{3}created_at\0\u{1}status\0\u{3}closed_at\0\u{1}version\0\u{4}\u{4}group_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 { try decoder.decodeSingularMessageField(value: &self._paymentRequestID) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._creator) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._createdAt) }() + case 4: try { try decoder.decodeSingularEnumField(value: &self.status) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._closedAt) }() + case 6: try { try decoder.decodeSingularUInt64Field(value: &self.version) }() + case 10: try { + var v: Flipcash_Paymentrequest_V1_GroupChatPaymentRequest? + var hadOneofValue = false + if let current = self.kind { + hadOneofValue = true + if case .groupChat(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.kind = .groupChat(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._paymentRequestID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._creator { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = self._createdAt { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + if self.status != .unknown { + try visitor.visitSingularEnumField(value: self.status, fieldNumber: 4) + } + try { if let v = self._closedAt { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + if self.version != 0 { + try visitor.visitSingularUInt64Field(value: self.version, fieldNumber: 6) + } + try { if case .groupChat(let v)? = self.kind { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_PaymentRequestMetadata, rhs: Flipcash_Paymentrequest_V1_PaymentRequestMetadata) -> Bool { + if lhs._paymentRequestID != rhs._paymentRequestID {return false} + if lhs._creator != rhs._creator {return false} + if lhs._createdAt != rhs._createdAt {return false} + if lhs.status != rhs.status {return false} + if lhs._closedAt != rhs._closedAt {return false} + if lhs.version != rhs.version {return false} + if lhs.kind != rhs.kind {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_GroupChatPaymentRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GroupChatPaymentRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}split\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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_Paymentrequest_V1_Split? + var hadOneofValue = false + if let current = self.type { + hadOneofValue = true + if case .split(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.type = .split(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) + } }() + try { if case .split(let v)? = self.type { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_GroupChatPaymentRequest, rhs: Flipcash_Paymentrequest_V1_GroupChatPaymentRequest) -> 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_Paymentrequest_V1_Split: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Split" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}plaintext\0\u{1}encrypted\0\u{1}currency\0\u{3}ends_at\0\u{1}shares\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates 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_Paymentrequest_V1_PaymentRequestText? + var hadOneofValue = false + if let current = self.text { + hadOneofValue = true + if case .plaintext(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.text = .plaintext(v) + } + }() + case 2: try { + var v: Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText? + var hadOneofValue = false + if let current = self.text { + hadOneofValue = true + if case .encrypted(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.text = .encrypted(v) + } + }() + case 3: try { try decoder.decodeSingularStringField(value: &self.currency) }() + case 4: try { try decoder.decodeSingularMessageField(value: &self._endsAt) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.shares) }() + 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.text { + case .plaintext?: try { + guard case .plaintext(let v)? = self.text else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + }() + case .encrypted?: try { + guard case .encrypted(let v)? = self.text else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case nil: break + } + if !self.currency.isEmpty { + try visitor.visitSingularStringField(value: self.currency, fieldNumber: 3) + } + try { if let v = self._endsAt { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + if !self.shares.isEmpty { + try visitor.visitRepeatedMessageField(value: self.shares, fieldNumber: 5) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_Split, rhs: Flipcash_Paymentrequest_V1_Split) -> Bool { + if lhs.text != rhs.text {return false} + if lhs.currency != rhs.currency {return false} + if lhs._endsAt != rhs._endsAt {return false} + if lhs.shares != rhs.shares {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_PaymentRequestText: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PaymentRequestText" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}title\0\u{1}description\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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.title) }() + case 2: try { try decoder.decodeSingularStringField(value: &self.description_p) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.title.isEmpty { + try visitor.visitSingularStringField(value: self.title, fieldNumber: 1) + } + if !self.description_p.isEmpty { + try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_PaymentRequestText, rhs: Flipcash_Paymentrequest_V1_PaymentRequestText) -> Bool { + if lhs.title != rhs.title {return false} + if lhs.description_p != rhs.description_p {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".EncryptedPaymentRequestText" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}scheme\0\u{1}nonce\0\u{1}ciphertext\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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.scheme) }() + case 2: try { try decoder.decodeSingularBytesField(value: &self.nonce) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.ciphertext) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if self.scheme != .unknown { + try visitor.visitSingularEnumField(value: self.scheme, fieldNumber: 1) + } + if !self.nonce.isEmpty { + try visitor.visitSingularBytesField(value: self.nonce, fieldNumber: 2) + } + if !self.ciphertext.isEmpty { + try visitor.visitSingularBytesField(value: self.ciphertext, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText, rhs: Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText) -> Bool { + if lhs.scheme != rhs.scheme {return false} + if lhs.nonce != rhs.nonce {return false} + if lhs.ciphertext != rhs.ciphertext {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_EncryptedPaymentRequestText.Scheme: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}CHAT_KEY_XCHACHA20POLY1305\0") +} + +extension Flipcash_Paymentrequest_V1_Share: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".Share" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{3}native_amount\0\u{1}paid\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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.decodeSingularDoubleField(value: &self.nativeAmount) }() + case 3: try { try decoder.decodeSingularMessageField(value: &self._paid) }() + 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.nativeAmount.bitPattern != 0 { + try visitor.visitSingularDoubleField(value: self.nativeAmount, fieldNumber: 2) + } + try { if let v = self._paid { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_Share, rhs: Flipcash_Paymentrequest_V1_Share) -> Bool { + if lhs._userID != rhs._userID {return false} + if lhs.nativeAmount != rhs.nativeAmount {return false} + if lhs._paid != rhs._paid {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_PaidShare: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".PaidShare" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}paid_at\0\u{1}intent\0\u{1}manual\0\u{1}creator\0") + + public mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space 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._paidAt) }() + case 2: try { + var v: Flipcash_Common_V1_IntentId? + var hadOneofValue = false + if let current = self.how { + hadOneofValue = true + if case .intent(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.how = .intent(v) + } + }() + case 3: try { + var v: Flipcash_Paymentrequest_V1_PaidShare.Manual? + var hadOneofValue = false + if let current = self.how { + hadOneofValue = true + if case .manual(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.how = .manual(v) + } + }() + case 4: try { + var v: Flipcash_Paymentrequest_V1_PaidShare.Creator? + var hadOneofValue = false + if let current = self.how { + hadOneofValue = true + if case .creator(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.how = .creator(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._paidAt { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + switch self.how { + case .intent?: try { + guard case .intent(let v)? = self.how else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case .manual?: try { + guard case .manual(let v)? = self.how else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case .creator?: try { + guard case .creator(let v)? = self.how else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + }() + case nil: break + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_PaidShare, rhs: Flipcash_Paymentrequest_V1_PaidShare) -> Bool { + if lhs._paidAt != rhs._paidAt {return false} + if lhs.how != rhs.how {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_PaidShare.Manual: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Paymentrequest_V1_PaidShare.protoMessageName + ".Manual" + 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_Paymentrequest_V1_PaidShare.Manual, rhs: Flipcash_Paymentrequest_V1_PaidShare.Manual) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_PaidShare.Creator: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = Flipcash_Paymentrequest_V1_PaidShare.protoMessageName + ".Creator" + 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_Paymentrequest_V1_PaidShare.Creator, rhs: Flipcash_Paymentrequest_V1_PaidShare.Creator) -> Bool { + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Sources/Flipcash2ClientProtocol/paymentrequest_v1_paymentrequest_service.grpc.swift b/Sources/Flipcash2ClientProtocol/paymentrequest_v1_paymentrequest_service.grpc.swift new file mode 100644 index 0000000..713f415 --- /dev/null +++ b/Sources/Flipcash2ClientProtocol/paymentrequest_v1_paymentrequest_service.grpc.swift @@ -0,0 +1,959 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// swiftlint:disable all +// +// Generated by the gRPC Swift generator plugin for the protocol buffer compiler. +// Source: paymentrequest/v1/paymentrequest_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.paymentrequest.v1.PaymentRequest + +/// Namespace containing generated types for the "flipcash.paymentrequest.v1.PaymentRequest" service. +@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) +public enum Flipcash_Paymentrequest_V1_PaymentRequest { + /// Service descriptor for the "flipcash.paymentrequest.v1.PaymentRequest" service. + public static let descriptor = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.paymentrequest.v1.PaymentRequest") + /// Namespace for method metadata. + public enum Method { + /// Namespace for "CreatePaymentRequest" metadata. + public enum CreatePaymentRequest { + /// Request type for "CreatePaymentRequest". + public typealias Input = Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest + /// Response type for "CreatePaymentRequest". + public typealias Output = Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse + /// Descriptor for "CreatePaymentRequest". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.paymentrequest.v1.PaymentRequest"), + method: "CreatePaymentRequest" + ) + } + /// Namespace for "GetPaymentRequest" metadata. + public enum GetPaymentRequest { + /// Request type for "GetPaymentRequest". + public typealias Input = Flipcash_Paymentrequest_V1_GetPaymentRequestRequest + /// Response type for "GetPaymentRequest". + public typealias Output = Flipcash_Paymentrequest_V1_GetPaymentRequestResponse + /// Descriptor for "GetPaymentRequest". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.paymentrequest.v1.PaymentRequest"), + method: "GetPaymentRequest" + ) + } + /// Namespace for "GetChatPaymentRequests" metadata. + public enum GetChatPaymentRequests { + /// Request type for "GetChatPaymentRequests". + public typealias Input = Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest + /// Response type for "GetChatPaymentRequests". + public typealias Output = Flipcash_Paymentrequest_V1_GetChatPaymentRequestsResponse + /// Descriptor for "GetChatPaymentRequests". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.paymentrequest.v1.PaymentRequest"), + method: "GetChatPaymentRequests" + ) + } + /// Namespace for "ClosePaymentRequest" metadata. + public enum ClosePaymentRequest { + /// Request type for "ClosePaymentRequest". + public typealias Input = Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest + /// Response type for "ClosePaymentRequest". + public typealias Output = Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse + /// Descriptor for "ClosePaymentRequest". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.paymentrequest.v1.PaymentRequest"), + method: "ClosePaymentRequest" + ) + } + /// Namespace for "MarkPaid" metadata. + public enum MarkPaid { + /// Request type for "MarkPaid". + public typealias Input = Flipcash_Paymentrequest_V1_MarkPaidRequest + /// Response type for "MarkPaid". + public typealias Output = Flipcash_Paymentrequest_V1_MarkPaidResponse + /// Descriptor for "MarkPaid". + public static let descriptor = GRPCCore.MethodDescriptor( + service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.paymentrequest.v1.PaymentRequest"), + method: "MarkPaid" + ) + } + /// Descriptors for all methods in the "flipcash.paymentrequest.v1.PaymentRequest" service. + public static let descriptors: [GRPCCore.MethodDescriptor] = [ + CreatePaymentRequest.descriptor, + GetPaymentRequest.descriptor, + GetChatPaymentRequests.descriptor, + ClosePaymentRequest.descriptor, + MarkPaid.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.paymentrequest.v1.PaymentRequest" service. + public static let flipcash_paymentrequest_v1_PaymentRequest = GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.paymentrequest.v1.PaymentRequest") +} + +// MARK: flipcash.paymentrequest.v1.PaymentRequest (client) + +@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) +extension Flipcash_Paymentrequest_V1_PaymentRequest { + /// Generated client protocol for the "flipcash.paymentrequest.v1.PaymentRequest" service. + /// + /// You don't need to implement this protocol directly, use the generated + /// implementation, ``Client``. + /// + /// > Source IDL Documentation: + /// > + /// > PaymentRequest manages payment requests: a creator asking others for money. + /// > Requests are layered (see PaymentRequestMetadata): the first layer is where + /// > a request is made, today a group chat (GroupChatPaymentRequest), and the + /// > second is its type, today a split (Split). Every kind shares its identity, + /// > creator, status, version and the RPCs below; what each layer adds is documented on + /// > its message. DMs are not supported. + /// > + /// > A group chat request is shown in its chat as a message. The creator first + /// > calls CreatePaymentRequest, then sends the returned PaymentRequestId with + /// > Messaging.SendMessage as a messaging.v1.PaymentRequestWidget. The message + /// > carries only the PaymentRequestId; clients get the request's kind, shares + /// > and status from GetPaymentRequest. The request is live from creation, sent + /// > or not. + /// > + /// > A request belongs to the chat it was created for. Its creator may send it + /// > in that chat any number of times, for example to bring an older request + /// > back to the bottom of the chat. Every message carrying it shows the same + /// > request. Deleting a message that carries a request does not touch the + /// > request. + /// > + /// > Anyone who can read the chat in full sees the request, its shares and + /// > who has paid; someone who can only preview the chat sees the widget but + /// > not the request. No event announces a change to a request: clients + /// > refetch it to see payments and closes land. + /// > + /// > In a group that is not private, a split's title and description are + /// > plaintext and moderated, and the widget is sent as plain WidgetContent. + /// > + /// > In a private group, they are encrypted with the chat key (see + /// > EncryptedPaymentRequestText), and the widget is sent inside + /// > messaging.v1.EncryptedContent like everything else. The server still sees + /// > everything else (the currency, ends_at, the shares and every payment), + /// > since it has to check payments against the shares and decide when the + /// > request is complete. + public protocol ClientProtocol: Sendable { + /// Call the "CreatePaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > CreatePaymentRequest creates a payment request of the kind the request + /// > carries. For a group chat request, the caller, who becomes its + /// > creator, must be able to send messages in the chat; a split's + /// > plaintext title and description are moderated together, as one text, + /// > and encrypted text is not. The request is OPEN and accepts payments as + /// > soon as it is created; the widget message the creator sends announces + /// > it. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse` 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 createPaymentRequest( + 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 "GetPaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetPaymentRequest gets a payment request. The caller must be able to read + /// > the chat in full (see messaging.v1.ViewMode FULL): in a group that is + /// > not private, its members and anyone who satisfies its listener rules; + /// > in a private group, only its members. Being able to preview the chat is + /// > not enough. + /// > + /// > A caller who holds an unpaid share of the request is also given the + /// > intent ID their payment of it must use (see + /// > GetPaymentRequestResponse.payment_intent_id). + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_GetPaymentRequestRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_GetPaymentRequestRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_GetPaymentRequestResponse` 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 getPaymentRequest( + 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 "GetChatPaymentRequests" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetChatPaymentRequests pages one section of the payment requests made + /// > in a group chat (every kind whose first layer is that chat): the OPEN + /// > ones, soonest to end first, or the RESOLVED ones, most recently + /// > resolved first (see GetChatPaymentRequestsRequest.section). Together + /// > the two sections are the chat's full history of requests, and a client + /// > showing both pages each on its own. The caller must be able to read the + /// > chat in full, as for GetPaymentRequest. + /// > + /// > A page's requests are current as of its read, and clients apply them by + /// > version (see PaymentRequestMetadata) against what they already hold. A + /// > request moves from OPEN to RESOLVED while a client walks either + /// > section, so a walk may miss it or see it in both; clients learn of a + /// > new request from its widget message, and refresh a section to see one + /// > resolve. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_GetChatPaymentRequestsResponse` 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 getChatPaymentRequests( + 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 "ClosePaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > ClosePaymentRequest closes an OPEN request, which then accepts no more + /// > payments: it becomes CLOSED and advances the version. Only the creator + /// > can close. Closing a request that is not OPEN (already COMPLETED, + /// > CLOSED or EXPIRED) is a no-op that returns OK. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse` 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 closePaymentRequest( + 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 "MarkPaid" method. + /// + /// > Source IDL Documentation: + /// > + /// > MarkPaid records a debtor's share of a split as paid by hand, for a + /// > share settled outside Flipcash. Only the creator can mark a share paid. + /// > The share is recorded as a PaidShare.Manual and the version advances; + /// > if it was the last unpaid share, the request becomes COMPLETED. No + /// > message is posted into the chat. + /// > + /// > Marking a share that is already paid, by payment or by hand, is a no-op + /// > that returns OK, whatever the request's status. A debtor's payment in + /// > flight when the share is marked replaces the mark once it lands (see + /// > PaidShare). + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_MarkPaidRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_MarkPaidRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_MarkPaidResponse` 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 markPaid( + 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.paymentrequest.v1.PaymentRequest" 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: + /// > + /// > PaymentRequest manages payment requests: a creator asking others for money. + /// > Requests are layered (see PaymentRequestMetadata): the first layer is where + /// > a request is made, today a group chat (GroupChatPaymentRequest), and the + /// > second is its type, today a split (Split). Every kind shares its identity, + /// > creator, status, version and the RPCs below; what each layer adds is documented on + /// > its message. DMs are not supported. + /// > + /// > A group chat request is shown in its chat as a message. The creator first + /// > calls CreatePaymentRequest, then sends the returned PaymentRequestId with + /// > Messaging.SendMessage as a messaging.v1.PaymentRequestWidget. The message + /// > carries only the PaymentRequestId; clients get the request's kind, shares + /// > and status from GetPaymentRequest. The request is live from creation, sent + /// > or not. + /// > + /// > A request belongs to the chat it was created for. Its creator may send it + /// > in that chat any number of times, for example to bring an older request + /// > back to the bottom of the chat. Every message carrying it shows the same + /// > request. Deleting a message that carries a request does not touch the + /// > request. + /// > + /// > Anyone who can read the chat in full sees the request, its shares and + /// > who has paid; someone who can only preview the chat sees the widget but + /// > not the request. No event announces a change to a request: clients + /// > refetch it to see payments and closes land. + /// > + /// > In a group that is not private, a split's title and description are + /// > plaintext and moderated, and the widget is sent as plain WidgetContent. + /// > + /// > In a private group, they are encrypted with the chat key (see + /// > EncryptedPaymentRequestText), and the widget is sent inside + /// > messaging.v1.EncryptedContent like everything else. The server still sees + /// > everything else (the currency, ends_at, the shares and every payment), + /// > since it has to check payments against the shares and decide when the + /// > request is complete. + 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 "CreatePaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > CreatePaymentRequest creates a payment request of the kind the request + /// > carries. For a group chat request, the caller, who becomes its + /// > creator, must be able to send messages in the chat; a split's + /// > plaintext title and description are moderated together, as one text, + /// > and encrypted text is not. The request is OPEN and accepts payments as + /// > soon as it is created; the widget message the creator sends announces + /// > it. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse` 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 createPaymentRequest( + 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_Paymentrequest_V1_PaymentRequest.Method.CreatePaymentRequest.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetPaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetPaymentRequest gets a payment request. The caller must be able to read + /// > the chat in full (see messaging.v1.ViewMode FULL): in a group that is + /// > not private, its members and anyone who satisfies its listener rules; + /// > in a private group, only its members. Being able to preview the chat is + /// > not enough. + /// > + /// > A caller who holds an unpaid share of the request is also given the + /// > intent ID their payment of it must use (see + /// > GetPaymentRequestResponse.payment_intent_id). + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_GetPaymentRequestRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_GetPaymentRequestRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_GetPaymentRequestResponse` 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 getPaymentRequest( + 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_Paymentrequest_V1_PaymentRequest.Method.GetPaymentRequest.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetChatPaymentRequests" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetChatPaymentRequests pages one section of the payment requests made + /// > in a group chat (every kind whose first layer is that chat): the OPEN + /// > ones, soonest to end first, or the RESOLVED ones, most recently + /// > resolved first (see GetChatPaymentRequestsRequest.section). Together + /// > the two sections are the chat's full history of requests, and a client + /// > showing both pages each on its own. The caller must be able to read the + /// > chat in full, as for GetPaymentRequest. + /// > + /// > A page's requests are current as of its read, and clients apply them by + /// > version (see PaymentRequestMetadata) against what they already hold. A + /// > request moves from OPEN to RESOLVED while a client walks either + /// > section, so a walk may miss it or see it in both; clients learn of a + /// > new request from its widget message, and refresh a section to see one + /// > resolve. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_GetChatPaymentRequestsResponse` 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 getChatPaymentRequests( + 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_Paymentrequest_V1_PaymentRequest.Method.GetChatPaymentRequests.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "ClosePaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > ClosePaymentRequest closes an OPEN request, which then accepts no more + /// > payments: it becomes CLOSED and advances the version. Only the creator + /// > can close. Closing a request that is not OPEN (already COMPLETED, + /// > CLOSED or EXPIRED) is a no-op that returns OK. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse` 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 closePaymentRequest( + 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_Paymentrequest_V1_PaymentRequest.Method.ClosePaymentRequest.descriptor, + serializer: serializer, + deserializer: deserializer, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "MarkPaid" method. + /// + /// > Source IDL Documentation: + /// > + /// > MarkPaid records a debtor's share of a split as paid by hand, for a + /// > share settled outside Flipcash. Only the creator can mark a share paid. + /// > The share is recorded as a PaidShare.Manual and the version advances; + /// > if it was the last unpaid share, the request becomes COMPLETED. No + /// > message is posted into the chat. + /// > + /// > Marking a share that is already paid, by payment or by hand, is a no-op + /// > that returns OK, whatever the request's status. A debtor's payment in + /// > flight when the share is marked replaces the mark once it lands (see + /// > PaidShare). + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_MarkPaidRequest` message. + /// - serializer: A serializer for `Flipcash_Paymentrequest_V1_MarkPaidRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Paymentrequest_V1_MarkPaidResponse` 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 markPaid( + 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_Paymentrequest_V1_PaymentRequest.Method.MarkPaid.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_Paymentrequest_V1_PaymentRequest.ClientProtocol { + /// Call the "CreatePaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > CreatePaymentRequest creates a payment request of the kind the request + /// > carries. For a group chat request, the caller, who becomes its + /// > creator, must be able to send messages in the chat; a split's + /// > plaintext title and description are moderated together, as one text, + /// > and encrypted text is not. The request is OPEN and accepts payments as + /// > soon as it is created; the widget message the creator sends announces + /// > it. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest` 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 createPaymentRequest( + 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.createPaymentRequest( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetPaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetPaymentRequest gets a payment request. The caller must be able to read + /// > the chat in full (see messaging.v1.ViewMode FULL): in a group that is + /// > not private, its members and anyone who satisfies its listener rules; + /// > in a private group, only its members. Being able to preview the chat is + /// > not enough. + /// > + /// > A caller who holds an unpaid share of the request is also given the + /// > intent ID their payment of it must use (see + /// > GetPaymentRequestResponse.payment_intent_id). + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_GetPaymentRequestRequest` 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 getPaymentRequest( + 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.getPaymentRequest( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetChatPaymentRequests" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetChatPaymentRequests pages one section of the payment requests made + /// > in a group chat (every kind whose first layer is that chat): the OPEN + /// > ones, soonest to end first, or the RESOLVED ones, most recently + /// > resolved first (see GetChatPaymentRequestsRequest.section). Together + /// > the two sections are the chat's full history of requests, and a client + /// > showing both pages each on its own. The caller must be able to read the + /// > chat in full, as for GetPaymentRequest. + /// > + /// > A page's requests are current as of its read, and clients apply them by + /// > version (see PaymentRequestMetadata) against what they already hold. A + /// > request moves from OPEN to RESOLVED while a client walks either + /// > section, so a walk may miss it or see it in both; clients learn of a + /// > new request from its widget message, and refresh a section to see one + /// > resolve. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest` 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 getChatPaymentRequests( + 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.getChatPaymentRequests( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } + + /// Call the "ClosePaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > ClosePaymentRequest closes an OPEN request, which then accepts no more + /// > payments: it becomes CLOSED and advances the version. Only the creator + /// > can close. Closing a request that is not OPEN (already COMPLETED, + /// > CLOSED or EXPIRED) is a no-op that returns OK. + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest` 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 closePaymentRequest( + 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.closePaymentRequest( + request: request, + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), + options: options, + onResponse: handleResponse + ) + } + + /// Call the "MarkPaid" method. + /// + /// > Source IDL Documentation: + /// > + /// > MarkPaid records a debtor's share of a split as paid by hand, for a + /// > share settled outside Flipcash. Only the creator can mark a share paid. + /// > The share is recorded as a PaidShare.Manual and the version advances; + /// > if it was the last unpaid share, the request becomes COMPLETED. No + /// > message is posted into the chat. + /// > + /// > Marking a share that is already paid, by payment or by hand, is a no-op + /// > that returns OK, whatever the request's status. A debtor's payment in + /// > flight when the share is marked replaces the mark once it lands (see + /// > PaidShare). + /// + /// - Parameters: + /// - request: A request containing a single `Flipcash_Paymentrequest_V1_MarkPaidRequest` 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 markPaid( + 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.markPaid( + 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_Paymentrequest_V1_PaymentRequest.ClientProtocol { + /// Call the "CreatePaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > CreatePaymentRequest creates a payment request of the kind the request + /// > carries. For a group chat request, the caller, who becomes its + /// > creator, must be able to send messages in the chat; a split's + /// > plaintext title and description are moderated together, as one text, + /// > and encrypted text is not. The request is OPEN and accepts payments as + /// > soon as it is created; the widget message the creator sends announces + /// > it. + /// + /// - 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 createPaymentRequest( + _ message: Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest, + 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.createPaymentRequest( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetPaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetPaymentRequest gets a payment request. The caller must be able to read + /// > the chat in full (see messaging.v1.ViewMode FULL): in a group that is + /// > not private, its members and anyone who satisfies its listener rules; + /// > in a private group, only its members. Being able to preview the chat is + /// > not enough. + /// > + /// > A caller who holds an unpaid share of the request is also given the + /// > intent ID their payment of it must use (see + /// > GetPaymentRequestResponse.payment_intent_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 getPaymentRequest( + _ message: Flipcash_Paymentrequest_V1_GetPaymentRequestRequest, + 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.getPaymentRequest( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "GetChatPaymentRequests" method. + /// + /// > Source IDL Documentation: + /// > + /// > GetChatPaymentRequests pages one section of the payment requests made + /// > in a group chat (every kind whose first layer is that chat): the OPEN + /// > ones, soonest to end first, or the RESOLVED ones, most recently + /// > resolved first (see GetChatPaymentRequestsRequest.section). Together + /// > the two sections are the chat's full history of requests, and a client + /// > showing both pages each on its own. The caller must be able to read the + /// > chat in full, as for GetPaymentRequest. + /// > + /// > A page's requests are current as of its read, and clients apply them by + /// > version (see PaymentRequestMetadata) against what they already hold. A + /// > request moves from OPEN to RESOLVED while a client walks either + /// > section, so a walk may miss it or see it in both; clients learn of a + /// > new request from its widget message, and refresh a section to see one + /// > resolve. + /// + /// - 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 getChatPaymentRequests( + _ message: Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest, + 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.getChatPaymentRequests( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "ClosePaymentRequest" method. + /// + /// > Source IDL Documentation: + /// > + /// > ClosePaymentRequest closes an OPEN request, which then accepts no more + /// > payments: it becomes CLOSED and advances the version. Only the creator + /// > can close. Closing a request that is not OPEN (already COMPLETED, + /// > CLOSED or EXPIRED) is a no-op that 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 closePaymentRequest( + _ message: Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest, + 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.closePaymentRequest( + request: request, + options: options, + onResponse: handleResponse + ) + } + + /// Call the "MarkPaid" method. + /// + /// > Source IDL Documentation: + /// > + /// > MarkPaid records a debtor's share of a split as paid by hand, for a + /// > share settled outside Flipcash. Only the creator can mark a share paid. + /// > The share is recorded as a PaidShare.Manual and the version advances; + /// > if it was the last unpaid share, the request becomes COMPLETED. No + /// > message is posted into the chat. + /// > + /// > Marking a share that is already paid, by payment or by hand, is a no-op + /// > that returns OK, whatever the request's status. A debtor's payment in + /// > flight when the share is marked replaces the mark once it lands (see + /// > PaidShare). + /// + /// - 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 markPaid( + _ message: Flipcash_Paymentrequest_V1_MarkPaidRequest, + 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.markPaid( + request: request, + options: options, + onResponse: handleResponse + ) + } +} \ No newline at end of file diff --git a/Sources/Flipcash2ClientProtocol/paymentrequest_v1_paymentrequest_service.pb.swift b/Sources/Flipcash2ClientProtocol/paymentrequest_v1_paymentrequest_service.pb.swift new file mode 100644 index 0000000..322a163 --- /dev/null +++ b/Sources/Flipcash2ClientProtocol/paymentrequest_v1_paymentrequest_service.pb.swift @@ -0,0 +1,1357 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// swiftlint:disable all +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: paymentrequest/v1/paymentrequest_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_Paymentrequest_V1_CreatePaymentRequestRequest: Sendable { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Key for retrying this request safely. A retry with the same key from + /// the same caller returns the payment request the first attempt created, + /// with result OK, even if the parameters, or the kind, differ. + public var idempotencyKey: Flipcash_Paymentrequest_V1_IdempotencyKey { + get {return _idempotencyKey ?? Flipcash_Paymentrequest_V1_IdempotencyKey()} + set {_idempotencyKey = newValue} + } + /// Returns true if `idempotencyKey` has been explicitly set. + public var hasIdempotencyKey: Bool {return self._idempotencyKey != nil} + /// Clears the value of `idempotencyKey`. Subsequent reads from it will return its default value. + public mutating func clearIdempotencyKey() {self._idempotencyKey = nil} + + /// What to create and where. The same messages the created request + /// carries in PaymentRequestMetadata.kind, with nothing the server sets + /// (for a split, every share has paid unset). + public var kind: Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest.OneOf_Kind? = nil + + /// A request in a group chat. The caller may list themself among a + /// split's shares; that share is created paid (PaidShare.Creator), + /// and at least one share must name someone else. + public var groupChat: Flipcash_Paymentrequest_V1_GroupChatPaymentRequest { + get { + if case .groupChat(let v)? = kind {return v} + return Flipcash_Paymentrequest_V1_GroupChatPaymentRequest() + } + set {kind = .groupChat(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() + + /// What to create and where. The same messages the created request + /// carries in PaymentRequestMetadata.kind, with nothing the server sets + /// (for a split, every share has paid unset). + public enum OneOf_Kind: Equatable, Sendable { + /// A request in a group chat. The caller may list themself among a + /// split's shares; that share is created paid (PaidShare.Creator), + /// and at least one share must name someone else. + case groupChat(Flipcash_Paymentrequest_V1_GroupChatPaymentRequest) + + } + + public init() {} + + fileprivate var _idempotencyKey: Flipcash_Paymentrequest_V1_IdempotencyKey? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse: @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 result: Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse.Result { + get {return _storage._result} + set {_uniqueStorage()._result = newValue} + } + + /// The created request, or on a retry the request the first attempt + /// created. Set only when result == OK. + public var paymentRequest: Flipcash_Paymentrequest_V1_PaymentRequestMetadata { + get {return _storage._paymentRequest ?? Flipcash_Paymentrequest_V1_PaymentRequestMetadata()} + set {_uniqueStorage()._paymentRequest = newValue} + } + /// Returns true if `paymentRequest` has been explicitly set. + public var hasPaymentRequest: Bool {return _storage._paymentRequest != nil} + /// Clears the value of `paymentRequest`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequest() {_uniqueStorage()._paymentRequest = nil} + + /// The best-fit category that tripped moderation, mirroring the Moderation + /// service's vocabulary. Set only when result == TEXT_MODERATED; NONE + /// otherwise. + public var flaggedCategory: Flipcash_Moderation_V1_FlaggedCategory { + get {return _storage._flaggedCategory} + set {_uniqueStorage()._flaggedCategory = newValue} + } + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case ok // = 0 + + /// The caller is not a member of the chat, or does not satisfy its + /// speaker rules. + case denied // = 1 + + /// The chat a group chat request names is a DM. + case chatNotSupported // = 2 + + /// The text is encrypted and the chat is not a private group. + case encryptionNotAllowed // = 3 + + /// The chat is a private group and the text is not encrypted. + case encryptionRequired // = 4 + + /// A split's ends_at is not in the future, or is more than 4 weeks + /// away. + case invalidEndsAt // = 5 + + /// A split's share names a user who is not a member of the chat, or + /// a user another share already names; is not a whole number, at + /// least one, of the currency's minimum transfer value; or has paid + /// set. Or no share names anyone but the caller. + case invalidShares // = 6 + + /// A split's currency is one the server cannot value. + case invalidCurrency // = 7 + + /// The plaintext title and description, moderated together as one + /// text, were flagged. + case textModerated // = 8 + case UNRECOGNIZED(Int) + + public init() { + self = .ok + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .ok + case 1: self = .denied + case 2: self = .chatNotSupported + case 3: self = .encryptionNotAllowed + case 4: self = .encryptionRequired + case 5: self = .invalidEndsAt + case 6: self = .invalidShares + case 7: self = .invalidCurrency + case 8: self = .textModerated + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .ok: return 0 + case .denied: return 1 + case .chatNotSupported: return 2 + case .encryptionNotAllowed: return 3 + case .encryptionRequired: return 4 + case .invalidEndsAt: return 5 + case .invalidShares: return 6 + case .invalidCurrency: return 7 + case .textModerated: return 8 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse.Result] = [ + .ok, + .denied, + .chatNotSupported, + .encryptionNotAllowed, + .encryptionRequired, + .invalidEndsAt, + .invalidShares, + .invalidCurrency, + .textModerated, + ] + + } + + public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +public struct Flipcash_Paymentrequest_V1_GetPaymentRequestRequest: Sendable { + // SwiftProtobuf.Message 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 paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId { + get {return _paymentRequestID ?? Flipcash_Paymentrequest_V1_PaymentRequestId()} + set {_paymentRequestID = newValue} + } + /// Returns true if `paymentRequestID` has been explicitly set. + public var hasPaymentRequestID: Bool {return self._paymentRequestID != nil} + /// Clears the value of `paymentRequestID`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequestID() {self._paymentRequestID = 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 _paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Paymentrequest_V1_GetPaymentRequestResponse: @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 result: Flipcash_Paymentrequest_V1_GetPaymentRequestResponse.Result { + get {return _storage._result} + set {_uniqueStorage()._result = newValue} + } + + /// Set only when result == OK. + public var paymentRequest: Flipcash_Paymentrequest_V1_PaymentRequestMetadata { + get {return _storage._paymentRequest ?? Flipcash_Paymentrequest_V1_PaymentRequestMetadata()} + set {_uniqueStorage()._paymentRequest = newValue} + } + /// Returns true if `paymentRequest` has been explicitly set. + public var hasPaymentRequest: Bool {return _storage._paymentRequest != nil} + /// Clears the value of `paymentRequest`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequest() {_uniqueStorage()._paymentRequest = nil} + + /// The intent ID the caller's payment of their share must use (see + /// intent.v1.ChatMetadata.RequestedPayment), set only when result == OK + /// and the caller holds a share of the request that is unpaid. + /// + /// The server generates one at random for each debtor's share when the + /// request is created, and gives it to that debtor alone. A payment of the + /// share with any other intent ID is refused, and an intent ID is used at + /// most once, so a share is paid at most once: a retry, a second tap or a + /// second device all pay under this one ID, and only the first payment + /// goes through. Keep it to the payment: anyone who learns it before the + /// share is paid can use it up and block the payment. + public var paymentIntentID: Flipcash_Common_V1_IntentId { + get {return _storage._paymentIntentID ?? Flipcash_Common_V1_IntentId()} + set {_uniqueStorage()._paymentIntentID = newValue} + } + /// Returns true if `paymentIntentID` has been explicitly set. + public var hasPaymentIntentID: Bool {return _storage._paymentIntentID != nil} + /// Clears the value of `paymentIntentID`. Subsequent reads from it will return its default value. + public mutating func clearPaymentIntentID() {_uniqueStorage()._paymentIntentID = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case ok // = 0 + + /// The caller cannot read the request's chat in full. + case denied // = 1 + + /// The request doesn't exist. + 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_Paymentrequest_V1_GetPaymentRequestResponse.Result] = [ + .ok, + .denied, + .notFound, + ] + + } + + public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +public struct Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest: Sendable { + // SwiftProtobuf.Message 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 group chat whose requests to page: every request whose + /// GroupChatPaymentRequest.chat_id is this chat. + 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} + + /// Which requests to page, and in what order. A request is in exactly one + /// section at any moment, decided by its status (see + /// PaymentRequestMetadata.status). + public var section: Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest.Section = .unknown + + /// QueryOptions controls page_size, capped at 100. Ordering is fixed by + /// the section and is not client-selectable. + /// + /// Leave query_options.paging_token unset on the first request. On every + /// subsequent request, set it to the paging_token from the most recent + /// response. The token is opaque and server-generated; do not construct + /// it. It is bound to chat_id and section and refused with another. + 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 enum Section: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case unknown // = 0 + + /// Requests that are OPEN: still accepting payments. Ordered by + /// ends_at ascending, the one ending soonest first, so the most urgent + /// leads. The section is the same for every member: a request stays + /// here until every share is paid, the creator closes it or it + /// reaches its ends_at, whether or not the caller has paid their own + /// share. + case `open` // = 1 + + /// Requests that are COMPLETED, CLOSED or EXPIRED: no longer accepting + /// payments. Ordered by PaymentRequestMetadata.closed_at descending, the + /// most recently resolved first: when its last share was paid, when + /// the creator closed it, or its ends_at when it expired. + case resolved // = 2 + case UNRECOGNIZED(Int) + + public init() { + self = .unknown + } + + public init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .open + case 2: self = .resolved + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .unknown: return 0 + case .open: return 1 + case .resolved: return 2 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest.Section] = [ + .unknown, + .open, + .resolved, + ] + + } + + public init() {} + + fileprivate var _chatID: Flipcash_Common_V1_ChatId? = nil + fileprivate var _queryOptions: Flipcash_Common_V1_QueryOptions? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Paymentrequest_V1_GetChatPaymentRequestsResponse: Sendable { + // SwiftProtobuf.Message 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_Paymentrequest_V1_GetChatPaymentRequestsResponse.Result = .ok + + /// The page, in the section's order. Set when result is OK. + public var paymentRequests: [Flipcash_Paymentrequest_V1_PaymentRequestMetadata] = [] + + /// PagingToken carries the cursor after the last request returned. The + /// client MUST send it back in query_options.paging_token on the next + /// GetChatPaymentRequestsRequest. 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 remain. When false, every + /// request in the section as of the walk has been read. When true, the + /// client should issue another GetChatPaymentRequestsRequest 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 + + /// The caller cannot read the chat in full, or the chat is a DM. + case denied // = 1 + + /// The chat doesn't exist. + 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_Paymentrequest_V1_GetChatPaymentRequestsResponse.Result] = [ + .ok, + .denied, + .notFound, + ] + + } + + public init() {} + + fileprivate var _pagingToken: Flipcash_Common_V1_PagingToken? = nil +} + +public struct Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest: Sendable { + // SwiftProtobuf.Message 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 paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId { + get {return _paymentRequestID ?? Flipcash_Paymentrequest_V1_PaymentRequestId()} + set {_paymentRequestID = newValue} + } + /// Returns true if `paymentRequestID` has been explicitly set. + public var hasPaymentRequestID: Bool {return self._paymentRequestID != nil} + /// Clears the value of `paymentRequestID`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequestID() {self._paymentRequestID = 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 _paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse: @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 result: Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse.Result { + get {return _storage._result} + set {_uniqueStorage()._result = newValue} + } + + /// The request after the close, or as it is when it was not OPEN. Set + /// only when result == OK. + public var paymentRequest: Flipcash_Paymentrequest_V1_PaymentRequestMetadata { + get {return _storage._paymentRequest ?? Flipcash_Paymentrequest_V1_PaymentRequestMetadata()} + set {_uniqueStorage()._paymentRequest = newValue} + } + /// Returns true if `paymentRequest` has been explicitly set. + public var hasPaymentRequest: Bool {return _storage._paymentRequest != nil} + /// Clears the value of `paymentRequest`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequest() {_uniqueStorage()._paymentRequest = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case ok // = 0 + + /// The caller is not the request's creator. + case denied // = 1 + + /// The request doesn't exist. + 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_Paymentrequest_V1_ClosePaymentRequestResponse.Result] = [ + .ok, + .denied, + .notFound, + ] + + } + + public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +public struct Flipcash_Paymentrequest_V1_MarkPaidRequest: Sendable { + // SwiftProtobuf.Message 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 paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId { + get {return _paymentRequestID ?? Flipcash_Paymentrequest_V1_PaymentRequestId()} + set {_paymentRequestID = newValue} + } + /// Returns true if `paymentRequestID` has been explicitly set. + public var hasPaymentRequestID: Bool {return self._paymentRequestID != nil} + /// Clears the value of `paymentRequestID`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequestID() {self._paymentRequestID = nil} + + /// The debtor whose share to mark paid. + 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 _paymentRequestID: Flipcash_Paymentrequest_V1_PaymentRequestId? = nil + fileprivate var _userID: Flipcash_Common_V1_UserId? = nil + fileprivate var _auth: Flipcash_Common_V1_Auth? = nil +} + +public struct Flipcash_Paymentrequest_V1_MarkPaidResponse: @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 result: Flipcash_Paymentrequest_V1_MarkPaidResponse.Result { + get {return _storage._result} + set {_uniqueStorage()._result = newValue} + } + + /// The request after the share was marked paid, or as it is when the + /// share was already paid. Set only when result == OK. + public var paymentRequest: Flipcash_Paymentrequest_V1_PaymentRequestMetadata { + get {return _storage._paymentRequest ?? Flipcash_Paymentrequest_V1_PaymentRequestMetadata()} + set {_uniqueStorage()._paymentRequest = newValue} + } + /// Returns true if `paymentRequest` has been explicitly set. + public var hasPaymentRequest: Bool {return _storage._paymentRequest != nil} + /// Clears the value of `paymentRequest`. Subsequent reads from it will return its default value. + public mutating func clearPaymentRequest() {_uniqueStorage()._paymentRequest = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public enum Result: SwiftProtobuf.Enum, Swift.CaseIterable { + public typealias RawValue = Int + case ok // = 0 + + /// The caller is not the request's creator. + case denied // = 1 + + /// The request doesn't exist. + case notFound // = 2 + + /// The share is unpaid and the request is not OPEN: it is CLOSED or + /// EXPIRED. + case notOpen // = 3 + + /// The request has no share for user_id. + case notAShare // = 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 = .notFound + case 3: self = .notOpen + case 4: self = .notAShare + default: self = .UNRECOGNIZED(rawValue) + } + } + + public var rawValue: Int { + switch self { + case .ok: return 0 + case .denied: return 1 + case .notFound: return 2 + case .notOpen: return 3 + case .notAShare: return 4 + case .UNRECOGNIZED(let i): return i + } + } + + // The compiler won't synthesize support with the UNRECOGNIZED case. + public static let allCases: [Flipcash_Paymentrequest_V1_MarkPaidResponse.Result] = [ + .ok, + .denied, + .notFound, + .notOpen, + .notAShare, + ] + + } + + public init() {} + + fileprivate var _storage = _StorageClass.defaultInstance +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "flipcash.paymentrequest.v1" + +extension Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CreatePaymentRequestRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}idempotency_key\0\u{3}group_chat\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._idempotencyKey) }() + case 2: try { + var v: Flipcash_Paymentrequest_V1_GroupChatPaymentRequest? + var hadOneofValue = false + if let current = self.kind { + hadOneofValue = true + if case .groupChat(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.kind = .groupChat(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._idempotencyKey { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if case .groupChat(let v)? = self.kind { + 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_Paymentrequest_V1_CreatePaymentRequestRequest, rhs: Flipcash_Paymentrequest_V1_CreatePaymentRequestRequest) -> Bool { + if lhs._idempotencyKey != rhs._idempotencyKey {return false} + if lhs.kind != rhs.kind {return false} + if lhs._auth != rhs._auth {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".CreatePaymentRequestResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}payment_request\0\u{3}flagged_category\0") + + fileprivate class _StorageClass { + var _result: Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse.Result = .ok + var _paymentRequest: Flipcash_Paymentrequest_V1_PaymentRequestMetadata? = nil + var _flaggedCategory: Flipcash_Moderation_V1_FlaggedCategory = .none + + // 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) { + _result = source._result + _paymentRequest = source._paymentRequest + _flaggedCategory = source._flaggedCategory + } + } + + 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.decodeSingularEnumField(value: &_storage._result) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._paymentRequest) }() + case 3: try { try decoder.decodeSingularEnumField(value: &_storage._flaggedCategory) }() + 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._result != .ok { + try visitor.visitSingularEnumField(value: _storage._result, fieldNumber: 1) + } + try { if let v = _storage._paymentRequest { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if _storage._flaggedCategory != .none { + try visitor.visitSingularEnumField(value: _storage._flaggedCategory, fieldNumber: 3) + } + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse, rhs: Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse) -> 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._result != rhs_storage._result {return false} + if _storage._paymentRequest != rhs_storage._paymentRequest {return false} + if _storage._flaggedCategory != rhs_storage._flaggedCategory {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_CreatePaymentRequestResponse.Result: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}CHAT_NOT_SUPPORTED\0\u{1}ENCRYPTION_NOT_ALLOWED\0\u{1}ENCRYPTION_REQUIRED\0\u{1}INVALID_ENDS_AT\0\u{1}INVALID_SHARES\0\u{1}INVALID_CURRENCY\0\u{1}TEXT_MODERATED\0") +} + +extension Flipcash_Paymentrequest_V1_GetPaymentRequestRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetPaymentRequestRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}payment_request_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._paymentRequestID) }() + 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._paymentRequestID { + 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_Paymentrequest_V1_GetPaymentRequestRequest, rhs: Flipcash_Paymentrequest_V1_GetPaymentRequestRequest) -> Bool { + if lhs._paymentRequestID != rhs._paymentRequestID {return false} + if lhs._auth != rhs._auth {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_GetPaymentRequestResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetPaymentRequestResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}payment_request\0\u{3}payment_intent_id\0") + + fileprivate class _StorageClass { + var _result: Flipcash_Paymentrequest_V1_GetPaymentRequestResponse.Result = .ok + var _paymentRequest: Flipcash_Paymentrequest_V1_PaymentRequestMetadata? = nil + var _paymentIntentID: Flipcash_Common_V1_IntentId? = 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) { + _result = source._result + _paymentRequest = source._paymentRequest + _paymentIntentID = source._paymentIntentID + } + } + + 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.decodeSingularEnumField(value: &_storage._result) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._paymentRequest) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._paymentIntentID) }() + 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._result != .ok { + try visitor.visitSingularEnumField(value: _storage._result, fieldNumber: 1) + } + try { if let v = _storage._paymentRequest { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._paymentIntentID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_GetPaymentRequestResponse, rhs: Flipcash_Paymentrequest_V1_GetPaymentRequestResponse) -> 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._result != rhs_storage._result {return false} + if _storage._paymentRequest != rhs_storage._paymentRequest {return false} + if _storage._paymentIntentID != rhs_storage._paymentIntentID {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_GetPaymentRequestResponse.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_Paymentrequest_V1_GetChatPaymentRequestsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetChatPaymentRequestsRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}chat_id\0\u{1}section\0\u{3}query_options\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.section) }() + case 3: 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._chatID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + if self.section != .unknown { + try visitor.visitSingularEnumField(value: self.section, fieldNumber: 2) + } + try { if let v = self._queryOptions { + 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_Paymentrequest_V1_GetChatPaymentRequestsRequest, rhs: Flipcash_Paymentrequest_V1_GetChatPaymentRequestsRequest) -> Bool { + if lhs._chatID != rhs._chatID {return false} + if lhs.section != rhs.section {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_Paymentrequest_V1_GetChatPaymentRequestsRequest.Section: SwiftProtobuf._ProtoNameProviding { + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN\0\u{1}OPEN\0\u{1}RESOLVED\0") +} + +extension Flipcash_Paymentrequest_V1_GetChatPaymentRequestsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GetChatPaymentRequestsResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}payment_requests\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.paymentRequests) }() + 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.paymentRequests.isEmpty { + try visitor.visitRepeatedMessageField(value: self.paymentRequests, 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_Paymentrequest_V1_GetChatPaymentRequestsResponse, rhs: Flipcash_Paymentrequest_V1_GetChatPaymentRequestsResponse) -> Bool { + if lhs.result != rhs.result {return false} + if lhs.paymentRequests != rhs.paymentRequests {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_Paymentrequest_V1_GetChatPaymentRequestsResponse.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_Paymentrequest_V1_ClosePaymentRequestRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ClosePaymentRequestRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}payment_request_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._paymentRequestID) }() + 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._paymentRequestID { + 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_Paymentrequest_V1_ClosePaymentRequestRequest, rhs: Flipcash_Paymentrequest_V1_ClosePaymentRequestRequest) -> Bool { + if lhs._paymentRequestID != rhs._paymentRequestID {return false} + if lhs._auth != rhs._auth {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".ClosePaymentRequestResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}payment_request\0") + + fileprivate class _StorageClass { + var _result: Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse.Result = .ok + var _paymentRequest: Flipcash_Paymentrequest_V1_PaymentRequestMetadata? = 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) { + _result = source._result + _paymentRequest = source._paymentRequest + } + } + + 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.decodeSingularEnumField(value: &_storage._result) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._paymentRequest) }() + 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._result != .ok { + try visitor.visitSingularEnumField(value: _storage._result, fieldNumber: 1) + } + try { if let v = _storage._paymentRequest { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse, rhs: Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse) -> 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._result != rhs_storage._result {return false} + if _storage._paymentRequest != rhs_storage._paymentRequest {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_ClosePaymentRequestResponse.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_Paymentrequest_V1_MarkPaidRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".MarkPaidRequest" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}payment_request_id\0\u{3}user_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._paymentRequestID) }() + case 2: 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._paymentRequestID { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._userID { + 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_Paymentrequest_V1_MarkPaidRequest, rhs: Flipcash_Paymentrequest_V1_MarkPaidRequest) -> Bool { + if lhs._paymentRequestID != rhs._paymentRequestID {return false} + 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_Paymentrequest_V1_MarkPaidResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".MarkPaidResponse" + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0\u{3}payment_request\0") + + fileprivate class _StorageClass { + var _result: Flipcash_Paymentrequest_V1_MarkPaidResponse.Result = .ok + var _paymentRequest: Flipcash_Paymentrequest_V1_PaymentRequestMetadata? = 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) { + _result = source._result + _paymentRequest = source._paymentRequest + } + } + + 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.decodeSingularEnumField(value: &_storage._result) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._paymentRequest) }() + 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._result != .ok { + try visitor.visitSingularEnumField(value: _storage._result, fieldNumber: 1) + } + try { if let v = _storage._paymentRequest { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Flipcash_Paymentrequest_V1_MarkPaidResponse, rhs: Flipcash_Paymentrequest_V1_MarkPaidResponse) -> 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._result != rhs_storage._result {return false} + if _storage._paymentRequest != rhs_storage._paymentRequest {return false} + return true + } + if !storagesAreEqual {return false} + } + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Flipcash_Paymentrequest_V1_MarkPaidResponse.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}NOT_OPEN\0\u{1}NOT_A_SHARE\0") +} diff --git a/flipcash2.lock b/flipcash2.lock index 7bf54d7..c961ee6 100644 --- a/flipcash2.lock +++ b/flipcash2.lock @@ -1,4 +1,4 @@ # Pinned upstream contract. Regenerate with scripts/sync-protos.sh . upstream: code-payments/flipcash2-protobuf-api -commit: 733ea7f9f33291b9631f0176fab5485acf161fab -subject: Update comments around paid reactions (#149) +commit: b77bf78ff8d9ea1bcbf9aa3afa6696ba7edd37a9 +subject: Add chat moderation RPCs for group creators (#156) diff --git a/proto/activity/v1/model.proto b/proto/activity/v1/model.proto index 26e3055..7941c77 100644 --- a/proto/activity/v1/model.proto +++ b/proto/activity/v1/model.proto @@ -81,18 +81,18 @@ message ReceivedCryptoNotificationMetadata { // Set when the payment was the recipient's share of a boost of a // reaction (see BoostedReaction), paid to them as the boosted message's - // sender or the group's creator. source_identifier names the payer, and + // sender or its group's creator. source_identifier names the payer, and // payment_amount is the recipient's share alone. BoostedReaction boosted_reaction = 3; } // The reaction a payment boosted: the payer's reaction with emoji on a -// message in a group chat (see intent.v1.ChatMetadata.ReactionBoost). It is -// what the payment was for when it was made and is not kept up to date: the -// message may since have been deleted, and the viewer may no longer be a +// message in a group chat or a DM (see intent.v1.ChatMetadata.ReactionBoost). +// It is what the payment was for when it was made and is not kept up to date: +// the message may since have been deleted, and the viewer may no longer be a // member of the chat. message BoostedReaction { - // The group chat the boosted message is in. + // The chat, a group or a DM, the boosted message is in. common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; // The message whose reaction was boosted. diff --git a/proto/chat/v1/chat_service.proto b/proto/chat/v1/chat_service.proto index 275be7e..9b1e727 100644 --- a/proto/chat/v1/chat_service.proto +++ b/proto/chat/v1/chat_service.proto @@ -373,6 +373,75 @@ service Chat { // so a client can fetch a profile (see profile.v1.Profile.GetProfile) and // its featured groups at once. rpc GetFeaturedGroups(GetFeaturedGroupsRequest) returns (GetFeaturedGroupsResponse); + + // SilenceUser silences a user in a group chat, until a time or + // indefinitely: they may still read the chat, react and vote, but not + // send, edit, show typing, or do anything else that requires speaking + // in it (see ViewerState.Restrictions.silence). They may still delete + // their own messages. + // + // Public and private groups alike. Only a member the server permits to + // silence users in the chat may call it, as reported by + // ViewerState.Permissions.moderation.can_silence; anyone else, and any + // DM, is DENIED. The chat's creator cannot be silenced. + // + // The user need not be a member: a silence survives leaving and + // rejoining, and may be set before the user ever joins. Calling it again + // with a different duration replaces the silence; an identical request + // is a no-op that returns OK. A timed silence must end in the future; + // the server rejects one that does not. + // + // A real change reaches the silenced user's devices, while they are a + // member, as a MetadataUpdate.ViewerStateChanged on the event stream. + // Nobody else is told. + rpc SilenceUser(SilenceUserRequest) returns (SilenceUserResponse); + + // UnsilenceUser clears a user's silence in a group chat. Gated as + // SilenceUser. Unsilencing a user who is not silenced is a no-op that + // returns OK. A real change reaches the user's devices as SilenceUser's + // does. + rpc UnsilenceUser(UnsilenceUserRequest) returns (UnsilenceUserResponse); + + // BanUser bans a user from a group chat: a member is removed from its + // roster, a user waiting in a private group's lobby is removed from it, + // and the user cannot join, enter the lobby or be admitted until they + // are unbanned. A banned user may not read the chat as a non-member + // either (see the listener rules), though anyone may still see its + // redacted public view. Only a member the server permits to ban users + // in the chat may call it, as reported by + // ViewerState.Permissions.moderation.can_ban; anyone else, and any DM, + // is DENIED. The chat's creator cannot be banned. + // + // The user need not be a member, so a creator can ban someone before + // they join. Banning a user who is already banned is a no-op that + // returns OK. A ban leaves a silence as it is, and the user's messages + // stay in the chat. + // + // Removing a member is announced exactly like a departure: a + // RosterUpdate.MemberLeft to the banned user's devices, which does not + // say why, and the roster change to the chat's other members. A banned + // member of a private group loses their key envelope (see KeyEnvelope), + // as when leaving. They cannot fetch anything from the chat afterwards, + // but the server cannot take back the chat key they already opened: + // ciphertext of later messages that reached them some other way is + // readable to them, since the key is not rotated. + rpc BanUser(BanUserRequest) returns (BanUserResponse); + + // UnbanUser lifts a user's ban from a group chat. Gated as BanUser. + // It does not return them to the chat: they join (or enter a private + // group's lobby) again like anyone else. Unbanning a user who is not + // banned is a no-op that returns OK. Nothing is published. + rpc UnbanUser(UnbanUserRequest) returns (UnbanUserResponse); + + // GetRestrictedUsers pages the users silenced or banned in a group chat, + // most recently restricted first, by the time of the latest silence or + // ban set on them. A silence that has lapsed is left out. Only a member + // the server permits to silence or to ban users in the chat may call it + // (see ViewerState.Permissions.moderation); anyone else, and any DM, is + // DENIED. The page is read from an index that trails writes + // briefly, so a user just restricted may be absent and one just + // released may be present. + rpc GetRestrictedUsers(GetRestrictedUsersRequest) returns (GetRestrictedUsersResponse); } message GetChatRequest { @@ -748,6 +817,7 @@ message JoinChatResponse { DENIED = 1; NOT_FOUND = 2; RULES_NOT_SATISFIED = 3; + BANNED = 4; // The chat's creator banned the caller (see BanUser) } // The metadata for the joined chat, as seen by the caller. Set only when @@ -895,6 +965,7 @@ message EnterLobbyResponse { ALREADY_MEMBER = 3; // Caller is already a member of the chat LOBBY_FULL = 4; // The chat's lobby holds as many users as the server allows TOO_MANY_LOBBIES = 5; // Caller is waiting in as many lobbies as the server allows + BANNED = 6; // The chat's creator banned the caller (see BanUser) } // The caller's place in the lobby, so the client can record the chat it @@ -1101,3 +1172,121 @@ message GetFeaturedGroupsResponse { max_items: 10 }]; } + +message SilenceUserRequest { + common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; + + // The user to silence. + common.v1.UserId user_id = 2 [(validate.rules).message.required = true]; + + // How long to silence them for. A timed silence must end in the future; + // the server rejects one that does not. + SilenceState silence = 3 [(validate.rules).message.required = true]; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message SilenceUserResponse { + Result result = 1; + enum Result { + OK = 0; + DENIED = 1; // Caller may not silence users in this chat (see SilenceUser) + NOT_FOUND = 2; + CANNOT_RESTRICT_CREATOR = 3; // The user is the chat's creator + } +} + +message UnsilenceUserRequest { + common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; + + // The user to unsilence. + common.v1.UserId user_id = 2 [(validate.rules).message.required = true]; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message UnsilenceUserResponse { + Result result = 1; + enum Result { + OK = 0; + DENIED = 1; // Caller may not silence users in this chat (see SilenceUser) + NOT_FOUND = 2; + } +} + +message BanUserRequest { + common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; + + // The user to ban. + common.v1.UserId user_id = 2 [(validate.rules).message.required = true]; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message BanUserResponse { + Result result = 1; + enum Result { + OK = 0; + DENIED = 1; // Caller may not ban users in this chat (see BanUser) + NOT_FOUND = 2; + CANNOT_RESTRICT_CREATOR = 3; // The user is the chat's creator + } +} + +message UnbanUserRequest { + common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; + + // The user to unban. + common.v1.UserId user_id = 2 [(validate.rules).message.required = true]; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message UnbanUserResponse { + Result result = 1; + enum Result { + OK = 0; + DENIED = 1; // Caller may not ban users in this chat (see BanUser) + NOT_FOUND = 2; + } +} + +message GetRestrictedUsersRequest { + common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; + + // QueryOptions controls page_size, capped at 100. Ordering is fixed to + // most recently restricted first and is not client-selectable. + // + // Leave query_options.paging_token unset on the first request. On every + // subsequent request, set it to the paging_token from the most recent + // response. The token is opaque and server-generated; do not construct + // it. It is bound to chat_id and refused with another chat. + common.v1.QueryOptions query_options = 2; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message GetRestrictedUsersResponse { + Result result = 1; + enum Result { + OK = 0; + DENIED = 1; // Caller may neither silence nor ban users in this chat (see GetRestrictedUsers) + NOT_FOUND = 2; + } + + // The page, most recently restricted first. Set when result is OK. + repeated RestrictedUser users = 2 [(validate.rules).repeated = { + min_items: 0 + max_items: 100 + }]; + + // PagingToken carries the cursor after the last user returned. The + // client MUST send it back in query_options.paging_token on the next + // GetRestrictedUsersRequest. Set when result is OK and has_more is true. + common.v1.PagingToken paging_token = 3; + + // HasMore indicates whether further pages remain. When true, the client + // should issue another GetRestrictedUsersRequest with the returned + // paging_token. + bool has_more = 4; +} diff --git a/proto/chat/v1/model.proto b/proto/chat/v1/model.proto index 86e7945..4dd457e 100644 --- a/proto/chat/v1/model.proto +++ b/proto/chat/v1/model.proto @@ -549,6 +549,10 @@ message ViewerState { // MetadataUpdate.ViewerStateChanged. Permissions permissions = 2; + // State the chat's creator set on the viewer (see Chat.SilenceUser). + // Absent when the creator has set none. + Restrictions restrictions = 3; + // Advanced by exactly one on every real change to any field of this // message, never by a no-op. Compared like RosterSummary.version: apply // the greater value and drop the rest, so delivery order does not matter. @@ -570,7 +574,75 @@ message ViewerState { // every DM, and for a group member the server does not permit to // edit it. bool can_edit = 1; + + // What the viewer may do to moderate the chat's users. Unset when + // they may do none of it, as for every DM. + ModerationPermissions moderation = 2; + } + + // ModerationPermissions are the moderation actions the viewer may take + // in the chat. Like Permissions, each flag defaults to false. A viewer + // holding either may call Chat.GetRestrictedUsers. + message ModerationPermissions { + // Whether the viewer may call Chat.SilenceUser and + // Chat.UnsilenceUser on this chat. + bool can_silence = 1; + + // Whether the viewer may call Chat.BanUser and Chat.UnbanUser on + // this chat. + bool can_ban = 2; + } + + // Restrictions are what the chat's creator has imposed on the viewer. + // A ban is not carried here: a banned user is not a member, and a + // non-member is shown no ViewerState. A banned member's devices receive + // the RosterUpdate.MemberLeft of any departure, which does not say why; + // they learn of the ban from a BANNED result when they try to return. + message Restrictions { + // Present if and only if the viewer is silenced in the chat: they + // may read, react and vote, but not send, edit, show typing, or do + // anything else that requires speaking in the chat. They may still + // delete their own messages. A client hides the composer while a + // silence is in force. A timed silence lapses on its own and nothing + // is sent when it does, so the client owns the countdown. + SilenceState silence = 1; + } +} + +message SilenceState { + oneof duration { + option (validate.required) = true; + + // Silenced until this time, after which the silence lapses. + google.protobuf.Timestamp until = 1; + + // Silenced until explicitly unsilenced. + Forever forever = 2; } + + message Forever {} +} + +// BanState is a ban the chat's creator has set on a user (see Chat.BanUser). +// A ban lasts until it is lifted (see Chat.UnbanUser). +message BanState { + // When the ban was made. + google.protobuf.Timestamp banned_at = 1 [(validate.rules).timestamp.required = true]; +} + +// RestrictedUser is a user the chat's creator has silenced or banned, as +// listed by Chat.GetRestrictedUsers. At least one of silence and ban is set. +message RestrictedUser { + common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; + + // The user's public profile. + profile.v1.UserProfile user_profile = 2 [(validate.rules).message.required = true]; + + // Set when the user is silenced (see Chat.SilenceUser). + SilenceState silence = 3; + + // Set when the user is banned (see Chat.BanUser). + BanState ban = 4; } message MuteState { diff --git a/proto/intent/v1/model.proto b/proto/intent/v1/model.proto index 36d1338..d518e08 100644 --- a/proto/intent/v1/model.proto +++ b/proto/intent/v1/model.proto @@ -8,6 +8,7 @@ option objc_class_prefix = "FPBIntentV1"; import "common/v1/common.proto"; import "messaging/v1/model.proto"; +import "paymentrequest/v1/model.proto"; import "validate/validate.proto"; message AppMetadata { @@ -25,10 +26,11 @@ message ChatMetadata { oneof type { option (validate.required) = true; - ContactDmPayment contact_dm_payment = 2; - DmPayment dm_payment = 3; - GroupPayment group_payment = 4; - ReactionBoost reaction_boost = 5; + ContactDmPayment contact_dm_payment = 2; + DmPayment dm_payment = 3; + GroupPayment group_payment = 4; + ReactionBoost reaction_boost = 5; + RequestedPayment requested_payment = 6; } // For sending a payment to a contact in a DM @@ -54,12 +56,20 @@ message ChatMetadata { PaymentAction action = 2; } - // For sending a payment directly to another member of a group chat. The - // chat_id must be a group, and the payment's destination owner account - // names the recipient, who must be a Flipcash user and a member of the - // group. The sender must be able to speak in the group: the payment posts - // a CashContent message into it as the sender, naming the recipient as - // its receiver. + // For sending a payment directly to other members of a group chat. The + // chat_id must be a group, and the sender must be able to speak in it: + // the payment posts one CashContent message into the group as the sender. + // + // - A payment to one member is a SendPublicPayment, whose destination + // owner account names the recipient. The message names them as its + // single_receiver. + // - A payment to several members at once is a SendPublicMultiPayment + // to 2 to 10 of them, each a distinct destination owner account and + // none the sender. The message lists each recipient with their part + // in its multi_receiver, and carries the whole payment as its + // total_amount. + // + // Every recipient must be a Flipcash user and a member of the group. message GroupPayment { // The action being performed for the payment. Only DEFAULT and SEND // are supported today, and the payment is shown as SENT; the server @@ -67,18 +77,23 @@ message ChatMetadata { PaymentAction action = 1; } - // For paying to boost a reaction on a message in a group chat: the - // payer's reaction with the emoji carries money, shown as + // For paying to boost a reaction on a message in a group chat or a DM: + // the payer's reaction with the emoji carries money, shown as // messaging.v1.Reactor.boost_usd and summed into // messaging.v1.EmojiReaction.boost_usd, which orders a message's - // reactions. The chat_id must be a group the payer is a member + // reactions. The chat_id must be a group or a DM the payer is a member // of, the message one of its reactable messages, and the payer must // already have reacted to it with the emoji: a boost puts money behind // a reaction the payer holds, so a client adds the reaction first // (messaging.v1.AddReaction) and pays after. No one boosts their own - // message, the group's creator included. The payment is divided - // between the message's sender and the group's creator by a fixed rule - // the server enforces; the payer does not choose it: + // message, a group's creator included. Who is paid is a fixed rule the + // server enforces; the payer does not choose it. + // + // In a DM, the payer boosts the other member's message, and the + // payment pays them the whole, as one SendPublicPayment. + // + // In a group, the payment is divided between the message's sender and + // the group's creator: // // - A boost by anyone but the creator of a message the creator did // not send pays the creator 20% of the whole and the sender the @@ -112,6 +127,41 @@ message ChatMetadata { // The emoji boosted. messaging.v1.Emoji emoji = 2 [(validate.rules).message.required = true]; } + + // For paying the payer's share of a payment request made in a group chat, + // today a paymentrequest.v1.Split (see paymentrequest.v1.PaymentRequest; a + // kind with no shares takes no such payment). The payment is a + // SendPublicPayment, never a multi payment, from a debtor of the request + // to its creator, and pays the debtor's own unpaid share exactly: + // + // - The chat_id must be the group the request was created for. + // - The payment's one destination must be the creator's owner account. + // - The payment's currency must be the request's, and its native amount + // (its exchange data's native_amount) must be the share's + // native_amount to within half the currency's smallest unit. Any mint + // may pay. A partial payment or an overpayment is refused: a share is + // paid all at once. + // - The request must be OPEN: not COMPLETED, not closed, and not past + // its ends_at. + // - The payer must hold an unpaid share of the request. + // - The intent's ID must be the one the server generated for the + // payer's share, which paymentrequest.v1.GetPaymentRequest gives the + // payer alone (GetPaymentRequestResponse.payment_intent_id). An intent + // ID is used at most once, so this is what makes a share payable at + // most once. + // - Neither the payer nor the creator may be the Flipcash team account. + // + // Once the payment is made the server marks the share paid (a + // paymentrequest.v1.PaidShare carrying the payment's intent), posts one + // messaging.v1.CashContent message into the group as the payer, with the + // creator as its single_receiver and the request's ID in its + // payment_request_id. If it was the last unpaid share, the request becomes + // COMPLETED. No event announces the change; clients see it by refetching + // the request. + message RequestedPayment { + // The payment request whose share is paid. + paymentrequest.v1.PaymentRequestId payment_request_id = 1 [(validate.rules).message.required = true]; + } } // The action being performed for a payment in a chat diff --git a/proto/messaging/v1/messaging_service.proto b/proto/messaging/v1/messaging_service.proto index 9734ddb..f303dfa 100644 --- a/proto/messaging/v1/messaging_service.proto +++ b/proto/messaging/v1/messaging_service.proto @@ -267,7 +267,7 @@ message SendMessageResponse { // The content is EncryptedContent and the chat is neither a DM nor a // private group, or its scheme is not the one the chat uses. ENCRYPTION_NOT_ALLOWED = 2; - // The chat is a private group and the content is not EncryptedContent. + // The chat is a DM or a private group and the content is not EncryptedContent. ENCRYPTION_REQUIRED = 3; } @@ -318,7 +318,7 @@ message EditMessageResponse { // The content is EncryptedContent and the chat is neither a DM nor a // private group, or its scheme is not the one the chat uses. ENCRYPTION_NOT_ALLOWED = 5; - // The chat is a private group and the content is not EncryptedContent. + // The chat is a DM or a private group and the content is not EncryptedContent. ENCRYPTION_REQUIRED = 6; } diff --git a/proto/messaging/v1/model.proto b/proto/messaging/v1/model.proto index 8851e31..f8af210 100644 --- a/proto/messaging/v1/model.proto +++ b/proto/messaging/v1/model.proto @@ -9,6 +9,7 @@ option objc_class_prefix = "FPBMessagingV1"; import "blob/v1/model.proto"; import "common/v1/common.proto"; import "google/protobuf/timestamp.proto"; +import "paymentrequest/v1/model.proto"; import "poll/v1/model.proto"; import "validate/validate.proto"; @@ -291,21 +292,64 @@ 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]; - - // The user who received the cash. Always set in a group chat, where it - // names which member was paid. In a DM it is set on new messages but unset - // on older ones, whose receiver is the DM member who is not the sender. - common.v1.UserId receiver = 3; + // The total amount of cash that was sent. For a payment to several people + // (see multi_receiver), the whole payment, every receiver's part together. + common.v1.CryptoPaymentAmount total_amount = 2 [(validate.rules).message.required = true]; + + // Who received the cash. Always set in a group chat. In a DM, + // single_receiver is set on new messages, and neither is set on older + // ones, whose receiver is the DM member who is not the sender. + oneof recipient { + // The user who received the cash, for a payment to one person + common.v1.UserId single_receiver = 3; + + // Who was paid and how much, for a payment to several people at once, + // made in a group chat alone. total_amount is the whole payment, so a + // client that does not know this field shows the sender paying the + // total to no one in particular. + Payments multi_receiver = 5; + } // Verb for how the cash was sent. Clients should always show SENT as a - // fallback. + // fallback. For a payment to several people, it applies to every one of + // them. enum Verb { SENT = 0; TIPPED = 1; } Verb verb = 4; + + // The payment request whose share this payment paid. Set only on the cash + // message posted when a debtor pays their share with a payment (see + // intent.v1.ChatMetadata.RequestedPayment), so clients render it + // against the request; such a message is from the debtor, with the + // request's creator as its single_receiver. Unset on every other cash + // message. + paymentrequest.v1.PaymentRequestId payment_request_id = 6; + + // The receivers of a payment to several people at once + message Payments { + // One entry per receiver, in the payment's own order. Each receiver is + // a distinct member of the group other than the sender, and every + // entry is in total_amount's currency and mint. + repeated Payment items = 1 [(validate.rules).repeated = { + min_items: 2 + max_items: 10 + }]; + } + + // One receiver's part of a payment to several people (see Payments). The + // currency and mint are total_amount's. + message Payment { + // The user who received this part + common.v1.UserId receiver = 1 [(validate.rules).message.required = true]; + + // The amount this receiver was paid, in total_amount's currency + double native_amount = 2 [(validate.rules).double.gte = 0]; + + // The amount in quarks of total_amount's mint this receiver was paid + uint64 quarks = 3; + } } // Reply content @@ -396,8 +440,9 @@ message WidgetContent { oneof type { option (validate.required) = true; - ShareProfileWidget share_profile = 1; - PollWidget poll = 2; + ShareProfileWidget share_profile = 1; + PollWidget poll = 2; + PaymentRequestWidget payment_request = 3; } } @@ -426,6 +471,29 @@ message PollWidget { poll.v1.PollId poll_id = 1 [(validate.rules).message.required = true]; } +// A widget that shows a payment request. It carries only the request's ID: +// clients get the title, shares, and state from +// paymentrequest.v1.PaymentRequest's GetPaymentRequest. +// +// The creator sends it after calling +// paymentrequest.v1.PaymentRequest.CreatePaymentRequest, and may send the same +// request in its chat any number of times. The request is live from creation, +// whether or not it has been sent. Deleting a message that carries it does not +// touch the request. +// +// In a group that is not private, it is sent as plain WidgetContent: +// SendMessage accepts it only from the request's creator, in the chat the +// request was created for, whatever the request's status; otherwise the send +// is DENIED. +// +// In a private group, it is sent inside EncryptedContent, so the server cannot +// check any of this. Clients render the widget as unsupported if the request's +// chat (GroupChatPaymentRequest.chat_id) is not the chat the message is in, or +// the request's creator is not the message's sender. +message PaymentRequestWidget { + paymentrequest.v1.PaymentRequestId payment_request_id = 1 [(validate.rules).message.required = true]; +} + // Deleted message content message DeletedContent { // Timestamp the message was deleted. Set whenever a message is tombstoned; diff --git a/proto/paymentrequest/v1/model.proto b/proto/paymentrequest/v1/model.proto new file mode 100644 index 0000000..1294644 --- /dev/null +++ b/proto/paymentrequest/v1/model.proto @@ -0,0 +1,320 @@ +syntax = "proto3"; + +package flipcash.paymentrequest.v1; + +option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/paymentrequest/v1;paymentrequestpb"; +option java_package = "com.codeinc.flipcash.gen.paymentrequest.v1"; +option objc_class_prefix = "FPBPaymentRequestV1"; + +import "common/v1/common.proto"; +import "google/protobuf/timestamp.proto"; +import "validate/validate.proto"; + +// PaymentRequestId is the server-assigned identity of a payment request, of any +// kind. It is what a messaging.v1.PaymentRequestWidget carries, and what every +// PaymentRequest RPC is keyed by. +message PaymentRequestId { + bytes value = 1 [(validate.rules).bytes = { + min_len: 16 + max_len: 16 + }]; +} + +// IdempotencyKey lets a client safely retry CreatePaymentRequest. The server +// derives the request's identity from the caller and this key, so a retry +// with the same key returns the original request instead of creating a +// duplicate. Which parameters were sent is not part of the identity: a retry +// with different parameters, or of a different kind, still returns the +// original. +// +// The key is owned by the client and is typically a randomly generated UUID. +// It is never exposed as the request's identity. +message IdempotencyKey { + bytes value = 1 [(validate.rules).bytes = { + min_len: 16 + max_len: 16 + }]; +} + +// PaymentRequestMetadata is a payment request: what every kind of request +// shares (its identity, creator, creation time, status and version), and in +// `kind` what the request is and where it was made. +// +// The message is versioned whole: every change to anything in it, a share +// paid (by payment or by hand) or a close, advances version by exactly one, +// and an idempotent no-op leaves it alone. Clients keep the copy with the +// greater version, comparing it like chat.v1.RosterSummary.version, and +// replace the whole message, so delivery order does not matter. Expiry is +// not a change: it comes from the clock and moves no version (see +// PAYMENT_REQUEST_STATUS_EXPIRED), so at an equal version a client keeps +// EXPIRED over OPEN, and judges an OPEN request past its ends_at as EXPIRED +// itself. +// +// Nothing announces a change in real time: no event carries a payment request +// today. Clients refetch a request to see payments and closes land, for +// example when they show its widget. +// +// Requests are layered. The first layer is where the request lives: today a +// group chat (GroupChatPaymentRequest). Within it, the second layer is the +// type of request: today a split (Split). Kinds and types added later each +// get a new arm; a client renders a request whose arm it does not know as +// unsupported. +message PaymentRequestMetadata { + PaymentRequestId payment_request_id = 1 [(validate.rules).message.required = true]; + + // The user that created the request, who is paid and is the only user + // that can close it or mark a share paid by hand. + common.v1.UserId creator = 2 [(validate.rules).message.required = true]; + + // When the request was created. + google.protobuf.Timestamp created_at = 3 [(validate.rules).timestamp.required = true]; + + // Where the request is in its life. It only moves forward: from OPEN to + // one of COMPLETED, CLOSED or EXPIRED, which are final. + PaymentRequestStatus status = 4 [(validate.rules).enum = { + in: [1, 2, 3, 4] // OPEN, COMPLETED, CLOSED, EXPIRED + }]; + + // When the request stopped being OPEN. Set once status is not OPEN: the + // request's ends_at when EXPIRED, when the creator closed it when CLOSED, + // and when its last unpaid share was paid when COMPLETED. + google.protobuf.Timestamp closed_at = 5; + + // Advances by exactly one on every change to anything in this message + // (see above). Opaque to clients: compare it against the last value seen + // and keep the greater. There is no delta to fetch against it, only a + // refetch of the request. + uint64 version = 6; + + // What the request is and where it was made. + oneof kind { + option (validate.required) = true; + + // A request made in a group chat. + GroupChatPaymentRequest group_chat = 10; + } +} + +// GroupChatPaymentRequest is a payment request made in a group chat, private or +// not. It is shown in that chat as a message carrying a +// messaging.v1.PaymentRequestWidget, and who may see or act on it is decided +// by the chat. +message GroupChatPaymentRequest { + // The chat the request was created for. Anyone who can read this chat in + // full can see the request: its members and anyone who satisfies its + // listener rules in a group that is not private, and only its members in + // a private group. Someone who can only preview the chat sees the + // PaymentRequestWidget but not the request. Clients render a + // PaymentRequestWidget whose request belongs to a different chat than the + // message carrying it as unsupported. + common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; + + // The type of request. + oneof type { + option (validate.required) = true; + + // Named members each owe the creator a share. + Split split = 2; + } +} + +// Split asks named members of the chat (its debtors) each to pay the creator +// an amount (their share) in one currency, for example to split a bill. Each +// debtor pays their share with a Flipcash payment (see +// intent.v1.ChatMetadata.RequestedPayment) or the creator marks it paid by +// hand (PaymentRequest.MarkPaid); the request is COMPLETED once every +// share is paid. +// +// The title and description are in `text`, which is plaintext in a group +// that is not private and encrypted in a private group. Everything else is +// plaintext everywhere, because the server needs it to check each payment +// against its share and to decide when the request is complete. +message Split { + // The title and description. + oneof text { + option (validate.required) = true; + + // Set in a group that is not private, and moderated. + PaymentRequestText plaintext = 1; + + // Set in a private group. Not moderated, since the server cannot + // read it. + EncryptedPaymentRequestText encrypted = 2; + } + + // ISO 4217 alpha-3 currency code that every share, and every payment of + // one, is in. The server must be able to value it. + string currency = 3 [(validate.rules).string = { pattern: "^[a-z]{3,4}$" }]; + + // When the request stops accepting payments. It is in the future when the + // request is created, and at most 4 weeks after it, and is the request's + // one deadline: after it, no share can be paid, by payment or by hand, + // and a request with shares still unpaid is EXPIRED. + google.protobuf.Timestamp ends_at = 4 [(validate.rules).timestamp.required = true]; + + // Who is asked to pay, and how much, in the order the creator listed + // them. Each share names a distinct member of the chat (or one who was a + // member when the request was created), the creator included: the + // creator's own share, their part of what is being split, is paid from + // creation (see PaidShare.Creator), and at least one share names someone + // else. The shares are fixed at creation: nothing adds, removes or + // reprices one, and a paid share stays paid (see PaidShare). + // + // On CreatePaymentRequest, every share has paid unset. + // + // At most 100 shares for now. A request is one record that grows with its + // shares and is rewritten whole each time one is paid, so the bound keeps + // that record, and a page of GetChatPaymentRequests, small. It may be + // raised later. + repeated Share shares = 5 [(validate.rules).repeated = { + min_items: 1 + max_items: 100 + }]; +} + +// PaymentRequestText is the human-readable part of a payment request. +message PaymentRequestText { + // What the money is for. + string title = 1 [(validate.rules).string = { + min_len: 1 + max_len: 100 + }]; + + // More detail about the request. Optional: empty means none. + string description = 2 [(validate.rules).string = { + max_len: 500 + }]; +} + +// EncryptedPaymentRequestText is a private group's PaymentRequestText, +// encrypted with the chat key every member holds. The server stores it as-is +// and cannot read it. +// +// For scheme CHAT_KEY_XCHACHA20POLY1305, the creator encrypts with +// XChaCha20-Poly1305, as for messaging.v1.EncryptedContent but with its own +// aad: +// key = the group's chat key +// nonce = 24 fresh random bytes, set in `nonce` below +// plaintext = the serialized PaymentRequestText +// aad = "flipcash-group-payment-request-e2ee-v1" || chat_id || creator_id +// chat_id is the raw bytes of common.v1.ChatId.value for the request's chat, +// and creator_id is the raw bytes of common.v1.UserId.value for +// PaymentRequestMetadata.creator. Never reuse a nonce, and do not substitute a +// 12-byte-nonce AEAD. +// +// A member decrypts with the chat key and the same aad, so the server cannot +// move the text to another chat or attribute it to another creator, and the +// distinct prefix keeps payment request text, poll text and message content +// from being swapped for each other. The request ID is not bound, since the +// server assigns it after the text is encrypted. +message EncryptedPaymentRequestText { + // The encryption scheme used. Clients render a request with an + // unrecognized scheme as unsupported. + Scheme scheme = 1 [(validate.rules).enum = { + in: [1] // CHAT_KEY_XCHACHA20POLY1305 + }]; + enum Scheme { + UNKNOWN = 0; + // The private group's chat key. + CHAT_KEY_XCHACHA20POLY1305 = 1; + } + + // The random XChaCha20-Poly1305 nonce, unique per encryption. + bytes nonce = 2 [(validate.rules).bytes = { + min_len: 24 + max_len: 24 + }]; + + // The encrypted, serialized PaymentRequestText with the 16-byte Poly1305 + // tag appended. The upper bound fits a PaymentRequestText with a + // maximum-length title and description: 100 + 500 characters of up to 4 + // bytes each is 2400 bytes, each field's tag and length prefix add 3 + // bytes (6 in all), and the tag adds 16, for 2422 bytes, rounded up to + // 2560. + bytes ciphertext = 3 [(validate.rules).bytes = { + min_len: 17 + max_len: 2560 + }]; +} + +// Share is one debtor's part of a payment request: who is asked to pay, how +// much, and whether they have. +message Share { + // The member asked to pay. + common.v1.UserId user_id = 1 [(validate.rules).message.required = true]; + + // The amount asked of them, in the request's currency. The server + // requires a whole number, at least one, of the currency's minimum + // transfer value (its smallest unit, e.g. $0.01): $12.34, not $12.345. + // A client dividing an amount rounds each share to that unit itself. + double native_amount = 2 [(validate.rules).double.gte = 0]; + + // How the share was paid. Unset while it is unpaid. Clients never set it: + // a share is paid only by a payment (see + // intent.v1.ChatMetadata.RequestedPayment), by the creator with + // PaymentRequest.MarkPaid, or, for the creator's own share, from + // creation. + PaidShare paid = 3; +} + +// PaidShare records how a share was paid. A share is paid all at once, for +// exactly its native_amount (a payment pays the share exactly, all or +// nothing, and a share marked paid by hand, or the creator's own, is taken +// as settled in full), and once paid it stays paid. +// +// It changes in one case only: a share marked paid by hand (manual) is +// replaced by a payment (intent) that lands after the mark, one the debtor +// made while the share was still unpaid. The record then shows the money +// that arrived, the request's version advances, and its status and +// closed_at stay as they were. Nothing replaces a payment or the creator's +// own share, and a hand mark never replaces anything. +message PaidShare { + // When the share was paid, or marked paid. + google.protobuf.Timestamp paid_at = 1 [(validate.rules).timestamp.required = true]; + + // How the share was paid. + oneof how { + option (validate.required) = true; + + // Paid with a Flipcash payment: the payment's intent. The payment + // also posted a messaging.v1.CashContent message into the chat, + // carrying this request's ID in payment_request_id. + common.v1.IntentId intent = 2; + + // Marked paid by the creator, for a share settled some other way. + // Nothing was paid through Flipcash and no message was posted. + Manual manual = 3; + + // The creator's own share, paid from creation: the creator is owed + // it by themself. Nothing was paid and no message was posted. + // paid_at is the request's created_at. + Creator creator = 4; + } + + // A share marked paid by hand (see PaymentRequest.MarkPaid), which only + // the request's creator can do. + message Manual {} + + // The creator's own share, paid from creation. + message Creator {} +} + +// PaymentRequestStatus is where a payment request is in its life (see +// PaymentRequestMetadata.status). +enum PaymentRequestStatus { + PAYMENT_REQUEST_STATUS_UNKNOWN = 0; + // Accepting payments: the request is before its ends_at and has something + // left to pay (for a Split, at least one unpaid share). + PAYMENT_REQUEST_STATUS_OPEN = 1; + // Everything asked for is paid (for a Split, every share). Final. + PAYMENT_REQUEST_STATUS_COMPLETED = 2; + // The creator closed the request (PaymentRequest.ClosePaymentRequest) + // while it was still OPEN. Final. + PAYMENT_REQUEST_STATUS_CLOSED = 3; + // The request reached its ends_at while still OPEN. Final. Decided by the + // clock, like poll.v1.PollState's TALLYING: it moves no version, and a + // client judges an OPEN request past its ends_at as EXPIRED itself rather + // than waiting for the server to say so. + PAYMENT_REQUEST_STATUS_EXPIRED = 4; +} + diff --git a/proto/paymentrequest/v1/paymentrequest_service.proto b/proto/paymentrequest/v1/paymentrequest_service.proto new file mode 100644 index 0000000..1525368 --- /dev/null +++ b/proto/paymentrequest/v1/paymentrequest_service.proto @@ -0,0 +1,315 @@ +syntax = "proto3"; + +package flipcash.paymentrequest.v1; + +option go_package = "github.com/code-payments/flipcash2-protobuf-api/generated/go/paymentrequest/v1;paymentrequestpb"; +option java_package = "com.codeinc.flipcash.gen.paymentrequest.v1"; +option objc_class_prefix = "FPBPaymentRequestV1"; + +import "common/v1/common.proto"; +import "google/protobuf/timestamp.proto"; +import "moderation/v1/model.proto"; +import "paymentrequest/v1/model.proto"; +import "validate/validate.proto"; + +// PaymentRequest manages payment requests: a creator asking others for money. +// Requests are layered (see PaymentRequestMetadata): the first layer is where +// a request is made, today a group chat (GroupChatPaymentRequest), and the +// second is its type, today a split (Split). Every kind shares its identity, +// creator, status, version and the RPCs below; what each layer adds is documented on +// its message. DMs are not supported. +// +// A group chat request is shown in its chat as a message. The creator first +// calls CreatePaymentRequest, then sends the returned PaymentRequestId with +// Messaging.SendMessage as a messaging.v1.PaymentRequestWidget. The message +// carries only the PaymentRequestId; clients get the request's kind, shares +// and status from GetPaymentRequest. The request is live from creation, sent +// or not. +// +// A request belongs to the chat it was created for. Its creator may send it +// in that chat any number of times, for example to bring an older request +// back to the bottom of the chat. Every message carrying it shows the same +// request. Deleting a message that carries a request does not touch the +// request. +// +// Anyone who can read the chat in full sees the request, its shares and +// who has paid; someone who can only preview the chat sees the widget but +// not the request. No event announces a change to a request: clients +// refetch it to see payments and closes land. +// +// In a group that is not private, a split's title and description are +// plaintext and moderated, and the widget is sent as plain WidgetContent. +// +// In a private group, they are encrypted with the chat key (see +// EncryptedPaymentRequestText), and the widget is sent inside +// messaging.v1.EncryptedContent like everything else. The server still sees +// everything else (the currency, ends_at, the shares and every payment), +// since it has to check payments against the shares and decide when the +// request is complete. +service PaymentRequest { + // CreatePaymentRequest creates a payment request of the kind the request + // carries. For a group chat request, the caller, who becomes its + // creator, must be able to send messages in the chat; a split's + // plaintext title and description are moderated together, as one text, + // and encrypted text is not. The request is OPEN and accepts payments as + // soon as it is created; the widget message the creator sends announces + // it. + rpc CreatePaymentRequest(CreatePaymentRequestRequest) returns (CreatePaymentRequestResponse); + + // GetPaymentRequest gets a payment request. The caller must be able to read + // the chat in full (see messaging.v1.ViewMode FULL): in a group that is + // not private, its members and anyone who satisfies its listener rules; + // in a private group, only its members. Being able to preview the chat is + // not enough. + // + // A caller who holds an unpaid share of the request is also given the + // intent ID their payment of it must use (see + // GetPaymentRequestResponse.payment_intent_id). + rpc GetPaymentRequest(GetPaymentRequestRequest) returns (GetPaymentRequestResponse); + + // GetChatPaymentRequests pages one section of the payment requests made + // in a group chat (every kind whose first layer is that chat): the OPEN + // ones, soonest to end first, or the RESOLVED ones, most recently + // resolved first (see GetChatPaymentRequestsRequest.section). Together + // the two sections are the chat's full history of requests, and a client + // showing both pages each on its own. The caller must be able to read the + // chat in full, as for GetPaymentRequest. + // + // A page's requests are current as of its read, and clients apply them by + // version (see PaymentRequestMetadata) against what they already hold. A + // request moves from OPEN to RESOLVED while a client walks either + // section, so a walk may miss it or see it in both; clients learn of a + // new request from its widget message, and refresh a section to see one + // resolve. + rpc GetChatPaymentRequests(GetChatPaymentRequestsRequest) returns (GetChatPaymentRequestsResponse); + + // ClosePaymentRequest closes an OPEN request, which then accepts no more + // payments: it becomes CLOSED and advances the version. Only the creator + // can close. Closing a request that is not OPEN (already COMPLETED, + // CLOSED or EXPIRED) is a no-op that returns OK. + rpc ClosePaymentRequest(ClosePaymentRequestRequest) returns (ClosePaymentRequestResponse); + + // MarkPaid records a debtor's share of a split as paid by hand, for a + // share settled outside Flipcash. Only the creator can mark a share paid. + // The share is recorded as a PaidShare.Manual and the version advances; + // if it was the last unpaid share, the request becomes COMPLETED. No + // message is posted into the chat. + // + // Marking a share that is already paid, by payment or by hand, is a no-op + // that returns OK, whatever the request's status. A debtor's payment in + // flight when the share is marked replaces the mark once it lands (see + // PaidShare). + rpc MarkPaid(MarkPaidRequest) returns (MarkPaidResponse); +} + +message CreatePaymentRequestRequest { + // Key for retrying this request safely. A retry with the same key from + // the same caller returns the payment request the first attempt created, + // with result OK, even if the parameters, or the kind, differ. + IdempotencyKey idempotency_key = 1 [(validate.rules).message.required = true]; + + // What to create and where. The same messages the created request + // carries in PaymentRequestMetadata.kind, with nothing the server sets + // (for a split, every share has paid unset). + oneof kind { + option (validate.required) = true; + + // A request in a group chat. The caller may list themself among a + // split's shares; that share is created paid (PaidShare.Creator), + // and at least one share must name someone else. + GroupChatPaymentRequest group_chat = 2; + } + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message CreatePaymentRequestResponse { + Result result = 1; + enum Result { + OK = 0; + // The caller is not a member of the chat, or does not satisfy its + // speaker rules. + DENIED = 1; + // The chat a group chat request names is a DM. + CHAT_NOT_SUPPORTED = 2; + // The text is encrypted and the chat is not a private group. + ENCRYPTION_NOT_ALLOWED = 3; + // The chat is a private group and the text is not encrypted. + ENCRYPTION_REQUIRED = 4; + // A split's ends_at is not in the future, or is more than 4 weeks + // away. + INVALID_ENDS_AT = 5; + // A split's share names a user who is not a member of the chat, or + // a user another share already names; is not a whole number, at + // least one, of the currency's minimum transfer value; or has paid + // set. Or no share names anyone but the caller. + INVALID_SHARES = 6; + // A split's currency is one the server cannot value. + INVALID_CURRENCY = 7; + // The plaintext title and description, moderated together as one + // text, were flagged. + TEXT_MODERATED = 8; + } + + // The created request, or on a retry the request the first attempt + // created. Set only when result == OK. + PaymentRequestMetadata payment_request = 2; + + // The best-fit category that tripped moderation, mirroring the Moderation + // service's vocabulary. Set only when result == TEXT_MODERATED; NONE + // otherwise. + moderation.v1.FlaggedCategory flagged_category = 3; +} + +message GetPaymentRequestRequest { + PaymentRequestId payment_request_id = 1 [(validate.rules).message.required = true]; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message GetPaymentRequestResponse { + Result result = 1; + enum Result { + OK = 0; + // The caller cannot read the request's chat in full. + DENIED = 1; + // The request doesn't exist. + NOT_FOUND = 2; + } + + // Set only when result == OK. + PaymentRequestMetadata payment_request = 2; + + // The intent ID the caller's payment of their share must use (see + // intent.v1.ChatMetadata.RequestedPayment), set only when result == OK + // and the caller holds a share of the request that is unpaid. + // + // The server generates one at random for each debtor's share when the + // request is created, and gives it to that debtor alone. A payment of the + // share with any other intent ID is refused, and an intent ID is used at + // most once, so a share is paid at most once: a retry, a second tap or a + // second device all pay under this one ID, and only the first payment + // goes through. Keep it to the payment: anyone who learns it before the + // share is paid can use it up and block the payment. + common.v1.IntentId payment_intent_id = 3; +} + +message GetChatPaymentRequestsRequest { + // The group chat whose requests to page: every request whose + // GroupChatPaymentRequest.chat_id is this chat. + common.v1.ChatId chat_id = 1 [(validate.rules).message.required = true]; + + // Which requests to page, and in what order. A request is in exactly one + // section at any moment, decided by its status (see + // PaymentRequestMetadata.status). + Section section = 2 [(validate.rules).enum = { + in: [1, 2] // OPEN, RESOLVED + }]; + enum Section { + UNKNOWN = 0; + + // Requests that are OPEN: still accepting payments. Ordered by + // ends_at ascending, the one ending soonest first, so the most urgent + // leads. The section is the same for every member: a request stays + // here until every share is paid, the creator closes it or it + // reaches its ends_at, whether or not the caller has paid their own + // share. + OPEN = 1; + + // Requests that are COMPLETED, CLOSED or EXPIRED: no longer accepting + // payments. Ordered by PaymentRequestMetadata.closed_at descending, the + // most recently resolved first: when its last share was paid, when + // the creator closed it, or its ends_at when it expired. + RESOLVED = 2; + } + + // QueryOptions controls page_size, capped at 100. Ordering is fixed by + // the section and is not client-selectable. + // + // Leave query_options.paging_token unset on the first request. On every + // subsequent request, set it to the paging_token from the most recent + // response. The token is opaque and server-generated; do not construct + // it. It is bound to chat_id and section and refused with another. + common.v1.QueryOptions query_options = 3; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message GetChatPaymentRequestsResponse { + Result result = 1; + enum Result { + OK = 0; + // The caller cannot read the chat in full, or the chat is a DM. + DENIED = 1; + // The chat doesn't exist. + NOT_FOUND = 2; + } + + // The page, in the section's order. Set when result is OK. + repeated PaymentRequestMetadata payment_requests = 2 [(validate.rules).repeated = { + min_items: 0 + max_items: 100 + }]; + + // PagingToken carries the cursor after the last request returned. The + // client MUST send it back in query_options.paging_token on the next + // GetChatPaymentRequestsRequest. Set when result is OK and has_more is + // true. + common.v1.PagingToken paging_token = 3; + + // HasMore indicates whether further pages remain. When false, every + // request in the section as of the walk has been read. When true, the + // client should issue another GetChatPaymentRequestsRequest with the + // returned paging_token. + bool has_more = 4; +} + +message ClosePaymentRequestRequest { + PaymentRequestId payment_request_id = 1 [(validate.rules).message.required = true]; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message ClosePaymentRequestResponse { + Result result = 1; + enum Result { + OK = 0; + // The caller is not the request's creator. + DENIED = 1; + // The request doesn't exist. + NOT_FOUND = 2; + } + + // The request after the close, or as it is when it was not OPEN. Set + // only when result == OK. + PaymentRequestMetadata payment_request = 2; +} + +message MarkPaidRequest { + PaymentRequestId payment_request_id = 1 [(validate.rules).message.required = true]; + + // The debtor whose share to mark paid. + common.v1.UserId user_id = 2 [(validate.rules).message.required = true]; + + common.v1.Auth auth = 10 [(validate.rules).message.required = true]; +} + +message MarkPaidResponse { + Result result = 1; + enum Result { + OK = 0; + // The caller is not the request's creator. + DENIED = 1; + // The request doesn't exist. + NOT_FOUND = 2; + // The share is unpaid and the request is not OPEN: it is CLOSED or + // EXPIRED. + NOT_OPEN = 3; + // The request has no share for user_id. + NOT_A_SHARE = 4; + } + + // The request after the share was marked paid, or as it is when the + // share was already paid. Set only when result == OK. + PaymentRequestMetadata payment_request = 2; +} From ac119f4aa132808abe662a0480105b5e01b9ae0b Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Fri, 23 Oct 2026 15:50:33 -0400 Subject: [PATCH 2/2] docs(changelog): add 0.21.0 entry --- CHANGELOG.md | 68 +++++++++++++++++++ .../ContractInfo.swift | 2 +- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2ce07f..6516ce5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,74 @@ called out explicitly even when nothing else did. release notes, so a version with no entry here does not release. Write the entry in the same PR that syncs the contract, while the diff is still in front of you. +## 0.21.0 + +Synced to [`flipcash2-protobuf-api@b77bf78f`](https://github.com/code-payments/flipcash2-protobuf-api/commit/b77bf78ff8d9ea1bcbf9aa3afa6696ba7edd37a9), +picking up [#151](https://github.com/code-payments/flipcash2-protobuf-api/pull/151), +[#152](https://github.com/code-payments/flipcash2-protobuf-api/pull/152) (docs only), +[#154](https://github.com/code-payments/flipcash2-protobuf-api/pull/154) (docs only), +[#155](https://github.com/code-payments/flipcash2-protobuf-api/pull/155) and +[#156](https://github.com/code-payments/flipcash2-protobuf-api/pull/156). `paymentrequest.v1` is +new. `activity.v1`, `chat.v1`, `intent.v1` and `messaging.v1` moved. + +This release adds payment requests (group splits), payments to several group members at once, and +moderation RPCs for group creators. Upgrading breaks source, not the wire. `CashContent` renamed +two fields and moved one into a oneof, so code reading `amount` or `receiver` stops compiling. Two +enums gained a case, appended at the end, so no existing value moved. + +### Breaking + +- `messaging.v1.CashContent.amount` (field 2) is now `total_amount`. Same type and number. For a + payment to several people it is the whole payment. +- `messaging.v1.CashContent.receiver` (field 3) is now `single_receiver`, inside a new + `oneof recipient`. Kotlin's `getReceiver()`/`hasReceiver()` become `getSingleReceiver()`/ + `hasSingleReceiver()`; Swift's `receiver` becomes `singleReceiver`. An older DM message that + predates per-message receivers still has neither member of the oneof set. + +The binary encoding of both fields is unchanged, so messages written before and after the rename +decode the same way. + +### Added + +- `paymentrequest.v1.PaymentRequest`, a new service with five RPCs: `CreatePaymentRequest`, + `GetPaymentRequest`, `GetChatPaymentRequests`, `ClosePaymentRequest` and `MarkPaid`. The one kind + today is a split in a group chat (`GroupChatPaymentRequest` with a `Split` of per-member + `Share`s). DMs are not supported. No event announces a change to a request; clients refetch it. + - In a private group the split's title and description are `EncryptedPaymentRequestText` under + the chat key. Everything else, including shares and payments, is visible to the server. + - `GetPaymentRequestResponse.payment_intent_id` is the intent ID a debtor's payment of their share + must use. The server issues one per share, so a share is paid at most once. +- `messaging.v1.PaymentRequestWidget`, sent as `WidgetContent.payment_request` (oneof field 3). It + carries only the request's ID. +- `intent.v1.ChatMetadata.requested_payment` (oneof field 6), a `RequestedPayment` naming the + `payment_request_id` whose share a `SendPublicPayment` pays. +- `messaging.v1.CashContent.multi_receiver` (oneof field 5), a `Payments` list of 2 to 10 + `Payment { receiver, native_amount, quarks }`. A group payment to several members is an ocp + `SendPublicMultiPayment`. +- `messaging.v1.CashContent.payment_request_id` (field 6), set only on the cash message posted when + a debtor pays their share. +- Chat moderation RPCs on `chat.v1.Chat`: `SilenceUser`, `UnsilenceUser`, `BanUser`, `UnbanUser` and + `GetRestrictedUsers`, with `SilenceState`, `BanState` and `RestrictedUser`. The chat's creator + cannot be silenced or banned. +- `chat.v1.ViewerState.restrictions` (field 3), carrying the viewer's `silence`. A timed silence + lapses with no event, so the client owns the countdown. +- `chat.v1.ViewerState.Permissions.moderation` (field 2), a `ModerationPermissions` with + `can_silence` and `can_ban`. +- `JoinChatResponse.Result.BANNED = 4` and `EnterLobbyResponse.Result.BANNED = 6`, both appended. + An exhaustive `switch` or `when` over either needs the new case before it compiles. + +### Changed + +- Reaction boosts are now allowed in DMs. A DM boost pays the other member the whole amount as one + `SendPublicPayment`. No field changed; the `activity.v1.BoostedReaction` and + `intent.v1.ChatMetadata.ReactionBoost` docs now cover DMs. +- `SendMessage` and `EditMessage` document that `ENCRYPTION_REQUIRED` also applies to DMs. + +### Unchanged + +Nothing was renumbered. No service, RPC or enum case was removed. Apart from the `CashContent` +rename above, no field was removed or changed type. + ## 0.20.0 Synced to [`flipcash2-protobuf-api@733ea7f9`](https://github.com/code-payments/flipcash2-protobuf-api/commit/733ea7f9f33291b9631f0176fab5485acf161fab), diff --git a/Sources/Flipcash2ClientProtocol/ContractInfo.swift b/Sources/Flipcash2ClientProtocol/ContractInfo.swift index af0d461..6830454 100644 --- a/Sources/Flipcash2ClientProtocol/ContractInfo.swift +++ b/Sources/Flipcash2ClientProtocol/ContractInfo.swift @@ -1,7 +1,7 @@ // Generated by scripts/generate-swift.sh. Do not edit. public enum Flipcash2ContractInfo { - public static let version = "0.20.0-dev" + public static let version = "0.21.0-dev" public static let protoCommit = "b77bf78ff8d9ea1bcbf9aa3afa6696ba7edd37a9" public static var isLocal: Bool { protoCommit == localSentinel }