// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetBackupIdRequest {
    /// A BackupAuthCredentialRequest containing a blinded encrypted backup-id,
    /// encoded in standard padded base64. This backup-id should be used for
    /// message backups only, and must have the message backup type set on the
    /// credential. If absent, the message credential request will not be updated.
    #[prost(bytes = "vec", tag = "1")]
    pub messages_backup_auth_credential_request: ::prost::alloc::vec::Vec<u8>,
    /// A BackupAuthCredentialRequest containing a blinded encrypted backup-id,
    /// encoded in standard padded base64. This backup-id should be used for
    /// media only, and must have the media type set on the credential. If absent,
    /// the media credential request will not be updated.
    #[prost(bytes = "vec", tag = "2")]
    pub media_backup_auth_credential_request: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetBackupIdResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RedeemReceiptRequest {
    /// Presentation for a previously acquired receipt, serialized with libsignal
    #[prost(bytes = "vec", tag = "1")]
    pub presentation: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RedeemReceiptResponse {
    #[prost(oneof = "redeem_receipt_response::Response", tags = "1, 2, 3")]
    pub response: ::core::option::Option<redeem_receipt_response::Response>,
}
/// Nested message and enum types in `RedeemReceiptResponse`.
pub mod redeem_receipt_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        /// The receipt was successfully redeemed
        #[prost(message, tag = "1")]
        Success(()),
        /// The target account does not have a backup-id commitment
        #[prost(message, tag = "2")]
        AccountMissingCommitment(super::super::errors::FailedPrecondition),
        /// The provided receipt presentation was malformed or expired
        #[prost(message, tag = "3")]
        InvalidReceipt(super::super::errors::FailedPrecondition),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetBackupAuthCredentialsRequest {
    /// The redemption time for the first credential. This must be a day-aligned
    /// seconds since epoch in UTC.
    #[prost(int64, tag = "1")]
    pub redemption_start: i64,
    /// The redemption time for the last credential. This must be a day-aligned
    /// seconds since epoch in UTC. The span between redemptionStart and
    /// redemptionEnd must not exceed 7 days.
    #[prost(int64, tag = "2")]
    pub redemption_stop: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBackupAuthCredentialsResponse {
    /// The requested credentials. If absent, there was no existing blinded
    /// backup id associated with the provided account.
    #[prost(message, optional, tag = "1")]
    pub credentials: ::core::option::Option<
        get_backup_auth_credentials_response::Credentials,
    >,
}
/// Nested message and enum types in `GetBackupAuthCredentialsResponse`.
pub mod get_backup_auth_credentials_response {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Credentials {
        /// The requested message backup ZkCredentials indexed by the start of their
        /// validity period. The smallest key should be for the requested
        /// redemption_start, the largest for the requested redemption_end.
        #[prost(map = "int64, message", tag = "1")]
        pub message_credentials: ::std::collections::HashMap<
            i64,
            super::super::common::ZkCredential,
        >,
        /// The requested media backup ZkCredentials indexed by the start of their
        /// validity period. The smallest key should be for the requested
        /// redemption_start, the largest for the requested redemption_end.
        #[prost(map = "int64, message", tag = "2")]
        pub media_credentials: ::std::collections::HashMap<
            i64,
            super::super::common::ZkCredential,
        >,
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SignedPresentation {
    /// Presentation of a BackupAuthCredential previously retrieved from
    /// GetBackupAuthCredentials on the authenticated channel
    #[prost(bytes = "vec", tag = "1")]
    pub presentation: ::prost::alloc::vec::Vec<u8>,
    /// The presentation signed with the private key corresponding to the public
    /// key set with SetPublicKey
    #[prost(bytes = "vec", tag = "2")]
    pub presentation_signature: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetPublicKeyRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
    /// The public key, serialized in libsignal's elliptic-curve public key format.
    #[prost(bytes = "vec", tag = "2")]
    pub public_key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetPublicKeyResponse {
    #[prost(oneof = "set_public_key_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<set_public_key_response::Response>,
}
/// Nested message and enum types in `SetPublicKeyResponse`.
pub mod set_public_key_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        /// The public key was successfully set
        #[prost(message, tag = "1")]
        Success(()),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        ///
        /// This may also be returned if there was an existing public key and the
        /// provided public key did not match.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetCdnCredentialsRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
    #[prost(uint32, tag = "2")]
    pub cdn: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetCdnCredentialsResponse {
    #[prost(oneof = "get_cdn_credentials_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<get_cdn_credentials_response::Response>,
}
/// Nested message and enum types in `GetCdnCredentialsResponse`.
pub mod get_cdn_credentials_response {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct CdnCredentials {
        #[prost(map = "string, string", tag = "1")]
        pub headers: ::std::collections::HashMap<
            ::prost::alloc::string::String,
            ::prost::alloc::string::String,
        >,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        /// Headers to include with requests to the read from the backup CDN. Includes
        /// time limited read-only credentials.
        #[prost(message, tag = "1")]
        CdnCredentials(CdnCredentials),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSvrBCredentialsRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSvrBCredentialsResponse {
    #[prost(oneof = "get_svr_b_credentials_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<get_svr_b_credentials_response::Response>,
}
/// Nested message and enum types in `GetSvrBCredentialsResponse`.
pub mod get_svr_b_credentials_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct SvrBCredentials {
        /// A username that can be presented to authenticate with SVRB
        #[prost(string, tag = "1")]
        pub username: ::prost::alloc::string::String,
        /// A password that can be presented to authenticate with SVRB
        #[prost(string, tag = "2")]
        pub password: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        SvrbCredentials(SvrBCredentials),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetBackupInfoRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMessageBackupInfoResponse {
    #[prost(oneof = "get_message_backup_info_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<get_message_backup_info_response::Response>,
}
/// Nested message and enum types in `GetMessageBackupInfoResponse`.
pub mod get_message_backup_info_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct MessageBackupInfo {
        /// The base directory of your backup data on the cdn. The message backup can
        /// be found in the returned cdn at /backup_dir/backup_name
        #[prost(string, tag = "1")]
        pub backup_dir: ::prost::alloc::string::String,
        /// The CDN type where the message backup is stored. Media may be stored
        /// elsewhere.
        #[prost(uint32, tag = "2")]
        pub cdn: u32,
        /// The location of the message backup on the cdn. If a backup was previously
        /// uploaded and unexpired, it can be found at /backup_dir/backup_name.
        #[prost(string, tag = "3")]
        pub backup_name: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        BackupInfo(MessageBackupInfo),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMediaBackupInfoResponse {
    #[prost(oneof = "get_media_backup_info_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<get_media_backup_info_response::Response>,
}
/// Nested message and enum types in `GetMediaBackupInfoResponse`.
pub mod get_media_backup_info_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct MediaBackupInfo {
        /// The base directory of your backup data on the cdn.
        #[prost(string, tag = "1")]
        pub backup_dir: ::prost::alloc::string::String,
        /// The prefix path component for media objects on a cdn. Stored media for a
        /// media_id can be found at /backup_dir/media_dir/media_id, where the media_id
        /// is encoded in unpadded url-safe base64.
        #[prost(string, tag = "2")]
        pub media_dir: ::prost::alloc::string::String,
        /// The amount of space used to store media
        #[prost(uint64, tag = "3")]
        pub used_space: u64,
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        BackupInfo(MediaBackupInfo),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RefreshRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RefreshResponse {
    #[prost(oneof = "refresh_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<refresh_response::Response>,
}
/// Nested message and enum types in `RefreshResponse`.
pub mod refresh_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        /// The backup was successfully refreshed
        #[prost(message, tag = "1")]
        Success(()),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetUploadFormRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
    /// 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 = "4")]
    pub upload_length: u64,
    #[prost(oneof = "get_upload_form_request::UploadType", tags = "2, 3")]
    pub upload_type: ::core::option::Option<get_upload_form_request::UploadType>,
}
/// Nested message and enum types in `GetUploadFormRequest`.
pub mod get_upload_form_request {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct MessagesUploadType {}
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct MediaUploadType {}
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum UploadType {
        /// Retrieve an upload form that can be used to perform a resumable upload of
        /// a message backup. The finished upload will be available on the backup cdn.
        #[prost(message, tag = "2")]
        Messages(MessagesUploadType),
        /// Retrieve an upload form for a temporary location that can be used to
        /// perform a resumable upload of an attachment. After uploading, the
        /// attachment can be copied into the backup via CopyMedia.
        ///
        /// Behaves identically to the account authenticated version at /attachments.
        #[prost(message, tag = "3")]
        Media(MediaUploadType),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetUploadFormResponse {
    #[prost(oneof = "get_upload_form_response::Response", tags = "1, 2, 3")]
    pub response: ::core::option::Option<get_upload_form_response::Response>,
}
/// Nested message and enum types in `GetUploadFormResponse`.
pub mod get_upload_form_response {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        UploadForm(super::super::common::UploadForm),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
        /// 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 = "3")]
        ExceedsMaxUploadLength(super::super::errors::FailedPrecondition),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CopyMediaItem {
    /// The attachment cdn of the object to copy into the backup
    #[prost(uint32, tag = "1")]
    pub source_attachment_cdn: u32,
    /// The attachment key of the object to copy into the backup
    #[prost(string, tag = "2")]
    pub source_key: ::prost::alloc::string::String,
    /// The length of the source attachment before the encryption applied by the
    /// copy operation
    #[prost(uint32, tag = "3")]
    pub object_length: u32,
    /// media_id to copy on to the backup CDN
    #[prost(bytes = "vec", tag = "4")]
    pub media_id: ::prost::alloc::vec::Vec<u8>,
    /// A 32-byte key for the MAC
    #[prost(bytes = "vec", tag = "5")]
    pub hmac_key: ::prost::alloc::vec::Vec<u8>,
    /// A 32-byte encryption key for AES
    #[prost(bytes = "vec", tag = "6")]
    pub encryption_key: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CopyMediaRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
    /// Items to copy
    #[prost(message, repeated, tag = "2")]
    pub items: ::prost::alloc::vec::Vec<CopyMediaItem>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CopyMediaResponse {
    /// The 15-byte media_id from the corresponding CopyMediaItem in the request
    #[prost(bytes = "vec", tag = "1")]
    pub media_id: ::prost::alloc::vec::Vec<u8>,
    #[prost(oneof = "copy_media_response::Response", tags = "2, 3, 4, 5, 6")]
    pub response: ::core::option::Option<copy_media_response::Response>,
}
/// Nested message and enum types in `CopyMediaResponse`.
pub mod copy_media_response {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct SourceNotFound {}
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct WrongSourceLength {}
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct OutOfSpace {}
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct CopySuccess {
        /// The backup cdn where this media object is stored
        #[prost(uint32, tag = "1")]
        pub cdn: u32,
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        /// The media item was successfully copied into the backup
        #[prost(message, tag = "2")]
        Success(CopySuccess),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "3")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
        /// The source object was not found
        #[prost(message, tag = "4")]
        SourceNotFound(SourceNotFound),
        /// The provided object length was incorrect
        #[prost(message, tag = "5")]
        WrongSourceLength(WrongSourceLength),
        /// All media capacity has been consumed. Free some space to continue.
        #[prost(message, tag = "6")]
        OutOfSpace(OutOfSpace),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListMediaRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
    /// A cursor returned by a previous call to ListMedia, absent on the first call
    #[prost(string, optional, tag = "2")]
    pub cursor: ::core::option::Option<::prost::alloc::string::String>,
    /// If provided, the maximum number of entries to return in a page
    #[prost(uint32, tag = "3")]
    pub limit: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMediaResponse {
    #[prost(oneof = "list_media_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<list_media_response::Response>,
}
/// Nested message and enum types in `ListMediaResponse`.
pub mod list_media_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct ListEntry {
        /// The backup cdn where this media object is stored
        #[prost(uint32, tag = "1")]
        pub cdn: u32,
        /// The media_id of the object
        #[prost(bytes = "vec", tag = "2")]
        pub media_id: ::prost::alloc::vec::Vec<u8>,
        /// The length of the object in bytes
        #[prost(uint64, tag = "3")]
        pub length: u64,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ListResult {
        /// A page of media objects stored for this backup ID
        #[prost(message, repeated, tag = "1")]
        pub page: ::prost::alloc::vec::Vec<ListEntry>,
        /// The base directory of the backup data on the cdn. The stored media can be
        /// found at /backup_dir/media_dir/media_id, where the media_id is encoded with
        /// unpadded url-safe base64.
        #[prost(string, tag = "2")]
        pub backup_dir: ::prost::alloc::string::String,
        /// The prefix path component for the media objects. The stored media for
        /// media_id can be found at /backup_dir/media_dir/media_id, where the media_id
        /// is encoded with unpadded url-safe base64.
        #[prost(string, tag = "3")]
        pub media_dir: ::prost::alloc::string::String,
        /// If set, the cursor value to pass to the next list request to continue
        /// listing. If absent, all objects have been listed
        #[prost(string, optional, tag = "4")]
        pub cursor: ::core::option::Option<::prost::alloc::string::String>,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        ListResult(ListResult),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteAllRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteAllResponse {
    #[prost(oneof = "delete_all_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<delete_all_response::Response>,
}
/// Nested message and enum types in `DeleteAllResponse`.
pub mod delete_all_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        /// The backup was successfully scheduled for deletion
        #[prost(message, tag = "1")]
        Success(()),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteMediaItem {
    /// The backup cdn where this media object is stored
    #[prost(uint32, tag = "1")]
    pub cdn: u32,
    /// The media_id of the object to delete
    #[prost(bytes = "vec", tag = "2")]
    pub media_id: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteMediaRequest {
    #[prost(message, optional, tag = "1")]
    pub signed_presentation: ::core::option::Option<SignedPresentation>,
    #[prost(message, repeated, tag = "2")]
    pub items: ::prost::alloc::vec::Vec<DeleteMediaItem>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteMediaResponse {
    #[prost(oneof = "delete_media_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<delete_media_response::Response>,
}
/// Nested message and enum types in `DeleteMediaResponse`.
pub mod delete_media_response {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        DeletedItem(super::DeleteMediaItem),
        /// The provided backup auth credential presentation could not be
        /// authenticated. Either, the presentation could not be verified, or
        /// the public key signature was invalid, or there is no backup associated
        /// with the backup-id in the presentation.
        #[prost(message, tag = "2")]
        FailedAuthentication(super::super::errors::FailedZkAuthentication),
    }
}
/// Generated client implementations.
pub mod backups_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for backup operations that require account authentication.
    ///
    /// Most actual backup operations operate on the backup-id and cannot be linked
    /// to the caller's account, but setting up anonymous credentials and changing
    /// backup tier requires account authentication.
    #[derive(Debug, Clone)]
    pub struct BackupsClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> BackupsClient<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,
        ) -> BackupsClient<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,
        {
            BackupsClient::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
        }
        /// Set (blinded) backup-id(s) for the account.
        ///
        /// Each account may have a single active backup-id for each credential type
        /// that can be used to store and retrieve backups. Once the backup-id is set,
        /// BackupAuthCredentials can be generated using GetBackupAuthCredentials.
        ///
        /// The blinded backup-id and the key-pair used to blind it must be derived
        /// from a recoverable secret.
        ///
        /// At least one of the credential types must be set on the request.
        /// Only the primary device can set a blinded backup-id.
        pub async fn set_backup_id(
            &mut self,
            request: impl tonic::IntoRequest<super::SetBackupIdRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SetBackupIdResponse>,
            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.backup.Backups/SetBackupId",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.backup.Backups", "SetBackupId"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Redeem a receipt acquired from /v1/subscription/{subscriberId}/receipt_credentials
        /// to mark the account as eligible for the paid backup tier.
        ///
        /// After successful redemption, subsequent requests to
        /// GetBackupAuthCredentials will return credentials with the level on the
        /// provided receipt until the expiration time on the receipt.
        pub async fn redeem_receipt(
            &mut self,
            request: impl tonic::IntoRequest<super::RedeemReceiptRequest>,
        ) -> std::result::Result<
            tonic::Response<super::RedeemReceiptResponse>,
            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.backup.Backups/RedeemReceipt",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.backup.Backups", "RedeemReceipt"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// After setting a blinded backup-id with PUT /v1/archives/, this fetches
        /// credentials that can be used to perform operations against that backup-id.
        /// Clients may (and should) request up to 7 days of credentials at a time.
        ///
        /// The redemption_start and redemption_end seconds must be UTC day aligned, and
        /// must not span more than 7 days.
        ///
        /// Each credential contains a receipt level which indicates the backup level
        /// the credential is good for. If the account has paid backup access that
        /// expires at some point in the provided redemption window, credentials with
        /// redemption times after the expiration may be on a lower backup level.
        ///
        /// Clients must validate the receipt level on the credential matches a known
        /// receipt level before using it.
        pub async fn get_backup_auth_credentials(
            &mut self,
            request: impl tonic::IntoRequest<super::GetBackupAuthCredentialsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetBackupAuthCredentialsResponse>,
            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.backup.Backups/GetBackupAuthCredentials",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.Backups",
                        "GetBackupAuthCredentials",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated client implementations.
pub mod backups_anonymous_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service for backup operations with anonymous credentials
    ///
    /// This service never requires account authentication. It instead requires a
    /// backup-id authenticated with an anonymous credential that cannot be linked
    /// to the account.
    ///
    /// To register an anonymous credential:
    ///   1. Set a backup-id on the authenticated channel via Backups::SetBackupId
    ///   2. Retrieve BackupAuthCredentials via Backups::GetBackupAuthCredentials
    ///   3. Generate a key pair and set the public key via
    ///      BackupsAnonymous::SetPublicKey
    ///
    /// Unless otherwise noted, requests for this service require a
    /// SignedPresentation, which includes:
    ///   - a presentation generated from a BackupAuthCredential issued by
    ///     GetBackupAuthCredentials
    ///   - a signature of that presentation using the private key of a key pair
    ///     previously set with SetPublicKey.
    #[derive(Debug, Clone)]
    pub struct BackupsAnonymousClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> BackupsAnonymousClient<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,
        ) -> BackupsAnonymousClient<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,
        {
            BackupsAnonymousClient::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 credentials used to read objects stored on the backup cdn
        pub async fn get_cdn_credentials(
            &mut self,
            request: impl tonic::IntoRequest<super::GetCdnCredentialsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetCdnCredentialsResponse>,
            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.backup.BackupsAnonymous/GetCdnCredentials",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "GetCdnCredentials",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieve credentials used to interact with the SecureValueRecoveryB service
        pub async fn get_svr_b_credentials(
            &mut self,
            request: impl tonic::IntoRequest<super::GetSvrBCredentialsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetSvrBCredentialsResponse>,
            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.backup.BackupsAnonymous/GetSvrBCredentials",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "GetSvrBCredentials",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieve information about the currently stored message backup
        pub async fn get_message_backup_info(
            &mut self,
            request: impl tonic::IntoRequest<super::GetBackupInfoRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetMessageBackupInfoResponse>,
            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.backup.BackupsAnonymous/GetMessageBackupInfo",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "GetMessageBackupInfo",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieve information about the currently stored media backup
        pub async fn get_media_backup_info(
            &mut self,
            request: impl tonic::IntoRequest<super::GetBackupInfoRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetMediaBackupInfoResponse>,
            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.backup.BackupsAnonymous/GetMediaBackupInfo",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "GetMediaBackupInfo",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Permanently set the public key of an ED25519 key-pair for the backup-id.
        /// All requests (including this one!) must sign their BackupAuthCredential
        /// presentations with the private key corresponding to the provided public key.
        pub async fn set_public_key(
            &mut self,
            request: impl tonic::IntoRequest<super::SetPublicKeyRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SetPublicKeyResponse>,
            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.backup.BackupsAnonymous/SetPublicKey",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "SetPublicKey",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Refresh the backup, indicating that the backup is still active. Clients
        /// must periodically upload new backups or perform a refresh. If a backup has
        /// not been active for 30 days, it may be deleted.
        pub async fn refresh(
            &mut self,
            request: impl tonic::IntoRequest<super::RefreshRequest>,
        ) -> std::result::Result<
            tonic::Response<super::RefreshResponse>,
            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.backup.BackupsAnonymous/Refresh",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("org.signal.chat.backup.BackupsAnonymous", "Refresh"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// 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.backup.BackupsAnonymous/GetUploadForm",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "GetUploadForm",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Copy and re-encrypt media from the attachments cdn into the backup cdn.
        /// The original, already encrypted, attachments will be encrypted with the
        /// provided key material before being copied.
        ///
        /// The copy operation is not atomic and responses will be returned as copy
        /// operations complete with detailed information about the outcome. If an
        /// error is encountered, not all requests may be reflected in the responses.
        ///
        /// On retries, a particular destination media id must not be reused with a
        /// different source media id or different encryption parameters.
        pub async fn copy_media(
            &mut self,
            request: impl tonic::IntoRequest<super::CopyMediaRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::CopyMediaResponse>>,
            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.backup.BackupsAnonymous/CopyMedia",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "CopyMedia",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// Retrieve a page of media objects stored for this backup-id. A client may
        /// have previously stored media objects that are no longer referenced in their
        /// current backup. To reclaim storage space used by these orphaned objects,
        /// perform a list operation and remove any unreferenced media objects
        /// via DeleteMedia.
        pub async fn list_media(
            &mut self,
            request: impl tonic::IntoRequest<super::ListMediaRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListMediaResponse>,
            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.backup.BackupsAnonymous/ListMedia",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "ListMedia",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Delete media objects stored with this backup-id. Streams the locations of
        /// media items back when the item has successfully been removed.
        pub async fn delete_media(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteMediaRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::DeleteMediaResponse>>,
            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.backup.BackupsAnonymous/DeleteMedia",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "DeleteMedia",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        /// Delete all backup metadata, objects, and stored public key. To use
        /// backups again, a public key must be resupplied.
        pub async fn delete_all(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteAllRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DeleteAllResponse>,
            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.backup.BackupsAnonymous/DeleteAll",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "org.signal.chat.backup.BackupsAnonymous",
                        "DeleteAll",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
