// This file is @generated by prost-build.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDevicesRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDevicesResponse {
    /// A list of devices linked to the authenticated account.
    #[prost(message, repeated, tag = "1")]
    pub devices: ::prost::alloc::vec::Vec<get_devices_response::LinkedDevice>,
}
/// Nested message and enum types in `GetDevicesResponse`.
pub mod get_devices_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct LinkedDevice {
        /// The identifier for the device within an account.
        #[prost(uint32, tag = "1")]
        pub id: u32,
        /// A sequence of bytes that encodes an encrypted human-readable name for
        /// this device.
        #[prost(bytes = "vec", tag = "2")]
        pub name: ::prost::alloc::vec::Vec<u8>,
        /// The approximate time, in milliseconds since the epoch, at which this
        /// device last connected to the server.
        #[prost(uint64, tag = "3")]
        pub last_seen: u64,
        /// The registration ID of the given device.
        #[prost(uint32, tag = "4")]
        pub registration_id: u32,
        /// A sequence of bytes that encodes the time,
        /// in milliseconds since the epoch, at which this device was
        /// attached to its parent account.
        #[prost(bytes = "vec", tag = "5")]
        pub created_at_ciphertext: ::prost::alloc::vec::Vec<u8>,
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoveDeviceRequest {
    /// The identifier for the device to remove from the authenticated account. The
    /// identifier must not be for the primary device.
    #[prost(uint32, tag = "1")]
    pub id: u32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetDeviceNameRequest {
    /// A sequence of bytes that encodes an encrypted human-readable name for this
    /// device.
    #[prost(bytes = "vec", tag = "1")]
    pub name: ::prost::alloc::vec::Vec<u8>,
    /// The identifier for the device for which to set a name.
    #[prost(uint32, tag = "2")]
    pub id: u32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetDeviceNameResponse {
    #[prost(oneof = "set_device_name_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<set_device_name_response::Response>,
}
/// Nested message and enum types in `SetDeviceNameResponse`.
pub mod set_device_name_response {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        /// The device name was successfully set
        #[prost(message, tag = "1")]
        Success(::pbjson_types::Empty),
        /// No device with the provided identifier was found on the account
        #[prost(message, tag = "2")]
        TargetDeviceNotFound(super::super::errors::NotFound),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RemoveDeviceResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetPushTokenRequest {
    #[prost(oneof = "set_push_token_request::TokenRequest", tags = "1, 2")]
    pub token_request: ::core::option::Option<set_push_token_request::TokenRequest>,
}
/// Nested message and enum types in `SetPushTokenRequest`.
pub mod set_push_token_request {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct ApnsTokenRequest {
        /// A "standard" APNs device token.
        #[prost(string, tag = "1")]
        pub apns_token: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct FcmTokenRequest {
        /// An FCM push token.
        #[prost(string, tag = "1")]
        pub fcm_token: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum TokenRequest {
        /// If present, specifies the APNs device token(s) the server will use to
        /// send new message notifications to the authenticated device.
        #[prost(message, tag = "1")]
        ApnsTokenRequest(ApnsTokenRequest),
        /// If present, specifies the FCM push token the server will use to send new
        /// message notifications to the authenticated device.
        #[prost(message, tag = "2")]
        FcmTokenRequest(FcmTokenRequest),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetPushTokenResponse {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClearPushTokenRequest {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClearPushTokenResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetCapabilitiesRequest {
    #[prost(enumeration = "super::common::DeviceCapability", repeated, tag = "1")]
    pub capabilities: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetCapabilitiesResponse {}
/// Generated client implementations.
pub mod devices_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 working with devices attached to a Signal account.
    #[derive(Debug, Clone)]
    pub struct DevicesClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> DevicesClient<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,
        ) -> DevicesClient<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,
        {
            DevicesClient::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
        }
        /// Returns a list of devices associated with the caller's account.
        pub async fn get_devices(
            &mut self,
            request: impl tonic::IntoRequest<super::GetDevicesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetDevicesResponse>,
            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.device.Devices/GetDevices",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("org.signal.chat.device.Devices", "GetDevices"));
            self.inner.unary(req, path, codec).await
        }
        /// Removes a linked device from the caller's account.
        ///
        /// Linked devices may only remove themselves. Primary devices may remove
        /// any device other than themselves.
        pub async fn remove_device(
            &mut self,
            request: impl tonic::IntoRequest<super::RemoveDeviceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::RemoveDeviceResponse>,
            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.device.Devices/RemoveDevice",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.device.Devices", "RemoveDevice"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Sets the encrypted human-readable name for a specific devices. Primary
        /// devices may change the name of any device associated with their account,
        /// but linked devices may only change their own name. The response will
        /// indicate if the target device was not found.
        pub async fn set_device_name(
            &mut self,
            request: impl tonic::IntoRequest<super::SetDeviceNameRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SetDeviceNameResponse>,
            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.device.Devices/SetDeviceName",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.device.Devices", "SetDeviceName"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Sets the token(s) the server should use to send new message notifications
        /// to the authenticated device.
        pub async fn set_push_token(
            &mut self,
            request: impl tonic::IntoRequest<super::SetPushTokenRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SetPushTokenResponse>,
            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.device.Devices/SetPushToken",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.device.Devices", "SetPushToken"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Removes any push tokens associated with the authenticated device. After
        /// calling this method, the server will assume that the authenticated device
        /// will periodically poll for new messages.
        pub async fn clear_push_token(
            &mut self,
            request: impl tonic::IntoRequest<super::ClearPushTokenRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ClearPushTokenResponse>,
            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.device.Devices/ClearPushToken",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.device.Devices", "ClearPushToken"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Declares that the authenticated device supports certain features.
        pub async fn set_capabilities(
            &mut self,
            request: impl tonic::IntoRequest<super::SetCapabilitiesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SetCapabilitiesResponse>,
            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.device.Devices/SetCapabilities",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.device.Devices", "SetCapabilities"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
