com.amazonaws.services.guardduty.AmazonGuardDutyClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-guardduty Show documentation
/*
* Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.guardduty;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import javax.annotation.Generated;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.client.builder.AdvancedConfig;
import com.amazonaws.services.guardduty.AmazonGuardDutyClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.guardduty.model.*;
import com.amazonaws.services.guardduty.model.transform.*;
/**
* Client for accessing Amazon GuardDuty. All service calls made using this client are blocking, and will not return
* until the service call completes.
*
* Assess, monitor, manage, and remediate security issues across your AWS infrastructure, applications, and data.
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonGuardDutyClient extends AmazonWebServiceClient implements AmazonGuardDuty {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AmazonGuardDuty.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "guardduty";
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final AdvancedConfig advancedConfig;
private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.1")
.withSupportsCbor(false)
.withSupportsIon(false)
.withContentTypeOverride("")
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("BadRequestException").withModeledClass(
com.amazonaws.services.guardduty.model.BadRequestException.class))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InternalServerErrorException").withModeledClass(
com.amazonaws.services.guardduty.model.InternalServerErrorException.class))
.withBaseServiceExceptionClass(com.amazonaws.services.guardduty.model.AmazonGuardDutyException.class));
public static AmazonGuardDutyClientBuilder builder() {
return AmazonGuardDutyClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on Amazon GuardDuty using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AmazonGuardDutyClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on Amazon GuardDuty using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AmazonGuardDutyClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("guardduty.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/guardduty/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/guardduty/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
* Accepts the invitation to be monitored by a master GuardDuty account.
*
* @param acceptInvitationRequest
* AcceptInvitation request body.
* @return Result of the AcceptInvitation operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.AcceptInvitation
* @see AWS API
* Documentation
*/
@Override
public AcceptInvitationResult acceptInvitation(AcceptInvitationRequest request) {
request = beforeClientExecution(request);
return executeAcceptInvitation(request);
}
@SdkInternalApi
final AcceptInvitationResult executeAcceptInvitation(AcceptInvitationRequest acceptInvitationRequest) {
ExecutionContext executionContext = createExecutionContext(acceptInvitationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptInvitationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(acceptInvitationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptInvitation");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AcceptInvitationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Archives Amazon GuardDuty findings specified by the list of finding IDs.
*
* @param archiveFindingsRequest
* ArchiveFindings request body.
* @return Result of the ArchiveFindings operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.ArchiveFindings
* @see AWS API
* Documentation
*/
@Override
public ArchiveFindingsResult archiveFindings(ArchiveFindingsRequest request) {
request = beforeClientExecution(request);
return executeArchiveFindings(request);
}
@SdkInternalApi
final ArchiveFindingsResult executeArchiveFindings(ArchiveFindingsRequest archiveFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(archiveFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ArchiveFindingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(archiveFindingsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ArchiveFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ArchiveFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Creates a single Amazon GuardDuty detector. A detector is an object that represents the GuardDuty service. A
* detector must be created in order for GuardDuty to become operational.
*
* @param createDetectorRequest
* CreateDetector request body.
* @return Result of the CreateDetector operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.CreateDetector
* @see AWS API
* Documentation
*/
@Override
public CreateDetectorResult createDetector(CreateDetectorRequest request) {
request = beforeClientExecution(request);
return executeCreateDetector(request);
}
@SdkInternalApi
final CreateDetectorResult executeCreateDetector(CreateDetectorRequest createDetectorRequest) {
ExecutionContext executionContext = createExecutionContext(createDetectorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDetectorRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDetector");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDetectorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Creates a filter using the specified finding criteria.
*
* @param createFilterRequest
* CreateFilterRequest request body.
* @return Result of the CreateFilter operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.CreateFilter
* @see AWS API
* Documentation
*/
@Override
public CreateFilterResult createFilter(CreateFilterRequest request) {
request = beforeClientExecution(request);
return executeCreateFilter(request);
}
@SdkInternalApi
final CreateFilterResult executeCreateFilter(CreateFilterRequest createFilterRequest) {
ExecutionContext executionContext = createExecutionContext(createFilterRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createFilterRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateFilter");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateFilterResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Creates a new IPSet - a list of trusted IP addresses that have been whitelisted for secure communication with AWS
* infrastructure and applications.
*
* @param createIPSetRequest
* CreateIPSet request body.
* @return Result of the CreateIPSet operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.CreateIPSet
* @see AWS API
* Documentation
*/
@Override
public CreateIPSetResult createIPSet(CreateIPSetRequest request) {
request = beforeClientExecution(request);
return executeCreateIPSet(request);
}
@SdkInternalApi
final CreateIPSetResult executeCreateIPSet(CreateIPSetRequest createIPSetRequest) {
ExecutionContext executionContext = createExecutionContext(createIPSetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateIPSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createIPSetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateIPSet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateIPSetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Creates member accounts of the current AWS account by specifying a list of AWS account IDs. The current AWS
* account can then invite these members to manage GuardDuty in their accounts.
*
* @param createMembersRequest
* CreateMembers request body.
* @return Result of the CreateMembers operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.CreateMembers
* @see AWS API
* Documentation
*/
@Override
public CreateMembersResult createMembers(CreateMembersRequest request) {
request = beforeClientExecution(request);
return executeCreateMembers(request);
}
@SdkInternalApi
final CreateMembersResult executeCreateMembers(CreateMembersRequest createMembersRequest) {
ExecutionContext executionContext = createExecutionContext(createMembersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createMembersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateMembers");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateMembersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Generates example findings of types specified by the list of finding types. If 'NULL' is specified for
* findingTypes, the API generates example findings of all supported finding types.
*
* @param createSampleFindingsRequest
* CreateSampleFindings request body.
* @return Result of the CreateSampleFindings operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.CreateSampleFindings
* @see AWS
* API Documentation
*/
@Override
public CreateSampleFindingsResult createSampleFindings(CreateSampleFindingsRequest request) {
request = beforeClientExecution(request);
return executeCreateSampleFindings(request);
}
@SdkInternalApi
final CreateSampleFindingsResult executeCreateSampleFindings(CreateSampleFindingsRequest createSampleFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(createSampleFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateSampleFindingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSampleFindingsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSampleFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSampleFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Create a new ThreatIntelSet. ThreatIntelSets consist of known malicious IP addresses. GuardDuty generates
* findings based on ThreatIntelSets.
*
* @param createThreatIntelSetRequest
* CreateThreatIntelSet request body.
* @return Result of the CreateThreatIntelSet operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.CreateThreatIntelSet
* @see AWS
* API Documentation
*/
@Override
public CreateThreatIntelSetResult createThreatIntelSet(CreateThreatIntelSetRequest request) {
request = beforeClientExecution(request);
return executeCreateThreatIntelSet(request);
}
@SdkInternalApi
final CreateThreatIntelSetResult executeCreateThreatIntelSet(CreateThreatIntelSetRequest createThreatIntelSetRequest) {
ExecutionContext executionContext = createExecutionContext(createThreatIntelSetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateThreatIntelSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createThreatIntelSetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateThreatIntelSet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateThreatIntelSetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Declines invitations sent to the current member account by AWS account specified by their account IDs.
*
* @param declineInvitationsRequest
* DeclineInvitations request body.
* @return Result of the DeclineInvitations operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DeclineInvitations
* @see AWS
* API Documentation
*/
@Override
public DeclineInvitationsResult declineInvitations(DeclineInvitationsRequest request) {
request = beforeClientExecution(request);
return executeDeclineInvitations(request);
}
@SdkInternalApi
final DeclineInvitationsResult executeDeclineInvitations(DeclineInvitationsRequest declineInvitationsRequest) {
ExecutionContext executionContext = createExecutionContext(declineInvitationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeclineInvitationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(declineInvitationsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeclineInvitations");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeclineInvitationsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Deletes a Amazon GuardDuty detector specified by the detector ID.
*
* @param deleteDetectorRequest
* @return Result of the DeleteDetector operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DeleteDetector
* @see AWS API
* Documentation
*/
@Override
public DeleteDetectorResult deleteDetector(DeleteDetectorRequest request) {
request = beforeClientExecution(request);
return executeDeleteDetector(request);
}
@SdkInternalApi
final DeleteDetectorResult executeDeleteDetector(DeleteDetectorRequest deleteDetectorRequest) {
ExecutionContext executionContext = createExecutionContext(deleteDetectorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDetectorRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDetector");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDetectorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Deletes the filter specified by the filter name.
*
* @param deleteFilterRequest
* @return Result of the DeleteFilter operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DeleteFilter
* @see AWS API
* Documentation
*/
@Override
public DeleteFilterResult deleteFilter(DeleteFilterRequest request) {
request = beforeClientExecution(request);
return executeDeleteFilter(request);
}
@SdkInternalApi
final DeleteFilterResult executeDeleteFilter(DeleteFilterRequest deleteFilterRequest) {
ExecutionContext executionContext = createExecutionContext(deleteFilterRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteFilterRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteFilter");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteFilterResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Deletes the IPSet specified by the IPSet ID.
*
* @param deleteIPSetRequest
* @return Result of the DeleteIPSet operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DeleteIPSet
* @see AWS API
* Documentation
*/
@Override
public DeleteIPSetResult deleteIPSet(DeleteIPSetRequest request) {
request = beforeClientExecution(request);
return executeDeleteIPSet(request);
}
@SdkInternalApi
final DeleteIPSetResult executeDeleteIPSet(DeleteIPSetRequest deleteIPSetRequest) {
ExecutionContext executionContext = createExecutionContext(deleteIPSetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteIPSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteIPSetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteIPSet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteIPSetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Deletes invitations sent to the current member account by AWS accounts specified by their account IDs.
*
* @param deleteInvitationsRequest
* DeleteInvitations request body.
* @return Result of the DeleteInvitations operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DeleteInvitations
* @see AWS
* API Documentation
*/
@Override
public DeleteInvitationsResult deleteInvitations(DeleteInvitationsRequest request) {
request = beforeClientExecution(request);
return executeDeleteInvitations(request);
}
@SdkInternalApi
final DeleteInvitationsResult executeDeleteInvitations(DeleteInvitationsRequest deleteInvitationsRequest) {
ExecutionContext executionContext = createExecutionContext(deleteInvitationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteInvitationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteInvitationsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteInvitations");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteInvitationsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Deletes GuardDuty member accounts (to the current GuardDuty master account) specified by the account IDs.
*
* @param deleteMembersRequest
* DeleteMembers request body.
* @return Result of the DeleteMembers operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DeleteMembers
* @see AWS API
* Documentation
*/
@Override
public DeleteMembersResult deleteMembers(DeleteMembersRequest request) {
request = beforeClientExecution(request);
return executeDeleteMembers(request);
}
@SdkInternalApi
final DeleteMembersResult executeDeleteMembers(DeleteMembersRequest deleteMembersRequest) {
ExecutionContext executionContext = createExecutionContext(deleteMembersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteMembersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteMembers");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteMembersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Deletes ThreatIntelSet specified by the ThreatIntelSet ID.
*
* @param deleteThreatIntelSetRequest
* @return Result of the DeleteThreatIntelSet operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DeleteThreatIntelSet
* @see AWS
* API Documentation
*/
@Override
public DeleteThreatIntelSetResult deleteThreatIntelSet(DeleteThreatIntelSetRequest request) {
request = beforeClientExecution(request);
return executeDeleteThreatIntelSet(request);
}
@SdkInternalApi
final DeleteThreatIntelSetResult executeDeleteThreatIntelSet(DeleteThreatIntelSetRequest deleteThreatIntelSetRequest) {
ExecutionContext executionContext = createExecutionContext(deleteThreatIntelSetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteThreatIntelSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteThreatIntelSetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteThreatIntelSet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteThreatIntelSetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Disassociates the current GuardDuty member account from its master account.
*
* @param disassociateFromMasterAccountRequest
* @return Result of the DisassociateFromMasterAccount operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DisassociateFromMasterAccount
* @see AWS API Documentation
*/
@Override
public DisassociateFromMasterAccountResult disassociateFromMasterAccount(DisassociateFromMasterAccountRequest request) {
request = beforeClientExecution(request);
return executeDisassociateFromMasterAccount(request);
}
@SdkInternalApi
final DisassociateFromMasterAccountResult executeDisassociateFromMasterAccount(DisassociateFromMasterAccountRequest disassociateFromMasterAccountRequest) {
ExecutionContext executionContext = createExecutionContext(disassociateFromMasterAccountRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DisassociateFromMasterAccountRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(disassociateFromMasterAccountRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateFromMasterAccount");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DisassociateFromMasterAccountResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Disassociates GuardDuty member accounts (to the current GuardDuty master account) specified by the account IDs.
*
* @param disassociateMembersRequest
* DisassociateMembers request body.
* @return Result of the DisassociateMembers operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.DisassociateMembers
* @see AWS
* API Documentation
*/
@Override
public DisassociateMembersResult disassociateMembers(DisassociateMembersRequest request) {
request = beforeClientExecution(request);
return executeDisassociateMembers(request);
}
@SdkInternalApi
final DisassociateMembersResult executeDisassociateMembers(DisassociateMembersRequest disassociateMembersRequest) {
ExecutionContext executionContext = createExecutionContext(disassociateMembersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DisassociateMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateMembersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateMembers");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateMembersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Retrieves an Amazon GuardDuty detector specified by the detectorId.
*
* @param getDetectorRequest
* @return Result of the GetDetector operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetDetector
* @see AWS API
* Documentation
*/
@Override
public GetDetectorResult getDetector(GetDetectorRequest request) {
request = beforeClientExecution(request);
return executeGetDetector(request);
}
@SdkInternalApi
final GetDetectorResult executeGetDetector(GetDetectorRequest getDetectorRequest) {
ExecutionContext executionContext = createExecutionContext(getDetectorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDetectorRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDetector");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDetectorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns the details of the filter specified by the filter name.
*
* @param getFilterRequest
* @return Result of the GetFilter operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetFilter
* @see AWS API
* Documentation
*/
@Override
public GetFilterResult getFilter(GetFilterRequest request) {
request = beforeClientExecution(request);
return executeGetFilter(request);
}
@SdkInternalApi
final GetFilterResult executeGetFilter(GetFilterRequest getFilterRequest) {
ExecutionContext executionContext = createExecutionContext(getFilterRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFilterRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFilter");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetFilterResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Describes Amazon GuardDuty findings specified by finding IDs.
*
* @param getFindingsRequest
* GetFindings request body.
* @return Result of the GetFindings operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetFindings
* @see AWS API
* Documentation
*/
@Override
public GetFindingsResult getFindings(GetFindingsRequest request) {
request = beforeClientExecution(request);
return executeGetFindings(request);
}
@SdkInternalApi
final GetFindingsResult executeGetFindings(GetFindingsRequest getFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(getFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetFindingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFindingsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Lists Amazon GuardDuty findings' statistics for the specified detector ID.
*
* @param getFindingsStatisticsRequest
* GetFindingsStatistics request body.
* @return Result of the GetFindingsStatistics operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetFindingsStatistics
* @see AWS API Documentation
*/
@Override
public GetFindingsStatisticsResult getFindingsStatistics(GetFindingsStatisticsRequest request) {
request = beforeClientExecution(request);
return executeGetFindingsStatistics(request);
}
@SdkInternalApi
final GetFindingsStatisticsResult executeGetFindingsStatistics(GetFindingsStatisticsRequest getFindingsStatisticsRequest) {
ExecutionContext executionContext = createExecutionContext(getFindingsStatisticsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetFindingsStatisticsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFindingsStatisticsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFindingsStatistics");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new GetFindingsStatisticsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Retrieves the IPSet specified by the IPSet ID.
*
* @param getIPSetRequest
* @return Result of the GetIPSet operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetIPSet
* @see AWS API
* Documentation
*/
@Override
public GetIPSetResult getIPSet(GetIPSetRequest request) {
request = beforeClientExecution(request);
return executeGetIPSet(request);
}
@SdkInternalApi
final GetIPSetResult executeGetIPSet(GetIPSetRequest getIPSetRequest) {
ExecutionContext executionContext = createExecutionContext(getIPSetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetIPSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getIPSetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetIPSet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetIPSetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns the count of all GuardDuty membership invitations that were sent to the current member account except the
* currently accepted invitation.
*
* @param getInvitationsCountRequest
* @return Result of the GetInvitationsCount operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetInvitationsCount
* @see AWS
* API Documentation
*/
@Override
public GetInvitationsCountResult getInvitationsCount(GetInvitationsCountRequest request) {
request = beforeClientExecution(request);
return executeGetInvitationsCount(request);
}
@SdkInternalApi
final GetInvitationsCountResult executeGetInvitationsCount(GetInvitationsCountRequest getInvitationsCountRequest) {
ExecutionContext executionContext = createExecutionContext(getInvitationsCountRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetInvitationsCountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getInvitationsCountRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetInvitationsCount");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetInvitationsCountResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Provides the details for the GuardDuty master account to the current GuardDuty member account.
*
* @param getMasterAccountRequest
* @return Result of the GetMasterAccount operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetMasterAccount
* @see AWS API
* Documentation
*/
@Override
public GetMasterAccountResult getMasterAccount(GetMasterAccountRequest request) {
request = beforeClientExecution(request);
return executeGetMasterAccount(request);
}
@SdkInternalApi
final GetMasterAccountResult executeGetMasterAccount(GetMasterAccountRequest getMasterAccountRequest) {
ExecutionContext executionContext = createExecutionContext(getMasterAccountRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetMasterAccountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMasterAccountRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMasterAccount");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMasterAccountResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Retrieves GuardDuty member accounts (to the current GuardDuty master account) specified by the account IDs.
*
* @param getMembersRequest
* GetMembers request body.
* @return Result of the GetMembers operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetMembers
* @see AWS API
* Documentation
*/
@Override
public GetMembersResult getMembers(GetMembersRequest request) {
request = beforeClientExecution(request);
return executeGetMembers(request);
}
@SdkInternalApi
final GetMembersResult executeGetMembers(GetMembersRequest getMembersRequest) {
ExecutionContext executionContext = createExecutionContext(getMembersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMembersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMembers");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMembersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Retrieves the ThreatIntelSet that is specified by the ThreatIntelSet ID.
*
* @param getThreatIntelSetRequest
* @return Result of the GetThreatIntelSet operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.GetThreatIntelSet
* @see AWS
* API Documentation
*/
@Override
public GetThreatIntelSetResult getThreatIntelSet(GetThreatIntelSetRequest request) {
request = beforeClientExecution(request);
return executeGetThreatIntelSet(request);
}
@SdkInternalApi
final GetThreatIntelSetResult executeGetThreatIntelSet(GetThreatIntelSetRequest getThreatIntelSetRequest) {
ExecutionContext executionContext = createExecutionContext(getThreatIntelSetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetThreatIntelSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getThreatIntelSetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetThreatIntelSet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetThreatIntelSetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Invites other AWS accounts (created as members of the current AWS account by CreateMembers) to enable GuardDuty
* and allow the current AWS account to view and manage these accounts' GuardDuty findings on their behalf as the
* master account.
*
* @param inviteMembersRequest
* InviteMembers request body.
* @return Result of the InviteMembers operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.InviteMembers
* @see AWS API
* Documentation
*/
@Override
public InviteMembersResult inviteMembers(InviteMembersRequest request) {
request = beforeClientExecution(request);
return executeInviteMembers(request);
}
@SdkInternalApi
final InviteMembersResult executeInviteMembers(InviteMembersRequest inviteMembersRequest) {
ExecutionContext executionContext = createExecutionContext(inviteMembersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new InviteMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(inviteMembersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "InviteMembers");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new InviteMembersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Lists detectorIds of all the existing Amazon GuardDuty detector resources.
*
* @param listDetectorsRequest
* @return Result of the ListDetectors operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.ListDetectors
* @see AWS API
* Documentation
*/
@Override
public ListDetectorsResult listDetectors(ListDetectorsRequest request) {
request = beforeClientExecution(request);
return executeListDetectors(request);
}
@SdkInternalApi
final ListDetectorsResult executeListDetectors(ListDetectorsRequest listDetectorsRequest) {
ExecutionContext executionContext = createExecutionContext(listDetectorsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListDetectorsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDetectorsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDetectors");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDetectorsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns a paginated list of the current filters.
*
* @param listFiltersRequest
* @return Result of the ListFilters operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.ListFilters
* @see AWS API
* Documentation
*/
@Override
public ListFiltersResult listFilters(ListFiltersRequest request) {
request = beforeClientExecution(request);
return executeListFilters(request);
}
@SdkInternalApi
final ListFiltersResult executeListFilters(ListFiltersRequest listFiltersRequest) {
ExecutionContext executionContext = createExecutionContext(listFiltersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListFiltersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFiltersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFilters");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListFiltersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Lists Amazon GuardDuty findings for the specified detector ID.
*
* @param listFindingsRequest
* ListFindings request body.
* @return Result of the ListFindings operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.ListFindings
* @see AWS API
* Documentation
*/
@Override
public ListFindingsResult listFindings(ListFindingsRequest request) {
request = beforeClientExecution(request);
return executeListFindings(request);
}
@SdkInternalApi
final ListFindingsResult executeListFindings(ListFindingsRequest listFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(listFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListFindingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFindingsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Lists the IPSets of the GuardDuty service specified by the detector ID.
*
* @param listIPSetsRequest
* @return Result of the ListIPSets operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.ListIPSets
* @see AWS API
* Documentation
*/
@Override
public ListIPSetsResult listIPSets(ListIPSetsRequest request) {
request = beforeClientExecution(request);
return executeListIPSets(request);
}
@SdkInternalApi
final ListIPSetsResult executeListIPSets(ListIPSetsRequest listIPSetsRequest) {
ExecutionContext executionContext = createExecutionContext(listIPSetsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListIPSetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listIPSetsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIPSets");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIPSetsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Lists all GuardDuty membership invitations that were sent to the current AWS account.
*
* @param listInvitationsRequest
* @return Result of the ListInvitations operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.ListInvitations
* @see AWS API
* Documentation
*/
@Override
public ListInvitationsResult listInvitations(ListInvitationsRequest request) {
request = beforeClientExecution(request);
return executeListInvitations(request);
}
@SdkInternalApi
final ListInvitationsResult executeListInvitations(ListInvitationsRequest listInvitationsRequest) {
ExecutionContext executionContext = createExecutionContext(listInvitationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListInvitationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listInvitationsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListInvitations");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListInvitationsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Lists details about all member accounts for the current GuardDuty master account.
*
* @param listMembersRequest
* @return Result of the ListMembers operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.ListMembers
* @see AWS API
* Documentation
*/
@Override
public ListMembersResult listMembers(ListMembersRequest request) {
request = beforeClientExecution(request);
return executeListMembers(request);
}
@SdkInternalApi
final ListMembersResult executeListMembers(ListMembersRequest listMembersRequest) {
ExecutionContext executionContext = createExecutionContext(listMembersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listMembersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListMembers");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListMembersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Lists the ThreatIntelSets of the GuardDuty service specified by the detector ID.
*
* @param listThreatIntelSetsRequest
* @return Result of the ListThreatIntelSets operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.ListThreatIntelSets
* @see AWS
* API Documentation
*/
@Override
public ListThreatIntelSetsResult listThreatIntelSets(ListThreatIntelSetsRequest request) {
request = beforeClientExecution(request);
return executeListThreatIntelSets(request);
}
@SdkInternalApi
final ListThreatIntelSetsResult executeListThreatIntelSets(ListThreatIntelSetsRequest listThreatIntelSetsRequest) {
ExecutionContext executionContext = createExecutionContext(listThreatIntelSetsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListThreatIntelSetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listThreatIntelSetsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListThreatIntelSets");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListThreatIntelSetsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Re-enables GuardDuty to monitor findings of the member accounts specified by the account IDs. A master GuardDuty
* account can run this command after disabling GuardDuty from monitoring these members' findings by running
* StopMonitoringMembers.
*
* @param startMonitoringMembersRequest
* StartMonitoringMembers request body.
* @return Result of the StartMonitoringMembers operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.StartMonitoringMembers
* @see AWS API Documentation
*/
@Override
public StartMonitoringMembersResult startMonitoringMembers(StartMonitoringMembersRequest request) {
request = beforeClientExecution(request);
return executeStartMonitoringMembers(request);
}
@SdkInternalApi
final StartMonitoringMembersResult executeStartMonitoringMembers(StartMonitoringMembersRequest startMonitoringMembersRequest) {
ExecutionContext executionContext = createExecutionContext(startMonitoringMembersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StartMonitoringMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startMonitoringMembersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartMonitoringMembers");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new StartMonitoringMembersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Disables GuardDuty from monitoring findings of the member accounts specified by the account IDs. After running
* this command, a master GuardDuty account can run StartMonitoringMembers to re-enable GuardDuty to monitor these
* members’ findings.
*
* @param stopMonitoringMembersRequest
* StopMonitoringMembers request body.
* @return Result of the StopMonitoringMembers operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.StopMonitoringMembers
* @see AWS API Documentation
*/
@Override
public StopMonitoringMembersResult stopMonitoringMembers(StopMonitoringMembersRequest request) {
request = beforeClientExecution(request);
return executeStopMonitoringMembers(request);
}
@SdkInternalApi
final StopMonitoringMembersResult executeStopMonitoringMembers(StopMonitoringMembersRequest stopMonitoringMembersRequest) {
ExecutionContext executionContext = createExecutionContext(stopMonitoringMembersRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StopMonitoringMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopMonitoringMembersRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopMonitoringMembers");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new StopMonitoringMembersResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Unarchives Amazon GuardDuty findings specified by the list of finding IDs.
*
* @param unarchiveFindingsRequest
* UnarchiveFindings request body.
* @return Result of the UnarchiveFindings operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.UnarchiveFindings
* @see AWS
* API Documentation
*/
@Override
public UnarchiveFindingsResult unarchiveFindings(UnarchiveFindingsRequest request) {
request = beforeClientExecution(request);
return executeUnarchiveFindings(request);
}
@SdkInternalApi
final UnarchiveFindingsResult executeUnarchiveFindings(UnarchiveFindingsRequest unarchiveFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(unarchiveFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UnarchiveFindingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(unarchiveFindingsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UnarchiveFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UnarchiveFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Updates an Amazon GuardDuty detector specified by the detectorId.
*
* @param updateDetectorRequest
* UpdateDetector request body.
* @return Result of the UpdateDetector operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.UpdateDetector
* @see AWS API
* Documentation
*/
@Override
public UpdateDetectorResult updateDetector(UpdateDetectorRequest request) {
request = beforeClientExecution(request);
return executeUpdateDetector(request);
}
@SdkInternalApi
final UpdateDetectorResult executeUpdateDetector(UpdateDetectorRequest updateDetectorRequest) {
ExecutionContext executionContext = createExecutionContext(updateDetectorRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDetectorRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDetector");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDetectorResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Updates the filter specified by the filter name.
*
* @param updateFilterRequest
* UpdateFilterRequest request body.
* @return Result of the UpdateFilter operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.UpdateFilter
* @see AWS API
* Documentation
*/
@Override
public UpdateFilterResult updateFilter(UpdateFilterRequest request) {
request = beforeClientExecution(request);
return executeUpdateFilter(request);
}
@SdkInternalApi
final UpdateFilterResult executeUpdateFilter(UpdateFilterRequest updateFilterRequest) {
ExecutionContext executionContext = createExecutionContext(updateFilterRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateFilterRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateFilter");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateFilterResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Marks specified Amazon GuardDuty findings as useful or not useful.
*
* @param updateFindingsFeedbackRequest
* UpdateFindingsFeedback request body.
* @return Result of the UpdateFindingsFeedback operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.UpdateFindingsFeedback
* @see AWS API Documentation
*/
@Override
public UpdateFindingsFeedbackResult updateFindingsFeedback(UpdateFindingsFeedbackRequest request) {
request = beforeClientExecution(request);
return executeUpdateFindingsFeedback(request);
}
@SdkInternalApi
final UpdateFindingsFeedbackResult executeUpdateFindingsFeedback(UpdateFindingsFeedbackRequest updateFindingsFeedbackRequest) {
ExecutionContext executionContext = createExecutionContext(updateFindingsFeedbackRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateFindingsFeedbackRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateFindingsFeedbackRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateFindingsFeedback");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new UpdateFindingsFeedbackResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Updates the IPSet specified by the IPSet ID.
*
* @param updateIPSetRequest
* UpdateIPSet request body.
* @return Result of the UpdateIPSet operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.UpdateIPSet
* @see AWS API
* Documentation
*/
@Override
public UpdateIPSetResult updateIPSet(UpdateIPSetRequest request) {
request = beforeClientExecution(request);
return executeUpdateIPSet(request);
}
@SdkInternalApi
final UpdateIPSetResult executeUpdateIPSet(UpdateIPSetRequest updateIPSetRequest) {
ExecutionContext executionContext = createExecutionContext(updateIPSetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateIPSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateIPSetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateIPSet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateIPSetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Updates the ThreatIntelSet specified by ThreatIntelSet ID.
*
* @param updateThreatIntelSetRequest
* UpdateThreatIntelSet request body.
* @return Result of the UpdateThreatIntelSet operation returned by the service.
* @throws BadRequestException
* 400 response
* @throws InternalServerErrorException
* 500 response
* @sample AmazonGuardDuty.UpdateThreatIntelSet
* @see AWS
* API Documentation
*/
@Override
public UpdateThreatIntelSetResult updateThreatIntelSet(UpdateThreatIntelSetRequest request) {
request = beforeClientExecution(request);
return executeUpdateThreatIntelSet(request);
}
@SdkInternalApi
final UpdateThreatIntelSetResult executeUpdateThreatIntelSet(UpdateThreatIntelSetRequest updateThreatIntelSetRequest) {
ExecutionContext executionContext = createExecutionContext(updateThreatIntelSetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateThreatIntelSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateThreatIntelSetRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GuardDuty");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateThreatIntelSet");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateThreatIntelSetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns additional metadata for a previously executed successful, request, typically used for debugging issues
* where a service isn't acting as expected. This data isn't considered part of the result data returned by an
* operation, so it's available through this separate, diagnostic interface.
*
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
return invoke(request, responseHandler, executionContext, null, null);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {
executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);
}
/**
* Invoke with no authentication. Credentials are not required and any credentials set on the client or request will
* be ignored for this operation.
**/
private Response anonymousInvoke(Request request,
HttpResponseHandler> responseHandler, ExecutionContext executionContext) {
return doInvoke(request, responseHandler, executionContext, null, null);
}
/**
* Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
* ExecutionContext beforehand.
**/
private Response doInvoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
if (discoveredEndpoint != null) {
request.setEndpoint(discoveredEndpoint);
request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
} else if (uriFromEndpointTrait != null) {
request.setEndpoint(uriFromEndpointTrait);
} else {
request.setEndpoint(endpoint);
}
request.setTimeOffset(timeOffset);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}
@com.amazonaws.annotation.SdkInternalApi
static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() {
return protocolFactory;
}
}