Interface CodeGuruSecurityClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.
Amazon CodeGuru Security is in preview release and is subject to change.
This section provides documentation for the Amazon CodeGuru Security API operations. CodeGuru Security is a service that uses program analysis and machine learning to detect security policy violations and vulnerabilities, and recommends ways to address these security risks.
By proactively detecting and providing recommendations for addressing security risks, CodeGuru Security improves the overall security of your application code. For more information about CodeGuru Security, see the Amazon CodeGuru Security User Guide.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptiondefault BatchGetFindingsResponse
batchGetFindings
(Consumer<BatchGetFindingsRequest.Builder> batchGetFindingsRequest) Returns a list of all requested findings.default BatchGetFindingsResponse
batchGetFindings
(BatchGetFindingsRequest batchGetFindingsRequest) Returns a list of all requested findings.builder()
Create a builder that can be used to configure and create aCodeGuruSecurityClient
.static CodeGuruSecurityClient
create()
Create aCodeGuruSecurityClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.default CreateScanResponse
createScan
(Consumer<CreateScanRequest.Builder> createScanRequest) Use to create a scan using code uploaded to an S3 bucket.default CreateScanResponse
createScan
(CreateScanRequest createScanRequest) Use to create a scan using code uploaded to an S3 bucket.default CreateUploadUrlResponse
createUploadUrl
(Consumer<CreateUploadUrlRequest.Builder> createUploadUrlRequest) Generates a pre-signed URL and request headers used to upload a code resource.default CreateUploadUrlResponse
createUploadUrl
(CreateUploadUrlRequest createUploadUrlRequest) Generates a pre-signed URL and request headers used to upload a code resource.default GetAccountConfigurationResponse
getAccountConfiguration
(Consumer<GetAccountConfigurationRequest.Builder> getAccountConfigurationRequest) Use to get account level configuration.default GetAccountConfigurationResponse
getAccountConfiguration
(GetAccountConfigurationRequest getAccountConfigurationRequest) Use to get account level configuration.default GetFindingsResponse
getFindings
(Consumer<GetFindingsRequest.Builder> getFindingsRequest) Returns a list of all findings generated by a particular scan.default GetFindingsResponse
getFindings
(GetFindingsRequest getFindingsRequest) Returns a list of all findings generated by a particular scan.default GetFindingsIterable
getFindingsPaginator
(Consumer<GetFindingsRequest.Builder> getFindingsRequest) This is a variant ofgetFindings(software.amazon.awssdk.services.codegurusecurity.model.GetFindingsRequest)
operation.default GetFindingsIterable
getFindingsPaginator
(GetFindingsRequest getFindingsRequest) This is a variant ofgetFindings(software.amazon.awssdk.services.codegurusecurity.model.GetFindingsRequest)
operation.default GetMetricsSummaryResponse
getMetricsSummary
(Consumer<GetMetricsSummaryRequest.Builder> getMetricsSummaryRequest) Returns top level metrics about an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings.default GetMetricsSummaryResponse
getMetricsSummary
(GetMetricsSummaryRequest getMetricsSummaryRequest) Returns top level metrics about an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings.default GetScanResponse
getScan
(Consumer<GetScanRequest.Builder> getScanRequest) Returns details about a scan, including whether or not a scan has completed.default GetScanResponse
getScan
(GetScanRequest getScanRequest) Returns details about a scan, including whether or not a scan has completed.default ListFindingsMetricsResponse
listFindingsMetrics
(Consumer<ListFindingsMetricsRequest.Builder> listFindingsMetricsRequest) Returns metrics about all findings in an account within a specified time range.default ListFindingsMetricsResponse
listFindingsMetrics
(ListFindingsMetricsRequest listFindingsMetricsRequest) Returns metrics about all findings in an account within a specified time range.default ListFindingsMetricsIterable
listFindingsMetricsPaginator
(Consumer<ListFindingsMetricsRequest.Builder> listFindingsMetricsRequest) This is a variant oflistFindingsMetrics(software.amazon.awssdk.services.codegurusecurity.model.ListFindingsMetricsRequest)
operation.default ListFindingsMetricsIterable
listFindingsMetricsPaginator
(ListFindingsMetricsRequest listFindingsMetricsRequest) This is a variant oflistFindingsMetrics(software.amazon.awssdk.services.codegurusecurity.model.ListFindingsMetricsRequest)
operation.default ListScansResponse
listScans
(Consumer<ListScansRequest.Builder> listScansRequest) Returns a list of all the standard scans in an account.default ListScansResponse
listScans
(ListScansRequest listScansRequest) Returns a list of all the standard scans in an account.default ListScansIterable
listScansPaginator
(Consumer<ListScansRequest.Builder> listScansRequest) This is a variant oflistScans(software.amazon.awssdk.services.codegurusecurity.model.ListScansRequest)
operation.default ListScansIterable
listScansPaginator
(ListScansRequest listScansRequest) This is a variant oflistScans(software.amazon.awssdk.services.codegurusecurity.model.ListScansRequest)
operation.default ListTagsForResourceResponse
listTagsForResource
(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) Returns a list of all tags associated with a scan.default ListTagsForResourceResponse
listTagsForResource
(ListTagsForResourceRequest listTagsForResourceRequest) Returns a list of all tags associated with a scan.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadata
default TagResourceResponse
tagResource
(Consumer<TagResourceRequest.Builder> tagResourceRequest) Use to add one or more tags to an existing scan.default TagResourceResponse
tagResource
(TagResourceRequest tagResourceRequest) Use to add one or more tags to an existing scan.default UntagResourceResponse
untagResource
(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Use to remove one or more tags from an existing scan.default UntagResourceResponse
untagResource
(UntagResourceRequest untagResourceRequest) Use to remove one or more tags from an existing scan.updateAccountConfiguration
(Consumer<UpdateAccountConfigurationRequest.Builder> updateAccountConfigurationRequest) Use to update account-level configuration with an encryption key.updateAccountConfiguration
(UpdateAccountConfigurationRequest updateAccountConfigurationRequest) Use to update account-level configuration with an encryption key.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider
.- See Also:
-
-
Method Details
-
batchGetFindings
default BatchGetFindingsResponse batchGetFindings(BatchGetFindingsRequest batchGetFindingsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns a list of all requested findings.
- Parameters:
batchGetFindingsRequest
-- Returns:
- Result of the BatchGetFindings operation returned by the service.
- See Also:
-
batchGetFindings
default BatchGetFindingsResponse batchGetFindings(Consumer<BatchGetFindingsRequest.Builder> batchGetFindingsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns a list of all requested findings.
This is a convenience which creates an instance of the
BatchGetFindingsRequest.Builder
avoiding the need to create one manually viaBatchGetFindingsRequest.builder()
- Parameters:
batchGetFindingsRequest
- AConsumer
that will call methods onBatchGetFindingsRequest.Builder
to create a request.- Returns:
- Result of the BatchGetFindings operation returned by the service.
- See Also:
-
createScan
default CreateScanResponse createScan(CreateScanRequest createScanRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to create a scan using code uploaded to an S3 bucket.
- Parameters:
createScanRequest
-- Returns:
- Result of the CreateScan operation returned by the service.
- See Also:
-
createScan
default CreateScanResponse createScan(Consumer<CreateScanRequest.Builder> createScanRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to create a scan using code uploaded to an S3 bucket.
This is a convenience which creates an instance of the
CreateScanRequest.Builder
avoiding the need to create one manually viaCreateScanRequest.builder()
- Parameters:
createScanRequest
- AConsumer
that will call methods onCreateScanRequest.Builder
to create a request.- Returns:
- Result of the CreateScan operation returned by the service.
- See Also:
-
createUploadUrl
default CreateUploadUrlResponse createUploadUrl(CreateUploadUrlRequest createUploadUrlRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Generates a pre-signed URL and request headers used to upload a code resource.
You can upload your code resource to the URL and add the request headers using any HTTP client.
- Parameters:
createUploadUrlRequest
-- Returns:
- Result of the CreateUploadUrl operation returned by the service.
- See Also:
-
createUploadUrl
default CreateUploadUrlResponse createUploadUrl(Consumer<CreateUploadUrlRequest.Builder> createUploadUrlRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Generates a pre-signed URL and request headers used to upload a code resource.
You can upload your code resource to the URL and add the request headers using any HTTP client.
This is a convenience which creates an instance of the
CreateUploadUrlRequest.Builder
avoiding the need to create one manually viaCreateUploadUrlRequest.builder()
- Parameters:
createUploadUrlRequest
- AConsumer
that will call methods onCreateUploadUrlRequest.Builder
to create a request.- Returns:
- Result of the CreateUploadUrl operation returned by the service.
- See Also:
-
getAccountConfiguration
default GetAccountConfigurationResponse getAccountConfiguration(GetAccountConfigurationRequest getAccountConfigurationRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to get account level configuration.
- Parameters:
getAccountConfigurationRequest
-- Returns:
- Result of the GetAccountConfiguration operation returned by the service.
- See Also:
-
getAccountConfiguration
default GetAccountConfigurationResponse getAccountConfiguration(Consumer<GetAccountConfigurationRequest.Builder> getAccountConfigurationRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to get account level configuration.
This is a convenience which creates an instance of the
GetAccountConfigurationRequest.Builder
avoiding the need to create one manually viaGetAccountConfigurationRequest.builder()
- Parameters:
getAccountConfigurationRequest
- AConsumer
that will call methods onGetAccountConfigurationRequest.Builder
to create a request.- Returns:
- Result of the GetAccountConfiguration operation returned by the service.
- See Also:
-
getFindings
default GetFindingsResponse getFindings(GetFindingsRequest getFindingsRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns a list of all findings generated by a particular scan.
- Parameters:
getFindingsRequest
-- Returns:
- Result of the GetFindings operation returned by the service.
- See Also:
-
getFindings
default GetFindingsResponse getFindings(Consumer<GetFindingsRequest.Builder> getFindingsRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns a list of all findings generated by a particular scan.
This is a convenience which creates an instance of the
GetFindingsRequest.Builder
avoiding the need to create one manually viaGetFindingsRequest.builder()
- Parameters:
getFindingsRequest
- AConsumer
that will call methods onGetFindingsRequest.Builder
to create a request.- Returns:
- Result of the GetFindings operation returned by the service.
- See Also:
-
getFindingsPaginator
default GetFindingsIterable getFindingsPaginator(GetFindingsRequest getFindingsRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException This is a variant of
getFindings(software.amazon.awssdk.services.codegurusecurity.model.GetFindingsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.codegurusecurity.paginators.GetFindingsIterable responses = client.getFindingsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.codegurusecurity.paginators.GetFindingsIterable responses = client .getFindingsPaginator(request); for (software.amazon.awssdk.services.codegurusecurity.model.GetFindingsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.codegurusecurity.paginators.GetFindingsIterable responses = client.getFindingsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getFindings(software.amazon.awssdk.services.codegurusecurity.model.GetFindingsRequest)
operation.- Parameters:
getFindingsRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getFindingsPaginator
default GetFindingsIterable getFindingsPaginator(Consumer<GetFindingsRequest.Builder> getFindingsRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException This is a variant of
getFindings(software.amazon.awssdk.services.codegurusecurity.model.GetFindingsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.codegurusecurity.paginators.GetFindingsIterable responses = client.getFindingsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.codegurusecurity.paginators.GetFindingsIterable responses = client .getFindingsPaginator(request); for (software.amazon.awssdk.services.codegurusecurity.model.GetFindingsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.codegurusecurity.paginators.GetFindingsIterable responses = client.getFindingsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getFindings(software.amazon.awssdk.services.codegurusecurity.model.GetFindingsRequest)
operation.
This is a convenience which creates an instance of the
GetFindingsRequest.Builder
avoiding the need to create one manually viaGetFindingsRequest.builder()
- Parameters:
getFindingsRequest
- AConsumer
that will call methods onGetFindingsRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getMetricsSummary
default GetMetricsSummaryResponse getMetricsSummary(GetMetricsSummaryRequest getMetricsSummaryRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns top level metrics about an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings.
- Parameters:
getMetricsSummaryRequest
-- Returns:
- Result of the GetMetricsSummary operation returned by the service.
- See Also:
-
getMetricsSummary
default GetMetricsSummaryResponse getMetricsSummary(Consumer<GetMetricsSummaryRequest.Builder> getMetricsSummaryRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns top level metrics about an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings.
This is a convenience which creates an instance of the
GetMetricsSummaryRequest.Builder
avoiding the need to create one manually viaGetMetricsSummaryRequest.builder()
- Parameters:
getMetricsSummaryRequest
- AConsumer
that will call methods onGetMetricsSummaryRequest.Builder
to create a request.- Returns:
- Result of the GetMetricsSummary operation returned by the service.
- See Also:
-
getScan
default GetScanResponse getScan(GetScanRequest getScanRequest) throws InternalServerException, ResourceNotFoundException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns details about a scan, including whether or not a scan has completed.
- Parameters:
getScanRequest
-- Returns:
- Result of the GetScan operation returned by the service.
- See Also:
-
getScan
default GetScanResponse getScan(Consumer<GetScanRequest.Builder> getScanRequest) throws InternalServerException, ResourceNotFoundException, ThrottlingException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns details about a scan, including whether or not a scan has completed.
This is a convenience which creates an instance of the
GetScanRequest.Builder
avoiding the need to create one manually viaGetScanRequest.builder()
- Parameters:
getScanRequest
- AConsumer
that will call methods onGetScanRequest.Builder
to create a request.- Returns:
- Result of the GetScan operation returned by the service.
- See Also:
-
listFindingsMetrics
default ListFindingsMetricsResponse listFindingsMetrics(ListFindingsMetricsRequest listFindingsMetricsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns metrics about all findings in an account within a specified time range.
- Parameters:
listFindingsMetricsRequest
-- Returns:
- Result of the ListFindingsMetrics operation returned by the service.
- See Also:
-
listFindingsMetrics
default ListFindingsMetricsResponse listFindingsMetrics(Consumer<ListFindingsMetricsRequest.Builder> listFindingsMetricsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns metrics about all findings in an account within a specified time range.
This is a convenience which creates an instance of the
ListFindingsMetricsRequest.Builder
avoiding the need to create one manually viaListFindingsMetricsRequest.builder()
- Parameters:
listFindingsMetricsRequest
- AConsumer
that will call methods onListFindingsMetricsRequest.Builder
to create a request.- Returns:
- Result of the ListFindingsMetrics operation returned by the service.
- See Also:
-
listFindingsMetricsPaginator
default ListFindingsMetricsIterable listFindingsMetricsPaginator(ListFindingsMetricsRequest listFindingsMetricsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException This is a variant of
listFindingsMetrics(software.amazon.awssdk.services.codegurusecurity.model.ListFindingsMetricsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.codegurusecurity.paginators.ListFindingsMetricsIterable responses = client.listFindingsMetricsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.codegurusecurity.paginators.ListFindingsMetricsIterable responses = client .listFindingsMetricsPaginator(request); for (software.amazon.awssdk.services.codegurusecurity.model.ListFindingsMetricsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.codegurusecurity.paginators.ListFindingsMetricsIterable responses = client.listFindingsMetricsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listFindingsMetrics(software.amazon.awssdk.services.codegurusecurity.model.ListFindingsMetricsRequest)
operation.- Parameters:
listFindingsMetricsRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listFindingsMetricsPaginator
default ListFindingsMetricsIterable listFindingsMetricsPaginator(Consumer<ListFindingsMetricsRequest.Builder> listFindingsMetricsRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException This is a variant of
listFindingsMetrics(software.amazon.awssdk.services.codegurusecurity.model.ListFindingsMetricsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.codegurusecurity.paginators.ListFindingsMetricsIterable responses = client.listFindingsMetricsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.codegurusecurity.paginators.ListFindingsMetricsIterable responses = client .listFindingsMetricsPaginator(request); for (software.amazon.awssdk.services.codegurusecurity.model.ListFindingsMetricsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.codegurusecurity.paginators.ListFindingsMetricsIterable responses = client.listFindingsMetricsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listFindingsMetrics(software.amazon.awssdk.services.codegurusecurity.model.ListFindingsMetricsRequest)
operation.
This is a convenience which creates an instance of the
ListFindingsMetricsRequest.Builder
avoiding the need to create one manually viaListFindingsMetricsRequest.builder()
- Parameters:
listFindingsMetricsRequest
- AConsumer
that will call methods onListFindingsMetricsRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listScans
default ListScansResponse listScans(ListScansRequest listScansRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns a list of all the standard scans in an account. Does not return express scans.
- Parameters:
listScansRequest
-- Returns:
- Result of the ListScans operation returned by the service.
- See Also:
-
listScans
default ListScansResponse listScans(Consumer<ListScansRequest.Builder> listScansRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns a list of all the standard scans in an account. Does not return express scans.
This is a convenience which creates an instance of the
ListScansRequest.Builder
avoiding the need to create one manually viaListScansRequest.builder()
- Parameters:
listScansRequest
- AConsumer
that will call methods onListScansRequest.Builder
to create a request.- Returns:
- Result of the ListScans operation returned by the service.
- See Also:
-
listScansPaginator
default ListScansIterable listScansPaginator(ListScansRequest listScansRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException This is a variant of
listScans(software.amazon.awssdk.services.codegurusecurity.model.ListScansRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.codegurusecurity.paginators.ListScansIterable responses = client.listScansPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.codegurusecurity.paginators.ListScansIterable responses = client.listScansPaginator(request); for (software.amazon.awssdk.services.codegurusecurity.model.ListScansResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.codegurusecurity.paginators.ListScansIterable responses = client.listScansPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listScans(software.amazon.awssdk.services.codegurusecurity.model.ListScansRequest)
operation.- Parameters:
listScansRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listScansPaginator
default ListScansIterable listScansPaginator(Consumer<ListScansRequest.Builder> listScansRequest) throws InternalServerException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException This is a variant of
listScans(software.amazon.awssdk.services.codegurusecurity.model.ListScansRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.codegurusecurity.paginators.ListScansIterable responses = client.listScansPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.codegurusecurity.paginators.ListScansIterable responses = client.listScansPaginator(request); for (software.amazon.awssdk.services.codegurusecurity.model.ListScansResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.codegurusecurity.paginators.ListScansIterable responses = client.listScansPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listScans(software.amazon.awssdk.services.codegurusecurity.model.ListScansRequest)
operation.
This is a convenience which creates an instance of the
ListScansRequest.Builder
avoiding the need to create one manually viaListScansRequest.builder()
- Parameters:
listScansRequest
- AConsumer
that will call methods onListScansRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns a list of all tags associated with a scan.
- Parameters:
listTagsForResourceRequest
-- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Returns a list of all tags associated with a scan.
This is a convenience which creates an instance of the
ListTagsForResourceRequest.Builder
avoiding the need to create one manually viaListTagsForResourceRequest.builder()
- Parameters:
listTagsForResourceRequest
- AConsumer
that will call methods onListTagsForResourceRequest.Builder
to create a request.- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to add one or more tags to an existing scan.
- Parameters:
tagResourceRequest
-- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to add one or more tags to an existing scan.
This is a convenience which creates an instance of the
TagResourceRequest.Builder
avoiding the need to create one manually viaTagResourceRequest.builder()
- Parameters:
tagResourceRequest
- AConsumer
that will call methods onTagResourceRequest.Builder
to create a request.- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to remove one or more tags from an existing scan.
- Parameters:
untagResourceRequest
-- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) throws InternalServerException, ConflictException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to remove one or more tags from an existing scan.
This is a convenience which creates an instance of the
UntagResourceRequest.Builder
avoiding the need to create one manually viaUntagResourceRequest.builder()
- Parameters:
untagResourceRequest
- AConsumer
that will call methods onUntagResourceRequest.Builder
to create a request.- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
updateAccountConfiguration
default UpdateAccountConfigurationResponse updateAccountConfiguration(UpdateAccountConfigurationRequest updateAccountConfigurationRequest) throws InternalServerException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to update account-level configuration with an encryption key.
- Parameters:
updateAccountConfigurationRequest
-- Returns:
- Result of the UpdateAccountConfiguration operation returned by the service.
- See Also:
-
updateAccountConfiguration
default UpdateAccountConfigurationResponse updateAccountConfiguration(Consumer<UpdateAccountConfigurationRequest.Builder> updateAccountConfigurationRequest) throws InternalServerException, ResourceNotFoundException, ThrottlingException, ValidationException, AccessDeniedException, AwsServiceException, SdkClientException, CodeGuruSecurityException Use to update account-level configuration with an encryption key.
This is a convenience which creates an instance of the
UpdateAccountConfigurationRequest.Builder
avoiding the need to create one manually viaUpdateAccountConfigurationRequest.builder()
- Parameters:
updateAccountConfigurationRequest
- AConsumer
that will call methods onUpdateAccountConfigurationRequest.Builder
to create a request.- Returns:
- Result of the UpdateAccountConfiguration operation returned by the service.
- See Also:
-
create
Create aCodeGuruSecurityClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aCodeGuruSecurityClient
. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClient
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfiguration
in interfaceAwsClient
- Specified by:
serviceClientConfiguration
in interfaceSdkClient
- Returns:
- SdkServiceClientConfiguration
-