Struct google_cloudasset1::api::AssetListCall
source · pub struct AssetListCall<'a, S>where
S: 'a,{ /* private fields */ }
Expand description
Lists assets with time and resource types and returns paged results in response.
A builder for the list method supported by a asset resource.
It is not used directly, but through a AssetMethods
instance.
§Example
Instantiate a resource method builder
// You can configure optional parameters by calling the respective setters at will, and
// execute the final call using `doit()`.
// Values shown here are possibly random and not representative !
let result = hub.assets().list("parent")
.add_relationship_types("voluptua.")
.read_time(chrono::Utc::now())
.page_token("At")
.page_size(-8)
.content_type("sed")
.add_asset_types("amet.")
.doit().await;
Implementations§
source§impl<'a, S> AssetListCall<'a, S>
impl<'a, S> AssetListCall<'a, S>
sourcepub async fn doit(self) -> Result<(Response<Body>, ListAssetsResponse)>
pub async fn doit(self) -> Result<(Response<Body>, ListAssetsResponse)>
Perform the operation you have build so far.
sourcepub fn parent(self, new_value: &str) -> AssetListCall<'a, S>
pub fn parent(self, new_value: &str) -> AssetListCall<'a, S>
Required. Name of the organization, folder, or project the assets belong to. Format: “organizations/[organization-number]” (such as “organizations/123”), “projects/[project-id]” (such as “projects/my-project-id”), “projects/[project-number]” (such as “projects/12345”), or “folders/[folder-number]” (such as “folders/12345”).
Sets the parent path property to the given value.
Even though the property as already been set when instantiating this call, we provide this method for API completeness.
sourcepub fn add_relationship_types(self, new_value: &str) -> AssetListCall<'a, S>
pub fn add_relationship_types(self, new_value: &str) -> AssetListCall<'a, S>
A list of relationship types to output, for example: INSTANCE_TO_INSTANCEGROUP
. This field should only be specified if content_type=RELATIONSHIP. * If specified: it snapshots specified relationships. It returns an error if any of the [relationship_types] doesn’t belong to the supported relationship types of the [asset_types] or if any of the [asset_types] doesn’t belong to the source types of the [relationship_types]. * Otherwise: it snapshots the supported relationships for all [asset_types] or returns an error if any of the [asset_types] has no relationship support. An unspecified asset types field means all supported asset_types. See Introduction to Cloud Asset Inventory for all supported asset types and relationship types.
Append the given value to the relationship types query property. Each appended value will retain its original ordering and be ‘/’-separated in the URL’s parameters.
sourcepub fn read_time(self, new_value: DateTime<Utc>) -> AssetListCall<'a, S>
pub fn read_time(self, new_value: DateTime<Utc>) -> AssetListCall<'a, S>
Timestamp to take an asset snapshot. This can only be set to a timestamp between the current time and the current time minus 35 days (inclusive). If not specified, the current time will be used. Due to delays in resource data collection and indexing, there is a volatile window during which running the same query may get different results.
Sets the read time query property to the given value.
sourcepub fn page_token(self, new_value: &str) -> AssetListCall<'a, S>
pub fn page_token(self, new_value: &str) -> AssetListCall<'a, S>
The next_page_token
returned from the previous ListAssetsResponse
, or unspecified for the first ListAssetsRequest
. It is a continuation of a prior ListAssets
call, and the API should return the next page of assets.
Sets the page token query property to the given value.
sourcepub fn page_size(self, new_value: i32) -> AssetListCall<'a, S>
pub fn page_size(self, new_value: i32) -> AssetListCall<'a, S>
The maximum number of assets to be returned in a single response. Default is 100, minimum is 1, and maximum is 1000.
Sets the page size query property to the given value.
sourcepub fn content_type(self, new_value: &str) -> AssetListCall<'a, S>
pub fn content_type(self, new_value: &str) -> AssetListCall<'a, S>
Asset content type. If not specified, no content but the asset name will be returned.
Sets the content type query property to the given value.
sourcepub fn add_asset_types(self, new_value: &str) -> AssetListCall<'a, S>
pub fn add_asset_types(self, new_value: &str) -> AssetListCall<'a, S>
A list of asset types to take a snapshot for. For example: “compute.googleapis.com/Disk”. Regular expression is also supported. For example: * “compute.googleapis.com.*” snapshots resources whose asset type starts with “compute.googleapis.com”. * “.*Instance” snapshots resources whose asset type ends with “Instance”. * “.Instance.” snapshots resources whose asset type contains “Instance”. See RE2 for all supported regular expression syntax. If the regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned. If specified, only matching assets will be returned, otherwise, it will snapshot all asset types. See Introduction to Cloud Asset Inventory for all supported asset types.
Append the given value to the asset types query property. Each appended value will retain its original ordering and be ‘/’-separated in the URL’s parameters.
sourcepub fn delegate(self, new_value: &'a mut dyn Delegate) -> AssetListCall<'a, S>
pub fn delegate(self, new_value: &'a mut dyn Delegate) -> AssetListCall<'a, S>
The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong while executing the actual API request.
It should be used to handle progress information, and to implement a certain level of resilience.
Sets the delegate property to the given value.
sourcepub fn param<T>(self, name: T, value: T) -> AssetListCall<'a, S>
pub fn param<T>(self, name: T, value: T) -> AssetListCall<'a, S>
Set any additional parameter of the query string used in the request. It should be used to set parameters which are not yet available through their own setters.
Please note that this method must not be used to set any of the known parameters which have their own setter method. If done anyway, the request will fail.
§Additional Parameters
- $.xgafv (query-string) - V1 error format.
- access_token (query-string) - OAuth access token.
- alt (query-string) - Data format for response.
- callback (query-string) - JSONP
- fields (query-string) - Selector specifying which fields to include in a partial response.
- key (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
- oauth_token (query-string) - OAuth 2.0 token for the current user.
- prettyPrint (query-boolean) - Returns response with indentations and line breaks.
- quotaUser (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
- uploadType (query-string) - Legacy upload protocol for media (e.g. “media”, “multipart”).
- upload_protocol (query-string) - Upload protocol for media (e.g. “raw”, “multipart”).
sourcepub fn add_scope<St>(self, scope: St) -> AssetListCall<'a, S>
pub fn add_scope<St>(self, scope: St) -> AssetListCall<'a, S>
Identifies the authorization scope for the method you are building.
Use this method to actively specify which scope should be used, instead of the default Scope
variant
Scope::CloudPlatform
.
The scope
will be added to a set of scopes. This is important as one can maintain access
tokens for more than one scope.
Usually there is more than one suitable scope to authorize an operation, some of which may encompass more rights than others. For example, for listing resources, a read-only scope will be sufficient, a read-write scope will do as well.
sourcepub fn add_scopes<I, St>(self, scopes: I) -> AssetListCall<'a, S>
pub fn add_scopes<I, St>(self, scopes: I) -> AssetListCall<'a, S>
Identifies the authorization scope(s) for the method you are building.
See Self::add_scope()
for details.
sourcepub fn clear_scopes(self) -> AssetListCall<'a, S>
pub fn clear_scopes(self) -> AssetListCall<'a, S>
Removes all scopes, and no default scope will be used either.
In this case, you have to specify your API-key using the key
parameter (see Self::param()
for details).