Skip to content

Commit 1d67938

Browse files
authored
feat(storage-control): add new PRPCs (#2357)
1 parent 6bfe2cf commit 1d67938

File tree

3 files changed

+234
-0
lines changed

3 files changed

+234
-0
lines changed

src/storage-control/src/client.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,48 @@ impl StorageControl {
559559
self.control.list_anywhere_caches()
560560
}
561561

562+
/// Returns the Project scoped singleton IntelligenceConfig resource.
563+
pub fn get_project_intelligence_config(
564+
&self,
565+
) -> super::builder::storage_control::GetProjectIntelligenceConfig {
566+
self.control.get_project_intelligence_config()
567+
}
568+
569+
/// Updates the Project scoped singleton IntelligenceConfig resource.
570+
pub fn update_project_intelligence_config(
571+
&self,
572+
) -> super::builder::storage_control::UpdateProjectIntelligenceConfig {
573+
self.control.update_project_intelligence_config()
574+
}
575+
576+
/// Returns the Folder scoped singleton IntelligenceConfig resource.
577+
pub fn get_folder_intelligence_config(
578+
&self,
579+
) -> super::builder::storage_control::GetFolderIntelligenceConfig {
580+
self.control.get_folder_intelligence_config()
581+
}
582+
583+
/// Updates the Folder scoped singleton IntelligenceConfig resource.
584+
pub fn update_folder_intelligence_config(
585+
&self,
586+
) -> super::builder::storage_control::UpdateFolderIntelligenceConfig {
587+
self.control.update_folder_intelligence_config()
588+
}
589+
590+
/// Returns the Organization scoped singleton IntelligenceConfig resource.
591+
pub fn get_organization_intelligence_config(
592+
&self,
593+
) -> super::builder::storage_control::GetOrganizationIntelligenceConfig {
594+
self.control.get_organization_intelligence_config()
595+
}
596+
597+
/// Updates the Organization scoped singleton IntelligenceConfig resource.
598+
pub fn update_organization_intelligence_config(
599+
&self,
600+
) -> super::builder::storage_control::UpdateOrganizationIntelligenceConfig {
601+
self.control.update_organization_intelligence_config()
602+
}
603+
562604
/// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
563605
///
564606
/// [google.longrunning.Operations]: longrunning::client::Operations

src/storage-control/src/stub.rs

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,72 @@ pub trait StorageControl: std::fmt::Debug + Send + Sync {
400400
gaxi::unimplemented::unimplemented_stub()
401401
}
402402

403+
/// Implements [super::client::StorageControl::get_project_intelligence_config].
404+
fn get_project_intelligence_config(
405+
&self,
406+
_req: crate::model::GetProjectIntelligenceConfigRequest,
407+
_options: gax::options::RequestOptions,
408+
) -> impl std::future::Future<
409+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
410+
> + Send {
411+
gaxi::unimplemented::unimplemented_stub()
412+
}
413+
414+
/// Implements [super::client::StorageControl::update_project_intelligence_config].
415+
fn update_project_intelligence_config(
416+
&self,
417+
_req: crate::model::UpdateProjectIntelligenceConfigRequest,
418+
_options: gax::options::RequestOptions,
419+
) -> impl std::future::Future<
420+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
421+
> + Send {
422+
gaxi::unimplemented::unimplemented_stub()
423+
}
424+
425+
/// Implements [super::client::StorageControl::get_folder_intelligence_config].
426+
fn get_folder_intelligence_config(
427+
&self,
428+
_req: crate::model::GetFolderIntelligenceConfigRequest,
429+
_options: gax::options::RequestOptions,
430+
) -> impl std::future::Future<
431+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
432+
> + Send {
433+
gaxi::unimplemented::unimplemented_stub()
434+
}
435+
436+
/// Implements [super::client::StorageControl::update_folder_intelligence_config].
437+
fn update_folder_intelligence_config(
438+
&self,
439+
_req: crate::model::UpdateFolderIntelligenceConfigRequest,
440+
_options: gax::options::RequestOptions,
441+
) -> impl std::future::Future<
442+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
443+
> + Send {
444+
gaxi::unimplemented::unimplemented_stub()
445+
}
446+
447+
/// Implements [super::client::StorageControl::get_organization_intelligence_config].
448+
fn get_organization_intelligence_config(
449+
&self,
450+
_req: crate::model::GetOrganizationIntelligenceConfigRequest,
451+
_options: gax::options::RequestOptions,
452+
) -> impl std::future::Future<
453+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
454+
> + Send {
455+
gaxi::unimplemented::unimplemented_stub()
456+
}
457+
458+
/// Implements [super::client::StorageControl::update_organization_intelligence_config].
459+
fn update_organization_intelligence_config(
460+
&self,
461+
_req: crate::model::UpdateOrganizationIntelligenceConfigRequest,
462+
_options: gax::options::RequestOptions,
463+
) -> impl std::future::Future<
464+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
465+
> + Send {
466+
gaxi::unimplemented::unimplemented_stub()
467+
}
468+
403469
/// Implements [super::client::StorageControl::get_operation].
404470
fn get_operation(
405471
&self,
@@ -740,6 +806,66 @@ where
740806
T::list_anywhere_caches(self, req, options)
741807
}
742808

809+
fn get_project_intelligence_config(
810+
&self,
811+
req: crate::model::GetProjectIntelligenceConfigRequest,
812+
options: gax::options::RequestOptions,
813+
) -> impl std::future::Future<
814+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
815+
> {
816+
T::get_project_intelligence_config(self, req, options)
817+
}
818+
819+
fn update_project_intelligence_config(
820+
&self,
821+
req: crate::model::UpdateProjectIntelligenceConfigRequest,
822+
options: gax::options::RequestOptions,
823+
) -> impl std::future::Future<
824+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
825+
> {
826+
T::update_project_intelligence_config(self, req, options)
827+
}
828+
829+
fn get_folder_intelligence_config(
830+
&self,
831+
req: crate::model::GetFolderIntelligenceConfigRequest,
832+
options: gax::options::RequestOptions,
833+
) -> impl std::future::Future<
834+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
835+
> {
836+
T::get_folder_intelligence_config(self, req, options)
837+
}
838+
839+
fn update_folder_intelligence_config(
840+
&self,
841+
req: crate::model::UpdateFolderIntelligenceConfigRequest,
842+
options: gax::options::RequestOptions,
843+
) -> impl std::future::Future<
844+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
845+
> {
846+
T::update_folder_intelligence_config(self, req, options)
847+
}
848+
849+
fn get_organization_intelligence_config(
850+
&self,
851+
req: crate::model::GetOrganizationIntelligenceConfigRequest,
852+
options: gax::options::RequestOptions,
853+
) -> impl std::future::Future<
854+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
855+
> {
856+
T::get_organization_intelligence_config(self, req, options)
857+
}
858+
859+
fn update_organization_intelligence_config(
860+
&self,
861+
req: crate::model::UpdateOrganizationIntelligenceConfigRequest,
862+
options: gax::options::RequestOptions,
863+
) -> impl std::future::Future<
864+
Output = crate::Result<gax::response::Response<crate::model::IntelligenceConfig>>,
865+
> {
866+
T::update_organization_intelligence_config(self, req, options)
867+
}
868+
743869
fn get_operation(
744870
&self,
745871
req: longrunning::model::GetOperationRequest,

src/storage-control/tests/mocking.rs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ mod test {
5555
async fn resume_anywhere_cache( &self, _req: gcs::model::ResumeAnywhereCacheRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::AnywhereCache>>;
5656
async fn get_anywhere_cache( &self, _req: gcs::model::GetAnywhereCacheRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::AnywhereCache>>;
5757
async fn list_anywhere_caches( &self, _req: gcs::model::ListAnywhereCachesRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::ListAnywhereCachesResponse>>;
58+
async fn get_folder_intelligence_config( &self, _req: gcs::model::GetFolderIntelligenceConfigRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::IntelligenceConfig>>;
59+
async fn update_folder_intelligence_config( &self, _req: gcs::model::UpdateFolderIntelligenceConfigRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::IntelligenceConfig>>;
60+
async fn get_project_intelligence_config( &self, _req: gcs::model::GetProjectIntelligenceConfigRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::IntelligenceConfig>>;
61+
async fn update_project_intelligence_config( &self, _req: gcs::model::UpdateProjectIntelligenceConfigRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::IntelligenceConfig>>;
62+
async fn get_organization_intelligence_config( &self, _req: gcs::model::GetOrganizationIntelligenceConfigRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::IntelligenceConfig>>;
63+
async fn update_organization_intelligence_config( &self, _req: gcs::model::UpdateOrganizationIntelligenceConfigRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<gcs::model::IntelligenceConfig>>;
5864
async fn get_operation( &self, _req: longrunning::model::GetOperationRequest, _options: gax::options::RequestOptions) -> gax::Result<gax::response::Response<longrunning::model::Operation>>;
5965
}
6066
}
@@ -200,6 +206,30 @@ mod test {
200206
.times(1)
201207
.in_sequence(&mut seq)
202208
.returning(|_, _| Err(gax::error::Error::other("simulated failure")));
209+
mock.expect_get_folder_intelligence_config()
210+
.times(1)
211+
.in_sequence(&mut seq)
212+
.returning(|_, _| Err(gax::error::Error::other("simulated failure")));
213+
mock.expect_update_folder_intelligence_config()
214+
.times(1)
215+
.in_sequence(&mut seq)
216+
.returning(|_, _| Err(gax::error::Error::other("simulated failure")));
217+
mock.expect_get_project_intelligence_config()
218+
.times(1)
219+
.in_sequence(&mut seq)
220+
.returning(|_, _| Err(gax::error::Error::other("simulated failure")));
221+
mock.expect_update_project_intelligence_config()
222+
.times(1)
223+
.in_sequence(&mut seq)
224+
.returning(|_, _| Err(gax::error::Error::other("simulated failure")));
225+
mock.expect_get_organization_intelligence_config()
226+
.times(1)
227+
.in_sequence(&mut seq)
228+
.returning(|_, _| Err(gax::error::Error::other("simulated failure")));
229+
mock.expect_update_organization_intelligence_config()
230+
.times(1)
231+
.in_sequence(&mut seq)
232+
.returning(|_, _| Err(gax::error::Error::other("simulated failure")));
203233
mock.expect_get_operation()
204234
.times(1)
205235
.in_sequence(&mut seq)
@@ -246,6 +276,36 @@ mod test {
246276
let _ = client.resume_anywhere_cache().send().await.unwrap_err();
247277
let _ = client.get_anywhere_cache().send().await.unwrap_err();
248278
let _ = client.list_anywhere_caches().send().await.unwrap_err();
279+
let _ = client
280+
.get_folder_intelligence_config()
281+
.send()
282+
.await
283+
.unwrap_err();
284+
let _ = client
285+
.update_folder_intelligence_config()
286+
.send()
287+
.await
288+
.unwrap_err();
289+
let _ = client
290+
.get_project_intelligence_config()
291+
.send()
292+
.await
293+
.unwrap_err();
294+
let _ = client
295+
.update_project_intelligence_config()
296+
.send()
297+
.await
298+
.unwrap_err();
299+
let _ = client
300+
.get_organization_intelligence_config()
301+
.send()
302+
.await
303+
.unwrap_err();
304+
let _ = client
305+
.update_organization_intelligence_config()
306+
.send()
307+
.await
308+
.unwrap_err();
249309
let _ = client.get_operation().send().await.unwrap_err();
250310
}
251311

@@ -304,6 +364,12 @@ mod test {
304364
resume_anywhere_cache,
305365
get_anywhere_cache,
306366
list_anywhere_caches,
367+
get_folder_intelligence_config,
368+
update_folder_intelligence_config,
369+
get_project_intelligence_config,
370+
update_project_intelligence_config,
371+
get_organization_intelligence_config,
372+
update_organization_intelligence_config,
307373
get_operation
308374
);
309375
}

0 commit comments

Comments
 (0)