aws-sdk-assurance 1.0.0

AWS SDK for AWS Assurance
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::start_resource_activities_query::_start_resource_activities_query_input::StartResourceActivitiesQueryInputBuilder;

pub use crate::operation::start_resource_activities_query::_start_resource_activities_query_output::StartResourceActivitiesQueryOutputBuilder;

impl crate::operation::start_resource_activities_query::builders::StartResourceActivitiesQueryInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::start_resource_activities_query::StartResourceActivitiesQueryOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_resource_activities_query::StartResourceActivitiesQueryError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.start_resource_activities_query();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `StartResourceActivitiesQuery`.
///
/// <p>Starts a query of the AWS API calls that an artificial intelligence (AI) agent on Amazon Bedrock AgentCore Runtime made. Use the results to audit which resources the agent touched in your account. Returns a query ID. To check the status of the query and get its results, call <code>GetResourceActivitiesQueryResults</code>.</p>
/// <p>The agent runtime that you query must be in your AWS account.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartResourceActivitiesQueryFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::start_resource_activities_query::builders::StartResourceActivitiesQueryInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::start_resource_activities_query::StartResourceActivitiesQueryOutput,
        crate::operation::start_resource_activities_query::StartResourceActivitiesQueryError,
    > for StartResourceActivitiesQueryFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::start_resource_activities_query::StartResourceActivitiesQueryOutput,
            crate::operation::start_resource_activities_query::StartResourceActivitiesQueryError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl StartResourceActivitiesQueryFluentBuilder {
    /// Creates a new `StartResourceActivitiesQueryFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the StartResourceActivitiesQuery as a reference.
    pub fn as_input(&self) -> &crate::operation::start_resource_activities_query::builders::StartResourceActivitiesQueryInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::start_resource_activities_query::StartResourceActivitiesQueryOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::start_resource_activities_query::StartResourceActivitiesQueryError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::start_resource_activities_query::StartResourceActivitiesQuery::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::start_resource_activities_query::StartResourceActivitiesQuery::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::start_resource_activities_query::StartResourceActivitiesQueryOutput,
        crate::operation::start_resource_activities_query::StartResourceActivitiesQueryError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The ARN of the environment to query in.</p>
    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.environment_arn(input.into());
        self
    }
    /// <p>The ARN of the environment to query in.</p>
    pub fn set_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_environment_arn(input);
        self
    }
    /// <p>The ARN of the environment to query in.</p>
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_environment_arn()
    }
    /// <p>The project to query in.</p>
    pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.project(input.into());
        self
    }
    /// <p>The project to query in.</p>
    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_project(input);
        self
    }
    /// <p>The project to query in.</p>
    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_project()
    }
    /// <p>The ARN of the agent runtime whose activity to query. The agent runtime must be in your AWS account.</p>
    pub fn actor_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.actor_arn(input.into());
        self
    }
    /// <p>The ARN of the agent runtime whose activity to query. The agent runtime must be in your AWS account.</p>
    pub fn set_actor_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_actor_arn(input);
        self
    }
    /// <p>The ARN of the agent runtime whose activity to query. The agent runtime must be in your AWS account.</p>
    pub fn get_actor_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_actor_arn()
    }
    /// <p>The start of the time range to query, inclusive. The default is 24 hours before the request.</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.start_time(input);
        self
    }
    /// <p>The start of the time range to query, inclusive. The default is 24 hours before the request.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_start_time(input);
        self
    }
    /// <p>The start of the time range to query, inclusive. The default is 24 hours before the request.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_start_time()
    }
    /// <p>The end of the time range to query, exclusive. The default is the time of the request.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.end_time(input);
        self
    }
    /// <p>The end of the time range to query, exclusive. The default is the time of the request.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_end_time(input);
        self
    }
    /// <p>The end of the time range to query, exclusive. The default is the time of the request.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_end_time()
    }
    ///
    /// Appends an item to `aggregationLevels`.
    ///
    /// To override the contents of this collection use [`set_aggregation_levels`](Self::set_aggregation_levels).
    ///
    /// <p>The ways to group the results. By default, the results include every grouping. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTION</code> – Call counts for each AWS service and API action.</p></li>
    /// <li>
    /// <p><code>RESOURCE</code> – Call counts for each resource.</p></li>
    /// <li>
    /// <p><code>SESSION</code> – The agent sessions in the time range.</p></li>
    /// </ul>
    pub fn aggregation_levels(mut self, input: crate::types::ActivityAggregationLevel) -> Self {
        self.inner = self.inner.aggregation_levels(input);
        self
    }
    /// <p>The ways to group the results. By default, the results include every grouping. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTION</code> – Call counts for each AWS service and API action.</p></li>
    /// <li>
    /// <p><code>RESOURCE</code> – Call counts for each resource.</p></li>
    /// <li>
    /// <p><code>SESSION</code> – The agent sessions in the time range.</p></li>
    /// </ul>
    pub fn set_aggregation_levels(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ActivityAggregationLevel>>) -> Self {
        self.inner = self.inner.set_aggregation_levels(input);
        self
    }
    /// <p>The ways to group the results. By default, the results include every grouping. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>ACTION</code> – Call counts for each AWS service and API action.</p></li>
    /// <li>
    /// <p><code>RESOURCE</code> – Call counts for each resource.</p></li>
    /// <li>
    /// <p><code>SESSION</code> – The agent sessions in the time range.</p></li>
    /// </ul>
    pub fn get_aggregation_levels(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ActivityAggregationLevel>> {
        self.inner.get_aggregation_levels()
    }
    ///
    /// Appends an item to `filters`.
    ///
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
    ///
    /// <p>The filters to apply to the results. A result must match every filter. Within one filter, a result must match at least one of the values. If you don't specify any filters, the query returns all activity in the time range.</p>
    pub fn filters(mut self, input: crate::types::ResourceActivitiesFilter) -> Self {
        self.inner = self.inner.filters(input);
        self
    }
    /// <p>The filters to apply to the results. A result must match every filter. Within one filter, a result must match at least one of the values. If you don't specify any filters, the query returns all activity in the time range.</p>
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceActivitiesFilter>>) -> Self {
        self.inner = self.inner.set_filters(input);
        self
    }
    /// <p>The filters to apply to the results. A result must match every filter. Within one filter, a result must match at least one of the values. If you don't specify any filters, the query returns all activity in the time range.</p>
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceActivitiesFilter>> {
        self.inner.get_filters()
    }
}