#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Attribution {
#[prost(message, optional, tag = "1")]
pub time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(string, tag = "2")]
pub user_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Drive {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "DriveState", tag = "4")]
pub state: i32,
#[prost(message, optional, tag = "5")]
pub created: ::core::option::Option<Attribution>,
#[prost(enumeration = "DriveKind", tag = "6")]
pub kind: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VirtualDrive {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub connection_details: ::core::option::Option<VirtualDriveConnectionDetails>,
#[prost(message, optional, tag = "3")]
pub status: ::core::option::Option<VirtualDriveStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VirtualDriveStatus {
#[prost(enumeration = "VirtualDriveState", tag = "1")]
pub state: i32,
#[prost(message, optional, tag = "2")]
pub last_successful_check_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VirtualDriveConnectionDetails {
#[prost(oneof = "virtual_drive_connection_details::Details", tags = "1")]
pub details: ::core::option::Option<virtual_drive_connection_details::Details>,
}
pub mod virtual_drive_connection_details {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Details {
#[prost(message, tag = "1")]
S3(super::S3VirtualDriveConnectionDetails),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct S3VirtualDriveConnectionDetails {
#[prost(string, tag = "1")]
pub bucket: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub prefix: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub credentials_secret_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogicalPath {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct File {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<LogicalPath>,
#[prost(enumeration = "FileState", tag = "2")]
pub state: i32,
#[prost(message, optional, tag = "4")]
pub created: ::core::option::Option<Attribution>,
#[prost(uint64, tag = "5")]
pub size_bytes: u64,
#[prost(message, optional, tag = "6")]
pub observed: ::core::option::Option<Attribution>,
#[prost(message, optional, tag = "7")]
pub source_ref: ::core::option::Option<FileSourceRef>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileSourceRef {
#[prost(oneof = "file_source_ref::Reference", tags = "1, 2")]
pub reference: ::core::option::Option<file_source_ref::Reference>,
}
pub mod file_source_ref {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Reference {
#[prost(message, tag = "1")]
Managed(super::ManagedFileSourceRef),
#[prost(message, tag = "2")]
S3(super::S3FileSourceRef),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ManagedFileSourceRef {
#[prost(string, tag = "1")]
pub file_revision_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub fingerprint: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct S3FileSourceRef {
#[prost(string, tag = "1")]
pub version_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub fingerprint: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub last_modified: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, tag = "4")]
pub path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileRevision {
#[prost(string, tag = "1")]
pub file_revision_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub file_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub path: ::core::option::Option<LogicalPath>,
#[prost(uint32, tag = "4")]
pub revision_number: u32,
#[prost(uint64, tag = "5")]
pub size_bytes: u64,
#[prost(message, optional, tag = "6")]
pub created: ::core::option::Option<Attribution>,
#[prost(message, optional, tag = "7")]
pub source_ref: ::core::option::Option<ManagedFileSourceRef>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Directory {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<LogicalPath>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileEntry {
#[prost(oneof = "file_entry::Entry", tags = "1, 2")]
pub entry: ::core::option::Option<file_entry::Entry>,
}
pub mod file_entry {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Entry {
#[prost(message, tag = "1")]
File(super::File),
#[prost(message, tag = "2")]
Directory(super::Directory),
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DriveState {
Unspecified = 0,
Active = 1,
Archived = 2,
}
impl DriveState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "DRIVE_STATE_UNSPECIFIED",
Self::Active => "DRIVE_STATE_ACTIVE",
Self::Archived => "DRIVE_STATE_ARCHIVED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DRIVE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"DRIVE_STATE_ACTIVE" => Some(Self::Active),
"DRIVE_STATE_ARCHIVED" => Some(Self::Archived),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DriveKind {
Unspecified = 0,
Managed = 1,
Virtual = 2,
}
impl DriveKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "DRIVE_KIND_UNSPECIFIED",
Self::Managed => "DRIVE_KIND_MANAGED",
Self::Virtual => "DRIVE_KIND_VIRTUAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DRIVE_KIND_UNSPECIFIED" => Some(Self::Unspecified),
"DRIVE_KIND_MANAGED" => Some(Self::Managed),
"DRIVE_KIND_VIRTUAL" => Some(Self::Virtual),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VirtualDriveState {
Unspecified = 0,
Active = 1,
AuthError = 2,
Unreachable = 3,
InvalidConfiguration = 4,
}
impl VirtualDriveState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "VIRTUAL_DRIVE_STATE_UNSPECIFIED",
Self::Active => "VIRTUAL_DRIVE_STATE_ACTIVE",
Self::AuthError => "VIRTUAL_DRIVE_STATE_AUTH_ERROR",
Self::Unreachable => "VIRTUAL_DRIVE_STATE_UNREACHABLE",
Self::InvalidConfiguration => "VIRTUAL_DRIVE_STATE_INVALID_CONFIGURATION",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VIRTUAL_DRIVE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"VIRTUAL_DRIVE_STATE_ACTIVE" => Some(Self::Active),
"VIRTUAL_DRIVE_STATE_AUTH_ERROR" => Some(Self::AuthError),
"VIRTUAL_DRIVE_STATE_UNREACHABLE" => Some(Self::Unreachable),
"VIRTUAL_DRIVE_STATE_INVALID_CONFIGURATION" => {
Some(Self::InvalidConfiguration)
}
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FileState {
Unspecified = 0,
Active = 1,
Removed = 2,
}
impl FileState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "FILE_STATE_UNSPECIFIED",
Self::Active => "FILE_STATE_ACTIVE",
Self::Removed => "FILE_STATE_REMOVED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FILE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"FILE_STATE_ACTIVE" => Some(Self::Active),
"FILE_STATE_REMOVED" => Some(Self::Removed),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FileStoreError {
Unspecified = 0,
DriveNotFound = 1,
FileNotFound = 2,
FileRevisionNotFound = 3,
PathAlreadyExists = 4,
InvalidLogicalPath = 5,
PermissionDenied = 6,
RevisionPreconditionFailed = 7,
VirtualDriveNotFound = 8,
InvalidVirtualDriveConfiguration = 9,
ReadOnlyDrive = 10,
FileHistoryNotAvailable = 11,
UpstreamUnavailable = 12,
}
impl FileStoreError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "FILE_STORE_ERROR_UNSPECIFIED",
Self::DriveNotFound => "FILE_STORE_ERROR_DRIVE_NOT_FOUND",
Self::FileNotFound => "FILE_STORE_ERROR_FILE_NOT_FOUND",
Self::FileRevisionNotFound => "FILE_STORE_ERROR_FILE_REVISION_NOT_FOUND",
Self::PathAlreadyExists => "FILE_STORE_ERROR_PATH_ALREADY_EXISTS",
Self::InvalidLogicalPath => "FILE_STORE_ERROR_INVALID_LOGICAL_PATH",
Self::PermissionDenied => "FILE_STORE_ERROR_PERMISSION_DENIED",
Self::RevisionPreconditionFailed => {
"FILE_STORE_ERROR_REVISION_PRECONDITION_FAILED"
}
Self::VirtualDriveNotFound => "FILE_STORE_ERROR_VIRTUAL_DRIVE_NOT_FOUND",
Self::InvalidVirtualDriveConfiguration => {
"FILE_STORE_ERROR_INVALID_VIRTUAL_DRIVE_CONFIGURATION"
}
Self::ReadOnlyDrive => "FILE_STORE_ERROR_READ_ONLY_DRIVE",
Self::FileHistoryNotAvailable => {
"FILE_STORE_ERROR_FILE_HISTORY_NOT_AVAILABLE"
}
Self::UpstreamUnavailable => "FILE_STORE_ERROR_UPSTREAM_UNAVAILABLE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FILE_STORE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
"FILE_STORE_ERROR_DRIVE_NOT_FOUND" => Some(Self::DriveNotFound),
"FILE_STORE_ERROR_FILE_NOT_FOUND" => Some(Self::FileNotFound),
"FILE_STORE_ERROR_FILE_REVISION_NOT_FOUND" => {
Some(Self::FileRevisionNotFound)
}
"FILE_STORE_ERROR_PATH_ALREADY_EXISTS" => Some(Self::PathAlreadyExists),
"FILE_STORE_ERROR_INVALID_LOGICAL_PATH" => Some(Self::InvalidLogicalPath),
"FILE_STORE_ERROR_PERMISSION_DENIED" => Some(Self::PermissionDenied),
"FILE_STORE_ERROR_REVISION_PRECONDITION_FAILED" => {
Some(Self::RevisionPreconditionFailed)
}
"FILE_STORE_ERROR_VIRTUAL_DRIVE_NOT_FOUND" => {
Some(Self::VirtualDriveNotFound)
}
"FILE_STORE_ERROR_INVALID_VIRTUAL_DRIVE_CONFIGURATION" => {
Some(Self::InvalidVirtualDriveConfiguration)
}
"FILE_STORE_ERROR_READ_ONLY_DRIVE" => Some(Self::ReadOnlyDrive),
"FILE_STORE_ERROR_FILE_HISTORY_NOT_AVAILABLE" => {
Some(Self::FileHistoryNotAvailable)
}
"FILE_STORE_ERROR_UPSTREAM_UNAVAILABLE" => Some(Self::UpstreamUnavailable),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateDriveRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateDriveResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateVirtualDriveRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub connection_details: ::core::option::Option<VirtualDriveConnectionDetails>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateVirtualDriveResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
#[prost(message, optional, tag = "2")]
pub virtual_drive: ::core::option::Option<VirtualDrive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDriveRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDriveResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVirtualDriveRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVirtualDriveResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
#[prost(message, optional, tag = "2")]
pub virtual_drive: ::core::option::Option<VirtualDrive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDriveByNameRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDriveByNameResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVirtualDriveByNameRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVirtualDriveByNameResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
#[prost(message, optional, tag = "2")]
pub virtual_drive: ::core::option::Option<VirtualDrive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDrivesRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub include_archived: bool,
#[prost(int32, optional, tag = "3")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "4")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDrivesResponse {
#[prost(message, repeated, tag = "1")]
pub drives: ::prost::alloc::vec::Vec<Drive>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateVirtualDriveRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub connection_details: ::core::option::Option<VirtualDriveConnectionDetails>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateVirtualDriveResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
#[prost(message, optional, tag = "2")]
pub virtual_drive: ::core::option::Option<VirtualDrive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RenameDriveRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RenameDriveResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArchiveDriveRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArchiveDriveResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnarchiveDriveRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnarchiveDriveResponse {
#[prost(message, optional, tag = "1")]
pub drive: ::core::option::Option<Drive>,
}
pub mod internal_drives_service_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 InternalDrivesServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InternalDrivesServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> InternalDrivesServiceClient<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,
) -> InternalDrivesServiceClient<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,
{
InternalDrivesServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_drive(
&mut self,
request: impl tonic::IntoRequest<super::CreateDriveRequest>,
) -> std::result::Result<
tonic::Response<super::CreateDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/CreateDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"CreateDrive",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_virtual_drive(
&mut self,
request: impl tonic::IntoRequest<super::CreateVirtualDriveRequest>,
) -> std::result::Result<
tonic::Response<super::CreateVirtualDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/CreateVirtualDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"CreateVirtualDrive",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_drive(
&mut self,
request: impl tonic::IntoRequest<super::GetDriveRequest>,
) -> std::result::Result<
tonic::Response<super::GetDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/GetDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"GetDrive",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_virtual_drive(
&mut self,
request: impl tonic::IntoRequest<super::GetVirtualDriveRequest>,
) -> std::result::Result<
tonic::Response<super::GetVirtualDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/GetVirtualDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"GetVirtualDrive",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_drive_by_name(
&mut self,
request: impl tonic::IntoRequest<super::GetDriveByNameRequest>,
) -> std::result::Result<
tonic::Response<super::GetDriveByNameResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/GetDriveByName",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"GetDriveByName",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_virtual_drive_by_name(
&mut self,
request: impl tonic::IntoRequest<super::GetVirtualDriveByNameRequest>,
) -> std::result::Result<
tonic::Response<super::GetVirtualDriveByNameResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/GetVirtualDriveByName",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"GetVirtualDriveByName",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_drives(
&mut self,
request: impl tonic::IntoRequest<super::ListDrivesRequest>,
) -> std::result::Result<
tonic::Response<super::ListDrivesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/ListDrives",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"ListDrives",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_virtual_drive(
&mut self,
request: impl tonic::IntoRequest<super::UpdateVirtualDriveRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateVirtualDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/UpdateVirtualDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"UpdateVirtualDrive",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn rename_drive(
&mut self,
request: impl tonic::IntoRequest<super::RenameDriveRequest>,
) -> std::result::Result<
tonic::Response<super::RenameDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/RenameDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"RenameDrive",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn archive_drive(
&mut self,
request: impl tonic::IntoRequest<super::ArchiveDriveRequest>,
) -> std::result::Result<
tonic::Response<super::ArchiveDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/ArchiveDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"ArchiveDrive",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn unarchive_drive(
&mut self,
request: impl tonic::IntoRequest<super::UnarchiveDriveRequest>,
) -> std::result::Result<
tonic::Response<super::UnarchiveDriveResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalDrivesService/UnarchiveDrive",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalDrivesService",
"UnarchiveDrive",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadedObjectRef {
#[prost(string, tag = "1")]
pub s3_path: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutFile {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<LogicalPath>,
#[prost(message, optional, tag = "2")]
pub object: ::core::option::Option<UploadedObjectRef>,
#[prost(uint64, tag = "3")]
pub size_bytes: u64,
#[prost(enumeration = "FileConflictPolicy", tag = "4")]
pub conflict_policy: i32,
#[prost(string, tag = "5")]
pub expected_revision_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveFile {
#[prost(message, optional, tag = "1")]
pub source_path: ::core::option::Option<LogicalPath>,
#[prost(message, optional, tag = "2")]
pub destination_path: ::core::option::Option<LogicalPath>,
#[prost(enumeration = "FileConflictPolicy", tag = "3")]
pub conflict_policy: i32,
#[prost(string, tag = "4")]
pub expected_source_revision_rid: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub expected_destination_revision_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemoveFile {
#[prost(message, optional, tag = "1")]
pub path: ::core::option::Option<LogicalPath>,
#[prost(string, tag = "2")]
pub expected_revision_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreFile {
#[prost(string, tag = "1")]
pub file_revision_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub destination_path: ::core::option::Option<LogicalPath>,
#[prost(enumeration = "FileConflictPolicy", tag = "3")]
pub conflict_policy: i32,
#[prost(string, tag = "4")]
pub expected_destination_revision_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileChange {
#[prost(oneof = "file_change::Change", tags = "1, 2, 3, 4")]
pub change: ::core::option::Option<file_change::Change>,
}
pub mod file_change {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Change {
#[prost(message, tag = "1")]
Put(super::PutFile),
#[prost(message, tag = "2")]
Move(super::MoveFile),
#[prost(message, tag = "3")]
Remove(super::RemoveFile),
#[prost(message, tag = "4")]
Restore(super::RestoreFile),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFileRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub path: ::core::option::Option<LogicalPath>,
#[prost(bool, tag = "3")]
pub include_removed: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFileResponse {
#[prost(message, optional, tag = "1")]
pub file: ::core::option::Option<File>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFilesRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub path_prefix: ::core::option::Option<LogicalPath>,
#[prost(bool, tag = "3")]
pub recursive: bool,
#[prost(bool, tag = "4")]
pub include_removed: bool,
#[prost(int32, optional, tag = "5")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "6")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFilesResponse {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<FileEntry>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyFileChangesRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub changes: ::prost::alloc::vec::Vec<FileChange>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyFileChangesResponse {
#[prost(message, repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<FileChangeResult>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileChangeSuccess {
#[prost(message, optional, tag = "1")]
pub file: ::core::option::Option<File>,
#[prost(message, optional, tag = "2")]
pub file_revision: ::core::option::Option<FileRevision>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileChangeFailure {
#[prost(enumeration = "FileStoreError", tag = "1")]
pub code: i32,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileChangeResult {
#[prost(oneof = "file_change_result::Result", tags = "1, 2")]
pub result: ::core::option::Option<file_change_result::Result>,
}
pub mod file_change_result {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Result {
#[prost(message, tag = "1")]
Success(super::FileChangeSuccess),
#[prost(message, tag = "2")]
Failure(super::FileChangeFailure),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFileRevisionsRequest {
#[prost(string, tag = "1")]
pub drive_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub file_rid: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "3")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "4")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFileRevisionsResponse {
#[prost(message, repeated, tag = "1")]
pub file_revisions: ::prost::alloc::vec::Vec<FileRevision>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PurgeFileRequest {
#[prost(string, tag = "1")]
pub file_revision_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PurgeFileResponse {}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FileConflictPolicy {
Unspecified = 0,
FailIfExists = 1,
ReplaceIfExists = 2,
}
impl FileConflictPolicy {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "FILE_CONFLICT_POLICY_UNSPECIFIED",
Self::FailIfExists => "FILE_CONFLICT_POLICY_FAIL_IF_EXISTS",
Self::ReplaceIfExists => "FILE_CONFLICT_POLICY_REPLACE_IF_EXISTS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FILE_CONFLICT_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
"FILE_CONFLICT_POLICY_FAIL_IF_EXISTS" => Some(Self::FailIfExists),
"FILE_CONFLICT_POLICY_REPLACE_IF_EXISTS" => Some(Self::ReplaceIfExists),
_ => None,
}
}
}
pub mod internal_files_service_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 InternalFilesServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InternalFilesServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> InternalFilesServiceClient<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,
) -> InternalFilesServiceClient<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,
{
InternalFilesServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn get_file(
&mut self,
request: impl tonic::IntoRequest<super::GetFileRequest>,
) -> std::result::Result<
tonic::Response<super::GetFileResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalFilesService/GetFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalFilesService",
"GetFile",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_files(
&mut self,
request: impl tonic::IntoRequest<super::ListFilesRequest>,
) -> std::result::Result<
tonic::Response<super::ListFilesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalFilesService/ListFiles",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalFilesService",
"ListFiles",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn apply_file_changes(
&mut self,
request: impl tonic::IntoRequest<super::ApplyFileChangesRequest>,
) -> std::result::Result<
tonic::Response<super::ApplyFileChangesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalFilesService/ApplyFileChanges",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalFilesService",
"ApplyFileChanges",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_file_revisions(
&mut self,
request: impl tonic::IntoRequest<super::ListFileRevisionsRequest>,
) -> std::result::Result<
tonic::Response<super::ListFileRevisionsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalFilesService/ListFileRevisions",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalFilesService",
"ListFileRevisions",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn purge_file(
&mut self,
request: impl tonic::IntoRequest<super::PurgeFileRequest>,
) -> std::result::Result<
tonic::Response<super::PurgeFileResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.file_store.v1.InternalFilesService/PurgeFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.file_store.v1.InternalFilesService",
"PurgeFile",
),
);
self.inner.unary(req, path, codec).await
}
}
}