#[non_exhaustive]pub struct Resource {
pub name: String,
pub display_name: String,
pub type: String,
pub cloud_provider: CloudProvider,
pub service: String,
pub location: String,
pub resource_path: Option<ResourcePath>,
pub resource_path_string: String,
pub cloud_provider_metadata: Option<CloudProviderMetadata>,
/* private fields */
}Expand description
Information related to the Google Cloud resource.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe full resource name of the resource. See: https://cloud.google.com/apis/design/resource_names#full_resource_name
display_name: StringThe human readable name of the resource.
type: StringThe full resource type of the resource.
cloud_provider: CloudProviderIndicates which cloud provider the finding is from.
service: StringThe service or resource provider associated with the resource.
location: StringThe region or location of the service (if applicable).
resource_path: Option<ResourcePath>Provides the path to the resource within the resource hierarchy.
resource_path_string: StringA string representation of the resource path.
For Google Cloud, it has the format of
organizations/{organization_id}/folders/{folder_id}/folders/{folder_id}/projects/{project_id}
where there can be any number of folders.
For AWS, it has the format of
org/{organization_id}/ou/{organizational_unit_id}/ou/{organizational_unit_id}/account/{account_id}
where there can be any number of organizational units.
For Azure, it has the format of
mg/{management_group_id}/mg/{management_group_id}/subscription/{subscription_id}/rg/{resource_group_name}
where there can be any number of management groups.
cloud_provider_metadata: Option<CloudProviderMetadata>The metadata associated with the cloud provider.
Implementations§
Source§impl Resource
impl Resource
pub fn new() -> Self
Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_cloud_provider<T: Into<CloudProvider>>(self, v: T) -> Self
pub fn set_cloud_provider<T: Into<CloudProvider>>(self, v: T) -> Self
Sets the value of cloud_provider.
§Example
use google_cloud_securitycenter_v2::model::CloudProvider;
let x0 = Resource::new().set_cloud_provider(CloudProvider::GoogleCloudPlatform);
let x1 = Resource::new().set_cloud_provider(CloudProvider::AmazonWebServices);
let x2 = Resource::new().set_cloud_provider(CloudProvider::MicrosoftAzure);Sourcepub fn set_service<T: Into<String>>(self, v: T) -> Self
pub fn set_service<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_location<T: Into<String>>(self, v: T) -> Self
pub fn set_location<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_resource_path<T>(self, v: T) -> Selfwhere
T: Into<ResourcePath>,
pub fn set_resource_path<T>(self, v: T) -> Selfwhere
T: Into<ResourcePath>,
Sets the value of resource_path.
§Example
use google_cloud_securitycenter_v2::model::ResourcePath;
let x = Resource::new().set_resource_path(ResourcePath::default()/* use setters */);Sourcepub fn set_or_clear_resource_path<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePath>,
pub fn set_or_clear_resource_path<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePath>,
Sets or clears the value of resource_path.
§Example
use google_cloud_securitycenter_v2::model::ResourcePath;
let x = Resource::new().set_or_clear_resource_path(Some(ResourcePath::default()/* use setters */));
let x = Resource::new().set_or_clear_resource_path(None::<ResourcePath>);Sourcepub fn set_resource_path_string<T: Into<String>>(self, v: T) -> Self
pub fn set_resource_path_string<T: Into<String>>(self, v: T) -> Self
Sets the value of resource_path_string.
§Example
let x = Resource::new().set_resource_path_string("example");Sourcepub fn set_cloud_provider_metadata<T: Into<Option<CloudProviderMetadata>>>(
self,
v: T,
) -> Self
pub fn set_cloud_provider_metadata<T: Into<Option<CloudProviderMetadata>>>( self, v: T, ) -> Self
Sets the value of cloud_provider_metadata.
Note that all the setters affecting cloud_provider_metadata are mutually
exclusive.
§Example
use google_cloud_securitycenter_v2::model::GcpMetadata;
let x = Resource::new().set_cloud_provider_metadata(Some(
google_cloud_securitycenter_v2::model::resource::CloudProviderMetadata::GcpMetadata(GcpMetadata::default().into())));Sourcepub fn gcp_metadata(&self) -> Option<&Box<GcpMetadata>>
pub fn gcp_metadata(&self) -> Option<&Box<GcpMetadata>>
The value of cloud_provider_metadata
if it holds a GcpMetadata, None if the field is not set or
holds a different branch.
Sourcepub fn set_gcp_metadata<T: Into<Box<GcpMetadata>>>(self, v: T) -> Self
pub fn set_gcp_metadata<T: Into<Box<GcpMetadata>>>(self, v: T) -> Self
Sets the value of cloud_provider_metadata
to hold a GcpMetadata.
Note that all the setters affecting cloud_provider_metadata are
mutually exclusive.
§Example
use google_cloud_securitycenter_v2::model::GcpMetadata;
let x = Resource::new().set_gcp_metadata(GcpMetadata::default()/* use setters */);
assert!(x.gcp_metadata().is_some());
assert!(x.aws_metadata().is_none());
assert!(x.azure_metadata().is_none());Sourcepub fn aws_metadata(&self) -> Option<&Box<AwsMetadata>>
pub fn aws_metadata(&self) -> Option<&Box<AwsMetadata>>
The value of cloud_provider_metadata
if it holds a AwsMetadata, None if the field is not set or
holds a different branch.
Sourcepub fn set_aws_metadata<T: Into<Box<AwsMetadata>>>(self, v: T) -> Self
pub fn set_aws_metadata<T: Into<Box<AwsMetadata>>>(self, v: T) -> Self
Sets the value of cloud_provider_metadata
to hold a AwsMetadata.
Note that all the setters affecting cloud_provider_metadata are
mutually exclusive.
§Example
use google_cloud_securitycenter_v2::model::AwsMetadata;
let x = Resource::new().set_aws_metadata(AwsMetadata::default()/* use setters */);
assert!(x.aws_metadata().is_some());
assert!(x.gcp_metadata().is_none());
assert!(x.azure_metadata().is_none());Sourcepub fn azure_metadata(&self) -> Option<&Box<AzureMetadata>>
pub fn azure_metadata(&self) -> Option<&Box<AzureMetadata>>
The value of cloud_provider_metadata
if it holds a AzureMetadata, None if the field is not set or
holds a different branch.
Sourcepub fn set_azure_metadata<T: Into<Box<AzureMetadata>>>(self, v: T) -> Self
pub fn set_azure_metadata<T: Into<Box<AzureMetadata>>>(self, v: T) -> Self
Sets the value of cloud_provider_metadata
to hold a AzureMetadata.
Note that all the setters affecting cloud_provider_metadata are
mutually exclusive.
§Example
use google_cloud_securitycenter_v2::model::AzureMetadata;
let x = Resource::new().set_azure_metadata(AzureMetadata::default()/* use setters */);
assert!(x.azure_metadata().is_some());
assert!(x.gcp_metadata().is_none());
assert!(x.aws_metadata().is_none());