diff --git a/librarian.yaml b/librarian.yaml index 26ee2b92fd..eaa23427d4 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -22,8 +22,7 @@ sources: commit: 0e6dd9602b8f4a2fa119cd268eb01e82e762e08e sha256: 4005f18049cc924eeacc4f060d96940202251de7ce65c92d361a3db5905b84e7 googleapis: - commit: 43731d5d22f8e3526ba7aa708da9d5de26043d0f - sha256: d146cfa257ffa00fc298ec7b6f73f9c7395a5a5ba050dcc553cfd78d6705bc3b + dir: /usr/local/google/home/haphung/googleapis protobuf: commit: b407e8416e3893036aee5af9a12bd9b6a0e2b2e6 sha256: 55912546338433f465a552e9ef09930c63b9eb697053937416890cff83a8622d @@ -269,7 +268,7 @@ libraries: match: |2 - `folders/` - `organizations/` - replace: |+ + replace: | - `folders/` - `organizations/` @@ -1441,7 +1440,6 @@ libraries: copyright_year: "2025" output: src/storage rust: - resource_name_heuristic: true modules: - module_path: crate::generated::gapic_control::model name_overrides: .google.storage.control.v2.IntelligenceConfig.Filter.cloud_storage_buckets=CloudStorageBucketsOneOf,.google.storage.control.v2.IntelligenceConfig.Filter.cloud_storage_locations=CloudStorageLocationsOneOf diff --git a/src/generated/cloud/compute/v1/src/transport.rs b/src/generated/cloud/compute/v1/src/transport.rs index 640cfea9a0..c43f651c34 100644 --- a/src/generated/cloud/compute/v1/src/transport.rs +++ b/src/generated/cloud/compute/v1/src/transport.rs @@ -8577,11 +8577,18 @@ impl super::stub::FirewallPolicies for FirewallPolicies { use gaxi::http::reqwest::{HeaderValue, Method}; use gaxi::path_parameter::PathMismatchBuilder; use google_cloud_gax::error::binding::BindingError; - let (builder, method, _path_template) = None + let (builder, method, _path_template, _resource_name) = None .or_else(|| { let path = "/compute/v1/locations/global/firewallPolicies".to_string(); let path_template = "/compute/v1/locations/global/firewallPolicies"; + let resource_name = format!( + "//compute.googleapis.com/{}", + Some(&req) + .and_then(|m| m.parent_id.as_ref()) + .map(|s| s.as_str()) + .unwrap_or(""), + ); let builder = self.inner.builder(Method::POST, path); let builder = req .parent_id @@ -8592,7 +8599,7 @@ impl super::stub::FirewallPolicies for FirewallPolicies { .iter() .fold(builder, |builder, p| builder.query(&[("requestId", p)])); let builder = Ok(builder); - Some(builder.map(|b| (b, Method::POST, path_template))) + Some(builder.map(|b| (b, Method::POST, path_template, resource_name))) }) .ok_or_else(|| { let mut paths = Vec::new(); @@ -8606,7 +8613,8 @@ impl super::stub::FirewallPolicies for FirewallPolicies { recorder.on_client_request( gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.cloud.compute.v1.firewallPolicies/insert") - .set_url_template(_path_template), + .set_url_template(_path_template) + .set_resource_name(_resource_name), ); } let options = google_cloud_gax::options::internal::set_default_idempotency( @@ -8629,11 +8637,18 @@ impl super::stub::FirewallPolicies for FirewallPolicies { use gaxi::http::reqwest::{HeaderValue, Method}; use gaxi::path_parameter::PathMismatchBuilder; use google_cloud_gax::error::binding::BindingError; - let (builder, method, _path_template) = None + let (builder, method, _path_template, _resource_name) = None .or_else(|| { let path = "/compute/v1/locations/global/firewallPolicies".to_string(); let path_template = "/compute/v1/locations/global/firewallPolicies"; + let resource_name = format!( + "//compute.googleapis.com/{}", + Some(&req) + .and_then(|m| m.parent_id.as_ref()) + .map(|s| s.as_str()) + .unwrap_or(""), + ); let builder = self.inner.builder(Method::GET, path); let builder = req .filter @@ -8662,7 +8677,7 @@ impl super::stub::FirewallPolicies for FirewallPolicies { builder.query(&[("returnPartialSuccess", p)]) }); let builder = Ok(builder); - Some(builder.map(|b| (b, Method::GET, path_template))) + Some(builder.map(|b| (b, Method::GET, path_template, resource_name))) }) .ok_or_else(|| { let mut paths = Vec::new(); @@ -8676,7 +8691,8 @@ impl super::stub::FirewallPolicies for FirewallPolicies { recorder.on_client_request( gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.cloud.compute.v1.firewallPolicies/list") - .set_url_template(_path_template), + .set_url_template(_path_template) + .set_resource_name(_resource_name), ); } let options = google_cloud_gax::options::internal::set_default_idempotency( @@ -8699,13 +8715,20 @@ impl super::stub::FirewallPolicies for FirewallPolicies { use gaxi::http::reqwest::{HeaderValue, Method}; use gaxi::path_parameter::PathMismatchBuilder; use google_cloud_gax::error::binding::BindingError; - let (builder, method, _path_template) = None + let (builder, method, _path_template, _resource_name) = None .or_else(|| { let path = "/compute/v1/locations/global/firewallPolicies/listAssociations".to_string(); let path_template = "/compute/v1/locations/global/firewallPolicies/listAssociations"; + let resource_name = format!( + "//compute.googleapis.com/{}", + Some(&req) + .and_then(|m| m.target_resource.as_ref()) + .map(|s| s.as_str()) + .unwrap_or(""), + ); let builder = self.inner.builder(Method::GET, path); let builder = req .include_inherited_policies @@ -8717,7 +8740,7 @@ impl super::stub::FirewallPolicies for FirewallPolicies { builder.query(&[("targetResource", p)]) }); let builder = Ok(builder); - Some(builder.map(|b| (b, Method::GET, path_template))) + Some(builder.map(|b| (b, Method::GET, path_template, resource_name))) }) .ok_or_else(|| { let mut paths = Vec::new(); @@ -8731,7 +8754,8 @@ impl super::stub::FirewallPolicies for FirewallPolicies { recorder.on_client_request( gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.cloud.compute.v1.firewallPolicies/listAssociations") - .set_url_template(_path_template), + .set_url_template(_path_template) + .set_resource_name(_resource_name), ); } let options = google_cloud_gax::options::internal::set_default_idempotency( @@ -13964,11 +13988,18 @@ impl super::stub::GlobalOrganizationOperations for GlobalOrganizationOperations use gaxi::http::reqwest::{HeaderValue, Method}; use gaxi::path_parameter::PathMismatchBuilder; use google_cloud_gax::error::binding::BindingError; - let (builder, method, _path_template) = None + let (builder, method, _path_template, _resource_name) = None .or_else(|| { let path = "/compute/v1/locations/global/operations".to_string(); let path_template = "/compute/v1/locations/global/operations"; + let resource_name = format!( + "//compute.googleapis.com/{}", + Some(&req) + .and_then(|m| m.parent_id.as_ref()) + .map(|s| s.as_str()) + .unwrap_or(""), + ); let builder = self.inner.builder(Method::GET, path); let builder = req .filter @@ -13997,7 +14028,7 @@ impl super::stub::GlobalOrganizationOperations for GlobalOrganizationOperations builder.query(&[("returnPartialSuccess", p)]) }); let builder = Ok(builder); - Some(builder.map(|b| (b, Method::GET, path_template))) + Some(builder.map(|b| (b, Method::GET, path_template, resource_name))) }) .ok_or_else(|| { let mut paths = Vec::new(); @@ -14011,7 +14042,8 @@ impl super::stub::GlobalOrganizationOperations for GlobalOrganizationOperations recorder.on_client_request( gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.cloud.compute.v1.globalOrganizationOperations/list") - .set_url_template(_path_template), + .set_url_template(_path_template) + .set_resource_name(_resource_name), ); } let options = google_cloud_gax::options::internal::set_default_idempotency( @@ -42507,11 +42539,18 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies use gaxi::http::reqwest::{HeaderValue, Method}; use gaxi::path_parameter::PathMismatchBuilder; use google_cloud_gax::error::binding::BindingError; - let (builder, method, _path_template) = None + let (builder, method, _path_template, _resource_name) = None .or_else(|| { let path = "/compute/v1/locations/global/securityPolicies".to_string(); let path_template = "/compute/v1/locations/global/securityPolicies"; + let resource_name = format!( + "//compute.googleapis.com/{}", + Some(&req) + .and_then(|m| m.parent_id.as_ref()) + .map(|s| s.as_str()) + .unwrap_or(""), + ); let builder = self.inner.builder(Method::POST, path); let builder = req .parent_id @@ -42522,7 +42561,7 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies .iter() .fold(builder, |builder, p| builder.query(&[("requestId", p)])); let builder = Ok(builder); - Some(builder.map(|b| (b, Method::POST, path_template))) + Some(builder.map(|b| (b, Method::POST, path_template, resource_name))) }) .ok_or_else(|| { let mut paths = Vec::new(); @@ -42536,7 +42575,8 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies recorder.on_client_request( gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.cloud.compute.v1.organizationSecurityPolicies/insert") - .set_url_template(_path_template), + .set_url_template(_path_template) + .set_resource_name(_resource_name), ); } let options = google_cloud_gax::options::internal::set_default_idempotency( @@ -42559,11 +42599,18 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies use gaxi::http::reqwest::{HeaderValue, Method}; use gaxi::path_parameter::PathMismatchBuilder; use google_cloud_gax::error::binding::BindingError; - let (builder, method, _path_template) = None + let (builder, method, _path_template, _resource_name) = None .or_else(|| { let path = "/compute/v1/locations/global/securityPolicies".to_string(); let path_template = "/compute/v1/locations/global/securityPolicies"; + let resource_name = format!( + "//compute.googleapis.com/{}", + Some(&req) + .and_then(|m| m.parent_id.as_ref()) + .map(|s| s.as_str()) + .unwrap_or(""), + ); let builder = self.inner.builder(Method::GET, path); let builder = req .filter @@ -42592,7 +42639,7 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies builder.query(&[("returnPartialSuccess", p)]) }); let builder = Ok(builder); - Some(builder.map(|b| (b, Method::GET, path_template))) + Some(builder.map(|b| (b, Method::GET, path_template, resource_name))) }) .ok_or_else(|| { let mut paths = Vec::new(); @@ -42606,7 +42653,8 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies recorder.on_client_request( gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.cloud.compute.v1.organizationSecurityPolicies/list") - .set_url_template(_path_template), + .set_url_template(_path_template) + .set_resource_name(_resource_name), ); } let options = google_cloud_gax::options::internal::set_default_idempotency( @@ -42630,19 +42678,26 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies use gaxi::http::reqwest::{HeaderValue, Method}; use gaxi::path_parameter::PathMismatchBuilder; use google_cloud_gax::error::binding::BindingError; - let (builder, method, _path_template) = None + let (builder, method, _path_template, _resource_name) = None .or_else(|| { let path = "/compute/v1/locations/global/securityPolicies/listAssociations".to_string(); let path_template = "/compute/v1/locations/global/securityPolicies/listAssociations"; + let resource_name = format!( + "//compute.googleapis.com/{}", + Some(&req) + .and_then(|m| m.target_resource.as_ref()) + .map(|s| s.as_str()) + .unwrap_or(""), + ); let builder = self.inner.builder(Method::GET, path); let builder = req.target_resource.iter().fold(builder, |builder, p| { builder.query(&[("targetResource", p)]) }); let builder = Ok(builder); - Some(builder.map(|b| (b, Method::GET, path_template))) + Some(builder.map(|b| (b, Method::GET, path_template, resource_name))) }) .ok_or_else(|| { let mut paths = Vec::new(); @@ -42658,7 +42713,8 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies .set_rpc_method( "google.cloud.compute.v1.organizationSecurityPolicies/listAssociations", ) - .set_url_template(_path_template), + .set_url_template(_path_template) + .set_resource_name(_resource_name), ); } let options = google_cloud_gax::options::internal::set_default_idempotency( @@ -42683,7 +42739,7 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies use gaxi::http::reqwest::{HeaderValue, Method}; use gaxi::path_parameter::PathMismatchBuilder; use google_cloud_gax::error::binding::BindingError; - let (builder, method, _path_template) = None + let (builder, method, _path_template, _resource_name) = None .or_else(|| { let path = "/compute/v1/locations/global/securityPolicies/listPreconfiguredExpressionSets" @@ -42691,6 +42747,13 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies let path_template = "/compute/v1/locations/global/securityPolicies/listPreconfiguredExpressionSets"; + let resource_name = format!( + "//compute.googleapis.com/{}", + Some(&req) + .and_then(|m| m.parent_id.as_ref()) + .map(|s| s.as_str()) + .unwrap_or(""), + ); let builder = self.inner.builder(Method::GET, path); let builder = req .filter @@ -42719,7 +42782,7 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies builder.query(&[("returnPartialSuccess", p)]) }); let builder = Ok(builder); - Some(builder.map(|b| (b, Method::GET, path_template))) + Some(builder.map(|b| (b, Method::GET, path_template, resource_name))) }) .ok_or_else(|| { let mut paths = Vec::new(); @@ -42734,6 +42797,7 @@ impl super::stub::OrganizationSecurityPolicies for OrganizationSecurityPolicies gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.cloud.compute.v1.organizationSecurityPolicies/listPreconfiguredExpressionSets") .set_url_template(_path_template) + .set_resource_name(_resource_name) ); } let options = google_cloud_gax::options::internal::set_default_idempotency( diff --git a/src/storage/src/generated/gapic/transport.rs b/src/storage/src/generated/gapic/transport.rs index 0a37541459..e900b39fee 100644 --- a/src/storage/src/generated/gapic/transport.rs +++ b/src/storage/src/generated/gapic/transport.rs @@ -118,6 +118,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/DeleteBucket"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -186,6 +197,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/GetBucket"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -278,6 +300,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/CreateBucket"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -346,6 +379,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/ListBuckets"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -419,6 +463,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/LockBucketRetentionPolicy"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.bucket).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -493,6 +548,20 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/UpdateBucket"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req) + .and_then(|m| m.bucket.as_ref()) + .map(|m| &m.name) + .map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -570,6 +639,20 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/ComposeObject"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req) + .and_then(|m| m.destination.as_ref()) + .map(|m| &m.name) + .map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -638,6 +721,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/DeleteObject"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.bucket).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -709,6 +803,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/RestoreObject"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.bucket).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -777,6 +882,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/GetObject"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.bucket).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -851,6 +967,20 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/UpdateObject"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req) + .and_then(|m| m.object.as_ref()) + .map(|m| &m.name) + .map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -919,6 +1049,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/ListObjects"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1010,6 +1151,19 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/RewriteObject"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req) + .map(|m| &m.destination_bucket) + .map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1078,6 +1232,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.v2.Storage/MoveObject"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.bucket).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner diff --git a/src/storage/src/generated/gapic_control/transport.rs b/src/storage/src/generated/gapic_control/transport.rs index 7a40646d2d..b940444b5d 100644 --- a/src/storage/src/generated/gapic_control/transport.rs +++ b/src/storage/src/generated/gapic_control/transport.rs @@ -123,6 +123,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/CreateFolder"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -207,6 +218,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/DeleteFolder"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -291,6 +313,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/GetFolder"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -364,6 +397,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/ListFolders"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -448,6 +492,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/RenameFolder"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -532,6 +587,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/DeleteFolderRecursive"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -616,6 +682,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/GetStorageLayout"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -689,6 +766,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/CreateManagedFolder"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -773,6 +861,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/DeleteManagedFolder"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -857,6 +956,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/GetManagedFolder"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -930,6 +1040,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/ListManagedFolders"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1003,6 +1124,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/CreateAnywhereCache"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1093,6 +1225,20 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/UpdateAnywhereCache"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req) + .and_then(|m| m.anywhere_cache.as_ref()) + .map(|m| &m.name) + .map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1177,6 +1323,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/DisableAnywhereCache"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1261,6 +1418,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/PauseAnywhereCache"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1345,6 +1513,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/ResumeAnywhereCache"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1429,6 +1608,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/GetAnywhereCache"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.name).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1502,6 +1692,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/ListAnywhereCaches"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.parent).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -1982,6 +2183,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/GetIamPolicy"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.resource).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -2084,6 +2296,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/SetIamPolicy"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.resource).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -2220,6 +2443,17 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.storage.control.v2.StorageControl/TestIamPermissions"); + let resource_name = (|| { + Some(format!( + "//storage.googleapis.com/{}", + Some(&req).map(|m| &m.resource).map(|s| s.as_str())?, + )) + })(); + let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { + attributes.set_resource_name(rn) + } else { + attributes + }; recorder.on_client_request(attributes); } self.inner @@ -2272,17 +2506,6 @@ impl super::stub::StorageControl for StorageControl { if let Some(recorder) = gaxi::observability::RequestRecorder::current() { let attributes = gaxi::observability::ClientRequestAttributes::default() .set_rpc_method("google.longrunning.Operations/GetOperation"); - let resource_name = (|| { - Some(format!( - "//storage.googleapis.com/{}", - Some(&req).map(|m| &m.name).map(|s| s.as_str())?, - )) - })(); - let attributes = if let Some(rn) = resource_name.filter(|s| !s.is_empty()) { - attributes.set_resource_name(rn) - } else { - attributes - }; recorder.on_client_request(attributes); } self.inner