1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Attribution {
4 #[prost(message, optional, tag = "1")]
5 pub time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
6 #[prost(string, tag = "2")]
7 pub user_rid: ::prost::alloc::string::String,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct Drive {
11 #[prost(string, tag = "1")]
12 pub rid: ::prost::alloc::string::String,
13 #[prost(string, tag = "2")]
14 pub workspace_rid: ::prost::alloc::string::String,
15 #[prost(string, tag = "3")]
16 pub name: ::prost::alloc::string::String,
17 #[prost(enumeration = "DriveState", tag = "4")]
18 pub state: i32,
19 #[prost(message, optional, tag = "5")]
20 pub created: ::core::option::Option<Attribution>,
21 #[prost(enumeration = "DriveKind", tag = "6")]
22 pub kind: i32,
23}
24#[derive(Clone, PartialEq, ::prost::Message)]
25pub struct VirtualDrive {
26 #[prost(string, tag = "1")]
27 pub drive_rid: ::prost::alloc::string::String,
28 #[prost(message, optional, tag = "2")]
29 pub connection_details: ::core::option::Option<VirtualDriveConnectionDetails>,
30 #[prost(message, optional, tag = "3")]
31 pub status: ::core::option::Option<VirtualDriveStatus>,
32}
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct VirtualDriveStatus {
35 #[prost(enumeration = "VirtualDriveState", tag = "1")]
36 pub state: i32,
37 #[prost(message, optional, tag = "2")]
38 pub last_successful_check_time: ::core::option::Option<
39 super::super::super::google::protobuf::Timestamp,
40 >,
41 #[prost(string, tag = "3")]
42 pub message: ::prost::alloc::string::String,
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct VirtualDriveConnectionDetails {
46 #[prost(oneof = "virtual_drive_connection_details::Details", tags = "1")]
47 pub details: ::core::option::Option<virtual_drive_connection_details::Details>,
48}
49pub mod virtual_drive_connection_details {
51 #[derive(Clone, PartialEq, ::prost::Oneof)]
52 pub enum Details {
53 #[prost(message, tag = "1")]
54 S3(super::S3VirtualDriveConnectionDetails),
55 }
56}
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct S3VirtualDriveConnectionDetails {
59 #[prost(string, tag = "1")]
60 pub bucket: ::prost::alloc::string::String,
61 #[prost(string, tag = "2")]
62 pub prefix: ::prost::alloc::string::String,
63 #[prost(string, tag = "3")]
64 pub credentials_secret_rid: ::prost::alloc::string::String,
65}
66#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct LogicalPath {
68 #[prost(string, tag = "1")]
69 pub path: ::prost::alloc::string::String,
70}
71#[derive(Clone, PartialEq, ::prost::Message)]
72pub struct LogicalFile {
73 #[prost(message, optional, tag = "1")]
74 pub identity: ::core::option::Option<LogicalFileIdentity>,
75 #[prost(message, optional, tag = "2")]
76 pub path: ::core::option::Option<LogicalPath>,
77 #[prost(enumeration = "FileState", tag = "3")]
78 pub state: i32,
79 #[prost(message, optional, tag = "4")]
80 pub created: ::core::option::Option<Attribution>,
81 #[prost(uint64, tag = "5")]
82 pub size_bytes: u64,
83 #[prost(message, optional, tag = "6")]
84 pub observed: ::core::option::Option<Attribution>,
85 #[prost(message, optional, tag = "7")]
86 pub current_revision: ::core::option::Option<FileRevisionRef>,
87}
88#[derive(Clone, PartialEq, ::prost::Message)]
89pub struct LogicalFileIdentity {
90 #[prost(oneof = "logical_file_identity::Identity", tags = "1, 2")]
91 pub identity: ::core::option::Option<logical_file_identity::Identity>,
92}
93pub mod logical_file_identity {
95 #[derive(Clone, PartialEq, ::prost::Oneof)]
96 pub enum Identity {
97 #[prost(message, tag = "1")]
98 Managed(super::ManagedFileIdentity),
99 #[prost(message, tag = "2")]
100 Virtual(super::VirtualFileIdentity),
101 }
102}
103#[derive(Clone, PartialEq, ::prost::Message)]
104pub struct ManagedFileIdentity {
105 #[prost(string, tag = "1")]
106 pub file_rid: ::prost::alloc::string::String,
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct VirtualFileIdentity {
110 #[prost(oneof = "virtual_file_identity::Kind", tags = "1, 2")]
111 pub kind: ::core::option::Option<virtual_file_identity::Kind>,
112}
113pub mod virtual_file_identity {
115 #[derive(Clone, PartialEq, ::prost::Oneof)]
116 pub enum Kind {
117 #[prost(message, tag = "1")]
118 S3(super::S3FileIdentity),
119 #[prost(message, tag = "2")]
120 GoogleDrive(super::GoogleDriveFileIdentity),
121 }
122}
123#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct S3FileIdentity {
125 #[prost(string, tag = "1")]
126 pub drive_rid: ::prost::alloc::string::String,
127 #[prost(string, tag = "2")]
128 pub path: ::prost::alloc::string::String,
129}
130#[derive(Clone, PartialEq, ::prost::Message)]
131pub struct GoogleDriveFileIdentity {
132 #[prost(string, tag = "1")]
133 pub file_id: ::prost::alloc::string::String,
134}
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct FileRevisionRef {
137 #[prost(oneof = "file_revision_ref::Reference", tags = "1, 2")]
138 pub reference: ::core::option::Option<file_revision_ref::Reference>,
139}
140pub mod file_revision_ref {
142 #[derive(Clone, PartialEq, ::prost::Oneof)]
143 pub enum Reference {
144 #[prost(message, tag = "1")]
145 Managed(super::ManagedFileRevisionRef),
146 #[prost(message, tag = "2")]
147 Virtual(super::VirtualFileRevisionRef),
148 }
149}
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct ManagedFileRevisionRef {
152 #[prost(string, tag = "1")]
153 pub file_revision_rid: ::prost::alloc::string::String,
154}
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct VirtualFileRevisionRef {
157 #[prost(oneof = "virtual_file_revision_ref::Kind", tags = "1, 2")]
158 pub kind: ::core::option::Option<virtual_file_revision_ref::Kind>,
159}
160pub mod virtual_file_revision_ref {
162 #[derive(Clone, PartialEq, ::prost::Oneof)]
163 pub enum Kind {
164 #[prost(message, tag = "1")]
165 S3(super::S3FileRevisionRef),
166 #[prost(message, tag = "2")]
167 GoogleDrive(super::GoogleDriveFileRevisionRef),
168 }
169}
170#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct S3FileRevisionRef {
172 #[prost(string, tag = "1")]
173 pub drive_rid: ::prost::alloc::string::String,
174 #[prost(string, tag = "2")]
175 pub path: ::prost::alloc::string::String,
176 #[prost(string, tag = "3")]
177 pub etag: ::prost::alloc::string::String,
178 #[prost(string, tag = "4")]
179 pub version_id: ::prost::alloc::string::String,
180}
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct GoogleDriveFileRevisionRef {
183 #[prost(string, tag = "1")]
184 pub drive_rid: ::prost::alloc::string::String,
185 #[prost(string, tag = "2")]
186 pub file_id: ::prost::alloc::string::String,
187 #[prost(string, tag = "3")]
188 pub version: ::prost::alloc::string::String,
189}
190#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct ManagedFileRevision {
192 #[prost(string, tag = "1")]
193 pub file_revision_rid: ::prost::alloc::string::String,
194 #[prost(string, tag = "2")]
195 pub file_rid: ::prost::alloc::string::String,
196 #[prost(message, optional, tag = "3")]
197 pub path: ::core::option::Option<LogicalPath>,
198 #[prost(uint32, tag = "4")]
199 pub revision_number: u32,
200 #[prost(uint64, tag = "5")]
201 pub size_bytes: u64,
202 #[prost(message, optional, tag = "6")]
203 pub created: ::core::option::Option<Attribution>,
204}
205#[derive(Clone, PartialEq, ::prost::Message)]
206pub struct VirtualFileRevision {
207 #[prost(string, tag = "1")]
208 pub file_revision_rid: ::prost::alloc::string::String,
209 #[prost(message, optional, tag = "2")]
210 pub file_identity: ::core::option::Option<VirtualFileIdentity>,
211 #[prost(message, optional, tag = "3")]
212 pub path: ::core::option::Option<LogicalPath>,
213 #[prost(uint64, tag = "4")]
214 pub size_bytes: u64,
215 #[prost(message, optional, tag = "5")]
216 pub observed: ::core::option::Option<Attribution>,
217}
218#[derive(Clone, PartialEq, ::prost::Message)]
219pub struct Directory {
220 #[prost(message, optional, tag = "1")]
221 pub path: ::core::option::Option<LogicalPath>,
222}
223#[derive(Clone, PartialEq, ::prost::Message)]
224pub struct FileEntry {
225 #[prost(oneof = "file_entry::Entry", tags = "1, 2")]
226 pub entry: ::core::option::Option<file_entry::Entry>,
227}
228pub mod file_entry {
230 #[derive(Clone, PartialEq, ::prost::Oneof)]
231 pub enum Entry {
232 #[prost(message, tag = "1")]
233 File(super::LogicalFile),
234 #[prost(message, tag = "2")]
235 Directory(super::Directory),
236 }
237}
238#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
239#[repr(i32)]
240pub enum DriveState {
241 Unspecified = 0,
242 Active = 1,
243 Archived = 2,
244}
245impl DriveState {
246 pub fn as_str_name(&self) -> &'static str {
251 match self {
252 Self::Unspecified => "DRIVE_STATE_UNSPECIFIED",
253 Self::Active => "DRIVE_STATE_ACTIVE",
254 Self::Archived => "DRIVE_STATE_ARCHIVED",
255 }
256 }
257 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
259 match value {
260 "DRIVE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
261 "DRIVE_STATE_ACTIVE" => Some(Self::Active),
262 "DRIVE_STATE_ARCHIVED" => Some(Self::Archived),
263 _ => None,
264 }
265 }
266}
267#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
268#[repr(i32)]
269pub enum DriveKind {
270 Unspecified = 0,
271 Managed = 1,
272 Virtual = 2,
273}
274impl DriveKind {
275 pub fn as_str_name(&self) -> &'static str {
280 match self {
281 Self::Unspecified => "DRIVE_KIND_UNSPECIFIED",
282 Self::Managed => "DRIVE_KIND_MANAGED",
283 Self::Virtual => "DRIVE_KIND_VIRTUAL",
284 }
285 }
286 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
288 match value {
289 "DRIVE_KIND_UNSPECIFIED" => Some(Self::Unspecified),
290 "DRIVE_KIND_MANAGED" => Some(Self::Managed),
291 "DRIVE_KIND_VIRTUAL" => Some(Self::Virtual),
292 _ => None,
293 }
294 }
295}
296#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
297#[repr(i32)]
298pub enum VirtualDriveState {
299 Unspecified = 0,
300 Active = 1,
301 AuthError = 2,
302 Unreachable = 3,
303 InvalidConfiguration = 4,
304}
305impl VirtualDriveState {
306 pub fn as_str_name(&self) -> &'static str {
311 match self {
312 Self::Unspecified => "VIRTUAL_DRIVE_STATE_UNSPECIFIED",
313 Self::Active => "VIRTUAL_DRIVE_STATE_ACTIVE",
314 Self::AuthError => "VIRTUAL_DRIVE_STATE_AUTH_ERROR",
315 Self::Unreachable => "VIRTUAL_DRIVE_STATE_UNREACHABLE",
316 Self::InvalidConfiguration => "VIRTUAL_DRIVE_STATE_INVALID_CONFIGURATION",
317 }
318 }
319 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
321 match value {
322 "VIRTUAL_DRIVE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
323 "VIRTUAL_DRIVE_STATE_ACTIVE" => Some(Self::Active),
324 "VIRTUAL_DRIVE_STATE_AUTH_ERROR" => Some(Self::AuthError),
325 "VIRTUAL_DRIVE_STATE_UNREACHABLE" => Some(Self::Unreachable),
326 "VIRTUAL_DRIVE_STATE_INVALID_CONFIGURATION" => {
327 Some(Self::InvalidConfiguration)
328 }
329 _ => None,
330 }
331 }
332}
333#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
334#[repr(i32)]
335pub enum FileState {
336 Unspecified = 0,
337 Active = 1,
338 Removed = 2,
339}
340impl FileState {
341 pub fn as_str_name(&self) -> &'static str {
346 match self {
347 Self::Unspecified => "FILE_STATE_UNSPECIFIED",
348 Self::Active => "FILE_STATE_ACTIVE",
349 Self::Removed => "FILE_STATE_REMOVED",
350 }
351 }
352 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
354 match value {
355 "FILE_STATE_UNSPECIFIED" => Some(Self::Unspecified),
356 "FILE_STATE_ACTIVE" => Some(Self::Active),
357 "FILE_STATE_REMOVED" => Some(Self::Removed),
358 _ => None,
359 }
360 }
361}
362#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
363#[repr(i32)]
364pub enum FileStoreError {
365 Unspecified = 0,
366 DriveNotFound = 1,
367 FileNotFound = 2,
368 FileRevisionNotFound = 3,
369 PathAlreadyExists = 4,
370 InvalidLogicalPath = 5,
371 PermissionDenied = 6,
372 RevisionPreconditionFailed = 7,
373 VirtualDriveNotFound = 8,
374 InvalidVirtualDriveConfiguration = 9,
375 ReadOnlyDrive = 10,
376 FileHistoryNotAvailable = 11,
377 UpstreamUnavailable = 12,
378}
379impl FileStoreError {
380 pub fn as_str_name(&self) -> &'static str {
385 match self {
386 Self::Unspecified => "FILE_STORE_ERROR_UNSPECIFIED",
387 Self::DriveNotFound => "FILE_STORE_ERROR_DRIVE_NOT_FOUND",
388 Self::FileNotFound => "FILE_STORE_ERROR_FILE_NOT_FOUND",
389 Self::FileRevisionNotFound => "FILE_STORE_ERROR_FILE_REVISION_NOT_FOUND",
390 Self::PathAlreadyExists => "FILE_STORE_ERROR_PATH_ALREADY_EXISTS",
391 Self::InvalidLogicalPath => "FILE_STORE_ERROR_INVALID_LOGICAL_PATH",
392 Self::PermissionDenied => "FILE_STORE_ERROR_PERMISSION_DENIED",
393 Self::RevisionPreconditionFailed => {
394 "FILE_STORE_ERROR_REVISION_PRECONDITION_FAILED"
395 }
396 Self::VirtualDriveNotFound => "FILE_STORE_ERROR_VIRTUAL_DRIVE_NOT_FOUND",
397 Self::InvalidVirtualDriveConfiguration => {
398 "FILE_STORE_ERROR_INVALID_VIRTUAL_DRIVE_CONFIGURATION"
399 }
400 Self::ReadOnlyDrive => "FILE_STORE_ERROR_READ_ONLY_DRIVE",
401 Self::FileHistoryNotAvailable => {
402 "FILE_STORE_ERROR_FILE_HISTORY_NOT_AVAILABLE"
403 }
404 Self::UpstreamUnavailable => "FILE_STORE_ERROR_UPSTREAM_UNAVAILABLE",
405 }
406 }
407 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
409 match value {
410 "FILE_STORE_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
411 "FILE_STORE_ERROR_DRIVE_NOT_FOUND" => Some(Self::DriveNotFound),
412 "FILE_STORE_ERROR_FILE_NOT_FOUND" => Some(Self::FileNotFound),
413 "FILE_STORE_ERROR_FILE_REVISION_NOT_FOUND" => {
414 Some(Self::FileRevisionNotFound)
415 }
416 "FILE_STORE_ERROR_PATH_ALREADY_EXISTS" => Some(Self::PathAlreadyExists),
417 "FILE_STORE_ERROR_INVALID_LOGICAL_PATH" => Some(Self::InvalidLogicalPath),
418 "FILE_STORE_ERROR_PERMISSION_DENIED" => Some(Self::PermissionDenied),
419 "FILE_STORE_ERROR_REVISION_PRECONDITION_FAILED" => {
420 Some(Self::RevisionPreconditionFailed)
421 }
422 "FILE_STORE_ERROR_VIRTUAL_DRIVE_NOT_FOUND" => {
423 Some(Self::VirtualDriveNotFound)
424 }
425 "FILE_STORE_ERROR_INVALID_VIRTUAL_DRIVE_CONFIGURATION" => {
426 Some(Self::InvalidVirtualDriveConfiguration)
427 }
428 "FILE_STORE_ERROR_READ_ONLY_DRIVE" => Some(Self::ReadOnlyDrive),
429 "FILE_STORE_ERROR_FILE_HISTORY_NOT_AVAILABLE" => {
430 Some(Self::FileHistoryNotAvailable)
431 }
432 "FILE_STORE_ERROR_UPSTREAM_UNAVAILABLE" => Some(Self::UpstreamUnavailable),
433 _ => None,
434 }
435 }
436}
437#[derive(Clone, PartialEq, ::prost::Message)]
438pub struct CreateDriveRequest {
439 #[prost(string, tag = "1")]
440 pub workspace_rid: ::prost::alloc::string::String,
441 #[prost(string, tag = "2")]
442 pub name: ::prost::alloc::string::String,
443}
444#[derive(Clone, PartialEq, ::prost::Message)]
445pub struct CreateDriveResponse {
446 #[prost(message, optional, tag = "1")]
447 pub drive: ::core::option::Option<Drive>,
448}
449#[derive(Clone, PartialEq, ::prost::Message)]
450pub struct CreateVirtualDriveRequest {
451 #[prost(string, tag = "1")]
452 pub workspace_rid: ::prost::alloc::string::String,
453 #[prost(string, tag = "2")]
454 pub name: ::prost::alloc::string::String,
455 #[prost(message, optional, tag = "3")]
456 pub connection_details: ::core::option::Option<VirtualDriveConnectionDetails>,
457}
458#[derive(Clone, PartialEq, ::prost::Message)]
459pub struct CreateVirtualDriveResponse {
460 #[prost(message, optional, tag = "1")]
461 pub drive: ::core::option::Option<Drive>,
462 #[prost(message, optional, tag = "2")]
463 pub virtual_drive: ::core::option::Option<VirtualDrive>,
464}
465#[derive(Clone, PartialEq, ::prost::Message)]
466pub struct GetDriveRequest {
467 #[prost(string, tag = "1")]
468 pub drive_rid: ::prost::alloc::string::String,
469}
470#[derive(Clone, PartialEq, ::prost::Message)]
471pub struct GetDriveResponse {
472 #[prost(message, optional, tag = "1")]
473 pub drive: ::core::option::Option<Drive>,
474}
475#[derive(Clone, PartialEq, ::prost::Message)]
476pub struct GetVirtualDriveRequest {
477 #[prost(string, tag = "1")]
478 pub drive_rid: ::prost::alloc::string::String,
479}
480#[derive(Clone, PartialEq, ::prost::Message)]
481pub struct GetVirtualDriveResponse {
482 #[prost(message, optional, tag = "1")]
483 pub drive: ::core::option::Option<Drive>,
484 #[prost(message, optional, tag = "2")]
485 pub virtual_drive: ::core::option::Option<VirtualDrive>,
486}
487#[derive(Clone, PartialEq, ::prost::Message)]
488pub struct GetDriveByNameRequest {
489 #[prost(string, tag = "1")]
490 pub workspace_rid: ::prost::alloc::string::String,
491 #[prost(string, tag = "2")]
492 pub name: ::prost::alloc::string::String,
493}
494#[derive(Clone, PartialEq, ::prost::Message)]
495pub struct GetDriveByNameResponse {
496 #[prost(message, optional, tag = "1")]
497 pub drive: ::core::option::Option<Drive>,
498}
499#[derive(Clone, PartialEq, ::prost::Message)]
500pub struct GetVirtualDriveByNameRequest {
501 #[prost(string, tag = "1")]
502 pub workspace_rid: ::prost::alloc::string::String,
503 #[prost(string, tag = "2")]
504 pub name: ::prost::alloc::string::String,
505}
506#[derive(Clone, PartialEq, ::prost::Message)]
507pub struct GetVirtualDriveByNameResponse {
508 #[prost(message, optional, tag = "1")]
509 pub drive: ::core::option::Option<Drive>,
510 #[prost(message, optional, tag = "2")]
511 pub virtual_drive: ::core::option::Option<VirtualDrive>,
512}
513#[derive(Clone, PartialEq, ::prost::Message)]
514pub struct ListDrivesRequest {
515 #[prost(string, tag = "1")]
516 pub workspace_rid: ::prost::alloc::string::String,
517 #[prost(bool, tag = "2")]
518 pub include_archived: bool,
519 #[prost(int32, optional, tag = "3")]
520 pub page_size: ::core::option::Option<i32>,
521 #[prost(string, optional, tag = "4")]
522 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
523}
524#[derive(Clone, PartialEq, ::prost::Message)]
525pub struct ListDrivesResponse {
526 #[prost(message, repeated, tag = "1")]
527 pub drives: ::prost::alloc::vec::Vec<Drive>,
528 #[prost(string, optional, tag = "2")]
529 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
530}
531#[derive(Clone, PartialEq, ::prost::Message)]
532pub struct UpdateVirtualDriveRequest {
533 #[prost(string, tag = "1")]
534 pub drive_rid: ::prost::alloc::string::String,
535 #[prost(message, optional, tag = "2")]
536 pub connection_details: ::core::option::Option<VirtualDriveConnectionDetails>,
537}
538#[derive(Clone, PartialEq, ::prost::Message)]
539pub struct UpdateVirtualDriveResponse {
540 #[prost(message, optional, tag = "1")]
541 pub drive: ::core::option::Option<Drive>,
542 #[prost(message, optional, tag = "2")]
543 pub virtual_drive: ::core::option::Option<VirtualDrive>,
544}
545#[derive(Clone, PartialEq, ::prost::Message)]
546pub struct RenameDriveRequest {
547 #[prost(string, tag = "1")]
548 pub drive_rid: ::prost::alloc::string::String,
549 #[prost(string, tag = "2")]
550 pub name: ::prost::alloc::string::String,
551}
552#[derive(Clone, PartialEq, ::prost::Message)]
553pub struct RenameDriveResponse {
554 #[prost(message, optional, tag = "1")]
555 pub drive: ::core::option::Option<Drive>,
556}
557#[derive(Clone, PartialEq, ::prost::Message)]
558pub struct ArchiveDriveRequest {
559 #[prost(string, tag = "1")]
560 pub drive_rid: ::prost::alloc::string::String,
561}
562#[derive(Clone, PartialEq, ::prost::Message)]
563pub struct ArchiveDriveResponse {
564 #[prost(message, optional, tag = "1")]
565 pub drive: ::core::option::Option<Drive>,
566}
567#[derive(Clone, PartialEq, ::prost::Message)]
568pub struct UnarchiveDriveRequest {
569 #[prost(string, tag = "1")]
570 pub drive_rid: ::prost::alloc::string::String,
571}
572#[derive(Clone, PartialEq, ::prost::Message)]
573pub struct UnarchiveDriveResponse {
574 #[prost(message, optional, tag = "1")]
575 pub drive: ::core::option::Option<Drive>,
576}
577pub mod internal_drives_service_client {
579 #![allow(
580 unused_variables,
581 dead_code,
582 missing_docs,
583 clippy::wildcard_imports,
584 clippy::let_unit_value,
585 )]
586 use tonic::codegen::*;
587 use tonic::codegen::http::Uri;
588 #[derive(Debug, Clone)]
589 pub struct InternalDrivesServiceClient<T> {
590 inner: tonic::client::Grpc<T>,
591 }
592 impl InternalDrivesServiceClient<tonic::transport::Channel> {
593 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
595 where
596 D: TryInto<tonic::transport::Endpoint>,
597 D::Error: Into<StdError>,
598 {
599 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
600 Ok(Self::new(conn))
601 }
602 }
603 impl<T> InternalDrivesServiceClient<T>
604 where
605 T: tonic::client::GrpcService<tonic::body::Body>,
606 T::Error: Into<StdError>,
607 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
608 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
609 {
610 pub fn new(inner: T) -> Self {
611 let inner = tonic::client::Grpc::new(inner);
612 Self { inner }
613 }
614 pub fn with_origin(inner: T, origin: Uri) -> Self {
615 let inner = tonic::client::Grpc::with_origin(inner, origin);
616 Self { inner }
617 }
618 pub fn with_interceptor<F>(
619 inner: T,
620 interceptor: F,
621 ) -> InternalDrivesServiceClient<InterceptedService<T, F>>
622 where
623 F: tonic::service::Interceptor,
624 T::ResponseBody: Default,
625 T: tonic::codegen::Service<
626 http::Request<tonic::body::Body>,
627 Response = http::Response<
628 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
629 >,
630 >,
631 <T as tonic::codegen::Service<
632 http::Request<tonic::body::Body>,
633 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
634 {
635 InternalDrivesServiceClient::new(InterceptedService::new(inner, interceptor))
636 }
637 #[must_use]
642 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
643 self.inner = self.inner.send_compressed(encoding);
644 self
645 }
646 #[must_use]
648 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
649 self.inner = self.inner.accept_compressed(encoding);
650 self
651 }
652 #[must_use]
656 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
657 self.inner = self.inner.max_decoding_message_size(limit);
658 self
659 }
660 #[must_use]
664 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
665 self.inner = self.inner.max_encoding_message_size(limit);
666 self
667 }
668 pub async fn create_drive(
669 &mut self,
670 request: impl tonic::IntoRequest<super::CreateDriveRequest>,
671 ) -> std::result::Result<
672 tonic::Response<super::CreateDriveResponse>,
673 tonic::Status,
674 > {
675 self.inner
676 .ready()
677 .await
678 .map_err(|e| {
679 tonic::Status::unknown(
680 format!("Service was not ready: {}", e.into()),
681 )
682 })?;
683 let codec = tonic::codec::ProstCodec::default();
684 let path = http::uri::PathAndQuery::from_static(
685 "/nominal.file_store.v1.InternalDrivesService/CreateDrive",
686 );
687 let mut req = request.into_request();
688 req.extensions_mut()
689 .insert(
690 GrpcMethod::new(
691 "nominal.file_store.v1.InternalDrivesService",
692 "CreateDrive",
693 ),
694 );
695 self.inner.unary(req, path, codec).await
696 }
697 pub async fn create_virtual_drive(
698 &mut self,
699 request: impl tonic::IntoRequest<super::CreateVirtualDriveRequest>,
700 ) -> std::result::Result<
701 tonic::Response<super::CreateVirtualDriveResponse>,
702 tonic::Status,
703 > {
704 self.inner
705 .ready()
706 .await
707 .map_err(|e| {
708 tonic::Status::unknown(
709 format!("Service was not ready: {}", e.into()),
710 )
711 })?;
712 let codec = tonic::codec::ProstCodec::default();
713 let path = http::uri::PathAndQuery::from_static(
714 "/nominal.file_store.v1.InternalDrivesService/CreateVirtualDrive",
715 );
716 let mut req = request.into_request();
717 req.extensions_mut()
718 .insert(
719 GrpcMethod::new(
720 "nominal.file_store.v1.InternalDrivesService",
721 "CreateVirtualDrive",
722 ),
723 );
724 self.inner.unary(req, path, codec).await
725 }
726 pub async fn get_drive(
727 &mut self,
728 request: impl tonic::IntoRequest<super::GetDriveRequest>,
729 ) -> std::result::Result<
730 tonic::Response<super::GetDriveResponse>,
731 tonic::Status,
732 > {
733 self.inner
734 .ready()
735 .await
736 .map_err(|e| {
737 tonic::Status::unknown(
738 format!("Service was not ready: {}", e.into()),
739 )
740 })?;
741 let codec = tonic::codec::ProstCodec::default();
742 let path = http::uri::PathAndQuery::from_static(
743 "/nominal.file_store.v1.InternalDrivesService/GetDrive",
744 );
745 let mut req = request.into_request();
746 req.extensions_mut()
747 .insert(
748 GrpcMethod::new(
749 "nominal.file_store.v1.InternalDrivesService",
750 "GetDrive",
751 ),
752 );
753 self.inner.unary(req, path, codec).await
754 }
755 pub async fn get_virtual_drive(
756 &mut self,
757 request: impl tonic::IntoRequest<super::GetVirtualDriveRequest>,
758 ) -> std::result::Result<
759 tonic::Response<super::GetVirtualDriveResponse>,
760 tonic::Status,
761 > {
762 self.inner
763 .ready()
764 .await
765 .map_err(|e| {
766 tonic::Status::unknown(
767 format!("Service was not ready: {}", e.into()),
768 )
769 })?;
770 let codec = tonic::codec::ProstCodec::default();
771 let path = http::uri::PathAndQuery::from_static(
772 "/nominal.file_store.v1.InternalDrivesService/GetVirtualDrive",
773 );
774 let mut req = request.into_request();
775 req.extensions_mut()
776 .insert(
777 GrpcMethod::new(
778 "nominal.file_store.v1.InternalDrivesService",
779 "GetVirtualDrive",
780 ),
781 );
782 self.inner.unary(req, path, codec).await
783 }
784 pub async fn get_drive_by_name(
785 &mut self,
786 request: impl tonic::IntoRequest<super::GetDriveByNameRequest>,
787 ) -> std::result::Result<
788 tonic::Response<super::GetDriveByNameResponse>,
789 tonic::Status,
790 > {
791 self.inner
792 .ready()
793 .await
794 .map_err(|e| {
795 tonic::Status::unknown(
796 format!("Service was not ready: {}", e.into()),
797 )
798 })?;
799 let codec = tonic::codec::ProstCodec::default();
800 let path = http::uri::PathAndQuery::from_static(
801 "/nominal.file_store.v1.InternalDrivesService/GetDriveByName",
802 );
803 let mut req = request.into_request();
804 req.extensions_mut()
805 .insert(
806 GrpcMethod::new(
807 "nominal.file_store.v1.InternalDrivesService",
808 "GetDriveByName",
809 ),
810 );
811 self.inner.unary(req, path, codec).await
812 }
813 pub async fn get_virtual_drive_by_name(
814 &mut self,
815 request: impl tonic::IntoRequest<super::GetVirtualDriveByNameRequest>,
816 ) -> std::result::Result<
817 tonic::Response<super::GetVirtualDriveByNameResponse>,
818 tonic::Status,
819 > {
820 self.inner
821 .ready()
822 .await
823 .map_err(|e| {
824 tonic::Status::unknown(
825 format!("Service was not ready: {}", e.into()),
826 )
827 })?;
828 let codec = tonic::codec::ProstCodec::default();
829 let path = http::uri::PathAndQuery::from_static(
830 "/nominal.file_store.v1.InternalDrivesService/GetVirtualDriveByName",
831 );
832 let mut req = request.into_request();
833 req.extensions_mut()
834 .insert(
835 GrpcMethod::new(
836 "nominal.file_store.v1.InternalDrivesService",
837 "GetVirtualDriveByName",
838 ),
839 );
840 self.inner.unary(req, path, codec).await
841 }
842 pub async fn list_drives(
843 &mut self,
844 request: impl tonic::IntoRequest<super::ListDrivesRequest>,
845 ) -> std::result::Result<
846 tonic::Response<super::ListDrivesResponse>,
847 tonic::Status,
848 > {
849 self.inner
850 .ready()
851 .await
852 .map_err(|e| {
853 tonic::Status::unknown(
854 format!("Service was not ready: {}", e.into()),
855 )
856 })?;
857 let codec = tonic::codec::ProstCodec::default();
858 let path = http::uri::PathAndQuery::from_static(
859 "/nominal.file_store.v1.InternalDrivesService/ListDrives",
860 );
861 let mut req = request.into_request();
862 req.extensions_mut()
863 .insert(
864 GrpcMethod::new(
865 "nominal.file_store.v1.InternalDrivesService",
866 "ListDrives",
867 ),
868 );
869 self.inner.unary(req, path, codec).await
870 }
871 pub async fn update_virtual_drive(
872 &mut self,
873 request: impl tonic::IntoRequest<super::UpdateVirtualDriveRequest>,
874 ) -> std::result::Result<
875 tonic::Response<super::UpdateVirtualDriveResponse>,
876 tonic::Status,
877 > {
878 self.inner
879 .ready()
880 .await
881 .map_err(|e| {
882 tonic::Status::unknown(
883 format!("Service was not ready: {}", e.into()),
884 )
885 })?;
886 let codec = tonic::codec::ProstCodec::default();
887 let path = http::uri::PathAndQuery::from_static(
888 "/nominal.file_store.v1.InternalDrivesService/UpdateVirtualDrive",
889 );
890 let mut req = request.into_request();
891 req.extensions_mut()
892 .insert(
893 GrpcMethod::new(
894 "nominal.file_store.v1.InternalDrivesService",
895 "UpdateVirtualDrive",
896 ),
897 );
898 self.inner.unary(req, path, codec).await
899 }
900 pub async fn rename_drive(
901 &mut self,
902 request: impl tonic::IntoRequest<super::RenameDriveRequest>,
903 ) -> std::result::Result<
904 tonic::Response<super::RenameDriveResponse>,
905 tonic::Status,
906 > {
907 self.inner
908 .ready()
909 .await
910 .map_err(|e| {
911 tonic::Status::unknown(
912 format!("Service was not ready: {}", e.into()),
913 )
914 })?;
915 let codec = tonic::codec::ProstCodec::default();
916 let path = http::uri::PathAndQuery::from_static(
917 "/nominal.file_store.v1.InternalDrivesService/RenameDrive",
918 );
919 let mut req = request.into_request();
920 req.extensions_mut()
921 .insert(
922 GrpcMethod::new(
923 "nominal.file_store.v1.InternalDrivesService",
924 "RenameDrive",
925 ),
926 );
927 self.inner.unary(req, path, codec).await
928 }
929 pub async fn archive_drive(
930 &mut self,
931 request: impl tonic::IntoRequest<super::ArchiveDriveRequest>,
932 ) -> std::result::Result<
933 tonic::Response<super::ArchiveDriveResponse>,
934 tonic::Status,
935 > {
936 self.inner
937 .ready()
938 .await
939 .map_err(|e| {
940 tonic::Status::unknown(
941 format!("Service was not ready: {}", e.into()),
942 )
943 })?;
944 let codec = tonic::codec::ProstCodec::default();
945 let path = http::uri::PathAndQuery::from_static(
946 "/nominal.file_store.v1.InternalDrivesService/ArchiveDrive",
947 );
948 let mut req = request.into_request();
949 req.extensions_mut()
950 .insert(
951 GrpcMethod::new(
952 "nominal.file_store.v1.InternalDrivesService",
953 "ArchiveDrive",
954 ),
955 );
956 self.inner.unary(req, path, codec).await
957 }
958 pub async fn unarchive_drive(
959 &mut self,
960 request: impl tonic::IntoRequest<super::UnarchiveDriveRequest>,
961 ) -> std::result::Result<
962 tonic::Response<super::UnarchiveDriveResponse>,
963 tonic::Status,
964 > {
965 self.inner
966 .ready()
967 .await
968 .map_err(|e| {
969 tonic::Status::unknown(
970 format!("Service was not ready: {}", e.into()),
971 )
972 })?;
973 let codec = tonic::codec::ProstCodec::default();
974 let path = http::uri::PathAndQuery::from_static(
975 "/nominal.file_store.v1.InternalDrivesService/UnarchiveDrive",
976 );
977 let mut req = request.into_request();
978 req.extensions_mut()
979 .insert(
980 GrpcMethod::new(
981 "nominal.file_store.v1.InternalDrivesService",
982 "UnarchiveDrive",
983 ),
984 );
985 self.inner.unary(req, path, codec).await
986 }
987 }
988}
989#[derive(Clone, PartialEq, ::prost::Message)]
990pub struct UploadedObjectRef {
991 #[prost(string, tag = "1")]
992 pub s3_path: ::prost::alloc::string::String,
993}
994#[derive(Clone, PartialEq, ::prost::Message)]
995pub struct PutFile {
996 #[prost(message, optional, tag = "1")]
997 pub path: ::core::option::Option<LogicalPath>,
998 #[prost(message, optional, tag = "2")]
999 pub object: ::core::option::Option<UploadedObjectRef>,
1000 #[prost(uint64, tag = "3")]
1001 pub size_bytes: u64,
1002 #[prost(enumeration = "FileConflictPolicy", tag = "4")]
1003 pub conflict_policy: i32,
1004 #[prost(string, tag = "5")]
1005 pub expected_revision_rid: ::prost::alloc::string::String,
1006}
1007#[derive(Clone, PartialEq, ::prost::Message)]
1008pub struct MoveFile {
1009 #[prost(message, optional, tag = "1")]
1010 pub source_path: ::core::option::Option<LogicalPath>,
1011 #[prost(message, optional, tag = "2")]
1012 pub destination_path: ::core::option::Option<LogicalPath>,
1013 #[prost(enumeration = "FileConflictPolicy", tag = "3")]
1014 pub conflict_policy: i32,
1015 #[prost(string, tag = "4")]
1016 pub expected_source_revision_rid: ::prost::alloc::string::String,
1017 #[prost(string, tag = "5")]
1018 pub expected_destination_revision_rid: ::prost::alloc::string::String,
1019}
1020#[derive(Clone, PartialEq, ::prost::Message)]
1021pub struct RemoveFile {
1022 #[prost(message, optional, tag = "1")]
1023 pub path: ::core::option::Option<LogicalPath>,
1024 #[prost(string, tag = "2")]
1025 pub expected_revision_rid: ::prost::alloc::string::String,
1026}
1027#[derive(Clone, PartialEq, ::prost::Message)]
1028pub struct RestoreFile {
1029 #[prost(string, tag = "1")]
1030 pub file_revision_rid: ::prost::alloc::string::String,
1031 #[prost(message, optional, tag = "2")]
1032 pub destination_path: ::core::option::Option<LogicalPath>,
1033 #[prost(enumeration = "FileConflictPolicy", tag = "3")]
1034 pub conflict_policy: i32,
1035 #[prost(string, tag = "4")]
1036 pub expected_destination_revision_rid: ::prost::alloc::string::String,
1037}
1038#[derive(Clone, PartialEq, ::prost::Message)]
1039pub struct FileChange {
1040 #[prost(oneof = "file_change::Change", tags = "1, 2, 3, 4")]
1041 pub change: ::core::option::Option<file_change::Change>,
1042}
1043pub mod file_change {
1045 #[derive(Clone, PartialEq, ::prost::Oneof)]
1046 pub enum Change {
1047 #[prost(message, tag = "1")]
1048 Put(super::PutFile),
1049 #[prost(message, tag = "2")]
1050 Move(super::MoveFile),
1051 #[prost(message, tag = "3")]
1052 Remove(super::RemoveFile),
1053 #[prost(message, tag = "4")]
1054 Restore(super::RestoreFile),
1055 }
1056}
1057#[derive(Clone, PartialEq, ::prost::Message)]
1058pub struct GetFileRequest {
1059 #[prost(string, tag = "1")]
1060 pub drive_rid: ::prost::alloc::string::String,
1061 #[prost(message, optional, tag = "2")]
1062 pub path: ::core::option::Option<LogicalPath>,
1063 #[prost(bool, tag = "3")]
1064 pub include_removed: bool,
1065}
1066#[derive(Clone, PartialEq, ::prost::Message)]
1067pub struct GetFileResponse {
1068 #[prost(message, optional, tag = "1")]
1069 pub file: ::core::option::Option<LogicalFile>,
1070}
1071#[derive(Clone, PartialEq, ::prost::Message)]
1072pub struct ResolveFileRevisionRequest {
1073 #[prost(string, tag = "1")]
1074 pub drive_rid: ::prost::alloc::string::String,
1075 #[prost(message, optional, tag = "2")]
1076 pub source_ref: ::core::option::Option<FileRevisionRef>,
1077}
1078#[derive(Clone, PartialEq, ::prost::Message)]
1079pub struct ResolveFileRevisionResponse {
1080 #[prost(string, tag = "1")]
1081 pub file_revision_rid: ::prost::alloc::string::String,
1082}
1083#[derive(Clone, PartialEq, ::prost::Message)]
1084pub struct ReadFileRequest {
1085 #[prost(string, tag = "1")]
1086 pub file_revision_rid: ::prost::alloc::string::String,
1087}
1088#[derive(Clone, PartialEq, ::prost::Message)]
1089pub struct ReadFileResponse {
1090 #[prost(bytes = "vec", tag = "1")]
1091 pub content: ::prost::alloc::vec::Vec<u8>,
1092}
1093#[derive(Clone, PartialEq, ::prost::Message)]
1094pub struct ListFilesRequest {
1095 #[prost(string, tag = "1")]
1096 pub drive_rid: ::prost::alloc::string::String,
1097 #[prost(message, optional, tag = "2")]
1098 pub path_prefix: ::core::option::Option<LogicalPath>,
1099 #[prost(bool, tag = "3")]
1100 pub recursive: bool,
1101 #[prost(bool, tag = "4")]
1102 pub include_removed: bool,
1103 #[prost(int32, optional, tag = "5")]
1104 pub page_size: ::core::option::Option<i32>,
1105 #[prost(string, optional, tag = "6")]
1106 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
1107}
1108#[derive(Clone, PartialEq, ::prost::Message)]
1109pub struct ListFilesResponse {
1110 #[prost(message, repeated, tag = "1")]
1111 pub entries: ::prost::alloc::vec::Vec<FileEntry>,
1112 #[prost(string, optional, tag = "2")]
1113 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
1114}
1115#[derive(Clone, PartialEq, ::prost::Message)]
1116pub struct ApplyFileChangesRequest {
1117 #[prost(string, tag = "1")]
1118 pub drive_rid: ::prost::alloc::string::String,
1119 #[prost(message, repeated, tag = "2")]
1120 pub changes: ::prost::alloc::vec::Vec<FileChange>,
1121}
1122#[derive(Clone, PartialEq, ::prost::Message)]
1123pub struct ApplyFileChangesResponse {
1124 #[prost(message, repeated, tag = "1")]
1125 pub results: ::prost::alloc::vec::Vec<FileChangeResult>,
1126}
1127#[derive(Clone, PartialEq, ::prost::Message)]
1128pub struct FileChangeSuccess {
1129 #[prost(message, optional, tag = "1")]
1130 pub file: ::core::option::Option<LogicalFile>,
1131 #[prost(message, optional, tag = "2")]
1132 pub file_revision: ::core::option::Option<ManagedFileRevision>,
1133}
1134#[derive(Clone, PartialEq, ::prost::Message)]
1135pub struct FileChangeFailure {
1136 #[prost(enumeration = "FileStoreError", tag = "1")]
1137 pub code: i32,
1138 #[prost(string, tag = "2")]
1139 pub message: ::prost::alloc::string::String,
1140}
1141#[derive(Clone, PartialEq, ::prost::Message)]
1142pub struct FileChangeResult {
1143 #[prost(oneof = "file_change_result::Result", tags = "1, 2")]
1144 pub result: ::core::option::Option<file_change_result::Result>,
1145}
1146pub mod file_change_result {
1148 #[derive(Clone, PartialEq, ::prost::Oneof)]
1149 pub enum Result {
1150 #[prost(message, tag = "1")]
1151 Success(super::FileChangeSuccess),
1152 #[prost(message, tag = "2")]
1153 Failure(super::FileChangeFailure),
1154 }
1155}
1156#[derive(Clone, PartialEq, ::prost::Message)]
1157pub struct ListFileRevisionsRequest {
1158 #[prost(string, tag = "1")]
1159 pub drive_rid: ::prost::alloc::string::String,
1160 #[prost(string, tag = "2")]
1161 pub file_rid: ::prost::alloc::string::String,
1162 #[prost(int32, optional, tag = "3")]
1163 pub page_size: ::core::option::Option<i32>,
1164 #[prost(string, optional, tag = "4")]
1165 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
1166}
1167#[derive(Clone, PartialEq, ::prost::Message)]
1168pub struct ListFileRevisionsResponse {
1169 #[prost(message, repeated, tag = "1")]
1170 pub file_revisions: ::prost::alloc::vec::Vec<ManagedFileRevision>,
1171 #[prost(string, optional, tag = "2")]
1172 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
1173}
1174#[derive(Clone, PartialEq, ::prost::Message)]
1175pub struct PurgeFileRequest {
1176 #[prost(string, tag = "1")]
1177 pub file_revision_rid: ::prost::alloc::string::String,
1178}
1179#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1180pub struct PurgeFileResponse {}
1181#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1182#[repr(i32)]
1183pub enum FileConflictPolicy {
1184 Unspecified = 0,
1185 FailIfExists = 1,
1186 ReplaceIfExists = 2,
1187}
1188impl FileConflictPolicy {
1189 pub fn as_str_name(&self) -> &'static str {
1194 match self {
1195 Self::Unspecified => "FILE_CONFLICT_POLICY_UNSPECIFIED",
1196 Self::FailIfExists => "FILE_CONFLICT_POLICY_FAIL_IF_EXISTS",
1197 Self::ReplaceIfExists => "FILE_CONFLICT_POLICY_REPLACE_IF_EXISTS",
1198 }
1199 }
1200 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1202 match value {
1203 "FILE_CONFLICT_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
1204 "FILE_CONFLICT_POLICY_FAIL_IF_EXISTS" => Some(Self::FailIfExists),
1205 "FILE_CONFLICT_POLICY_REPLACE_IF_EXISTS" => Some(Self::ReplaceIfExists),
1206 _ => None,
1207 }
1208 }
1209}
1210pub mod internal_files_service_client {
1212 #![allow(
1213 unused_variables,
1214 dead_code,
1215 missing_docs,
1216 clippy::wildcard_imports,
1217 clippy::let_unit_value,
1218 )]
1219 use tonic::codegen::*;
1220 use tonic::codegen::http::Uri;
1221 #[derive(Debug, Clone)]
1222 pub struct InternalFilesServiceClient<T> {
1223 inner: tonic::client::Grpc<T>,
1224 }
1225 impl InternalFilesServiceClient<tonic::transport::Channel> {
1226 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1228 where
1229 D: TryInto<tonic::transport::Endpoint>,
1230 D::Error: Into<StdError>,
1231 {
1232 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1233 Ok(Self::new(conn))
1234 }
1235 }
1236 impl<T> InternalFilesServiceClient<T>
1237 where
1238 T: tonic::client::GrpcService<tonic::body::Body>,
1239 T::Error: Into<StdError>,
1240 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1241 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1242 {
1243 pub fn new(inner: T) -> Self {
1244 let inner = tonic::client::Grpc::new(inner);
1245 Self { inner }
1246 }
1247 pub fn with_origin(inner: T, origin: Uri) -> Self {
1248 let inner = tonic::client::Grpc::with_origin(inner, origin);
1249 Self { inner }
1250 }
1251 pub fn with_interceptor<F>(
1252 inner: T,
1253 interceptor: F,
1254 ) -> InternalFilesServiceClient<InterceptedService<T, F>>
1255 where
1256 F: tonic::service::Interceptor,
1257 T::ResponseBody: Default,
1258 T: tonic::codegen::Service<
1259 http::Request<tonic::body::Body>,
1260 Response = http::Response<
1261 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1262 >,
1263 >,
1264 <T as tonic::codegen::Service<
1265 http::Request<tonic::body::Body>,
1266 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1267 {
1268 InternalFilesServiceClient::new(InterceptedService::new(inner, interceptor))
1269 }
1270 #[must_use]
1275 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1276 self.inner = self.inner.send_compressed(encoding);
1277 self
1278 }
1279 #[must_use]
1281 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1282 self.inner = self.inner.accept_compressed(encoding);
1283 self
1284 }
1285 #[must_use]
1289 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1290 self.inner = self.inner.max_decoding_message_size(limit);
1291 self
1292 }
1293 #[must_use]
1297 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1298 self.inner = self.inner.max_encoding_message_size(limit);
1299 self
1300 }
1301 pub async fn get_file(
1302 &mut self,
1303 request: impl tonic::IntoRequest<super::GetFileRequest>,
1304 ) -> std::result::Result<
1305 tonic::Response<super::GetFileResponse>,
1306 tonic::Status,
1307 > {
1308 self.inner
1309 .ready()
1310 .await
1311 .map_err(|e| {
1312 tonic::Status::unknown(
1313 format!("Service was not ready: {}", e.into()),
1314 )
1315 })?;
1316 let codec = tonic::codec::ProstCodec::default();
1317 let path = http::uri::PathAndQuery::from_static(
1318 "/nominal.file_store.v1.InternalFilesService/GetFile",
1319 );
1320 let mut req = request.into_request();
1321 req.extensions_mut()
1322 .insert(
1323 GrpcMethod::new(
1324 "nominal.file_store.v1.InternalFilesService",
1325 "GetFile",
1326 ),
1327 );
1328 self.inner.unary(req, path, codec).await
1329 }
1330 pub async fn resolve_file_revision(
1331 &mut self,
1332 request: impl tonic::IntoRequest<super::ResolveFileRevisionRequest>,
1333 ) -> std::result::Result<
1334 tonic::Response<super::ResolveFileRevisionResponse>,
1335 tonic::Status,
1336 > {
1337 self.inner
1338 .ready()
1339 .await
1340 .map_err(|e| {
1341 tonic::Status::unknown(
1342 format!("Service was not ready: {}", e.into()),
1343 )
1344 })?;
1345 let codec = tonic::codec::ProstCodec::default();
1346 let path = http::uri::PathAndQuery::from_static(
1347 "/nominal.file_store.v1.InternalFilesService/ResolveFileRevision",
1348 );
1349 let mut req = request.into_request();
1350 req.extensions_mut()
1351 .insert(
1352 GrpcMethod::new(
1353 "nominal.file_store.v1.InternalFilesService",
1354 "ResolveFileRevision",
1355 ),
1356 );
1357 self.inner.unary(req, path, codec).await
1358 }
1359 pub async fn read_file(
1360 &mut self,
1361 request: impl tonic::IntoRequest<super::ReadFileRequest>,
1362 ) -> std::result::Result<
1363 tonic::Response<tonic::codec::Streaming<super::ReadFileResponse>>,
1364 tonic::Status,
1365 > {
1366 self.inner
1367 .ready()
1368 .await
1369 .map_err(|e| {
1370 tonic::Status::unknown(
1371 format!("Service was not ready: {}", e.into()),
1372 )
1373 })?;
1374 let codec = tonic::codec::ProstCodec::default();
1375 let path = http::uri::PathAndQuery::from_static(
1376 "/nominal.file_store.v1.InternalFilesService/ReadFile",
1377 );
1378 let mut req = request.into_request();
1379 req.extensions_mut()
1380 .insert(
1381 GrpcMethod::new(
1382 "nominal.file_store.v1.InternalFilesService",
1383 "ReadFile",
1384 ),
1385 );
1386 self.inner.server_streaming(req, path, codec).await
1387 }
1388 pub async fn list_files(
1389 &mut self,
1390 request: impl tonic::IntoRequest<super::ListFilesRequest>,
1391 ) -> std::result::Result<
1392 tonic::Response<super::ListFilesResponse>,
1393 tonic::Status,
1394 > {
1395 self.inner
1396 .ready()
1397 .await
1398 .map_err(|e| {
1399 tonic::Status::unknown(
1400 format!("Service was not ready: {}", e.into()),
1401 )
1402 })?;
1403 let codec = tonic::codec::ProstCodec::default();
1404 let path = http::uri::PathAndQuery::from_static(
1405 "/nominal.file_store.v1.InternalFilesService/ListFiles",
1406 );
1407 let mut req = request.into_request();
1408 req.extensions_mut()
1409 .insert(
1410 GrpcMethod::new(
1411 "nominal.file_store.v1.InternalFilesService",
1412 "ListFiles",
1413 ),
1414 );
1415 self.inner.unary(req, path, codec).await
1416 }
1417 pub async fn apply_file_changes(
1418 &mut self,
1419 request: impl tonic::IntoRequest<super::ApplyFileChangesRequest>,
1420 ) -> std::result::Result<
1421 tonic::Response<super::ApplyFileChangesResponse>,
1422 tonic::Status,
1423 > {
1424 self.inner
1425 .ready()
1426 .await
1427 .map_err(|e| {
1428 tonic::Status::unknown(
1429 format!("Service was not ready: {}", e.into()),
1430 )
1431 })?;
1432 let codec = tonic::codec::ProstCodec::default();
1433 let path = http::uri::PathAndQuery::from_static(
1434 "/nominal.file_store.v1.InternalFilesService/ApplyFileChanges",
1435 );
1436 let mut req = request.into_request();
1437 req.extensions_mut()
1438 .insert(
1439 GrpcMethod::new(
1440 "nominal.file_store.v1.InternalFilesService",
1441 "ApplyFileChanges",
1442 ),
1443 );
1444 self.inner.unary(req, path, codec).await
1445 }
1446 pub async fn list_file_revisions(
1447 &mut self,
1448 request: impl tonic::IntoRequest<super::ListFileRevisionsRequest>,
1449 ) -> std::result::Result<
1450 tonic::Response<super::ListFileRevisionsResponse>,
1451 tonic::Status,
1452 > {
1453 self.inner
1454 .ready()
1455 .await
1456 .map_err(|e| {
1457 tonic::Status::unknown(
1458 format!("Service was not ready: {}", e.into()),
1459 )
1460 })?;
1461 let codec = tonic::codec::ProstCodec::default();
1462 let path = http::uri::PathAndQuery::from_static(
1463 "/nominal.file_store.v1.InternalFilesService/ListFileRevisions",
1464 );
1465 let mut req = request.into_request();
1466 req.extensions_mut()
1467 .insert(
1468 GrpcMethod::new(
1469 "nominal.file_store.v1.InternalFilesService",
1470 "ListFileRevisions",
1471 ),
1472 );
1473 self.inner.unary(req, path, codec).await
1474 }
1475 pub async fn purge_file(
1476 &mut self,
1477 request: impl tonic::IntoRequest<super::PurgeFileRequest>,
1478 ) -> std::result::Result<
1479 tonic::Response<super::PurgeFileResponse>,
1480 tonic::Status,
1481 > {
1482 self.inner
1483 .ready()
1484 .await
1485 .map_err(|e| {
1486 tonic::Status::unknown(
1487 format!("Service was not ready: {}", e.into()),
1488 )
1489 })?;
1490 let codec = tonic::codec::ProstCodec::default();
1491 let path = http::uri::PathAndQuery::from_static(
1492 "/nominal.file_store.v1.InternalFilesService/PurgeFile",
1493 );
1494 let mut req = request.into_request();
1495 req.extensions_mut()
1496 .insert(
1497 GrpcMethod::new(
1498 "nominal.file_store.v1.InternalFilesService",
1499 "PurgeFile",
1500 ),
1501 );
1502 self.inner.unary(req, path, codec).await
1503 }
1504 }
1505}