pub struct Client { /* private fields */ }
Expand description
Client for Amazon Inspector
Client for invoking operations on Amazon Inspector. Each operation on Amazon Inspector is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_inspector::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Builder
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_inspector::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateAssessmentTarget
operation has
a Client::create_assessment_target
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_assessment_target()
.assessment_target_name("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn add_attributes_to_findings(&self) -> AddAttributesToFindingsFluentBuilder
pub fn add_attributes_to_findings(&self) -> AddAttributesToFindingsFluentBuilder
Constructs a fluent builder for the AddAttributesToFindings
operation.
- The fluent builder is configurable:
finding_arns(impl Into<String>)
/set_finding_arns(Option<Vec::<String>>)
:
required: trueThe ARNs that specify the findings that you want to assign attributes to.
attributes(Attribute)
/set_attributes(Option<Vec::<Attribute>>)
:
required: trueThe array of attributes that you want to assign to specified findings.
- On success, responds with
AddAttributesToFindingsOutput
with field(s):failed_items(HashMap::<String, FailedItemDetails>)
:Attribute details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<AddAttributesToFindingsError>
Source§impl Client
impl Client
Sourcepub fn create_assessment_target(&self) -> CreateAssessmentTargetFluentBuilder
pub fn create_assessment_target(&self) -> CreateAssessmentTargetFluentBuilder
Constructs a fluent builder for the CreateAssessmentTarget
operation.
- The fluent builder is configurable:
assessment_target_name(impl Into<String>)
/set_assessment_target_name(Option<String>)
:
required: trueThe user-defined name that identifies the assessment target that you want to create. The name must be unique within the AWS account.
resource_group_arn(impl Into<String>)
/set_resource_group_arn(Option<String>)
:
required: falseThe ARN that specifies the resource group that is used to create the assessment target. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.
- On success, responds with
CreateAssessmentTargetOutput
with field(s):assessment_target_arn(String)
:The ARN that specifies the assessment target that is created.
- On failure, responds with
SdkError<CreateAssessmentTargetError>
Source§impl Client
impl Client
Sourcepub fn create_assessment_template(
&self,
) -> CreateAssessmentTemplateFluentBuilder
pub fn create_assessment_template( &self, ) -> CreateAssessmentTemplateFluentBuilder
Constructs a fluent builder for the CreateAssessmentTemplate
operation.
- The fluent builder is configurable:
assessment_target_arn(impl Into<String>)
/set_assessment_target_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment target for which you want to create the assessment template.
assessment_template_name(impl Into<String>)
/set_assessment_template_name(Option<String>)
:
required: trueThe user-defined name that identifies the assessment template that you want to create. You can create several assessment templates for an assessment target. The names of the assessment templates that correspond to a particular assessment target must be unique.
duration_in_seconds(i32)
/set_duration_in_seconds(Option<i32>)
:
required: trueThe duration of the assessment run in seconds.
rules_package_arns(impl Into<String>)
/set_rules_package_arns(Option<Vec::<String>>)
:
required: trueThe ARNs that specify the rules packages that you want to attach to the assessment template.
user_attributes_for_findings(Attribute)
/set_user_attributes_for_findings(Option<Vec::<Attribute>>)
:
required: falseThe user-defined attributes that are assigned to every finding that is generated by the assessment run that uses this assessment template. An attribute is a key and value pair (an
Attribute
object). Within an assessment template, each key must be unique.
- On success, responds with
CreateAssessmentTemplateOutput
with field(s):assessment_template_arn(String)
:The ARN that specifies the assessment template that is created.
- On failure, responds with
SdkError<CreateAssessmentTemplateError>
Source§impl Client
impl Client
Sourcepub fn create_exclusions_preview(&self) -> CreateExclusionsPreviewFluentBuilder
pub fn create_exclusions_preview(&self) -> CreateExclusionsPreviewFluentBuilder
Constructs a fluent builder for the CreateExclusionsPreview
operation.
- The fluent builder is configurable:
assessment_template_arn(impl Into<String>)
/set_assessment_template_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment template for which you want to create an exclusions preview.
- On success, responds with
CreateExclusionsPreviewOutput
with field(s):preview_token(String)
:Specifies the unique identifier of the requested exclusions preview. You can use the unique identifier to retrieve the exclusions preview when running the GetExclusionsPreview API.
- On failure, responds with
SdkError<CreateExclusionsPreviewError>
Source§impl Client
impl Client
Sourcepub fn create_resource_group(&self) -> CreateResourceGroupFluentBuilder
pub fn create_resource_group(&self) -> CreateResourceGroupFluentBuilder
Constructs a fluent builder for the CreateResourceGroup
operation.
- The fluent builder is configurable:
resource_group_tags(ResourceGroupTag)
/set_resource_group_tags(Option<Vec::<ResourceGroupTag>>)
:
required: trueA collection of keys and an array of possible values, ‘[{“key”:“key1”,“values”:[“Value1”,“Value2”]},{“key”:“Key2”,“values”:[“Value3”]}]’.
For example,‘[{“key”:“Name”,“values”:[“TestEC2Instance”]}]’.
- On success, responds with
CreateResourceGroupOutput
with field(s):resource_group_arn(String)
:The ARN that specifies the resource group that is created.
- On failure, responds with
SdkError<CreateResourceGroupError>
Source§impl Client
impl Client
Sourcepub fn delete_assessment_run(&self) -> DeleteAssessmentRunFluentBuilder
pub fn delete_assessment_run(&self) -> DeleteAssessmentRunFluentBuilder
Constructs a fluent builder for the DeleteAssessmentRun
operation.
- The fluent builder is configurable:
assessment_run_arn(impl Into<String>)
/set_assessment_run_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment run that you want to delete.
- On success, responds with
DeleteAssessmentRunOutput
- On failure, responds with
SdkError<DeleteAssessmentRunError>
Source§impl Client
impl Client
Sourcepub fn delete_assessment_target(&self) -> DeleteAssessmentTargetFluentBuilder
pub fn delete_assessment_target(&self) -> DeleteAssessmentTargetFluentBuilder
Constructs a fluent builder for the DeleteAssessmentTarget
operation.
- The fluent builder is configurable:
assessment_target_arn(impl Into<String>)
/set_assessment_target_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment target that you want to delete.
- On success, responds with
DeleteAssessmentTargetOutput
- On failure, responds with
SdkError<DeleteAssessmentTargetError>
Source§impl Client
impl Client
Sourcepub fn delete_assessment_template(
&self,
) -> DeleteAssessmentTemplateFluentBuilder
pub fn delete_assessment_template( &self, ) -> DeleteAssessmentTemplateFluentBuilder
Constructs a fluent builder for the DeleteAssessmentTemplate
operation.
- The fluent builder is configurable:
assessment_template_arn(impl Into<String>)
/set_assessment_template_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment template that you want to delete.
- On success, responds with
DeleteAssessmentTemplateOutput
- On failure, responds with
SdkError<DeleteAssessmentTemplateError>
Source§impl Client
impl Client
Sourcepub fn describe_assessment_runs(&self) -> DescribeAssessmentRunsFluentBuilder
pub fn describe_assessment_runs(&self) -> DescribeAssessmentRunsFluentBuilder
Constructs a fluent builder for the DescribeAssessmentRuns
operation.
- The fluent builder is configurable:
assessment_run_arns(impl Into<String>)
/set_assessment_run_arns(Option<Vec::<String>>)
:
required: trueThe ARN that specifies the assessment run that you want to describe.
- On success, responds with
DescribeAssessmentRunsOutput
with field(s):assessment_runs(Vec::<AssessmentRun>)
:Information about the assessment run.
failed_items(HashMap::<String, FailedItemDetails>)
:Assessment run details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<DescribeAssessmentRunsError>
Source§impl Client
impl Client
Sourcepub fn describe_assessment_targets(
&self,
) -> DescribeAssessmentTargetsFluentBuilder
pub fn describe_assessment_targets( &self, ) -> DescribeAssessmentTargetsFluentBuilder
Constructs a fluent builder for the DescribeAssessmentTargets
operation.
- The fluent builder is configurable:
assessment_target_arns(impl Into<String>)
/set_assessment_target_arns(Option<Vec::<String>>)
:
required: trueThe ARNs that specifies the assessment targets that you want to describe.
- On success, responds with
DescribeAssessmentTargetsOutput
with field(s):assessment_targets(Vec::<AssessmentTarget>)
:Information about the assessment targets.
failed_items(HashMap::<String, FailedItemDetails>)
:Assessment target details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<DescribeAssessmentTargetsError>
Source§impl Client
impl Client
Sourcepub fn describe_assessment_templates(
&self,
) -> DescribeAssessmentTemplatesFluentBuilder
pub fn describe_assessment_templates( &self, ) -> DescribeAssessmentTemplatesFluentBuilder
Constructs a fluent builder for the DescribeAssessmentTemplates
operation.
- The fluent builder is configurable:
assessment_template_arns(impl Into<String>)
/set_assessment_template_arns(Option<Vec::<String>>)
:
required: true
(undocumented)
- On success, responds with
DescribeAssessmentTemplatesOutput
with field(s):assessment_templates(Vec::<AssessmentTemplate>)
:Information about the assessment templates.
failed_items(HashMap::<String, FailedItemDetails>)
:Assessment template details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<DescribeAssessmentTemplatesError>
Source§impl Client
impl Client
Sourcepub fn describe_cross_account_access_role(
&self,
) -> DescribeCrossAccountAccessRoleFluentBuilder
pub fn describe_cross_account_access_role( &self, ) -> DescribeCrossAccountAccessRoleFluentBuilder
Constructs a fluent builder for the DescribeCrossAccountAccessRole
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeCrossAccountAccessRoleOutput
with field(s):role_arn(String)
:The ARN that specifies the IAM role that Amazon Inspector uses to access your AWS account.
valid(bool)
:A Boolean value that specifies whether the IAM role has the necessary policies attached to enable Amazon Inspector to access your AWS account.
registered_at(DateTime)
:The date when the cross-account access role was registered.
- On failure, responds with
SdkError<DescribeCrossAccountAccessRoleError>
Source§impl Client
impl Client
Sourcepub fn describe_exclusions(&self) -> DescribeExclusionsFluentBuilder
pub fn describe_exclusions(&self) -> DescribeExclusionsFluentBuilder
Constructs a fluent builder for the DescribeExclusions
operation.
- The fluent builder is configurable:
exclusion_arns(impl Into<String>)
/set_exclusion_arns(Option<Vec::<String>>)
:
required: trueThe list of ARNs that specify the exclusions that you want to describe.
locale(Locale)
/set_locale(Option<Locale>)
:
required: falseThe locale into which you want to translate the exclusion’s title, description, and recommendation.
- On success, responds with
DescribeExclusionsOutput
with field(s):exclusions(HashMap::<String, Exclusion>)
:Information about the exclusions.
failed_items(HashMap::<String, FailedItemDetails>)
:Exclusion details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<DescribeExclusionsError>
Source§impl Client
impl Client
Sourcepub fn describe_findings(&self) -> DescribeFindingsFluentBuilder
pub fn describe_findings(&self) -> DescribeFindingsFluentBuilder
Constructs a fluent builder for the DescribeFindings
operation.
- The fluent builder is configurable:
finding_arns(impl Into<String>)
/set_finding_arns(Option<Vec::<String>>)
:
required: trueThe ARN that specifies the finding that you want to describe.
locale(Locale)
/set_locale(Option<Locale>)
:
required: falseThe locale into which you want to translate a finding description, recommendation, and the short description that identifies the finding.
- On success, responds with
DescribeFindingsOutput
with field(s):findings(Vec::<Finding>)
:Information about the finding.
failed_items(HashMap::<String, FailedItemDetails>)
:Finding details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<DescribeFindingsError>
Source§impl Client
impl Client
Sourcepub fn describe_resource_groups(&self) -> DescribeResourceGroupsFluentBuilder
pub fn describe_resource_groups(&self) -> DescribeResourceGroupsFluentBuilder
Constructs a fluent builder for the DescribeResourceGroups
operation.
- The fluent builder is configurable:
resource_group_arns(impl Into<String>)
/set_resource_group_arns(Option<Vec::<String>>)
:
required: trueThe ARN that specifies the resource group that you want to describe.
- On success, responds with
DescribeResourceGroupsOutput
with field(s):resource_groups(Vec::<ResourceGroup>)
:Information about a resource group.
failed_items(HashMap::<String, FailedItemDetails>)
:Resource group details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<DescribeResourceGroupsError>
Source§impl Client
impl Client
Sourcepub fn describe_rules_packages(&self) -> DescribeRulesPackagesFluentBuilder
pub fn describe_rules_packages(&self) -> DescribeRulesPackagesFluentBuilder
Constructs a fluent builder for the DescribeRulesPackages
operation.
- The fluent builder is configurable:
rules_package_arns(impl Into<String>)
/set_rules_package_arns(Option<Vec::<String>>)
:
required: trueThe ARN that specifies the rules package that you want to describe.
locale(Locale)
/set_locale(Option<Locale>)
:
required: falseThe locale that you want to translate a rules package description into.
- On success, responds with
DescribeRulesPackagesOutput
with field(s):rules_packages(Vec::<RulesPackage>)
:Information about the rules package.
failed_items(HashMap::<String, FailedItemDetails>)
:Rules package details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<DescribeRulesPackagesError>
Source§impl Client
impl Client
Sourcepub fn get_assessment_report(&self) -> GetAssessmentReportFluentBuilder
pub fn get_assessment_report(&self) -> GetAssessmentReportFluentBuilder
Constructs a fluent builder for the GetAssessmentReport
operation.
- The fluent builder is configurable:
assessment_run_arn(impl Into<String>)
/set_assessment_run_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment run for which you want to generate a report.
report_file_format(ReportFileFormat)
/set_report_file_format(Option<ReportFileFormat>)
:
required: trueSpecifies the file format (html or pdf) of the assessment report that you want to generate.
report_type(ReportType)
/set_report_type(Option<ReportType>)
:
required: trueSpecifies the type of the assessment report that you want to generate. There are two types of assessment reports: a finding report and a full report. For more information, see Assessment Reports.
- On success, responds with
GetAssessmentReportOutput
with field(s):status(ReportStatus)
:Specifies the status of the request to generate an assessment report.
url(Option<String>)
:Specifies the URL where you can find the generated assessment report. This parameter is only returned if the report is successfully generated.
- On failure, responds with
SdkError<GetAssessmentReportError>
Source§impl Client
impl Client
Sourcepub fn get_exclusions_preview(&self) -> GetExclusionsPreviewFluentBuilder
pub fn get_exclusions_preview(&self) -> GetExclusionsPreviewFluentBuilder
Constructs a fluent builder for the GetExclusionsPreview
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
assessment_template_arn(impl Into<String>)
/set_assessment_template_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment template for which the exclusions preview was requested.
preview_token(impl Into<String>)
/set_preview_token(Option<String>)
:
required: trueThe unique identifier associated of the exclusions preview.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the GetExclusionsPreviewRequest action. Subsequent calls to the action fill nextToken in the request with the value of nextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items you want in the response. The default value is 100. The maximum value is 500.
locale(Locale)
/set_locale(Option<Locale>)
:
required: falseThe locale into which you want to translate the exclusion’s title, description, and recommendation.
- On success, responds with
GetExclusionsPreviewOutput
with field(s):preview_status(PreviewStatus)
:Specifies the status of the request to generate an exclusions preview.
exclusion_previews(Option<Vec::<ExclusionPreview>>)
:Information about the exclusions included in the preview.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameters is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<GetExclusionsPreviewError>
Source§impl Client
impl Client
Sourcepub fn get_telemetry_metadata(&self) -> GetTelemetryMetadataFluentBuilder
pub fn get_telemetry_metadata(&self) -> GetTelemetryMetadataFluentBuilder
Constructs a fluent builder for the GetTelemetryMetadata
operation.
- The fluent builder is configurable:
assessment_run_arn(impl Into<String>)
/set_assessment_run_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment run that has the telemetry data that you want to obtain.
- On success, responds with
GetTelemetryMetadataOutput
with field(s):telemetry_metadata(Vec::<TelemetryMetadata>)
:Telemetry details.
- On failure, responds with
SdkError<GetTelemetryMetadataError>
Source§impl Client
impl Client
Sourcepub fn list_assessment_run_agents(&self) -> ListAssessmentRunAgentsFluentBuilder
pub fn list_assessment_run_agents(&self) -> ListAssessmentRunAgentsFluentBuilder
Constructs a fluent builder for the ListAssessmentRunAgents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
assessment_run_arn(impl Into<String>)
/set_assessment_run_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment run whose agents you want to list.
filter(AgentFilter)
/set_filter(Option<AgentFilter>)
:
required: falseYou can use this parameter to specify a subset of data to be included in the action’s response.
For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListAssessmentRunAgents action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items that you want in the response. The default value is 10. The maximum value is 500.
- On success, responds with
ListAssessmentRunAgentsOutput
with field(s):assessment_run_agents(Vec::<AssessmentRunAgent>)
:A list of ARNs that specifies the agents returned by the action.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListAssessmentRunAgentsError>
Source§impl Client
impl Client
Sourcepub fn list_assessment_runs(&self) -> ListAssessmentRunsFluentBuilder
pub fn list_assessment_runs(&self) -> ListAssessmentRunsFluentBuilder
Constructs a fluent builder for the ListAssessmentRuns
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
assessment_template_arns(impl Into<String>)
/set_assessment_template_arns(Option<Vec::<String>>)
:
required: falseThe ARNs that specify the assessment templates whose assessment runs you want to list.
filter(AssessmentRunFilter)
/set_filter(Option<AssessmentRunFilter>)
:
required: falseYou can use this parameter to specify a subset of data to be included in the action’s response.
For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListAssessmentRuns action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items that you want in the response. The default value is 10. The maximum value is 500.
- On success, responds with
ListAssessmentRunsOutput
with field(s):assessment_run_arns(Vec::<String>)
:A list of ARNs that specifies the assessment runs that are returned by the action.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListAssessmentRunsError>
Source§impl Client
impl Client
Sourcepub fn list_assessment_targets(&self) -> ListAssessmentTargetsFluentBuilder
pub fn list_assessment_targets(&self) -> ListAssessmentTargetsFluentBuilder
Constructs a fluent builder for the ListAssessmentTargets
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
filter(AssessmentTargetFilter)
/set_filter(Option<AssessmentTargetFilter>)
:
required: falseYou can use this parameter to specify a subset of data to be included in the action’s response.
For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListAssessmentTargets action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.
- On success, responds with
ListAssessmentTargetsOutput
with field(s):assessment_target_arns(Vec::<String>)
:A list of ARNs that specifies the assessment targets that are returned by the action.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListAssessmentTargetsError>
Source§impl Client
impl Client
Sourcepub fn list_assessment_templates(&self) -> ListAssessmentTemplatesFluentBuilder
pub fn list_assessment_templates(&self) -> ListAssessmentTemplatesFluentBuilder
Constructs a fluent builder for the ListAssessmentTemplates
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
assessment_target_arns(impl Into<String>)
/set_assessment_target_arns(Option<Vec::<String>>)
:
required: falseA list of ARNs that specifies the assessment targets whose assessment templates you want to list.
filter(AssessmentTemplateFilter)
/set_filter(Option<AssessmentTemplateFilter>)
:
required: falseYou can use this parameter to specify a subset of data to be included in the action’s response.
For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListAssessmentTemplates action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.
- On success, responds with
ListAssessmentTemplatesOutput
with field(s):assessment_template_arns(Vec::<String>)
:A list of ARNs that specifies the assessment templates returned by the action.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListAssessmentTemplatesError>
Source§impl Client
impl Client
Sourcepub fn list_event_subscriptions(&self) -> ListEventSubscriptionsFluentBuilder
pub fn list_event_subscriptions(&self) -> ListEventSubscriptionsFluentBuilder
Constructs a fluent builder for the ListEventSubscriptions
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: falseThe ARN of the assessment template for which you want to list the existing event subscriptions.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListEventSubscriptions action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.
- On success, responds with
ListEventSubscriptionsOutput
with field(s):subscriptions(Vec::<Subscription>)
:Details of the returned event subscriptions.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListEventSubscriptionsError>
Source§impl Client
impl Client
Sourcepub fn list_exclusions(&self) -> ListExclusionsFluentBuilder
pub fn list_exclusions(&self) -> ListExclusionsFluentBuilder
Constructs a fluent builder for the ListExclusions
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
assessment_run_arn(impl Into<String>)
/set_assessment_run_arn(Option<String>)
:
required: trueThe ARN of the assessment run that generated the exclusions that you want to list.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListExclusionsRequest action. Subsequent calls to the action fill nextToken in the request with the value of nextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items you want in the response. The default value is 100. The maximum value is 500.
- On success, responds with
ListExclusionsOutput
with field(s):exclusion_arns(Vec::<String>)
:A list of exclusions’ ARNs returned by the action.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameters is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListExclusionsError>
Source§impl Client
impl Client
Sourcepub fn list_findings(&self) -> ListFindingsFluentBuilder
pub fn list_findings(&self) -> ListFindingsFluentBuilder
Constructs a fluent builder for the ListFindings
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
assessment_run_arns(impl Into<String>)
/set_assessment_run_arns(Option<Vec::<String>>)
:
required: falseThe ARNs of the assessment runs that generate the findings that you want to list.
filter(FindingFilter)
/set_filter(Option<FindingFilter>)
:
required: falseYou can use this parameter to specify a subset of data to be included in the action’s response.
For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListFindings action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.
- On success, responds with
ListFindingsOutput
with field(s):finding_arns(Vec::<String>)
:A list of ARNs that specifies the findings returned by the action.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListFindingsError>
Source§impl Client
impl Client
Sourcepub fn list_rules_packages(&self) -> ListRulesPackagesFluentBuilder
pub fn list_rules_packages(&self) -> ListRulesPackagesFluentBuilder
Constructs a fluent builder for the ListRulesPackages
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListRulesPackages action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.
- On success, responds with
ListRulesPackagesOutput
with field(s):rules_package_arns(Vec::<String>)
:The list of ARNs that specifies the rules packages returned by the action.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListRulesPackagesError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN that specifies the assessment template whose tags you want to list.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Vec::<Tag>)
:A collection of key and value pairs.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn preview_agents(&self) -> PreviewAgentsFluentBuilder
pub fn preview_agents(&self) -> PreviewAgentsFluentBuilder
Constructs a fluent builder for the PreviewAgents
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
preview_agents_arn(impl Into<String>)
/set_preview_agents_arn(Option<String>)
:
required: trueThe ARN of the assessment target whose agents you want to preview.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the PreviewAgents action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseYou can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.
- On success, responds with
PreviewAgentsOutput
with field(s):agent_previews(Vec::<AgentPreview>)
:The resulting list of agents.
next_token(Option<String>)
:When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<PreviewAgentsError>
Source§impl Client
impl Client
Sourcepub fn register_cross_account_access_role(
&self,
) -> RegisterCrossAccountAccessRoleFluentBuilder
pub fn register_cross_account_access_role( &self, ) -> RegisterCrossAccountAccessRoleFluentBuilder
Constructs a fluent builder for the RegisterCrossAccountAccessRole
operation.
- The fluent builder is configurable:
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:
required: trueThe ARN of the IAM role that grants Amazon Inspector access to AWS Services needed to perform security assessments.
- On success, responds with
RegisterCrossAccountAccessRoleOutput
- On failure, responds with
SdkError<RegisterCrossAccountAccessRoleError>
Source§impl Client
impl Client
Sourcepub fn remove_attributes_from_findings(
&self,
) -> RemoveAttributesFromFindingsFluentBuilder
pub fn remove_attributes_from_findings( &self, ) -> RemoveAttributesFromFindingsFluentBuilder
Constructs a fluent builder for the RemoveAttributesFromFindings
operation.
- The fluent builder is configurable:
finding_arns(impl Into<String>)
/set_finding_arns(Option<Vec::<String>>)
:
required: trueThe ARNs that specify the findings that you want to remove attributes from.
attribute_keys(impl Into<String>)
/set_attribute_keys(Option<Vec::<String>>)
:
required: trueThe array of attribute keys that you want to remove from specified findings.
- On success, responds with
RemoveAttributesFromFindingsOutput
with field(s):failed_items(HashMap::<String, FailedItemDetails>)
:Attributes details that cannot be described. An error code is provided for each failed item.
- On failure, responds with
SdkError<RemoveAttributesFromFindingsError>
Source§impl Client
impl Client
Constructs a fluent builder for the SetTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN of the assessment template that you want to set tags to.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseA collection of key and value pairs that you want to set to the assessment template.
- On success, responds with
SetTagsForResourceOutput
- On failure, responds with
SdkError<SetTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn start_assessment_run(&self) -> StartAssessmentRunFluentBuilder
pub fn start_assessment_run(&self) -> StartAssessmentRunFluentBuilder
Constructs a fluent builder for the StartAssessmentRun
operation.
- The fluent builder is configurable:
assessment_template_arn(impl Into<String>)
/set_assessment_template_arn(Option<String>)
:
required: trueThe ARN of the assessment template of the assessment run that you want to start.
assessment_run_name(impl Into<String>)
/set_assessment_run_name(Option<String>)
:
required: falseYou can specify the name for the assessment run. The name must be unique for the assessment template whose ARN is used to start the assessment run.
- On success, responds with
StartAssessmentRunOutput
with field(s):assessment_run_arn(String)
:The ARN of the assessment run that has been started.
- On failure, responds with
SdkError<StartAssessmentRunError>
Source§impl Client
impl Client
Sourcepub fn stop_assessment_run(&self) -> StopAssessmentRunFluentBuilder
pub fn stop_assessment_run(&self) -> StopAssessmentRunFluentBuilder
Constructs a fluent builder for the StopAssessmentRun
operation.
- The fluent builder is configurable:
assessment_run_arn(impl Into<String>)
/set_assessment_run_arn(Option<String>)
:
required: trueThe ARN of the assessment run that you want to stop.
stop_action(StopAction)
/set_stop_action(Option<StopAction>)
:
required: falseAn input option that can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION (the default value), stops the AWS agent from collecting data and begins the results evaluation and the findings generation process. SKIP_EVALUATION cancels the assessment run immediately, after which no findings are generated.
- On success, responds with
StopAssessmentRunOutput
- On failure, responds with
SdkError<StopAssessmentRunError>
Source§impl Client
impl Client
Sourcepub fn subscribe_to_event(&self) -> SubscribeToEventFluentBuilder
pub fn subscribe_to_event(&self) -> SubscribeToEventFluentBuilder
Constructs a fluent builder for the SubscribeToEvent
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN of the assessment template that is used during the event for which you want to receive SNS notifications.
event(InspectorEvent)
/set_event(Option<InspectorEvent>)
:
required: trueThe event for which you want to receive SNS notifications.
topic_arn(impl Into<String>)
/set_topic_arn(Option<String>)
:
required: trueThe ARN of the SNS topic to which the SNS notifications are sent.
- On success, responds with
SubscribeToEventOutput
- On failure, responds with
SdkError<SubscribeToEventError>
Source§impl Client
impl Client
Sourcepub fn unsubscribe_from_event(&self) -> UnsubscribeFromEventFluentBuilder
pub fn unsubscribe_from_event(&self) -> UnsubscribeFromEventFluentBuilder
Constructs a fluent builder for the UnsubscribeFromEvent
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN of the assessment template that is used during the event for which you want to stop receiving SNS notifications.
event(InspectorEvent)
/set_event(Option<InspectorEvent>)
:
required: trueThe event for which you want to stop receiving SNS notifications.
topic_arn(impl Into<String>)
/set_topic_arn(Option<String>)
:
required: trueThe ARN of the SNS topic to which SNS notifications are sent.
- On success, responds with
UnsubscribeFromEventOutput
- On failure, responds with
SdkError<UnsubscribeFromEventError>
Source§impl Client
impl Client
Sourcepub fn update_assessment_target(&self) -> UpdateAssessmentTargetFluentBuilder
pub fn update_assessment_target(&self) -> UpdateAssessmentTargetFluentBuilder
Constructs a fluent builder for the UpdateAssessmentTarget
operation.
- The fluent builder is configurable:
assessment_target_arn(impl Into<String>)
/set_assessment_target_arn(Option<String>)
:
required: trueThe ARN of the assessment target that you want to update.
assessment_target_name(impl Into<String>)
/set_assessment_target_name(Option<String>)
:
required: trueThe name of the assessment target that you want to update.
resource_group_arn(impl Into<String>)
/set_resource_group_arn(Option<String>)
:
required: falseThe ARN of the resource group that is used to specify the new resource group to associate with the assessment target.
- On success, responds with
UpdateAssessmentTargetOutput
- On failure, responds with
SdkError<UpdateAssessmentTargetError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);