// This file is @generated by prost-build.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUploadFormRequest {
    /// The length of the attachment for the requested upload form. Uploads
    /// performed with this form will be limited to the provided length.
    #[prost(uint64, tag = "1")]
    pub upload_length: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUploadFormResponse {
    #[prost(oneof = "get_upload_form_response::Outcome", tags = "1, 2")]
    pub outcome: ::core::option::Option<get_upload_form_response::Outcome>,
}
/// Nested message and enum types in `GetUploadFormResponse`.
pub mod get_upload_form_response {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Outcome {
        #[prost(message, tag = "1")]
        UploadForm(super::super::common::UploadForm),
        /// The request size was larger than the maximum supported upload size. The
        /// maximum upload size is subject to change and is governed by
        /// `global.attachments.maxBytes`
        #[prost(message, tag = "2")]
        ExceedsMaxUploadLength(super::super::errors::FailedPrecondition),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStickerUploadFormRequest {
    /// The number of stickers in the sticker pack to upload
    #[prost(uint32, tag = "1")]
    pub sticker_count: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetStickerUploadFormResponse {
    /// A randomly-generated ID for the new sticker pack
    #[prost(string, tag = "1")]
    pub pack_id: ::prost::alloc::string::String,
    /// An upload form clients must use to upload a manifest for the sticker pack
    #[prost(message, optional, tag = "2")]
    pub manifest_upload_form: ::core::option::Option<super::common::S3UploadForm>,
    /// Upload forms for individual stickers within the sticker pack
    #[prost(message, repeated, tag = "3")]
    pub sticker_upload_forms: ::prost::alloc::vec::Vec<super::common::S3UploadForm>,
}
/// Generated client implementations.
pub mod attachments_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct AttachmentsClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> AttachmentsClient<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,
        ) -> AttachmentsClient<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,
        {
            AttachmentsClient::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
        }
        /// Retrieve an upload form that can be used to perform a resumable upload
        pub async fn get_upload_form(
            &mut self,
            request: impl tonic::IntoRequest<super::GetUploadFormRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetUploadFormResponse>,
            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.attachments.Attachments/GetUploadForm",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.attachments.Attachments",
                        "GetUploadForm",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieve an upload form that can be used to upload a sticker pack
        pub async fn get_sticker_upload_form(
            &mut self,
            request: impl tonic::IntoRequest<super::GetStickerUploadFormRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetStickerUploadFormResponse>,
            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.attachments.Attachments/GetStickerUploadForm",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.attachments.Attachments",
                        "GetStickerUploadForm",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
