#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BucketRef {
#[prost(string, tag = "1")]
pub bucket_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SnapshotRef {
#[prost(string, tag = "1")]
pub snapshot_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub source_bucket_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadTarget {
#[prost(oneof = "read_target::Target", tags = "1, 2")]
pub target: ::core::option::Option<read_target::Target>,
}
pub mod read_target {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Target {
#[prost(message, tag = "1")]
Bucket(super::BucketRef),
#[prost(message, tag = "2")]
Snapshot(super::SnapshotRef),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectMetadata {
#[prost(string, tag = "1")]
pub content_type: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "2")]
pub user: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub content_encoding: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub cache_control: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub content_disposition: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub content_language: ::prost::alloc::string::String,
#[prost(int64, optional, tag = "7")]
pub expires_unix_seconds: ::core::option::Option<i64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Preconditions {
#[prost(oneof = "preconditions::Condition", tags = "1, 2, 3")]
pub condition: ::core::option::Option<preconditions::Condition>,
}
pub mod preconditions {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Condition {
#[prost(bool, tag = "1")]
IfAbsent(bool),
#[prost(string, tag = "2")]
IfMatch(::prost::alloc::string::String),
#[prost(string, tag = "3")]
IfVersion(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MutationIdentity {
#[prost(string, tag = "1")]
pub idempotency_key: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Bucket {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(message, optional, tag = "2")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateBucketRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HeadBucketRequest {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteBucketRequest {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(message, optional, tag = "2")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteBucketResponse {
#[prost(bool, tag = "1")]
pub existed: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutObjectHeader {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub metadata: ::core::option::Option<ObjectMetadata>,
#[prost(message, optional, tag = "4")]
pub preconditions: ::core::option::Option<Preconditions>,
#[prost(message, optional, tag = "5")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutObjectRequest {
#[prost(oneof = "put_object_request::Frame", tags = "1, 2")]
pub frame: ::core::option::Option<put_object_request::Frame>,
}
pub mod put_object_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Frame {
#[prost(message, tag = "1")]
Header(super::PutObjectHeader),
#[prost(bytes, tag = "2")]
Body(::prost::alloc::vec::Vec<u8>),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectVersion {
#[prost(string, tag = "1")]
pub version_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub etag: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub size: u64,
#[prost(bool, tag = "4")]
pub delete_marker: bool,
#[prost(message, optional, tag = "5")]
pub metadata: ::core::option::Option<ObjectMetadata>,
#[prost(message, optional, tag = "6")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetObjectRequest {
#[prost(message, optional, tag = "1")]
pub target: ::core::option::Option<ReadTarget>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub version_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "4")]
pub range_start: u64,
#[prost(uint64, optional, tag = "5")]
pub range_end_inclusive: ::core::option::Option<u64>,
#[prost(string, tag = "6")]
pub if_match: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub if_none_match: ::prost::alloc::string::String,
#[prost(bool, tag = "8")]
pub range_requested: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetObjectResponse {
#[prost(oneof = "get_object_response::Frame", tags = "1, 2")]
pub frame: ::core::option::Option<get_object_response::Frame>,
}
pub mod get_object_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Frame {
#[prost(message, tag = "1")]
Version(super::ObjectVersion),
#[prost(bytes, tag = "2")]
Body(::prost::alloc::vec::Vec<u8>),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HeadObjectRequest {
#[prost(message, optional, tag = "1")]
pub target: ::core::option::Option<ReadTarget>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub version_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub if_match: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub if_none_match: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeadObjectResponse {
#[prost(message, optional, tag = "1")]
pub version: ::core::option::Option<ObjectVersion>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteObjectRequest {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub version_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub preconditions: ::core::option::Option<Preconditions>,
#[prost(message, optional, tag = "5")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteObjectResponse {
#[prost(bool, tag = "1")]
pub existed: bool,
#[prost(message, optional, tag = "2")]
pub version: ::core::option::Option<ObjectVersion>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListObjectsRequest {
#[prost(message, optional, tag = "1")]
pub target: ::core::option::Option<ReadTarget>,
#[prost(string, tag = "2")]
pub prefix: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub delimiter: ::prost::alloc::string::String,
#[prost(enumeration = "ListingMode", tag = "4")]
pub mode: i32,
#[prost(uint32, tag = "5")]
pub page_size: u32,
#[prost(string, tag = "6")]
pub continuation_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEntry {
#[prost(string, tag = "1")]
pub object_key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub version: ::core::option::Option<ObjectVersion>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListObjectsResponse {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<ListEntry>,
#[prost(string, repeated, tag = "2")]
pub common_prefixes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub continuation_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateMultipartRequest {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub metadata: ::core::option::Option<ObjectMetadata>,
#[prost(message, optional, tag = "4")]
pub preconditions: ::core::option::Option<Preconditions>,
#[prost(message, optional, tag = "5")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MultipartUpload {
#[prost(string, tag = "1")]
pub upload_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPartHeader {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub upload_id: ::prost::alloc::string::String,
#[prost(uint32, tag = "4")]
pub part_number: u32,
#[prost(message, optional, tag = "5")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPartRequest {
#[prost(oneof = "upload_part_request::Frame", tags = "1, 2")]
pub frame: ::core::option::Option<upload_part_request::Frame>,
}
pub mod upload_part_request {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Frame {
#[prost(message, tag = "1")]
Header(super::UploadPartHeader),
#[prost(bytes, tag = "2")]
Body(::prost::alloc::vec::Vec<u8>),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadedPart {
#[prost(uint32, tag = "1")]
pub part_number: u32,
#[prost(string, tag = "2")]
pub etag: ::prost::alloc::string::String,
#[prost(uint64, tag = "3")]
pub size: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListPartsRequest {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub upload_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPartsResponse {
#[prost(message, repeated, tag = "1")]
pub parts: ::prost::alloc::vec::Vec<UploadedPart>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompleteMultipartRequest {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub upload_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub parts: ::prost::alloc::vec::Vec<UploadedPart>,
#[prost(message, optional, tag = "5")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AbortMultipartRequest {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(string, tag = "2")]
pub object_key: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub upload_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AbortMultipartResponse {
#[prost(bool, tag = "1")]
pub existed: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Snapshot {
#[prost(message, optional, tag = "1")]
pub snapshot: ::core::option::Option<SnapshotRef>,
#[prost(message, optional, tag = "2")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateSnapshotRequest {
#[prost(message, optional, tag = "1")]
pub bucket: ::core::option::Option<BucketRef>,
#[prost(message, optional, tag = "2")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DestroySnapshotRequest {
#[prost(message, optional, tag = "1")]
pub snapshot: ::core::option::Option<SnapshotRef>,
#[prost(message, optional, tag = "2")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DestroySnapshotResponse {
#[prost(bool, tag = "1")]
pub existed: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ForkSnapshotRequest {
#[prost(message, optional, tag = "1")]
pub snapshot: ::core::option::Option<SnapshotRef>,
#[prost(string, tag = "2")]
pub destination_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ForkBucketRequest {
#[prost(message, optional, tag = "1")]
pub source: ::core::option::Option<BucketRef>,
#[prost(string, tag = "2")]
pub destination_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub mutation: ::core::option::Option<MutationIdentity>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ErrorDetail {
#[prost(enumeration = "ErrorCode", tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub request_id: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ListingMode {
Unspecified = 0,
Current = 1,
Versions = 2,
}
impl ListingMode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "LISTING_MODE_UNSPECIFIED",
Self::Current => "LISTING_MODE_CURRENT",
Self::Versions => "LISTING_MODE_VERSIONS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LISTING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"LISTING_MODE_CURRENT" => Some(Self::Current),
"LISTING_MODE_VERSIONS" => Some(Self::Versions),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorCode {
Unspecified = 0,
InvalidArgument = 1,
NotFound = 2,
AlreadyExists = 3,
PreconditionFailed = 4,
IdempotencyMismatch = 5,
TokenExpired = 6,
QuotaExceeded = 7,
Unsupported = 8,
Unavailable = 9,
}
impl ErrorCode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "ERROR_CODE_UNSPECIFIED",
Self::InvalidArgument => "ERROR_CODE_INVALID_ARGUMENT",
Self::NotFound => "ERROR_CODE_NOT_FOUND",
Self::AlreadyExists => "ERROR_CODE_ALREADY_EXISTS",
Self::PreconditionFailed => "ERROR_CODE_PRECONDITION_FAILED",
Self::IdempotencyMismatch => "ERROR_CODE_IDEMPOTENCY_MISMATCH",
Self::TokenExpired => "ERROR_CODE_TOKEN_EXPIRED",
Self::QuotaExceeded => "ERROR_CODE_QUOTA_EXCEEDED",
Self::Unsupported => "ERROR_CODE_UNSUPPORTED",
Self::Unavailable => "ERROR_CODE_UNAVAILABLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ERROR_CODE_UNSPECIFIED" => Some(Self::Unspecified),
"ERROR_CODE_INVALID_ARGUMENT" => Some(Self::InvalidArgument),
"ERROR_CODE_NOT_FOUND" => Some(Self::NotFound),
"ERROR_CODE_ALREADY_EXISTS" => Some(Self::AlreadyExists),
"ERROR_CODE_PRECONDITION_FAILED" => Some(Self::PreconditionFailed),
"ERROR_CODE_IDEMPOTENCY_MISMATCH" => Some(Self::IdempotencyMismatch),
"ERROR_CODE_TOKEN_EXPIRED" => Some(Self::TokenExpired),
"ERROR_CODE_QUOTA_EXCEEDED" => Some(Self::QuotaExceeded),
"ERROR_CODE_UNSUPPORTED" => Some(Self::Unsupported),
"ERROR_CODE_UNAVAILABLE" => Some(Self::Unavailable),
_ => None,
}
}
}
#[cfg(feature = "grpc")]
include!("acyclic.objects.v1.tonic.rs");