google_cloud_storage/control/generated/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17use crate::control::client::*;
18
19impl StorageControl {
20 /// Returns a builder for [StorageControl].
21 ///
22 /// ```
23 /// # async fn sample() -> anyhow::Result<()> {
24 /// # use google_cloud_storage::client::StorageControl;
25 /// let client = StorageControl::builder().build().await?;
26 /// # Ok(()) }
27 /// ```
28 pub fn builder() -> ClientBuilder {
29 crate::new_client_builder(client_builder::Factory)
30 }
31
32 /// Permanently deletes an empty bucket.
33 /// The request fails if there are any live or
34 /// noncurrent objects in the bucket, but the request succeeds if the
35 /// bucket only contains soft-deleted objects or incomplete uploads, such
36 /// as ongoing XML API multipart uploads. Does not permanently delete
37 /// soft-deleted objects.
38 ///
39 /// When this API is used to delete a bucket containing an object that has a
40 /// soft delete policy
41 /// enabled, the object becomes soft deleted, and the
42 /// `softDeleteTime` and `hardDeleteTime` properties are set on the
43 /// object.
44 ///
45 /// Objects and multipart uploads that were in the bucket at the time of
46 /// deletion are also retained for the specified retention duration. When
47 /// a soft-deleted bucket reaches the end of its retention duration, it
48 /// is permanently deleted. The `hardDeleteTime` of the bucket always
49 /// equals
50 /// or exceeds the expiration time of the last soft-deleted object in the
51 /// bucket.
52 ///
53 /// **IAM Permissions**:
54 ///
55 /// Requires `storage.buckets.delete` IAM permission on the bucket.
56 pub fn delete_bucket(&self) -> crate::builder::storage_control::DeleteBucket {
57 self.storage.delete_bucket()
58 }
59
60 /// Returns metadata for the specified bucket.
61 ///
62 /// **IAM Permissions**:
63 ///
64 /// Requires `storage.buckets.get`
65 /// IAM permission on
66 /// the bucket. Additionally, to return specific bucket metadata, the
67 /// authenticated user must have the following permissions:
68 ///
69 /// - To return the IAM policies: `storage.buckets.getIamPolicy`
70 /// - To return the bucket IP filtering rules: `storage.buckets.getIpFilter`
71 pub fn get_bucket(&self) -> crate::builder::storage_control::GetBucket {
72 self.storage.get_bucket()
73 }
74
75 /// Creates a new bucket.
76 ///
77 /// **IAM Permissions**:
78 ///
79 /// Requires `storage.buckets.create` IAM permission on the bucket.
80 /// Additionally, to enable specific bucket features, the authenticated user
81 /// must have the following permissions:
82 ///
83 /// - To enable object retention using the `enableObjectRetention` query
84 /// parameter: `storage.buckets.enableObjectRetention`
85 /// - To set the bucket IP filtering rules: `storage.buckets.setIpFilter`
86 pub fn create_bucket(&self) -> crate::builder::storage_control::CreateBucket {
87 self.storage.create_bucket()
88 }
89
90 /// Retrieves a list of buckets for a given project, ordered
91 /// lexicographically by name.
92 ///
93 /// **IAM Permissions**:
94 ///
95 /// Requires `storage.buckets.list` IAM permission on the bucket.
96 /// Additionally, to enable specific bucket features, the authenticated
97 /// user must have the following permissions:
98 ///
99 /// - To list the IAM policies: `storage.buckets.getIamPolicy`
100 /// - To list the bucket IP filtering rules: `storage.buckets.getIpFilter`
101 pub fn list_buckets(&self) -> crate::builder::storage_control::ListBuckets {
102 self.storage.list_buckets()
103 }
104
105 /// Permanently locks the retention
106 /// policy that is
107 /// currently applied to the specified bucket.
108 ///
109 /// Caution: Locking a bucket is an
110 /// irreversible action. Once you lock a bucket:
111 ///
112 /// - You cannot remove the retention policy from the bucket.
113 /// - You cannot decrease the retention period for the policy.
114 ///
115 /// Once locked, you must delete the entire bucket in order to remove the
116 /// bucket's retention policy. However, before you can delete the bucket, you
117 /// must delete all the objects in the bucket, which is only
118 /// possible if all the objects have reached the retention period set by the
119 /// retention policy.
120 ///
121 /// **IAM Permissions**:
122 ///
123 /// Requires `storage.buckets.update` IAM permission on the bucket.
124 pub fn lock_bucket_retention_policy(
125 &self,
126 ) -> crate::builder::storage_control::LockBucketRetentionPolicy {
127 self.storage.lock_bucket_retention_policy()
128 }
129
130 /// Updates a bucket. Changes to the bucket are readable immediately after
131 /// writing, but configuration changes might take time to propagate. This
132 /// method supports `patch` semantics.
133 ///
134 /// **IAM Permissions**:
135 ///
136 /// Requires `storage.buckets.update` IAM permission on the bucket.
137 /// Additionally, to enable specific bucket features, the authenticated user
138 /// must have the following permissions:
139 ///
140 /// - To set bucket IP filtering rules: `storage.buckets.setIpFilter`
141 /// - To update public access prevention policies or access control lists
142 /// (ACLs): `storage.buckets.setIamPolicy`
143 pub fn update_bucket(&self) -> crate::builder::storage_control::UpdateBucket {
144 self.storage.update_bucket()
145 }
146
147 /// Concatenates a list of existing objects into a new object in the same
148 /// bucket. The existing source objects are unaffected by this operation.
149 ///
150 /// **IAM Permissions**:
151 ///
152 /// Requires the `storage.objects.create` and `storage.objects.get` IAM
153 /// permissions to use this method. If the new composite object
154 /// overwrites an existing object, the authenticated user must also have
155 /// the `storage.objects.delete` permission. If the request body includes
156 /// the retention property, the authenticated user must also have the
157 /// `storage.objects.setRetention` IAM permission.
158 pub fn compose_object(&self) -> crate::builder::storage_control::ComposeObject {
159 self.storage.compose_object()
160 }
161
162 /// Deletes an object and its metadata. Deletions are permanent if versioning
163 /// is not enabled for the bucket, or if the generation parameter is used, or
164 /// if soft delete is not
165 /// enabled for the bucket.
166 /// When this API is used to delete an object from a bucket that has soft
167 /// delete policy enabled, the object becomes soft deleted, and the
168 /// `softDeleteTime` and `hardDeleteTime` properties are set on the object.
169 /// This API cannot be used to permanently delete soft-deleted objects.
170 /// Soft-deleted objects are permanently deleted according to their
171 /// `hardDeleteTime`.
172 ///
173 /// You can use the [`RestoreObject`][google.storage.v2.Storage.RestoreObject]
174 /// API to restore soft-deleted objects until the soft delete retention period
175 /// has passed.
176 ///
177 /// **IAM Permissions**:
178 ///
179 /// Requires `storage.objects.delete` IAM permission on the bucket.
180 ///
181 /// [google.storage.v2.Storage.RestoreObject]: crate::client::StorageControl::restore_object
182 pub fn delete_object(&self) -> crate::builder::storage_control::DeleteObject {
183 self.storage.delete_object()
184 }
185
186 /// Restores a
187 /// soft-deleted object.
188 /// When a soft-deleted object is restored, a new copy of that object is
189 /// created in the same bucket and inherits the same metadata as the
190 /// soft-deleted object. The inherited metadata is the metadata that existed
191 /// when the original object became soft deleted, with the following
192 /// exceptions:
193 ///
194 /// - The `createTime` of the new object is set to the time at which the
195 /// soft-deleted object was restored.
196 /// - The `softDeleteTime` and `hardDeleteTime` values are cleared.
197 /// - A new generation is assigned and the metageneration is reset to 1.
198 /// - If the soft-deleted object was in a bucket that had Autoclass enabled,
199 /// the new object is
200 /// restored to Standard storage.
201 /// - The restored object inherits the bucket's default object ACL, unless
202 /// `copySourceAcl` is `true`.
203 ///
204 /// If a live object using the same name already exists in the bucket and
205 /// becomes overwritten, the live object becomes a noncurrent object if Object
206 /// Versioning is enabled on the bucket. If Object Versioning is not enabled,
207 /// the live object becomes soft deleted.
208 ///
209 /// **IAM Permissions**:
210 ///
211 /// Requires the following IAM permissions to use this method:
212 ///
213 /// - `storage.objects.restore`
214 /// - `storage.objects.create`
215 /// - `storage.objects.delete` (only required if overwriting an existing
216 /// object)
217 /// - `storage.objects.getIamPolicy` (only required if `projection` is `full`
218 /// and the relevant bucket
219 /// has uniform bucket-level access disabled)
220 /// - `storage.objects.setIamPolicy` (only required if `copySourceAcl` is
221 /// `true` and the relevant
222 /// bucket has uniform bucket-level access disabled)
223 pub fn restore_object(&self) -> crate::builder::storage_control::RestoreObject {
224 self.storage.restore_object()
225 }
226
227 /// Retrieves object metadata.
228 ///
229 /// **IAM Permissions**:
230 ///
231 /// Requires `storage.objects.get` IAM permission on the bucket.
232 /// To return object ACLs, the authenticated user must also have
233 /// the `storage.objects.getIamPolicy` permission.
234 pub fn get_object(&self) -> crate::builder::storage_control::GetObject {
235 self.storage.get_object()
236 }
237
238 /// Updates an object's metadata.
239 /// Equivalent to JSON API's `storage.objects.patch` method.
240 ///
241 /// **IAM Permissions**:
242 ///
243 /// Requires `storage.objects.update` IAM permission on the bucket.
244 pub fn update_object(&self) -> crate::builder::storage_control::UpdateObject {
245 self.storage.update_object()
246 }
247
248 /// Retrieves a list of objects matching the criteria.
249 ///
250 /// **IAM Permissions**:
251 ///
252 /// The authenticated user requires `storage.objects.list`
253 /// IAM permission to use this method. To return object ACLs, the
254 /// authenticated user must also
255 /// have the `storage.objects.getIamPolicy` permission.
256 pub fn list_objects(&self) -> crate::builder::storage_control::ListObjects {
257 self.storage.list_objects()
258 }
259
260 /// Rewrites a source object to a destination object. Optionally overrides
261 /// metadata.
262 pub fn rewrite_object(&self) -> crate::builder::storage_control::RewriteObject {
263 self.storage.rewrite_object()
264 }
265
266 /// Moves the source object to the destination object in the same bucket.
267 /// This operation moves a source object to a destination object in the
268 /// same bucket by renaming the object. The move itself is an atomic
269 /// transaction, ensuring all steps either complete successfully or no
270 /// changes are made.
271 ///
272 /// **IAM Permissions**:
273 ///
274 /// Requires the following IAM permissions to use this method:
275 ///
276 /// - `storage.objects.move`
277 /// - `storage.objects.create`
278 /// - `storage.objects.delete` (only required if overwriting an existing
279 /// object)
280 pub fn move_object(&self) -> crate::builder::storage_control::MoveObject {
281 self.storage.move_object()
282 }
283
284 /// Creates a new folder. This operation is only applicable to a hierarchical
285 /// namespace enabled bucket.
286 pub fn create_folder(&self) -> crate::builder::storage_control::CreateFolder {
287 self.control.create_folder()
288 }
289
290 /// Permanently deletes an empty folder. This operation is only applicable to a
291 /// hierarchical namespace enabled bucket.
292 pub fn delete_folder(&self) -> crate::builder::storage_control::DeleteFolder {
293 self.control.delete_folder()
294 }
295
296 /// Returns metadata for the specified folder. This operation is only
297 /// applicable to a hierarchical namespace enabled bucket.
298 pub fn get_folder(&self) -> crate::builder::storage_control::GetFolder {
299 self.control.get_folder()
300 }
301
302 /// Retrieves a list of folders. This operation is only applicable to a
303 /// hierarchical namespace enabled bucket.
304 pub fn list_folders(&self) -> crate::builder::storage_control::ListFolders {
305 self.control.list_folders()
306 }
307
308 /// Renames a source folder to a destination folder. This operation is only
309 /// applicable to a hierarchical namespace enabled bucket. During a rename, the
310 /// source and destination folders are locked until the long running operation
311 /// completes.
312 ///
313 /// # Long running operations
314 ///
315 /// This method is used to start, and/or poll a [long-running Operation].
316 /// The [Working with long-running operations] chapter in the [user guide]
317 /// covers these operations in detail.
318 ///
319 /// [long-running operation]: https://google.aip.dev/151
320 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
321 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
322 pub fn rename_folder(&self) -> crate::builder::storage_control::RenameFolder {
323 self.control.rename_folder()
324 }
325
326 /// Deletes a folder recursively. This operation is only applicable to a
327 /// hierarchical namespace enabled bucket.
328 ///
329 /// # Long running operations
330 ///
331 /// This method is used to start, and/or poll a [long-running Operation].
332 /// The [Working with long-running operations] chapter in the [user guide]
333 /// covers these operations in detail.
334 ///
335 /// [long-running operation]: https://google.aip.dev/151
336 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
337 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
338 pub fn delete_folder_recursive(
339 &self,
340 ) -> crate::builder::storage_control::DeleteFolderRecursive {
341 self.control.delete_folder_recursive()
342 }
343
344 /// Returns the storage layout configuration for a given bucket.
345 pub fn get_storage_layout(&self) -> crate::builder::storage_control::GetStorageLayout {
346 self.control.get_storage_layout()
347 }
348
349 /// Creates a new managed folder.
350 pub fn create_managed_folder(&self) -> crate::builder::storage_control::CreateManagedFolder {
351 self.control.create_managed_folder()
352 }
353
354 /// Permanently deletes an empty managed folder.
355 pub fn delete_managed_folder(&self) -> crate::builder::storage_control::DeleteManagedFolder {
356 self.control.delete_managed_folder()
357 }
358
359 /// Returns metadata for the specified managed folder.
360 pub fn get_managed_folder(&self) -> crate::builder::storage_control::GetManagedFolder {
361 self.control.get_managed_folder()
362 }
363
364 /// Retrieves a list of managed folders for a given bucket.
365 pub fn list_managed_folders(&self) -> crate::builder::storage_control::ListManagedFolders {
366 self.control.list_managed_folders()
367 }
368
369 /// Updates a managed folder. Currently, this RPC only supports updating the
370 /// `rapid_cache_config` field.
371 pub fn update_managed_folder(&self) -> crate::builder::storage_control::UpdateManagedFolder {
372 self.control.update_managed_folder()
373 }
374
375 /// Creates an Anywhere Cache instance.
376 ///
377 /// # Long running operations
378 ///
379 /// This method is used to start, and/or poll a [long-running Operation].
380 /// The [Working with long-running operations] chapter in the [user guide]
381 /// covers these operations in detail.
382 ///
383 /// [long-running operation]: https://google.aip.dev/151
384 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
385 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
386 pub fn create_anywhere_cache(&self) -> crate::builder::storage_control::CreateAnywhereCache {
387 self.control.create_anywhere_cache()
388 }
389
390 /// Updates an Anywhere Cache instance. Mutable fields include `ttl` and
391 /// `admission_policy`.
392 ///
393 /// # Long running operations
394 ///
395 /// This method is used to start, and/or poll a [long-running Operation].
396 /// The [Working with long-running operations] chapter in the [user guide]
397 /// covers these operations in detail.
398 ///
399 /// [long-running operation]: https://google.aip.dev/151
400 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
401 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
402 pub fn update_anywhere_cache(&self) -> crate::builder::storage_control::UpdateAnywhereCache {
403 self.control.update_anywhere_cache()
404 }
405
406 /// Disables an Anywhere Cache instance. A disabled instance is read-only. The
407 /// disablement could be revoked by calling ResumeAnywhereCache. The cache
408 /// instance will be deleted automatically if it remains in the disabled state
409 /// for at least one hour.
410 pub fn disable_anywhere_cache(&self) -> crate::builder::storage_control::DisableAnywhereCache {
411 self.control.disable_anywhere_cache()
412 }
413
414 /// Pauses an Anywhere Cache instance.
415 pub fn pause_anywhere_cache(&self) -> crate::builder::storage_control::PauseAnywhereCache {
416 self.control.pause_anywhere_cache()
417 }
418
419 /// Resumes a disabled or paused Anywhere Cache instance.
420 pub fn resume_anywhere_cache(&self) -> crate::builder::storage_control::ResumeAnywhereCache {
421 self.control.resume_anywhere_cache()
422 }
423
424 /// Gets an Anywhere Cache instance.
425 pub fn get_anywhere_cache(&self) -> crate::builder::storage_control::GetAnywhereCache {
426 self.control.get_anywhere_cache()
427 }
428
429 /// Lists Anywhere Cache instances for a given bucket.
430 pub fn list_anywhere_caches(&self) -> crate::builder::storage_control::ListAnywhereCaches {
431 self.control.list_anywhere_caches()
432 }
433
434 /// Creates a Rapid Cache instance.
435 ///
436 /// # Long running operations
437 ///
438 /// This method is used to start, and/or poll a [long-running Operation].
439 /// The [Working with long-running operations] chapter in the [user guide]
440 /// covers these operations in detail.
441 ///
442 /// [long-running operation]: https://google.aip.dev/151
443 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
444 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
445 pub fn create_rapid_cache(&self) -> crate::builder::storage_control::CreateRapidCache {
446 self.control.create_rapid_cache()
447 }
448
449 /// Updates a Rapid Cache instance.
450 ///
451 /// # Long running operations
452 ///
453 /// This method is used to start, and/or poll a [long-running Operation].
454 /// The [Working with long-running operations] chapter in the [user guide]
455 /// covers these operations in detail.
456 ///
457 /// [long-running operation]: https://google.aip.dev/151
458 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
459 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
460 pub fn update_rapid_cache(&self) -> crate::builder::storage_control::UpdateRapidCache {
461 self.control.update_rapid_cache()
462 }
463
464 /// Gets a Rapid Cache instance.
465 pub fn get_rapid_cache(&self) -> crate::builder::storage_control::GetRapidCache {
466 self.control.get_rapid_cache()
467 }
468
469 /// Lists Rapid Cache instances for a given bucket.
470 pub fn list_rapid_caches(&self) -> crate::builder::storage_control::ListRapidCaches {
471 self.control.list_rapid_caches()
472 }
473
474 /// Returns the Project scoped singleton IntelligenceConfig resource.
475 pub fn get_project_intelligence_config(
476 &self,
477 ) -> crate::builder::storage_control::GetProjectIntelligenceConfig {
478 self.control.get_project_intelligence_config()
479 }
480
481 /// Updates the Project scoped singleton IntelligenceConfig resource.
482 pub fn update_project_intelligence_config(
483 &self,
484 ) -> crate::builder::storage_control::UpdateProjectIntelligenceConfig {
485 self.control.update_project_intelligence_config()
486 }
487
488 /// Returns the Folder scoped singleton IntelligenceConfig resource.
489 pub fn get_folder_intelligence_config(
490 &self,
491 ) -> crate::builder::storage_control::GetFolderIntelligenceConfig {
492 self.control.get_folder_intelligence_config()
493 }
494
495 /// Updates the Folder scoped singleton IntelligenceConfig resource.
496 pub fn update_folder_intelligence_config(
497 &self,
498 ) -> crate::builder::storage_control::UpdateFolderIntelligenceConfig {
499 self.control.update_folder_intelligence_config()
500 }
501
502 /// Returns the Organization scoped singleton IntelligenceConfig resource.
503 pub fn get_organization_intelligence_config(
504 &self,
505 ) -> crate::builder::storage_control::GetOrganizationIntelligenceConfig {
506 self.control.get_organization_intelligence_config()
507 }
508
509 /// Updates the Organization scoped singleton IntelligenceConfig resource.
510 pub fn update_organization_intelligence_config(
511 &self,
512 ) -> crate::builder::storage_control::UpdateOrganizationIntelligenceConfig {
513 self.control.update_organization_intelligence_config()
514 }
515
516 /// Gets the IAM policy for a specified bucket.
517 /// The `resource` field in the request should be
518 /// `projects/_/buckets/{bucket}` for a bucket, or
519 /// `projects/_/buckets/{bucket}/managedFolders/{managedFolder}`
520 /// for a managed folder.
521 pub fn get_iam_policy(&self) -> crate::builder::storage_control::GetIamPolicy {
522 self.control.get_iam_policy()
523 }
524
525 /// Updates an IAM policy for the specified bucket.
526 /// The `resource` field in the request should be
527 /// `projects/_/buckets/{bucket}` for a bucket, or
528 /// `projects/_/buckets/{bucket}/managedFolders/{managedFolder}`
529 /// for a managed folder.
530 pub fn set_iam_policy(&self) -> crate::builder::storage_control::SetIamPolicy {
531 self.control.set_iam_policy()
532 }
533
534 /// Tests a set of permissions on the given bucket, object, or managed folder
535 /// to see which, if any, are held by the caller.
536 /// The `resource` field in the request should be
537 /// `projects/_/buckets/{bucket}` for a bucket,
538 /// `projects/_/buckets/{bucket}/objects/{object}` for an object, or
539 /// `projects/_/buckets/{bucket}/managedFolders/{managedFolder}`
540 /// for a managed folder.
541 pub fn test_iam_permissions(&self) -> crate::builder::storage_control::TestIamPermissions {
542 self.control.test_iam_permissions()
543 }
544
545 /// Gets the `IntelligenceFinding` for a project.
546 pub fn get_intelligence_finding(
547 &self,
548 ) -> crate::builder::storage_control::GetIntelligenceFinding {
549 self.control.get_intelligence_finding()
550 }
551
552 /// Lists the `IntelligenceFinding` resources for the specified the project.
553 pub fn list_intelligence_findings(
554 &self,
555 ) -> crate::builder::storage_control::ListIntelligenceFindings {
556 self.control.list_intelligence_findings()
557 }
558
559 /// Summarizes the intelligence findings for the specified scope (organization,
560 /// folder or project).
561 pub fn summarize_intelligence_findings(
562 &self,
563 ) -> crate::builder::storage_control::SummarizeIntelligenceFindings {
564 self.control.summarize_intelligence_findings()
565 }
566
567 /// Gets the `IntelligenceFindingRevision` resource.
568 pub fn get_intelligence_finding_revision(
569 &self,
570 ) -> crate::builder::storage_control::GetIntelligenceFindingRevision {
571 self.control.get_intelligence_finding_revision()
572 }
573
574 /// Lists all the revisions of an `IntelligenceFinding` resource.
575 pub fn list_intelligence_finding_revisions(
576 &self,
577 ) -> crate::builder::storage_control::ListIntelligenceFindingRevisions {
578 self.control.list_intelligence_finding_revisions()
579 }
580
581 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
582 ///
583 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
584 pub fn get_operation(&self) -> crate::builder::storage_control::GetOperation {
585 self.control.get_operation()
586 }
587
588 /// Creates a new client from the provided stub.
589 ///
590 /// The most common case for calling this function is in tests mocking the
591 /// client's behavior.
592 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
593 where
594 T: crate::stub::StorageControl + 'static,
595 {
596 let stub: std::sync::Arc<T> = stub.into();
597 Self {
598 storage: crate::generated::gapic::client::StorageControl::from_stub::<std::sync::Arc<T>>(
599 stub.clone(),
600 ),
601 control: crate::generated::gapic_control::client::StorageControl::from_stub::<
602 std::sync::Arc<T>,
603 >(stub),
604 }
605 }
606
607 pub(crate) async fn new(
608 config: gaxi::options::ClientConfig,
609 ) -> crate::ClientBuilderResult<Self> {
610 let storage = crate::generated::gapic::client::StorageControl::new(config.clone()).await?;
611 let control = crate::generated::gapic_control::client::StorageControl::new(config).await?;
612 Ok(Self { storage, control })
613 }
614}