// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndividualRecipientMessageBundle {
    /// The time, in milliseconds since the epoch, at which this message was
    /// originally sent from the perspective of the sender. Note that the maximum
    /// allowable timestamp for JavaScript clients is less than Long.MAX_VALUE; see
    /// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date>
    /// for additional details and discussion.
    #[prost(uint64, tag = "1")]
    pub timestamp: u64,
    /// A map of device IDs to individual messages. Generally, callers must include
    /// one message for each device linked to the destination account. In cases of
    /// "sync messages" where a sender is distributing information to other devices
    /// linked to the sender's account, senders may omit a message for the sending
    /// device.
    #[prost(map = "uint32, message", tag = "2")]
    pub messages: ::std::collections::HashMap<
        u32,
        individual_recipient_message_bundle::Message,
    >,
}
/// Nested message and enum types in `IndividualRecipientMessageBundle`.
pub mod individual_recipient_message_bundle {
    /// A message for an individual device linked to a destination account.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct Message {
        /// The registration ID for the destination device.
        #[prost(uint32, tag = "1")]
        pub registration_id: u32,
        /// The content of the message to deliver to the destination device.
        ///
        /// 256 KiB
        #[prost(bytes = "vec", tag = "2")]
        pub payload: ::prost::alloc::vec::Vec<u8>,
        /// The message type of the message. If this message is part of an
        /// unidentified send, this must be UNIDENTIFIED_SENDER
        #[prost(enumeration = "super::SendMessageType", tag = "3")]
        pub r#type: i32,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendAuthenticatedSenderMessageRequest {
    /// The service identifier of the account to which to deliver the message.
    #[prost(message, optional, tag = "1")]
    pub destination: ::core::option::Option<super::common::ServiceIdentifier>,
    /// If true, this message will only be delivered to destination devices that
    /// have an active message delivery channel with a Signal server.
    #[prost(bool, tag = "2")]
    pub ephemeral: bool,
    /// Indicates whether this message is urgent and should trigger a high-priority
    /// notification if the destination device does not have an active message
    /// delivery channel with a Signal server
    #[prost(bool, tag = "3")]
    pub urgent: bool,
    /// The messages to send to the destination account.
    #[prost(message, optional, tag = "4")]
    pub messages: ::core::option::Option<IndividualRecipientMessageBundle>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SendMessageAuthenticatedSenderResponse {
    /// The outcome of the message delivery
    #[prost(
        oneof = "send_message_authenticated_sender_response::Response",
        tags = "1, 2, 3, 4"
    )]
    pub response: ::core::option::Option<
        send_message_authenticated_sender_response::Response,
    >,
}
/// Nested message and enum types in `SendMessageAuthenticatedSenderResponse`.
pub mod send_message_authenticated_sender_response {
    /// The outcome of the message delivery
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        /// The message was successfully delivered to all destination devices
        #[prost(message, tag = "1")]
        Success(()),
        /// A list of discrepancies between the destination devices identified in a
        /// request to send a message and the devices that are actually linked to an
        /// account.
        #[prost(message, tag = "2")]
        MismatchedDevices(super::MismatchedDevices),
        /// A description of a challenge callers must complete before sending
        /// additional messages.
        #[prost(message, tag = "3")]
        ChallengeRequired(super::ChallengeRequired),
        /// The destination account did not exist
        #[prost(message, tag = "4")]
        DestinationNotFound(super::super::errors::NotFound),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendSyncMessageRequest {
    /// Indicates whether this message is urgent and should trigger a high-priority
    /// notification if the destination device does not have an active message
    /// delivery channel with a Signal server
    #[prost(bool, tag = "1")]
    pub urgent: bool,
    /// The messages to send to the destination account.
    #[prost(message, optional, tag = "2")]
    pub messages: ::core::option::Option<IndividualRecipientMessageBundle>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendSealedSenderMessageRequest {
    /// The service identifier of the account to which to deliver the message.
    #[prost(message, optional, tag = "1")]
    pub destination: ::core::option::Option<super::common::ServiceIdentifier>,
    /// If true, this message will only be delivered to destination devices that
    /// have an active message delivery channel with a Signal server.
    #[prost(bool, tag = "2")]
    pub ephemeral: bool,
    /// Indicates whether this message is urgent and should trigger a high-priority
    /// notification if the destination device does not have an active message
    /// delivery channel with a Signal server
    #[prost(bool, tag = "3")]
    pub urgent: bool,
    /// The messages to send to the destination account.
    #[prost(message, optional, tag = "4")]
    pub messages: ::core::option::Option<IndividualRecipientMessageBundle>,
    /// A means to authorize the request.
    #[prost(
        oneof = "send_sealed_sender_message_request::Authorization",
        tags = "5, 6, 7"
    )]
    pub authorization: ::core::option::Option<
        send_sealed_sender_message_request::Authorization,
    >,
}
/// Nested message and enum types in `SendSealedSenderMessageRequest`.
pub mod send_sealed_sender_message_request {
    /// A means to authorize the request.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Authorization {
        /// The unidentified access key (UAK) for the destination account.
        #[prost(bytes, tag = "5")]
        UnidentifiedAccessKey(::prost::alloc::vec::Vec<u8>),
        /// A group send endorsement token for the destination account.
        #[prost(bytes, tag = "6")]
        GroupSendToken(::prost::alloc::vec::Vec<u8>),
        /// The destination account allows unrestricted unidentified access
        #[prost(message, tag = "7")]
        UnrestrictedAccess(()),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendStoryMessageRequest {
    /// The service identifier of the account to which to deliver the message.
    #[prost(message, optional, tag = "1")]
    pub destination: ::core::option::Option<super::common::ServiceIdentifier>,
    /// Indicates whether this message is urgent and should trigger a high-priority
    /// notification if the destination device does not have an active message
    /// delivery channel with a Signal server
    #[prost(bool, tag = "2")]
    pub urgent: bool,
    /// The messages to send to the destination account.
    #[prost(message, optional, tag = "3")]
    pub messages: ::core::option::Option<IndividualRecipientMessageBundle>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SendMessageResponse {
    /// The outcome of the message delivery
    #[prost(oneof = "send_message_response::Response", tags = "1, 2, 3, 4")]
    pub response: ::core::option::Option<send_message_response::Response>,
}
/// Nested message and enum types in `SendMessageResponse`.
pub mod send_message_response {
    /// The outcome of the message delivery
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        /// The message was successfully delivered to all destination devices
        #[prost(message, tag = "1")]
        Success(()),
        /// A list of discrepancies between the destination devices identified in a
        /// request to send a message and the devices that are actually linked to an
        /// account.
        #[prost(message, tag = "2")]
        MismatchedDevices(super::MismatchedDevices),
        /// The provided unidentified authorization credential was invalid
        #[prost(message, tag = "3")]
        FailedUnidentifiedAuthorization(
            super::super::errors::FailedUnidentifiedAuthorization,
        ),
        /// The destination account did not exist
        #[prost(message, tag = "4")]
        DestinationNotFound(super::super::errors::NotFound),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MultiRecipientMessage {
    /// The time, in milliseconds since the epoch, at which this message was
    /// originally sent from the perspective of the sender. Note that the maximum
    /// allowable timestamp for JavaScript clients is less than Long.MAX_VALUE; see
    /// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date>
    /// for additional details and discussion.
    #[prost(uint64, tag = "1")]
    pub timestamp: u64,
    /// The serialized multi-recipient message payload.
    ///
    /// 256 KiB payload + (5000 * 100) of overhead
    #[prost(bytes = "vec", tag = "2")]
    pub payload: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SendMultiRecipientMessageRequest {
    /// If true, this message will only be delivered to destination devices that
    /// have an active message delivery channel with a Signal server.
    #[prost(bool, tag = "1")]
    pub ephemeral: bool,
    /// Indicates whether this message is urgent and should trigger a high-priority
    /// notification if the destination device does not have an active message
    /// delivery channel with a Signal server
    #[prost(bool, tag = "2")]
    pub urgent: bool,
    /// The multi-recipient message to send to all destination accounts and
    /// devices.
    #[prost(message, optional, tag = "3")]
    pub message: ::core::option::Option<MultiRecipientMessage>,
    /// A group send endorsement token for the destination account.
    #[prost(bytes = "vec", tag = "4")]
    pub group_send_token: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SendMultiRecipientStoryRequest {
    /// Indicates whether this message is urgent and should trigger a high-priority
    /// notification if the destination device does not have an active message
    /// delivery channel with a Signal server
    #[prost(bool, tag = "1")]
    pub urgent: bool,
    /// The multi-recipient story message to send to all destination accounts and
    /// devices.
    #[prost(message, optional, tag = "2")]
    pub message: ::core::option::Option<MultiRecipientMessage>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiRecipientSuccess {
    /// A list of destination service identifiers that could not be resolved to
    /// registered Signal accounts. The  message in the original request was sent
    /// to all service identifiers/devices in the original request except for the
    /// destination devices associated with the service identifiers in this list.
    #[prost(message, repeated, tag = "1")]
    pub unresolved_recipients: ::prost::alloc::vec::Vec<
        super::common::ServiceIdentifier,
    >,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendMultiRecipientMessageResponse {
    /// The outcome of the message delivery
    #[prost(oneof = "send_multi_recipient_message_response::Response", tags = "1, 2, 3")]
    pub response: ::core::option::Option<
        send_multi_recipient_message_response::Response,
    >,
}
/// Nested message and enum types in `SendMultiRecipientMessageResponse`.
pub mod send_multi_recipient_message_response {
    /// The outcome of the message delivery
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        /// The message was sent to at least some of the destination accounts/devices
        /// identified in the original request.
        #[prost(message, tag = "1")]
        Success(super::MultiRecipientSuccess),
        /// A list of sets of discrepancies between the destination devices
        /// identified in a request to send a message and the devices that are
        /// actually linked to a destination account.
        #[prost(message, tag = "2")]
        MismatchedDevices(super::MultiRecipientMismatchedDevices),
        /// The provided unidentified authorization credential was invalid
        #[prost(message, tag = "3")]
        FailedUnidentifiedAuthorization(
            super::super::errors::FailedUnidentifiedAuthorization,
        ),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MismatchedDevices {
    /// The service identifier to which the devices named in this object are
    /// linked.
    #[prost(message, optional, tag = "1")]
    pub service_identifier: ::core::option::Option<super::common::ServiceIdentifier>,
    /// A list of device IDs that are linked to the destination account, but were
    /// not included in the collection of messages bound for the destination
    /// account.
    #[prost(uint32, repeated, packed = "false", tag = "2")]
    pub missing_devices: ::prost::alloc::vec::Vec<u32>,
    /// A list of device IDs that were included in the collection of messages bound
    /// for the destination account, but are not currently linked to the
    /// destination account.
    #[prost(uint32, repeated, packed = "false", tag = "3")]
    pub extra_devices: ::prost::alloc::vec::Vec<u32>,
    /// A list of device IDs that present in the collection of messages bound for
    /// the destination account and are linked to the destination account, but have
    /// a different registration ID than the registration ID presented by the
    /// sender (indicating that the destination device has likely been replaced by
    /// another device).
    #[prost(uint32, repeated, packed = "false", tag = "4")]
    pub stale_devices: ::prost::alloc::vec::Vec<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiRecipientMismatchedDevices {
    /// A list of sets of discrepancies between the destination devices identified
    /// in a request to send a message and the devices that are actually linked to
    /// a destination account.
    #[prost(message, repeated, tag = "1")]
    pub mismatched_devices: ::prost::alloc::vec::Vec<MismatchedDevices>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChallengeRequired {
    /// An opaque token identifying this challenge request. Clients must generally
    /// submit this token when submitting a challenge response.
    #[prost(string, tag = "1")]
    pub token: ::prost::alloc::string::String,
    /// A list of challenge types callers may choose to complete to resolve the
    /// challenge requirement. May be empty, in which case callers cannot resolve
    /// the challenge by any means other than waiting.
    #[prost(enumeration = "challenge_required::ChallengeType", repeated, tag = "2")]
    pub challenge_options: ::prost::alloc::vec::Vec<i32>,
    /// A duration (in seconds) after which the challenge requirement may be
    /// resolved by simply waiting. May not be set if the challenge cannot be
    /// resolved by waiting.
    #[prost(uint64, optional, tag = "3")]
    pub retry_after_seconds: ::core::option::Option<u64>,
}
/// Nested message and enum types in `ChallengeRequired`.
pub mod challenge_required {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ChallengeType {
        Unspecified = 0,
        /// A challenge that callers can fulfill by completing a captcha.
        Captcha = 1,
        /// A challenge that callers can fulfill by supplying a token delivered via
        /// push notification.
        PushChallenge = 2,
    }
    impl ChallengeType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "UNSPECIFIED",
                Self::Captcha => "CAPTCHA",
                Self::PushChallenge => "PUSH_CHALLENGE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNSPECIFIED" => Some(Self::Unspecified),
                "CAPTCHA" => Some(Self::Captcha),
                "PUSH_CHALLENGE" => Some(Self::PushChallenge),
                _ => None,
            }
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SendMessageType {
    Unspecified = 0,
    /// A double-ratchet message represents a "normal," "unsealed-sender" message
    /// encrypted using the Double Ratchet within an established Signal session.
    DoubleRatchet = 1,
    /// A prekey message begins a new Signal session. The `content` of a prekey
    /// message is a superset of a double-ratchet message's `content` and
    /// contains the sender's identity public key and information identifying the
    /// pre-keys used in the message's ciphertext.
    PrekeyMessage = 2,
    /// A plaintext message is used solely to convey encryption error receipts
    /// and never contains encrypted message content. Encryption error receipts
    /// must be delivered in plaintext because encryption/decryption of a prior
    /// message failed and there is no reason to believe that
    /// encryption/decryption of subsequent messages with the same key material
    /// would succeed.
    ///
    /// Critically, plaintext messages never have "real" message content
    /// generated by users. Plaintext messages include sender information.
    PlaintextContent = 3,
    /// An unidentified sender message is an encrypted message. No other
    /// information about the type of the encrypted message is known to the server.
    ///
    /// Unidenitfied sender messages require an unidentified access token or a
    /// group send endorsement token to prove the unidentified sender is authorized
    /// to send messages to the destination.
    UnidentifiedSender = 4,
}
impl SendMessageType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "UNSPECIFIED",
            Self::DoubleRatchet => "DOUBLE_RATCHET",
            Self::PrekeyMessage => "PREKEY_MESSAGE",
            Self::PlaintextContent => "PLAINTEXT_CONTENT",
            Self::UnidentifiedSender => "UNIDENTIFIED_SENDER",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNSPECIFIED" => Some(Self::Unspecified),
            "DOUBLE_RATCHET" => Some(Self::DoubleRatchet),
            "PREKEY_MESSAGE" => Some(Self::PrekeyMessage),
            "PLAINTEXT_CONTENT" => Some(Self::PlaintextContent),
            "UNIDENTIFIED_SENDER" => Some(Self::UnidentifiedSender),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod messages_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Provides methods for sending "unsealed sender" messages.
    #[derive(Debug, Clone)]
    pub struct MessagesClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> MessagesClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> MessagesClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            MessagesClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Sends an "unsealed sender" message to all devices linked to a single
        /// destination account.
        ///
        /// The destination account must not be the same as the authenticated caller.
        /// Callers should use `SendSyncMessage` to send messages to themselves.
        pub async fn send_message(
            &mut self,
            request: impl tonic::IntoRequest<
                super::SendAuthenticatedSenderMessageRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::SendMessageAuthenticatedSenderResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/org.signal.chat.messages.Messages/SendMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.messages.Messages", "SendMessage"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Sends a "sync" message to all other devices linked to the authenticated
        /// sender's account.
        pub async fn send_sync_message(
            &mut self,
            request: impl tonic::IntoRequest<super::SendSyncMessageRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SendMessageAuthenticatedSenderResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/org.signal.chat.messages.Messages/SendSyncMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.messages.Messages",
                        "SendSyncMessage",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated client implementations.
pub mod messages_anonymous_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Provides methods for sending "sealed sender" messages.
    #[derive(Debug, Clone)]
    pub struct MessagesAnonymousClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> MessagesAnonymousClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> MessagesAnonymousClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            MessagesAnonymousClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Sends a "sealed sender" message to all devices linked to a single
        /// destination account.
        ///
        /// If this RPC is authorized with an unidentified access key, it will fail
        /// with an authorization failure if the credential is invalid OR if the
        /// destination account was not found. If it is authorized using a group send
        /// token, it will fail with an authorization failure if the credential is
        /// invalid and with an destination not found error if the account does not
        /// exist
        pub async fn send_single_recipient_message(
            &mut self,
            request: impl tonic::IntoRequest<super::SendSealedSenderMessageRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SendMessageResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/org.signal.chat.messages.MessagesAnonymous/SendSingleRecipientMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.messages.MessagesAnonymous",
                        "SendSingleRecipientMessage",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Sends a "sealed sender" message with a common payload to all devices linked
        /// to multiple destination accounts.
        pub async fn send_multi_recipient_message(
            &mut self,
            request: impl tonic::IntoRequest<super::SendMultiRecipientMessageRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SendMultiRecipientMessageResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/org.signal.chat.messages.MessagesAnonymous/SendMultiRecipientMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.messages.MessagesAnonymous",
                        "SendMultiRecipientMessage",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Sends a story message to devices linked to a single destination account.
        pub async fn send_story(
            &mut self,
            request: impl tonic::IntoRequest<super::SendStoryMessageRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SendMessageResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/org.signal.chat.messages.MessagesAnonymous/SendStory",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.messages.MessagesAnonymous",
                        "SendStory",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Sends a story message with a common payload to devices linked to devices
        /// linked to multiple destination accounts.
        pub async fn send_multi_recipient_story(
            &mut self,
            request: impl tonic::IntoRequest<super::SendMultiRecipientStoryRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SendMultiRecipientMessageResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/org.signal.chat.messages.MessagesAnonymous/SendMultiRecipientStory",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.messages.MessagesAnonymous",
                        "SendMultiRecipientStory",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
