pub struct AssetServiceClient<T> { /* private fields */ }
Expand description

Asset service definition.

Implementations§

source§

impl<T> AssetServiceClient<T>
where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

source

pub fn new(inner: T) -> Self

source

pub fn with_origin(inner: T, origin: Uri) -> Self

source

pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> AssetServiceClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,

source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

source

pub async fn export_assets( &mut self, request: impl IntoRequest<ExportAssetsRequest>, ) -> Result<Response<Operation>, Status>

Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.

source

pub async fn list_assets( &mut self, request: impl IntoRequest<ListAssetsRequest>, ) -> Result<Response<ListAssetsResponse>, Status>

Lists assets with time and resource types and returns paged results in response.

source

pub async fn batch_get_assets_history( &mut self, request: impl IntoRequest<BatchGetAssetsHistoryRequest>, ) -> Result<Response<BatchGetAssetsHistoryResponse>, Status>

Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.

source

pub async fn create_feed( &mut self, request: impl IntoRequest<CreateFeedRequest>, ) -> Result<Response<Feed>, Status>

Creates a feed in a parent project/folder/organization to listen to its asset updates.

source

pub async fn get_feed( &mut self, request: impl IntoRequest<GetFeedRequest>, ) -> Result<Response<Feed>, Status>

Gets details about an asset feed.

source

pub async fn list_feeds( &mut self, request: impl IntoRequest<ListFeedsRequest>, ) -> Result<Response<ListFeedsResponse>, Status>

Lists all asset feeds in a parent project/folder/organization.

source

pub async fn update_feed( &mut self, request: impl IntoRequest<UpdateFeedRequest>, ) -> Result<Response<Feed>, Status>

Updates an asset feed configuration.

source

pub async fn delete_feed( &mut self, request: impl IntoRequest<DeleteFeedRequest>, ) -> Result<Response<()>, Status>

Deletes an asset feed.

source

pub async fn search_all_resources( &mut self, request: impl IntoRequest<SearchAllResourcesRequest>, ) -> Result<Response<SearchAllResourcesResponse>, Status>

Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllResources permission on the desired scope, otherwise the request will be rejected.

source

pub async fn search_all_iam_policies( &mut self, request: impl IntoRequest<SearchAllIamPoliciesRequest>, ) -> Result<Response<SearchAllIamPoliciesResponse>, Status>

Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllIamPolicies permission on the desired scope, otherwise the request will be rejected.

source

pub async fn analyze_iam_policy( &mut self, request: impl IntoRequest<AnalyzeIamPolicyRequest>, ) -> Result<Response<AnalyzeIamPolicyResponse>, Status>

Analyzes IAM policies to answer which identities have what accesses on which resources.

source

pub async fn analyze_iam_policy_longrunning( &mut self, request: impl IntoRequest<AnalyzeIamPolicyLongrunningRequest>, ) -> Result<Response<Operation>, Status>

Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.

source

pub async fn analyze_move( &mut self, request: impl IntoRequest<AnalyzeMoveRequest>, ) -> Result<Response<AnalyzeMoveResponse>, Status>

Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user’s permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.

source

pub async fn query_assets( &mut self, request: impl IntoRequest<QueryAssetsRequest>, ) -> Result<Response<QueryAssetsResponse>, Status>

Issue a job that queries assets using a SQL statement compatible with BigQuery SQL.

If the query execution finishes within timeout and there’s no pagination, the full query results will be returned in the QueryAssetsResponse.

Otherwise, full query results can be obtained by issuing extra requests with the job_reference from the a previous QueryAssets call.

Note, the query result has approximately 10 GB limitation enforced by BigQuery. Queries return larger results will result in errors.

source

pub async fn create_saved_query( &mut self, request: impl IntoRequest<CreateSavedQueryRequest>, ) -> Result<Response<SavedQuery>, Status>

Creates a saved query in a parent project/folder/organization.

source

pub async fn get_saved_query( &mut self, request: impl IntoRequest<GetSavedQueryRequest>, ) -> Result<Response<SavedQuery>, Status>

Gets details about a saved query.

source

pub async fn list_saved_queries( &mut self, request: impl IntoRequest<ListSavedQueriesRequest>, ) -> Result<Response<ListSavedQueriesResponse>, Status>

Lists all saved queries in a parent project/folder/organization.

source

pub async fn update_saved_query( &mut self, request: impl IntoRequest<UpdateSavedQueryRequest>, ) -> Result<Response<SavedQuery>, Status>

Updates a saved query.

source

pub async fn delete_saved_query( &mut self, request: impl IntoRequest<DeleteSavedQueryRequest>, ) -> Result<Response<()>, Status>

Deletes a saved query.

source

pub async fn batch_get_effective_iam_policies( &mut self, request: impl IntoRequest<BatchGetEffectiveIamPoliciesRequest>, ) -> Result<Response<BatchGetEffectiveIamPoliciesResponse>, Status>

Gets effective IAM policies for a batch of resources.

source

pub async fn analyze_org_policies( &mut self, request: impl IntoRequest<AnalyzeOrgPoliciesRequest>, ) -> Result<Response<AnalyzeOrgPoliciesResponse>, Status>

Analyzes organization policies under a scope.

source

pub async fn analyze_org_policy_governed_containers( &mut self, request: impl IntoRequest<AnalyzeOrgPolicyGovernedContainersRequest>, ) -> Result<Response<AnalyzeOrgPolicyGovernedContainersResponse>, Status>

Analyzes organization policies governed containers (projects, folders or organization) under a scope.

source

pub async fn analyze_org_policy_governed_assets( &mut self, request: impl IntoRequest<AnalyzeOrgPolicyGovernedAssetsRequest>, ) -> Result<Response<AnalyzeOrgPolicyGovernedAssetsResponse>, Status>

Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following canned constraints:

  • constraints/ainotebooks.accessMode
  • constraints/ainotebooks.disableFileDownloads
  • constraints/ainotebooks.disableRootAccess
  • constraints/ainotebooks.disableTerminal
  • constraints/ainotebooks.environmentOptions
  • constraints/ainotebooks.requireAutoUpgradeSchedule
  • constraints/ainotebooks.restrictVpcNetworks
  • constraints/compute.disableGuestAttributesAccess
  • constraints/compute.disableInstanceDataAccessApis
  • constraints/compute.disableNestedVirtualization
  • constraints/compute.disableSerialPortAccess
  • constraints/compute.disableSerialPortLogging
  • constraints/compute.disableVpcExternalIpv6
  • constraints/compute.requireOsLogin
  • constraints/compute.requireShieldedVm
  • constraints/compute.restrictLoadBalancerCreationForTypes
  • constraints/compute.restrictProtocolForwardingCreationForTypes
  • constraints/compute.restrictXpnProjectLienRemoval
  • constraints/compute.setNewProjectDefaultToZonalDNSOnly
  • constraints/compute.skipDefaultNetworkCreation
  • constraints/compute.trustedImageProjects
  • constraints/compute.vmCanIpForward
  • constraints/compute.vmExternalIpAccess
  • constraints/gcp.detailedAuditLoggingMode
  • constraints/gcp.resourceLocations
  • constraints/iam.allowedPolicyMemberDomains
  • constraints/iam.automaticIamGrantsForDefaultServiceAccounts
  • constraints/iam.disableServiceAccountCreation
  • constraints/iam.disableServiceAccountKeyCreation
  • constraints/iam.disableServiceAccountKeyUpload
  • constraints/iam.restrictCrossProjectServiceAccountLienRemoval
  • constraints/iam.serviceAccountKeyExpiryHours
  • constraints/resourcemanager.accessBoundaries
  • constraints/resourcemanager.allowedExportDestinations
  • constraints/sql.restrictAuthorizedNetworks
  • constraints/sql.restrictNoncompliantDiagnosticDataAccess
  • constraints/sql.restrictNoncompliantResourceCreation
  • constraints/sql.restrictPublicIp
  • constraints/storage.publicAccessPrevention
  • constraints/storage.restrictAuthTypes
  • constraints/storage.uniformBucketLevelAccess

This RPC only returns either resources of types supported by search APIs or IAM policies.

Trait Implementations§

source§

impl<T: Clone> Clone for AssetServiceClient<T>

source§

fn clone(&self) -> AssetServiceClient<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for AssetServiceClient<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for AssetServiceClient<T>

§

impl<T> RefUnwindSafe for AssetServiceClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for AssetServiceClient<T>
where T: Send,

§

impl<T> Sync for AssetServiceClient<T>
where T: Sync,

§

impl<T> Unpin for AssetServiceClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for AssetServiceClient<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more