software.amazon.awssdk.services.securitylake.DefaultSecurityLakeClient Maven / Gradle / Ivy
Show all versions of securitylake Show documentation
/*
* Copyright 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 software.amazon.awssdk.services.securitylake;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.securitylake.internal.SecurityLakeServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.securitylake.model.AccessDeniedException;
import software.amazon.awssdk.services.securitylake.model.BadRequestException;
import software.amazon.awssdk.services.securitylake.model.ConflictException;
import software.amazon.awssdk.services.securitylake.model.CreateAwsLogSourceRequest;
import software.amazon.awssdk.services.securitylake.model.CreateAwsLogSourceResponse;
import software.amazon.awssdk.services.securitylake.model.CreateCustomLogSourceRequest;
import software.amazon.awssdk.services.securitylake.model.CreateCustomLogSourceResponse;
import software.amazon.awssdk.services.securitylake.model.CreateDataLakeExceptionSubscriptionRequest;
import software.amazon.awssdk.services.securitylake.model.CreateDataLakeExceptionSubscriptionResponse;
import software.amazon.awssdk.services.securitylake.model.CreateDataLakeOrganizationConfigurationRequest;
import software.amazon.awssdk.services.securitylake.model.CreateDataLakeOrganizationConfigurationResponse;
import software.amazon.awssdk.services.securitylake.model.CreateDataLakeRequest;
import software.amazon.awssdk.services.securitylake.model.CreateDataLakeResponse;
import software.amazon.awssdk.services.securitylake.model.CreateSubscriberNotificationRequest;
import software.amazon.awssdk.services.securitylake.model.CreateSubscriberNotificationResponse;
import software.amazon.awssdk.services.securitylake.model.CreateSubscriberRequest;
import software.amazon.awssdk.services.securitylake.model.CreateSubscriberResponse;
import software.amazon.awssdk.services.securitylake.model.DeleteAwsLogSourceRequest;
import software.amazon.awssdk.services.securitylake.model.DeleteAwsLogSourceResponse;
import software.amazon.awssdk.services.securitylake.model.DeleteCustomLogSourceRequest;
import software.amazon.awssdk.services.securitylake.model.DeleteCustomLogSourceResponse;
import software.amazon.awssdk.services.securitylake.model.DeleteDataLakeExceptionSubscriptionRequest;
import software.amazon.awssdk.services.securitylake.model.DeleteDataLakeExceptionSubscriptionResponse;
import software.amazon.awssdk.services.securitylake.model.DeleteDataLakeOrganizationConfigurationRequest;
import software.amazon.awssdk.services.securitylake.model.DeleteDataLakeOrganizationConfigurationResponse;
import software.amazon.awssdk.services.securitylake.model.DeleteDataLakeRequest;
import software.amazon.awssdk.services.securitylake.model.DeleteDataLakeResponse;
import software.amazon.awssdk.services.securitylake.model.DeleteSubscriberNotificationRequest;
import software.amazon.awssdk.services.securitylake.model.DeleteSubscriberNotificationResponse;
import software.amazon.awssdk.services.securitylake.model.DeleteSubscriberRequest;
import software.amazon.awssdk.services.securitylake.model.DeleteSubscriberResponse;
import software.amazon.awssdk.services.securitylake.model.DeregisterDataLakeDelegatedAdministratorRequest;
import software.amazon.awssdk.services.securitylake.model.DeregisterDataLakeDelegatedAdministratorResponse;
import software.amazon.awssdk.services.securitylake.model.GetDataLakeExceptionSubscriptionRequest;
import software.amazon.awssdk.services.securitylake.model.GetDataLakeExceptionSubscriptionResponse;
import software.amazon.awssdk.services.securitylake.model.GetDataLakeOrganizationConfigurationRequest;
import software.amazon.awssdk.services.securitylake.model.GetDataLakeOrganizationConfigurationResponse;
import software.amazon.awssdk.services.securitylake.model.GetDataLakeSourcesRequest;
import software.amazon.awssdk.services.securitylake.model.GetDataLakeSourcesResponse;
import software.amazon.awssdk.services.securitylake.model.GetSubscriberRequest;
import software.amazon.awssdk.services.securitylake.model.GetSubscriberResponse;
import software.amazon.awssdk.services.securitylake.model.InternalServerException;
import software.amazon.awssdk.services.securitylake.model.ListDataLakeExceptionsRequest;
import software.amazon.awssdk.services.securitylake.model.ListDataLakeExceptionsResponse;
import software.amazon.awssdk.services.securitylake.model.ListDataLakesRequest;
import software.amazon.awssdk.services.securitylake.model.ListDataLakesResponse;
import software.amazon.awssdk.services.securitylake.model.ListLogSourcesRequest;
import software.amazon.awssdk.services.securitylake.model.ListLogSourcesResponse;
import software.amazon.awssdk.services.securitylake.model.ListSubscribersRequest;
import software.amazon.awssdk.services.securitylake.model.ListSubscribersResponse;
import software.amazon.awssdk.services.securitylake.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.securitylake.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.securitylake.model.RegisterDataLakeDelegatedAdministratorRequest;
import software.amazon.awssdk.services.securitylake.model.RegisterDataLakeDelegatedAdministratorResponse;
import software.amazon.awssdk.services.securitylake.model.ResourceNotFoundException;
import software.amazon.awssdk.services.securitylake.model.SecurityLakeException;
import software.amazon.awssdk.services.securitylake.model.TagResourceRequest;
import software.amazon.awssdk.services.securitylake.model.TagResourceResponse;
import software.amazon.awssdk.services.securitylake.model.ThrottlingException;
import software.amazon.awssdk.services.securitylake.model.UntagResourceRequest;
import software.amazon.awssdk.services.securitylake.model.UntagResourceResponse;
import software.amazon.awssdk.services.securitylake.model.UpdateDataLakeExceptionSubscriptionRequest;
import software.amazon.awssdk.services.securitylake.model.UpdateDataLakeExceptionSubscriptionResponse;
import software.amazon.awssdk.services.securitylake.model.UpdateDataLakeRequest;
import software.amazon.awssdk.services.securitylake.model.UpdateDataLakeResponse;
import software.amazon.awssdk.services.securitylake.model.UpdateSubscriberNotificationRequest;
import software.amazon.awssdk.services.securitylake.model.UpdateSubscriberNotificationResponse;
import software.amazon.awssdk.services.securitylake.model.UpdateSubscriberRequest;
import software.amazon.awssdk.services.securitylake.model.UpdateSubscriberResponse;
import software.amazon.awssdk.services.securitylake.transform.CreateAwsLogSourceRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.CreateCustomLogSourceRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.CreateDataLakeExceptionSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.CreateDataLakeOrganizationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.CreateDataLakeRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.CreateSubscriberNotificationRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.CreateSubscriberRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.DeleteAwsLogSourceRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.DeleteCustomLogSourceRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.DeleteDataLakeExceptionSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.DeleteDataLakeOrganizationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.DeleteDataLakeRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.DeleteSubscriberNotificationRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.DeleteSubscriberRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.DeregisterDataLakeDelegatedAdministratorRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.GetDataLakeExceptionSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.GetDataLakeOrganizationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.GetDataLakeSourcesRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.GetSubscriberRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.ListDataLakeExceptionsRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.ListDataLakesRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.ListLogSourcesRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.ListSubscribersRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.RegisterDataLakeDelegatedAdministratorRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.UpdateDataLakeExceptionSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.UpdateDataLakeRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.UpdateSubscriberNotificationRequestMarshaller;
import software.amazon.awssdk.services.securitylake.transform.UpdateSubscriberRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link SecurityLakeClient}.
*
* @see SecurityLakeClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultSecurityLakeClient implements SecurityLakeClient {
private static final Logger log = Logger.loggerFor(DefaultSecurityLakeClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.REST_JSON).build();
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultSecurityLakeClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Adds a natively supported Amazon Web Service as an Amazon Security Lake source. Enables source types for member
* accounts in required Amazon Web Services Regions, based on the parameters you specify. You can choose any source
* type in any Region for either accounts that are part of a trusted organization or standalone accounts. Once you
* add an Amazon Web Service as a source, Security Lake starts collecting logs and events from it.
*
*
* You can use this API only to enable natively supported Amazon Web Services as a source. Use
* CreateCustomLogSource
to enable data collection from a custom source.
*
*
* @param createAwsLogSourceRequest
* @return Result of the CreateAwsLogSource operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.CreateAwsLogSource
* @see AWS API Documentation
*/
@Override
public CreateAwsLogSourceResponse createAwsLogSource(CreateAwsLogSourceRequest createAwsLogSourceRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateAwsLogSourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAwsLogSourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createAwsLogSourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAwsLogSource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateAwsLogSource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createAwsLogSourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateAwsLogSourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds a third-party custom source in Amazon Security Lake, from the Amazon Web Services Region where you want to
* create a custom source. Security Lake can collect logs and events from third-party custom sources. After creating
* the appropriate IAM role to invoke Glue crawler, use this API to add a custom source name in Security Lake. This
* operation creates a partition in the Amazon S3 bucket for Security Lake as the target location for log files from
* the custom source. In addition, this operation also creates an associated Glue table and an Glue crawler.
*
*
* @param createCustomLogSourceRequest
* @return Result of the CreateCustomLogSource operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.CreateCustomLogSource
* @see AWS API Documentation
*/
@Override
public CreateCustomLogSourceResponse createCustomLogSource(CreateCustomLogSourceRequest createCustomLogSourceRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCustomLogSourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCustomLogSourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createCustomLogSourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCustomLogSource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateCustomLogSource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createCustomLogSourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateCustomLogSourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Initializes an Amazon Security Lake instance with the provided (or default) configuration. You can enable
* Security Lake in Amazon Web Services Regions with customized settings before enabling log collection in Regions.
* To specify particular Regions, configure these Regions using the configurations
parameter. If you
* have already enabled Security Lake in a Region when you call this command, the command will update the Region if
* you provide new configuration parameters. If you have not already enabled Security Lake in the Region when you
* call this API, it will set up the data lake in the Region with the specified configurations.
*
*
* When you enable Security Lake, it starts ingesting security data after the CreateAwsLogSource
call.
* This includes ingesting security data from sources, storing data, and making data accessible to subscribers.
* Security Lake also enables all the existing settings and resources that it stores or maintains for your Amazon
* Web Services account in the current Region, including security log and event data. For more information, see the
* Amazon Security
* Lake User Guide.
*
*
* @param createDataLakeRequest
* @return Result of the CreateDataLake operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.CreateDataLake
* @see AWS
* API Documentation
*/
@Override
public CreateDataLakeResponse createDataLake(CreateDataLakeRequest createDataLakeRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateDataLakeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDataLakeRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDataLakeRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataLake");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateDataLake").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDataLakeRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDataLakeRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates the specified notification subscription in Amazon Security Lake for the organization you specify.
*
*
* @param createDataLakeExceptionSubscriptionRequest
* @return Result of the CreateDataLakeExceptionSubscription operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.CreateDataLakeExceptionSubscription
* @see AWS API Documentation
*/
@Override
public CreateDataLakeExceptionSubscriptionResponse createDataLakeExceptionSubscription(
CreateDataLakeExceptionSubscriptionRequest createDataLakeExceptionSubscriptionRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDataLakeExceptionSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDataLakeExceptionSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createDataLakeExceptionSubscriptionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataLakeExceptionSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDataLakeExceptionSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createDataLakeExceptionSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDataLakeExceptionSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Automatically enables Amazon Security Lake for new member accounts in your organization. Security Lake is not
* automatically enabled for any existing member accounts in your organization.
*
*
* @param createDataLakeOrganizationConfigurationRequest
* @return Result of the CreateDataLakeOrganizationConfiguration operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.CreateDataLakeOrganizationConfiguration
* @see AWS API Documentation
*/
@Override
public CreateDataLakeOrganizationConfigurationResponse createDataLakeOrganizationConfiguration(
CreateDataLakeOrganizationConfigurationRequest createDataLakeOrganizationConfigurationRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateDataLakeOrganizationConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDataLakeOrganizationConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createDataLakeOrganizationConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDataLakeOrganizationConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateDataLakeOrganizationConfiguration").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(createDataLakeOrganizationConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDataLakeOrganizationConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a subscription permission for accounts that are already enabled in Amazon Security Lake. You can create a
* subscriber with access to data in the current Amazon Web Services Region.
*
*
* @param createSubscriberRequest
* @return Result of the CreateSubscriber operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.CreateSubscriber
* @see AWS
* API Documentation
*/
@Override
public CreateSubscriberResponse createSubscriber(CreateSubscriberRequest createSubscriberRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateSubscriberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSubscriberRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createSubscriberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSubscriber");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateSubscriber").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createSubscriberRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateSubscriberRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Notifies the subscriber when new data is written to the data lake for the sources that the subscriber consumes in
* Security Lake. You can create only one subscriber notification per subscriber.
*
*
* @param createSubscriberNotificationRequest
* @return Result of the CreateSubscriberNotification operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.CreateSubscriberNotification
* @see AWS API Documentation
*/
@Override
public CreateSubscriberNotificationResponse createSubscriberNotification(
CreateSubscriberNotificationRequest createSubscriberNotificationRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateSubscriberNotificationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSubscriberNotificationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createSubscriberNotificationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSubscriberNotification");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateSubscriberNotification").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createSubscriberNotificationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateSubscriberNotificationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes a natively supported Amazon Web Service as an Amazon Security Lake source. You can remove a source for
* one or more Regions. When you remove the source, Security Lake stops collecting data from that source in the
* specified Regions and accounts, and subscribers can no longer consume new data from the source. However,
* subscribers can still consume data that Security Lake collected from the source before removal.
*
*
* You can choose any source type in any Amazon Web Services Region for either accounts that are part of a trusted
* organization or standalone accounts.
*
*
* @param deleteAwsLogSourceRequest
* @return Result of the DeleteAwsLogSource operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.DeleteAwsLogSource
* @see AWS API Documentation
*/
@Override
public DeleteAwsLogSourceResponse deleteAwsLogSource(DeleteAwsLogSourceRequest deleteAwsLogSourceRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteAwsLogSourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAwsLogSourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAwsLogSourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAwsLogSource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteAwsLogSource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteAwsLogSourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteAwsLogSourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes a custom log source from Amazon Security Lake, to stop sending data from the custom source to Security
* Lake.
*
*
* @param deleteCustomLogSourceRequest
* @return Result of the DeleteCustomLogSource operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.DeleteCustomLogSource
* @see AWS API Documentation
*/
@Override
public DeleteCustomLogSourceResponse deleteCustomLogSource(DeleteCustomLogSourceRequest deleteCustomLogSourceRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCustomLogSourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCustomLogSourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCustomLogSourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCustomLogSource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteCustomLogSource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteCustomLogSourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteCustomLogSourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* When you disable Amazon Security Lake from your account, Security Lake is disabled in all Amazon Web Services
* Regions and it stops collecting data from your sources. Also, this API automatically takes steps to remove the
* account from Security Lake. However, Security Lake retains all of your existing settings and the resources that
* it created in your Amazon Web Services account in the current Amazon Web Services Region.
*
*
* The DeleteDataLake
operation does not delete the data that is stored in your Amazon S3 bucket, which
* is owned by your Amazon Web Services account. For more information, see the Amazon Security Lake
* User Guide.
*
*
* @param deleteDataLakeRequest
* @return Result of the DeleteDataLake operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.DeleteDataLake
* @see AWS
* API Documentation
*/
@Override
public DeleteDataLakeResponse deleteDataLake(DeleteDataLakeRequest deleteDataLakeRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteDataLakeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDataLakeRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDataLakeRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDataLake");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteDataLake").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteDataLakeRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteDataLakeRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified notification subscription in Amazon Security Lake for the organization you specify.
*
*
* @param deleteDataLakeExceptionSubscriptionRequest
* @return Result of the DeleteDataLakeExceptionSubscription operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.DeleteDataLakeExceptionSubscription
* @see AWS API Documentation
*/
@Override
public DeleteDataLakeExceptionSubscriptionResponse deleteDataLakeExceptionSubscription(
DeleteDataLakeExceptionSubscriptionRequest deleteDataLakeExceptionSubscriptionRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteDataLakeExceptionSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDataLakeExceptionSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteDataLakeExceptionSubscriptionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDataLakeExceptionSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteDataLakeExceptionSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteDataLakeExceptionSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteDataLakeExceptionSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Turns off automatic enablement of Amazon Security Lake for member accounts that are added to an organization in
* Organizations. Only the delegated Security Lake administrator for an organization can perform this operation. If
* the delegated Security Lake administrator performs this operation, new member accounts won't automatically
* contribute data to the data lake.
*
*
* @param deleteDataLakeOrganizationConfigurationRequest
* @return Result of the DeleteDataLakeOrganizationConfiguration operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.DeleteDataLakeOrganizationConfiguration
* @see AWS API Documentation
*/
@Override
public DeleteDataLakeOrganizationConfigurationResponse deleteDataLakeOrganizationConfiguration(
DeleteDataLakeOrganizationConfigurationRequest deleteDataLakeOrganizationConfigurationRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteDataLakeOrganizationConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDataLakeOrganizationConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteDataLakeOrganizationConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDataLakeOrganizationConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteDataLakeOrganizationConfiguration").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(deleteDataLakeOrganizationConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteDataLakeOrganizationConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the subscription permission and all notification settings for accounts that are already enabled in Amazon
* Security Lake. When you run DeleteSubscriber
, the subscriber will no longer consume data from
* Security Lake and the subscriber is removed. This operation deletes the subscriber and removes access to data in
* the current Amazon Web Services Region.
*
*
* @param deleteSubscriberRequest
* @return Result of the DeleteSubscriber operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.DeleteSubscriber
* @see AWS
* API Documentation
*/
@Override
public DeleteSubscriberResponse deleteSubscriber(DeleteSubscriberRequest deleteSubscriberRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteSubscriberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSubscriberRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSubscriberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSubscriber");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteSubscriber").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteSubscriberRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteSubscriberRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified notification subscription in Amazon Security Lake for the organization you specify.
*
*
* @param deleteSubscriberNotificationRequest
* @return Result of the DeleteSubscriberNotification operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.DeleteSubscriberNotification
* @see AWS API Documentation
*/
@Override
public DeleteSubscriberNotificationResponse deleteSubscriberNotification(
DeleteSubscriberNotificationRequest deleteSubscriberNotificationRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteSubscriberNotificationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSubscriberNotificationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSubscriberNotificationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSubscriberNotification");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteSubscriberNotification").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteSubscriberNotificationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteSubscriberNotificationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the Amazon Security Lake delegated administrator account for the organization. This API can only be
* called by the organization management account. The organization management account cannot be the delegated
* administrator account.
*
*
* @param deregisterDataLakeDelegatedAdministratorRequest
* @return Result of the DeregisterDataLakeDelegatedAdministrator operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.DeregisterDataLakeDelegatedAdministrator
* @see AWS API Documentation
*/
@Override
public DeregisterDataLakeDelegatedAdministratorResponse deregisterDataLakeDelegatedAdministrator(
DeregisterDataLakeDelegatedAdministratorRequest deregisterDataLakeDelegatedAdministratorRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeregisterDataLakeDelegatedAdministratorResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(
deregisterDataLakeDelegatedAdministratorRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deregisterDataLakeDelegatedAdministratorRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeregisterDataLakeDelegatedAdministrator");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeregisterDataLakeDelegatedAdministrator").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(deregisterDataLakeDelegatedAdministratorRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeregisterDataLakeDelegatedAdministratorRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the details of exception notifications for the account in Amazon Security Lake.
*
*
* @param getDataLakeExceptionSubscriptionRequest
* @return Result of the GetDataLakeExceptionSubscription operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.GetDataLakeExceptionSubscription
* @see AWS API Documentation
*/
@Override
public GetDataLakeExceptionSubscriptionResponse getDataLakeExceptionSubscription(
GetDataLakeExceptionSubscriptionRequest getDataLakeExceptionSubscriptionRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDataLakeExceptionSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDataLakeExceptionSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getDataLakeExceptionSubscriptionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDataLakeExceptionSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDataLakeExceptionSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDataLakeExceptionSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDataLakeExceptionSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the configuration that will be automatically set up for accounts added to the organization after the
* organization has onboarded to Amazon Security Lake. This API does not take input parameters.
*
*
* @param getDataLakeOrganizationConfigurationRequest
* @return Result of the GetDataLakeOrganizationConfiguration operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.GetDataLakeOrganizationConfiguration
* @see AWS API Documentation
*/
@Override
public GetDataLakeOrganizationConfigurationResponse getDataLakeOrganizationConfiguration(
GetDataLakeOrganizationConfigurationRequest getDataLakeOrganizationConfigurationRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, GetDataLakeOrganizationConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDataLakeOrganizationConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getDataLakeOrganizationConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDataLakeOrganizationConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetDataLakeOrganizationConfiguration").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDataLakeOrganizationConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDataLakeOrganizationConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a snapshot of the current Region, including whether Amazon Security Lake is enabled for those accounts
* and which sources Security Lake is collecting data from.
*
*
* @param getDataLakeSourcesRequest
* @return Result of the GetDataLakeSources operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.GetDataLakeSources
* @see AWS API Documentation
*/
@Override
public GetDataLakeSourcesResponse getDataLakeSources(GetDataLakeSourcesRequest getDataLakeSourcesRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDataLakeSourcesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getDataLakeSourcesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDataLakeSourcesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDataLakeSources");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetDataLakeSources").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getDataLakeSourcesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDataLakeSourcesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the subscription information for the specified subscription ID. You can get information about a
* specific subscriber.
*
*
* @param getSubscriberRequest
* @return Result of the GetSubscriber operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.GetSubscriber
* @see AWS
* API Documentation
*/
@Override
public GetSubscriberResponse getSubscriber(GetSubscriberRequest getSubscriberRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetSubscriberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSubscriberRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getSubscriberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSubscriber");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetSubscriber").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getSubscriberRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetSubscriberRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the Amazon Security Lake exceptions that you can use to find the source of problems and fix them.
*
*
* @param listDataLakeExceptionsRequest
* @return Result of the ListDataLakeExceptions operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.ListDataLakeExceptions
* @see AWS API Documentation
*/
@Override
public ListDataLakeExceptionsResponse listDataLakeExceptions(ListDataLakeExceptionsRequest listDataLakeExceptionsRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDataLakeExceptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDataLakeExceptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDataLakeExceptionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDataLakeExceptions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDataLakeExceptions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDataLakeExceptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDataLakeExceptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the Amazon Security Lake configuration object for the specified Amazon Web Services Regions. You can
* use this operation to determine whether Security Lake is enabled for a Region.
*
*
* @param listDataLakesRequest
* @return Result of the ListDataLakes operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.ListDataLakes
* @see AWS
* API Documentation
*/
@Override
public ListDataLakesResponse listDataLakes(ListDataLakesRequest listDataLakesRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListDataLakesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listDataLakesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDataLakesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDataLakes");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDataLakes").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listDataLakesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDataLakesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the log sources in the current Amazon Web Services Region.
*
*
* @param listLogSourcesRequest
* @return Result of the ListLogSources operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.ListLogSources
* @see AWS
* API Documentation
*/
@Override
public ListLogSourcesResponse listLogSources(ListLogSourcesRequest listLogSourcesRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListLogSourcesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listLogSourcesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listLogSourcesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListLogSources");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListLogSources").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listLogSourcesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListLogSourcesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* List all subscribers for the specific Amazon Security Lake account ID. You can retrieve a list of subscriptions
* associated with a specific organization or Amazon Web Services account.
*
*
* @param listSubscribersRequest
* @return Result of the ListSubscribers operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.ListSubscribers
* @see AWS
* API Documentation
*/
@Override
public ListSubscribersResponse listSubscribers(ListSubscribersRequest listSubscribersRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListSubscribersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSubscribersRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listSubscribersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSubscribers");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListSubscribers").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listSubscribersRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListSubscribersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the tags (keys and values) that are associated with an Amazon Security Lake resource: a subscriber, or
* the data lake configuration for your Amazon Web Services account in a particular Amazon Web Services Region.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Designates the Amazon Security Lake delegated administrator account for the organization. This API can only be
* called by the organization management account. The organization management account cannot be the delegated
* administrator account.
*
*
* @param registerDataLakeDelegatedAdministratorRequest
* @return Result of the RegisterDataLakeDelegatedAdministrator operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.RegisterDataLakeDelegatedAdministrator
* @see AWS API Documentation
*/
@Override
public RegisterDataLakeDelegatedAdministratorResponse registerDataLakeDelegatedAdministrator(
RegisterDataLakeDelegatedAdministratorRequest registerDataLakeDelegatedAdministratorRequest)
throws BadRequestException, ResourceNotFoundException, InternalServerException, AccessDeniedException,
ConflictException, ThrottlingException, AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, RegisterDataLakeDelegatedAdministratorResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(registerDataLakeDelegatedAdministratorRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
registerDataLakeDelegatedAdministratorRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RegisterDataLakeDelegatedAdministrator");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RegisterDataLakeDelegatedAdministrator").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(registerDataLakeDelegatedAdministratorRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new RegisterDataLakeDelegatedAdministratorRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds or updates one or more tags that are associated with an Amazon Security Lake resource: a subscriber, or the
* data lake configuration for your Amazon Web Services account in a particular Amazon Web Services Region. A
* tag is a label that you can define and associate with Amazon Web Services resources. Each tag consists of
* a required tag key and an associated tag value. A tag key is a general label that acts as a
* category for a more specific tag value. A tag value acts as a descriptor for a tag key. Tags can help you
* identify, categorize, and manage resources in different ways, such as by owner, environment, or other criteria.
* For more information, see Tagging Amazon Security
* Lake resources in the Amazon Security Lake User Guide.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(tagResourceRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes one or more tags (keys and values) from an Amazon Security Lake resource: a subscriber, or the data lake
* configuration for your Amazon Web Services account in a particular Amazon Web Services Region.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.UntagResource
* @see AWS
* API Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Specifies where to store your security data and for how long. You can add a rollup Region to consolidate data
* from multiple Amazon Web Services Regions.
*
*
* @param updateDataLakeRequest
* @return Result of the UpdateDataLake operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.UpdateDataLake
* @see AWS
* API Documentation
*/
@Override
public UpdateDataLakeResponse updateDataLake(UpdateDataLakeRequest updateDataLakeRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateDataLakeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDataLakeRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDataLakeRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDataLake");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateDataLake").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateDataLakeRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateDataLakeRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the specified notification subscription in Amazon Security Lake for the organization you specify.
*
*
* @param updateDataLakeExceptionSubscriptionRequest
* @return Result of the UpdateDataLakeExceptionSubscription operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.UpdateDataLakeExceptionSubscription
* @see AWS API Documentation
*/
@Override
public UpdateDataLakeExceptionSubscriptionResponse updateDataLakeExceptionSubscription(
UpdateDataLakeExceptionSubscriptionRequest updateDataLakeExceptionSubscriptionRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateDataLakeExceptionSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDataLakeExceptionSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateDataLakeExceptionSubscriptionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDataLakeExceptionSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateDataLakeExceptionSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateDataLakeExceptionSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateDataLakeExceptionSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates an existing subscription for the given Amazon Security Lake account ID. You can update a subscriber by
* changing the sources that the subscriber consumes data from.
*
*
* @param updateSubscriberRequest
* @return Result of the UpdateSubscriber operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.UpdateSubscriber
* @see AWS
* API Documentation
*/
@Override
public UpdateSubscriberResponse updateSubscriber(UpdateSubscriberRequest updateSubscriberRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateSubscriberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSubscriberRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSubscriberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSubscriber");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateSubscriber").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateSubscriberRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateSubscriberRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates an existing notification method for the subscription (SQS or HTTPs endpoint) or switches the notification
* subscription endpoint for a subscriber.
*
*
* @param updateSubscriberNotificationRequest
* @return Result of the UpdateSubscriberNotification operation returned by the service.
* @throws BadRequestException
* The request is malformed or contains an error such as an invalid parameter value or a missing required
* parameter.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws InternalServerException
* Internal service exceptions are sometimes caused by transient issues. Before you start troubleshooting,
* perform the operation again.
* @throws AccessDeniedException
* You do not have sufficient access to perform this action. Access denied errors appear when Amazon
* Security Lake explicitly or implicitly denies an authorization request. An explicit denial occurs when a
* policy contains a Deny statement for the specific Amazon Web Services action. An implicit denial occurs
* when there is no applicable Deny statement and also no applicable Allow statement.
* @throws ConflictException
* Occurs when a conflict with a previous successful write is detected. This generally occurs when the
* previous write did not have time to propagate to the host serving the current request. A retry (with
* appropriate backoff logic) is the recommended response to this exception.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws SecurityLakeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample SecurityLakeClient.UpdateSubscriberNotification
* @see AWS API Documentation
*/
@Override
public UpdateSubscriberNotificationResponse updateSubscriberNotification(
UpdateSubscriberNotificationRequest updateSubscriberNotificationRequest) throws BadRequestException,
ResourceNotFoundException, InternalServerException, AccessDeniedException, ConflictException, ThrottlingException,
AwsServiceException, SdkClientException, SecurityLakeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateSubscriberNotificationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSubscriberNotificationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSubscriberNotificationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "SecurityLake");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSubscriberNotification");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateSubscriberNotification").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateSubscriberNotificationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateSubscriberNotificationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) {
List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder();
if (plugins.isEmpty()) {
return configuration.build();
}
SecurityLakeServiceClientConfigurationBuilder serviceConfigBuilder = new SecurityLakeServiceClientConfigurationBuilder(
configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
return configuration.build();
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(SecurityLakeException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("ThrottlingException")
.exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InternalServerException")
.exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AccessDeniedException")
.exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ConflictException")
.exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("BadRequestException")
.exceptionBuilderSupplier(BadRequestException::builder).httpStatusCode(400).build());
}
@Override
public final SecurityLakeServiceClientConfiguration serviceClientConfiguration() {
return new SecurityLakeServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build();
}
@Override
public void close() {
clientHandler.close();
}
}