software.amazon.awssdk.services.fms.DefaultFmsClient Maven / Gradle / Ivy
Show all versions of fms 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.fms;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
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.core.util.VersionInfo;
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.fms.model.AssociateAdminAccountRequest;
import software.amazon.awssdk.services.fms.model.AssociateAdminAccountResponse;
import software.amazon.awssdk.services.fms.model.AssociateThirdPartyFirewallRequest;
import software.amazon.awssdk.services.fms.model.AssociateThirdPartyFirewallResponse;
import software.amazon.awssdk.services.fms.model.BatchAssociateResourceRequest;
import software.amazon.awssdk.services.fms.model.BatchAssociateResourceResponse;
import software.amazon.awssdk.services.fms.model.BatchDisassociateResourceRequest;
import software.amazon.awssdk.services.fms.model.BatchDisassociateResourceResponse;
import software.amazon.awssdk.services.fms.model.DeleteAppsListRequest;
import software.amazon.awssdk.services.fms.model.DeleteAppsListResponse;
import software.amazon.awssdk.services.fms.model.DeleteNotificationChannelRequest;
import software.amazon.awssdk.services.fms.model.DeleteNotificationChannelResponse;
import software.amazon.awssdk.services.fms.model.DeletePolicyRequest;
import software.amazon.awssdk.services.fms.model.DeletePolicyResponse;
import software.amazon.awssdk.services.fms.model.DeleteProtocolsListRequest;
import software.amazon.awssdk.services.fms.model.DeleteProtocolsListResponse;
import software.amazon.awssdk.services.fms.model.DeleteResourceSetRequest;
import software.amazon.awssdk.services.fms.model.DeleteResourceSetResponse;
import software.amazon.awssdk.services.fms.model.DisassociateAdminAccountRequest;
import software.amazon.awssdk.services.fms.model.DisassociateAdminAccountResponse;
import software.amazon.awssdk.services.fms.model.DisassociateThirdPartyFirewallRequest;
import software.amazon.awssdk.services.fms.model.DisassociateThirdPartyFirewallResponse;
import software.amazon.awssdk.services.fms.model.FmsException;
import software.amazon.awssdk.services.fms.model.FmsRequest;
import software.amazon.awssdk.services.fms.model.GetAdminAccountRequest;
import software.amazon.awssdk.services.fms.model.GetAdminAccountResponse;
import software.amazon.awssdk.services.fms.model.GetAppsListRequest;
import software.amazon.awssdk.services.fms.model.GetAppsListResponse;
import software.amazon.awssdk.services.fms.model.GetComplianceDetailRequest;
import software.amazon.awssdk.services.fms.model.GetComplianceDetailResponse;
import software.amazon.awssdk.services.fms.model.GetNotificationChannelRequest;
import software.amazon.awssdk.services.fms.model.GetNotificationChannelResponse;
import software.amazon.awssdk.services.fms.model.GetPolicyRequest;
import software.amazon.awssdk.services.fms.model.GetPolicyResponse;
import software.amazon.awssdk.services.fms.model.GetProtectionStatusRequest;
import software.amazon.awssdk.services.fms.model.GetProtectionStatusResponse;
import software.amazon.awssdk.services.fms.model.GetProtocolsListRequest;
import software.amazon.awssdk.services.fms.model.GetProtocolsListResponse;
import software.amazon.awssdk.services.fms.model.GetResourceSetRequest;
import software.amazon.awssdk.services.fms.model.GetResourceSetResponse;
import software.amazon.awssdk.services.fms.model.GetThirdPartyFirewallAssociationStatusRequest;
import software.amazon.awssdk.services.fms.model.GetThirdPartyFirewallAssociationStatusResponse;
import software.amazon.awssdk.services.fms.model.GetViolationDetailsRequest;
import software.amazon.awssdk.services.fms.model.GetViolationDetailsResponse;
import software.amazon.awssdk.services.fms.model.InternalErrorException;
import software.amazon.awssdk.services.fms.model.InvalidInputException;
import software.amazon.awssdk.services.fms.model.InvalidOperationException;
import software.amazon.awssdk.services.fms.model.InvalidTypeException;
import software.amazon.awssdk.services.fms.model.LimitExceededException;
import software.amazon.awssdk.services.fms.model.ListAppsListsRequest;
import software.amazon.awssdk.services.fms.model.ListAppsListsResponse;
import software.amazon.awssdk.services.fms.model.ListComplianceStatusRequest;
import software.amazon.awssdk.services.fms.model.ListComplianceStatusResponse;
import software.amazon.awssdk.services.fms.model.ListDiscoveredResourcesRequest;
import software.amazon.awssdk.services.fms.model.ListDiscoveredResourcesResponse;
import software.amazon.awssdk.services.fms.model.ListMemberAccountsRequest;
import software.amazon.awssdk.services.fms.model.ListMemberAccountsResponse;
import software.amazon.awssdk.services.fms.model.ListPoliciesRequest;
import software.amazon.awssdk.services.fms.model.ListPoliciesResponse;
import software.amazon.awssdk.services.fms.model.ListProtocolsListsRequest;
import software.amazon.awssdk.services.fms.model.ListProtocolsListsResponse;
import software.amazon.awssdk.services.fms.model.ListResourceSetResourcesRequest;
import software.amazon.awssdk.services.fms.model.ListResourceSetResourcesResponse;
import software.amazon.awssdk.services.fms.model.ListResourceSetsRequest;
import software.amazon.awssdk.services.fms.model.ListResourceSetsResponse;
import software.amazon.awssdk.services.fms.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.fms.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.fms.model.ListThirdPartyFirewallFirewallPoliciesRequest;
import software.amazon.awssdk.services.fms.model.ListThirdPartyFirewallFirewallPoliciesResponse;
import software.amazon.awssdk.services.fms.model.PutAppsListRequest;
import software.amazon.awssdk.services.fms.model.PutAppsListResponse;
import software.amazon.awssdk.services.fms.model.PutNotificationChannelRequest;
import software.amazon.awssdk.services.fms.model.PutNotificationChannelResponse;
import software.amazon.awssdk.services.fms.model.PutPolicyRequest;
import software.amazon.awssdk.services.fms.model.PutPolicyResponse;
import software.amazon.awssdk.services.fms.model.PutProtocolsListRequest;
import software.amazon.awssdk.services.fms.model.PutProtocolsListResponse;
import software.amazon.awssdk.services.fms.model.PutResourceSetRequest;
import software.amazon.awssdk.services.fms.model.PutResourceSetResponse;
import software.amazon.awssdk.services.fms.model.ResourceNotFoundException;
import software.amazon.awssdk.services.fms.model.TagResourceRequest;
import software.amazon.awssdk.services.fms.model.TagResourceResponse;
import software.amazon.awssdk.services.fms.model.UntagResourceRequest;
import software.amazon.awssdk.services.fms.model.UntagResourceResponse;
import software.amazon.awssdk.services.fms.paginators.ListAppsListsIterable;
import software.amazon.awssdk.services.fms.paginators.ListComplianceStatusIterable;
import software.amazon.awssdk.services.fms.paginators.ListMemberAccountsIterable;
import software.amazon.awssdk.services.fms.paginators.ListPoliciesIterable;
import software.amazon.awssdk.services.fms.paginators.ListProtocolsListsIterable;
import software.amazon.awssdk.services.fms.paginators.ListThirdPartyFirewallFirewallPoliciesIterable;
import software.amazon.awssdk.services.fms.transform.AssociateAdminAccountRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.AssociateThirdPartyFirewallRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.BatchAssociateResourceRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.BatchDisassociateResourceRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.DeleteAppsListRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.DeleteNotificationChannelRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.DeletePolicyRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.DeleteProtocolsListRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.DeleteResourceSetRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.DisassociateAdminAccountRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.DisassociateThirdPartyFirewallRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetAdminAccountRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetAppsListRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetComplianceDetailRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetNotificationChannelRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetPolicyRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetProtectionStatusRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetProtocolsListRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetResourceSetRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetThirdPartyFirewallAssociationStatusRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.GetViolationDetailsRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListAppsListsRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListComplianceStatusRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListDiscoveredResourcesRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListMemberAccountsRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListPoliciesRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListProtocolsListsRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListResourceSetResourcesRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListResourceSetsRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.ListThirdPartyFirewallFirewallPoliciesRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.PutAppsListRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.PutNotificationChannelRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.PutPolicyRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.PutProtocolsListRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.PutResourceSetRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.fms.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link FmsClient}.
*
* @see FmsClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultFmsClient implements FmsClient {
private static final Logger log = Logger.loggerFor(DefaultFmsClient.class);
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultFmsClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Sets the Firewall Manager administrator account. The account must be a member of the organization in
* Organizations whose resources you want to protect. Firewall Manager sets the permissions that allow the account
* to administer your Firewall Manager policies.
*
*
* The account that you associate with Firewall Manager is called the Firewall Manager administrator account.
*
*
* @param associateAdminAccountRequest
* @return Result of the AssociateAdminAccount operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.AssociateAdminAccount
* @see AWS API
* Documentation
*/
@Override
public AssociateAdminAccountResponse associateAdminAccount(AssociateAdminAccountRequest associateAdminAccountRequest)
throws InvalidOperationException, InvalidInputException, ResourceNotFoundException, InternalErrorException,
LimitExceededException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateAdminAccountResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateAdminAccountRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateAdminAccount");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AssociateAdminAccount").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(associateAdminAccountRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AssociateAdminAccountRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Sets the Firewall Manager policy administrator as a tenant administrator of a third-party firewall service. A
* tenant is an instance of the third-party firewall service that's associated with your Amazon Web Services
* customer account.
*
*
* @param associateThirdPartyFirewallRequest
* @return Result of the AssociateThirdPartyFirewall operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.AssociateThirdPartyFirewall
* @see AWS API Documentation
*/
@Override
public AssociateThirdPartyFirewallResponse associateThirdPartyFirewall(
AssociateThirdPartyFirewallRequest associateThirdPartyFirewallRequest) throws InvalidOperationException,
InvalidInputException, ResourceNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateThirdPartyFirewallResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associateThirdPartyFirewallRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateThirdPartyFirewall");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateThirdPartyFirewall").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(associateThirdPartyFirewallRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AssociateThirdPartyFirewallRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Associate resources to a Firewall Manager resource set.
*
*
* @param batchAssociateResourceRequest
* @return Result of the BatchAssociateResource operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.BatchAssociateResource
* @see AWS
* API Documentation
*/
@Override
public BatchAssociateResourceResponse batchAssociateResource(BatchAssociateResourceRequest batchAssociateResourceRequest)
throws InvalidOperationException, InternalErrorException, InvalidInputException, LimitExceededException,
ResourceNotFoundException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchAssociateResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchAssociateResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchAssociateResource");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchAssociateResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(batchAssociateResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new BatchAssociateResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disassociates resources from a Firewall Manager resource set.
*
*
* @param batchDisassociateResourceRequest
* @return Result of the BatchDisassociateResource operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.BatchDisassociateResource
* @see AWS
* API Documentation
*/
@Override
public BatchDisassociateResourceResponse batchDisassociateResource(
BatchDisassociateResourceRequest batchDisassociateResourceRequest) throws InvalidOperationException,
InternalErrorException, InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchDisassociateResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchDisassociateResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchDisassociateResource");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchDisassociateResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(batchDisassociateResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new BatchDisassociateResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Permanently deletes an Firewall Manager applications list.
*
*
* @param deleteAppsListRequest
* @return Result of the DeleteAppsList operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.DeleteAppsList
* @see AWS API
* Documentation
*/
@Override
public DeleteAppsListResponse deleteAppsList(DeleteAppsListRequest deleteAppsListRequest) throws ResourceNotFoundException,
InvalidOperationException, InternalErrorException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteAppsListResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAppsListRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAppsList");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteAppsList").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteAppsListRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteAppsListRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes an Firewall Manager association with the IAM role and the Amazon Simple Notification Service (SNS) topic
* that is used to record Firewall Manager SNS logs.
*
*
* @param deleteNotificationChannelRequest
* @return Result of the DeleteNotificationChannel operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.DeleteNotificationChannel
* @see AWS
* API Documentation
*/
@Override
public DeleteNotificationChannelResponse deleteNotificationChannel(
DeleteNotificationChannelRequest deleteNotificationChannelRequest) throws ResourceNotFoundException,
InvalidOperationException, InternalErrorException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteNotificationChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteNotificationChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteNotificationChannel");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteNotificationChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteNotificationChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteNotificationChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Permanently deletes an Firewall Manager policy.
*
*
* @param deletePolicyRequest
* @return Result of the DeletePolicy operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.DeletePolicy
* @see AWS API
* Documentation
*/
@Override
public DeletePolicyResponse deletePolicy(DeletePolicyRequest deletePolicyRequest) throws ResourceNotFoundException,
InvalidOperationException, InternalErrorException, InvalidInputException, LimitExceededException,
AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeletePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeletePolicy").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deletePolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeletePolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Permanently deletes an Firewall Manager protocols list.
*
*
* @param deleteProtocolsListRequest
* @return Result of the DeleteProtocolsList operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.DeleteProtocolsList
* @see AWS API
* Documentation
*/
@Override
public DeleteProtocolsListResponse deleteProtocolsList(DeleteProtocolsListRequest deleteProtocolsListRequest)
throws ResourceNotFoundException, InvalidOperationException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteProtocolsListResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteProtocolsListRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteProtocolsList");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteProtocolsList").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteProtocolsListRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteProtocolsListRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified ResourceSet.
*
*
* @param deleteResourceSetRequest
* @return Result of the DeleteResourceSet operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.DeleteResourceSet
* @see AWS API
* Documentation
*/
@Override
public DeleteResourceSetResponse deleteResourceSet(DeleteResourceSetRequest deleteResourceSetRequest)
throws ResourceNotFoundException, InvalidOperationException, InternalErrorException, InvalidInputException,
AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteResourceSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourceSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourceSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteResourceSet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteResourceSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteResourceSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disassociates the account that has been set as the Firewall Manager administrator account. To set a different
* account as the administrator account, you must submit an AssociateAdminAccount
request.
*
*
* @param disassociateAdminAccountRequest
* @return Result of the DisassociateAdminAccount operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.DisassociateAdminAccount
* @see AWS
* API Documentation
*/
@Override
public DisassociateAdminAccountResponse disassociateAdminAccount(
DisassociateAdminAccountRequest disassociateAdminAccountRequest) throws InvalidOperationException,
ResourceNotFoundException, InternalErrorException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateAdminAccountResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateAdminAccountRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateAdminAccount");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateAdminAccount").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(disassociateAdminAccountRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DisassociateAdminAccountRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disassociates a Firewall Manager policy administrator from a third-party firewall tenant. When you call
* DisassociateThirdPartyFirewall
, the third-party firewall vendor deletes all of the firewalls that
* are associated with the account.
*
*
* @param disassociateThirdPartyFirewallRequest
* @return Result of the DisassociateThirdPartyFirewall operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.DisassociateThirdPartyFirewall
* @see AWS API Documentation
*/
@Override
public DisassociateThirdPartyFirewallResponse disassociateThirdPartyFirewall(
DisassociateThirdPartyFirewallRequest disassociateThirdPartyFirewallRequest) throws InvalidOperationException,
InvalidInputException, ResourceNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateThirdPartyFirewallResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
disassociateThirdPartyFirewallRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateThirdPartyFirewall");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateThirdPartyFirewall").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(disassociateThirdPartyFirewallRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DisassociateThirdPartyFirewallRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns the Organizations account that is associated with Firewall Manager as the Firewall Manager administrator.
*
*
* @param getAdminAccountRequest
* @return Result of the GetAdminAccount operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetAdminAccount
* @see AWS API
* Documentation
*/
@Override
public GetAdminAccountResponse getAdminAccount(GetAdminAccountRequest getAdminAccountRequest)
throws InvalidOperationException, ResourceNotFoundException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetAdminAccountResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAdminAccountRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAdminAccount");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetAdminAccount").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getAdminAccountRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAdminAccountRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns information about the specified Firewall Manager applications list.
*
*
* @param getAppsListRequest
* @return Result of the GetAppsList operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetAppsList
* @see AWS API
* Documentation
*/
@Override
public GetAppsListResponse getAppsList(GetAppsListRequest getAppsListRequest) throws ResourceNotFoundException,
InvalidOperationException, InternalErrorException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetAppsListResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAppsListRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAppsList");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetAppsList").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getAppsListRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAppsListRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns detailed compliance information about the specified member account. Details include resources that are in
* and out of compliance with the specified policy.
*
*
* -
*
* Resources are considered noncompliant for WAF and Shield Advanced policies if the specified policy has not been
* applied to them.
*
*
* -
*
* Resources are considered noncompliant for security group policies if they are in scope of the policy, they
* violate one or more of the policy rules, and remediation is disabled or not possible.
*
*
* -
*
* Resources are considered noncompliant for Network Firewall policies if a firewall is missing in the VPC, if the
* firewall endpoint isn't set up in an expected Availability Zone and subnet, if a subnet created by the Firewall
* Manager doesn't have the expected route table, and for modifications to a firewall policy that violate the
* Firewall Manager policy's rules.
*
*
* -
*
* Resources are considered noncompliant for DNS Firewall policies if a DNS Firewall rule group is missing from the
* rule group associations for the VPC.
*
*
*
*
* @param getComplianceDetailRequest
* @return Result of the GetComplianceDetail operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetComplianceDetail
* @see AWS API
* Documentation
*/
@Override
public GetComplianceDetailResponse getComplianceDetail(GetComplianceDetailRequest getComplianceDetailRequest)
throws ResourceNotFoundException, InternalErrorException, InvalidInputException, InvalidOperationException,
AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetComplianceDetailResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getComplianceDetailRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetComplianceDetail");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetComplianceDetail").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getComplianceDetailRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetComplianceDetailRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Information about the Amazon Simple Notification Service (SNS) topic that is used to record Firewall Manager SNS
* logs.
*
*
* @param getNotificationChannelRequest
* @return Result of the GetNotificationChannel operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetNotificationChannel
* @see AWS
* API Documentation
*/
@Override
public GetNotificationChannelResponse getNotificationChannel(GetNotificationChannelRequest getNotificationChannelRequest)
throws ResourceNotFoundException, InvalidOperationException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetNotificationChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getNotificationChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetNotificationChannel");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetNotificationChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getNotificationChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetNotificationChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns information about the specified Firewall Manager policy.
*
*
* @param getPolicyRequest
* @return Result of the GetPolicy operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidTypeException
* The value of the Type
parameter is invalid.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetPolicy
* @see AWS API
* Documentation
*/
@Override
public GetPolicyResponse getPolicy(GetPolicyRequest getPolicyRequest) throws ResourceNotFoundException,
InvalidOperationException, InternalErrorException, InvalidTypeException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetPolicy").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getPolicyRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new GetPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* If you created a Shield Advanced policy, returns policy-level attack summary information in the event of a
* potential DDoS attack. Other policy types are currently unsupported.
*
*
* @param getProtectionStatusRequest
* @return Result of the GetProtectionStatus operation returned by the service.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetProtectionStatus
* @see AWS API
* Documentation
*/
@Override
public GetProtectionStatusResponse getProtectionStatus(GetProtectionStatusRequest getProtectionStatusRequest)
throws InvalidInputException, ResourceNotFoundException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetProtectionStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getProtectionStatusRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetProtectionStatus");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetProtectionStatus").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getProtectionStatusRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetProtectionStatusRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns information about the specified Firewall Manager protocols list.
*
*
* @param getProtocolsListRequest
* @return Result of the GetProtocolsList operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetProtocolsList
* @see AWS API
* Documentation
*/
@Override
public GetProtocolsListResponse getProtocolsList(GetProtocolsListRequest getProtocolsListRequest)
throws ResourceNotFoundException, InvalidOperationException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetProtocolsListResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getProtocolsListRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetProtocolsList");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetProtocolsList").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getProtocolsListRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetProtocolsListRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets information about a specific resource set.
*
*
* @param getResourceSetRequest
* @return Result of the GetResourceSet operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetResourceSet
* @see AWS API
* Documentation
*/
@Override
public GetResourceSetResponse getResourceSet(GetResourceSetRequest getResourceSetRequest) throws InvalidOperationException,
InvalidInputException, ResourceNotFoundException, InternalErrorException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetResourceSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourceSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourceSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetResourceSet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getResourceSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetResourceSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* The onboarding status of a Firewall Manager admin account to third-party firewall vendor tenant.
*
*
* @param getThirdPartyFirewallAssociationStatusRequest
* @return Result of the GetThirdPartyFirewallAssociationStatus operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetThirdPartyFirewallAssociationStatus
* @see AWS API Documentation
*/
@Override
public GetThirdPartyFirewallAssociationStatusResponse getThirdPartyFirewallAssociationStatus(
GetThirdPartyFirewallAssociationStatusRequest getThirdPartyFirewallAssociationStatusRequest)
throws InvalidOperationException, InvalidInputException, ResourceNotFoundException, InternalErrorException,
AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, GetThirdPartyFirewallAssociationStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getThirdPartyFirewallAssociationStatusRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetThirdPartyFirewallAssociationStatus");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetThirdPartyFirewallAssociationStatus").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler)
.withInput(getThirdPartyFirewallAssociationStatusRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetThirdPartyFirewallAssociationStatusRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves violations for a resource based on the specified Firewall Manager policy and Amazon Web Services
* account.
*
*
* @param getViolationDetailsRequest
* @return Result of the GetViolationDetails operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.GetViolationDetails
* @see AWS API
* Documentation
*/
@Override
public GetViolationDetailsResponse getViolationDetails(GetViolationDetailsRequest getViolationDetailsRequest)
throws ResourceNotFoundException, InvalidInputException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetViolationDetailsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getViolationDetailsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetViolationDetails");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetViolationDetails").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getViolationDetailsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetViolationDetailsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns an array of AppsListDataSummary
objects.
*
*
* @param listAppsListsRequest
* @return Result of the ListAppsLists operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListAppsLists
* @see AWS API
* Documentation
*/
@Override
public ListAppsListsResponse listAppsLists(ListAppsListsRequest listAppsListsRequest) throws ResourceNotFoundException,
InvalidOperationException, LimitExceededException, InternalErrorException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListAppsListsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAppsListsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAppsLists");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListAppsLists").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listAppsListsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAppsListsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns an array of AppsListDataSummary
objects.
*
*
*
* This is a variant of {@link #listAppsLists(software.amazon.awssdk.services.fms.model.ListAppsListsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListAppsListsIterable responses = client.listAppsListsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.fms.paginators.ListAppsListsIterable responses = client.listAppsListsPaginator(request);
* for (software.amazon.awssdk.services.fms.model.ListAppsListsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListAppsListsIterable responses = client.listAppsListsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listAppsLists(software.amazon.awssdk.services.fms.model.ListAppsListsRequest)} operation.
*
*
* @param listAppsListsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListAppsLists
* @see AWS API
* Documentation
*/
@Override
public ListAppsListsIterable listAppsListsPaginator(ListAppsListsRequest listAppsListsRequest)
throws ResourceNotFoundException, InvalidOperationException, LimitExceededException, InternalErrorException,
AwsServiceException, SdkClientException, FmsException {
return new ListAppsListsIterable(this, applyPaginatorUserAgent(listAppsListsRequest));
}
/**
*
* Returns an array of PolicyComplianceStatus
objects. Use PolicyComplianceStatus
to get a
* summary of which member accounts are protected by the specified policy.
*
*
* @param listComplianceStatusRequest
* @return Result of the ListComplianceStatus operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListComplianceStatus
* @see AWS API
* Documentation
*/
@Override
public ListComplianceStatusResponse listComplianceStatus(ListComplianceStatusRequest listComplianceStatusRequest)
throws ResourceNotFoundException, InternalErrorException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListComplianceStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listComplianceStatusRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListComplianceStatus");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListComplianceStatus").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listComplianceStatusRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListComplianceStatusRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns an array of PolicyComplianceStatus
objects. Use PolicyComplianceStatus
to get a
* summary of which member accounts are protected by the specified policy.
*
*
*
* This is a variant of
* {@link #listComplianceStatus(software.amazon.awssdk.services.fms.model.ListComplianceStatusRequest)} operation.
* The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally
* handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListComplianceStatusIterable responses = client.listComplianceStatusPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.fms.paginators.ListComplianceStatusIterable responses = client
* .listComplianceStatusPaginator(request);
* for (software.amazon.awssdk.services.fms.model.ListComplianceStatusResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListComplianceStatusIterable responses = client.listComplianceStatusPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listComplianceStatus(software.amazon.awssdk.services.fms.model.ListComplianceStatusRequest)}
* operation.
*
*
* @param listComplianceStatusRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListComplianceStatus
* @see AWS API
* Documentation
*/
@Override
public ListComplianceStatusIterable listComplianceStatusPaginator(ListComplianceStatusRequest listComplianceStatusRequest)
throws ResourceNotFoundException, InternalErrorException, AwsServiceException, SdkClientException, FmsException {
return new ListComplianceStatusIterable(this, applyPaginatorUserAgent(listComplianceStatusRequest));
}
/**
*
* Returns an array of resources in the organization's accounts that are available to be associated with a resource
* set.
*
*
* @param listDiscoveredResourcesRequest
* @return Result of the ListDiscoveredResources operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListDiscoveredResources
* @see AWS
* API Documentation
*/
@Override
public ListDiscoveredResourcesResponse listDiscoveredResources(ListDiscoveredResourcesRequest listDiscoveredResourcesRequest)
throws InvalidOperationException, InvalidInputException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDiscoveredResourcesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDiscoveredResourcesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDiscoveredResources");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListDiscoveredResources").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listDiscoveredResourcesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDiscoveredResourcesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a MemberAccounts
object that lists the member accounts in the administrator's Amazon Web
* Services organization.
*
*
* The ListMemberAccounts
must be submitted by the account that is set as the Firewall Manager
* administrator.
*
*
* @param listMemberAccountsRequest
* @return Result of the ListMemberAccounts operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListMemberAccounts
* @see AWS API
* Documentation
*/
@Override
public ListMemberAccountsResponse listMemberAccounts(ListMemberAccountsRequest listMemberAccountsRequest)
throws ResourceNotFoundException, InternalErrorException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListMemberAccountsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listMemberAccountsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMemberAccounts");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListMemberAccounts").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listMemberAccountsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListMemberAccountsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a MemberAccounts
object that lists the member accounts in the administrator's Amazon Web
* Services organization.
*
*
* The ListMemberAccounts
must be submitted by the account that is set as the Firewall Manager
* administrator.
*
*
*
* This is a variant of
* {@link #listMemberAccounts(software.amazon.awssdk.services.fms.model.ListMemberAccountsRequest)} operation. The
* return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle
* making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListMemberAccountsIterable responses = client.listMemberAccountsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.fms.paginators.ListMemberAccountsIterable responses = client
* .listMemberAccountsPaginator(request);
* for (software.amazon.awssdk.services.fms.model.ListMemberAccountsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListMemberAccountsIterable responses = client.listMemberAccountsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listMemberAccounts(software.amazon.awssdk.services.fms.model.ListMemberAccountsRequest)} operation.
*
*
* @param listMemberAccountsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListMemberAccounts
* @see AWS API
* Documentation
*/
@Override
public ListMemberAccountsIterable listMemberAccountsPaginator(ListMemberAccountsRequest listMemberAccountsRequest)
throws ResourceNotFoundException, InternalErrorException, AwsServiceException, SdkClientException, FmsException {
return new ListMemberAccountsIterable(this, applyPaginatorUserAgent(listMemberAccountsRequest));
}
/**
*
* Returns an array of PolicySummary
objects.
*
*
* @param listPoliciesRequest
* @return Result of the ListPolicies operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListPolicies
* @see AWS API
* Documentation
*/
@Override
public ListPoliciesResponse listPolicies(ListPoliciesRequest listPoliciesRequest) throws ResourceNotFoundException,
InvalidOperationException, LimitExceededException, InternalErrorException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListPoliciesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listPoliciesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListPolicies");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListPolicies").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listPoliciesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListPoliciesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns an array of PolicySummary
objects.
*
*
*
* This is a variant of {@link #listPolicies(software.amazon.awssdk.services.fms.model.ListPoliciesRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListPoliciesIterable responses = client.listPoliciesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.fms.paginators.ListPoliciesIterable responses = client.listPoliciesPaginator(request);
* for (software.amazon.awssdk.services.fms.model.ListPoliciesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListPoliciesIterable responses = client.listPoliciesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listPolicies(software.amazon.awssdk.services.fms.model.ListPoliciesRequest)} operation.
*
*
* @param listPoliciesRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListPolicies
* @see AWS API
* Documentation
*/
@Override
public ListPoliciesIterable listPoliciesPaginator(ListPoliciesRequest listPoliciesRequest) throws ResourceNotFoundException,
InvalidOperationException, LimitExceededException, InternalErrorException, AwsServiceException, SdkClientException,
FmsException {
return new ListPoliciesIterable(this, applyPaginatorUserAgent(listPoliciesRequest));
}
/**
*
* Returns an array of ProtocolsListDataSummary
objects.
*
*
* @param listProtocolsListsRequest
* @return Result of the ListProtocolsLists operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListProtocolsLists
* @see AWS API
* Documentation
*/
@Override
public ListProtocolsListsResponse listProtocolsLists(ListProtocolsListsRequest listProtocolsListsRequest)
throws ResourceNotFoundException, InvalidOperationException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListProtocolsListsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listProtocolsListsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProtocolsLists");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListProtocolsLists").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listProtocolsListsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListProtocolsListsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns an array of ProtocolsListDataSummary
objects.
*
*
*
* This is a variant of
* {@link #listProtocolsLists(software.amazon.awssdk.services.fms.model.ListProtocolsListsRequest)} operation. The
* return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle
* making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListProtocolsListsIterable responses = client.listProtocolsListsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.fms.paginators.ListProtocolsListsIterable responses = client
* .listProtocolsListsPaginator(request);
* for (software.amazon.awssdk.services.fms.model.ListProtocolsListsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListProtocolsListsIterable responses = client.listProtocolsListsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listProtocolsLists(software.amazon.awssdk.services.fms.model.ListProtocolsListsRequest)} operation.
*
*
* @param listProtocolsListsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListProtocolsLists
* @see AWS API
* Documentation
*/
@Override
public ListProtocolsListsIterable listProtocolsListsPaginator(ListProtocolsListsRequest listProtocolsListsRequest)
throws ResourceNotFoundException, InvalidOperationException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
return new ListProtocolsListsIterable(this, applyPaginatorUserAgent(listProtocolsListsRequest));
}
/**
*
* Returns an array of resources that are currently associated to a resource set.
*
*
* @param listResourceSetResourcesRequest
* @return Result of the ListResourceSetResources operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListResourceSetResources
* @see AWS
* API Documentation
*/
@Override
public ListResourceSetResourcesResponse listResourceSetResources(
ListResourceSetResourcesRequest listResourceSetResourcesRequest) throws InvalidOperationException,
InternalErrorException, InvalidInputException, ResourceNotFoundException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListResourceSetResourcesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listResourceSetResourcesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResourceSetResources");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListResourceSetResources").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listResourceSetResourcesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListResourceSetResourcesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns an array of ResourceSetSummary
objects.
*
*
* @param listResourceSetsRequest
* @return Result of the ListResourceSets operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListResourceSets
* @see AWS API
* Documentation
*/
@Override
public ListResourceSetsResponse listResourceSets(ListResourceSetsRequest listResourceSetsRequest)
throws InvalidOperationException, InvalidInputException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListResourceSetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listResourceSetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResourceSets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListResourceSets").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listResourceSetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListResourceSetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the list of tags for the specified Amazon Web Services resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListTagsForResource
* @see AWS API
* Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws ResourceNotFoundException, InvalidOperationException, InternalErrorException, InvalidInputException,
AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list of all of the third-party firewall policies that are associated with the third-party firewall
* administrator's account.
*
*
* @param listThirdPartyFirewallFirewallPoliciesRequest
* @return Result of the ListThirdPartyFirewallFirewallPolicies operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListThirdPartyFirewallFirewallPolicies
* @see AWS API Documentation
*/
@Override
public ListThirdPartyFirewallFirewallPoliciesResponse listThirdPartyFirewallFirewallPolicies(
ListThirdPartyFirewallFirewallPoliciesRequest listThirdPartyFirewallFirewallPoliciesRequest)
throws InvalidOperationException, InvalidInputException, ResourceNotFoundException, InternalErrorException,
AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListThirdPartyFirewallFirewallPoliciesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listThirdPartyFirewallFirewallPoliciesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListThirdPartyFirewallFirewallPolicies");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListThirdPartyFirewallFirewallPolicies").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler)
.withInput(listThirdPartyFirewallFirewallPoliciesRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListThirdPartyFirewallFirewallPoliciesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list of all of the third-party firewall policies that are associated with the third-party firewall
* administrator's account.
*
*
*
* This is a variant of
* {@link #listThirdPartyFirewallFirewallPolicies(software.amazon.awssdk.services.fms.model.ListThirdPartyFirewallFirewallPoliciesRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListThirdPartyFirewallFirewallPoliciesIterable responses = client.listThirdPartyFirewallFirewallPoliciesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.fms.paginators.ListThirdPartyFirewallFirewallPoliciesIterable responses = client
* .listThirdPartyFirewallFirewallPoliciesPaginator(request);
* for (software.amazon.awssdk.services.fms.model.ListThirdPartyFirewallFirewallPoliciesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.fms.paginators.ListThirdPartyFirewallFirewallPoliciesIterable responses = client.listThirdPartyFirewallFirewallPoliciesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listThirdPartyFirewallFirewallPolicies(software.amazon.awssdk.services.fms.model.ListThirdPartyFirewallFirewallPoliciesRequest)}
* operation.
*
*
* @param listThirdPartyFirewallFirewallPoliciesRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.ListThirdPartyFirewallFirewallPolicies
* @see AWS API Documentation
*/
@Override
public ListThirdPartyFirewallFirewallPoliciesIterable listThirdPartyFirewallFirewallPoliciesPaginator(
ListThirdPartyFirewallFirewallPoliciesRequest listThirdPartyFirewallFirewallPoliciesRequest)
throws InvalidOperationException, InvalidInputException, ResourceNotFoundException, InternalErrorException,
AwsServiceException, SdkClientException, FmsException {
return new ListThirdPartyFirewallFirewallPoliciesIterable(this,
applyPaginatorUserAgent(listThirdPartyFirewallFirewallPoliciesRequest));
}
/**
*
* Creates an Firewall Manager applications list.
*
*
* @param putAppsListRequest
* @return Result of the PutAppsList operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.PutAppsList
* @see AWS API
* Documentation
*/
@Override
public PutAppsListResponse putAppsList(PutAppsListRequest putAppsListRequest) throws ResourceNotFoundException,
InvalidOperationException, InvalidInputException, LimitExceededException, InternalErrorException,
AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
PutAppsListResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putAppsListRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutAppsList");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PutAppsList").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putAppsListRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutAppsListRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Designates the IAM role and Amazon Simple Notification Service (SNS) topic that Firewall Manager uses to record
* SNS logs.
*
*
* To perform this action outside of the console, you must configure the SNS topic to allow the Firewall Manager
* role AWSServiceRoleForFMS
to publish SNS logs. For more information, see Firewall Manager
* required permissions for API actions in the Firewall Manager Developer Guide.
*
*
* @param putNotificationChannelRequest
* @return Result of the PutNotificationChannel operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.PutNotificationChannel
* @see AWS
* API Documentation
*/
@Override
public PutNotificationChannelResponse putNotificationChannel(PutNotificationChannelRequest putNotificationChannelRequest)
throws ResourceNotFoundException, InvalidOperationException, InternalErrorException, AwsServiceException,
SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutNotificationChannelResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putNotificationChannelRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutNotificationChannel");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutNotificationChannel").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putNotificationChannelRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutNotificationChannelRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates an Firewall Manager policy.
*
*
* Firewall Manager provides the following types of policies:
*
*
* -
*
* An WAF policy (type WAFV2), which defines rule groups to run first in the corresponding WAF web ACL and rule
* groups to run last in the web ACL.
*
*
* -
*
* An WAF Classic policy (type WAF), which defines a rule group.
*
*
* -
*
* A Shield Advanced policy, which applies Shield Advanced protection to specified accounts and resources.
*
*
* -
*
* A security group policy, which manages VPC security groups across your Amazon Web Services organization.
*
*
* -
*
* An Network Firewall policy, which provides firewall rules to filter network traffic in specified Amazon VPCs.
*
*
* -
*
* A DNS Firewall policy, which provides Route 53 Resolver DNS Firewall rules to filter DNS queries for specified
* VPCs.
*
*
*
*
* Each policy is specific to one of the types. If you want to enforce more than one policy type across accounts,
* create multiple policies. You can create multiple policies for each type.
*
*
* You must be subscribed to Shield Advanced to create a Shield Advanced policy. For more information about
* subscribing to Shield Advanced, see CreateSubscription.
*
*
* @param putPolicyRequest
* @return Result of the PutPolicy operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidTypeException
* The value of the Type
parameter is invalid.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.PutPolicy
* @see AWS API
* Documentation
*/
@Override
public PutPolicyResponse putPolicy(PutPolicyRequest putPolicyRequest) throws ResourceNotFoundException,
InvalidOperationException, InvalidInputException, LimitExceededException, InternalErrorException,
InvalidTypeException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
PutPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PutPolicy").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putPolicyRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new PutPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates an Firewall Manager protocols list.
*
*
* @param putProtocolsListRequest
* @return Result of the PutProtocolsList operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.PutProtocolsList
* @see AWS API
* Documentation
*/
@Override
public PutProtocolsListResponse putProtocolsList(PutProtocolsListRequest putProtocolsListRequest)
throws ResourceNotFoundException, InvalidOperationException, InvalidInputException, LimitExceededException,
InternalErrorException, AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
PutProtocolsListResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putProtocolsListRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutProtocolsList");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PutProtocolsList").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putProtocolsListRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutProtocolsListRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates the resource set.
*
*
* An Firewall Manager resource set defines the resources to import into an Firewall Manager policy from another
* Amazon Web Services service.
*
*
* @param putResourceSetRequest
* @return Result of the PutResourceSet operation returned by the service.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.PutResourceSet
* @see AWS API
* Documentation
*/
@Override
public PutResourceSetResponse putResourceSet(PutResourceSetRequest putResourceSetRequest) throws InvalidOperationException,
InvalidInputException, LimitExceededException, InternalErrorException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
PutResourceSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putResourceSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutResourceSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PutResourceSet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(putResourceSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutResourceSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds one or more tags to an Amazon Web Services resource.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @throws LimitExceededException
* The operation exceeds a resource limit, for example, the maximum number of policy
objects
* that you can create for an Amazon Web Services account. For more information, see Firewall Manager Limits
* in the WAF Developer Guide.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException,
InvalidOperationException, InternalErrorException, InvalidInputException, LimitExceededException,
AwsServiceException, SdkClientException, FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes one or more tags from an Amazon Web Services resource.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidOperationException
* The operation failed because there was nothing to do or the operation wasn't possible. For example, you
* might have submitted an AssociateAdminAccount
request for an account ID that was already set
* as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by
* default, and that you need to enable for the Firewall Manager administrator account and for Organizations
* before you can access it.
* @throws InternalErrorException
* The operation failed because of a system problem, even though the request was valid. Retry your request.
* @throws InvalidInputException
* The parameters of the request were invalid.
* @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 FmsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample FmsClient.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException,
InvalidOperationException, InternalErrorException, InvalidInputException, AwsServiceException, SdkClientException,
FmsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "FMS");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
@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 > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(FmsException::builder)
.protocol(AwsJsonProtocol.AWS_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidOperationException")
.exceptionBuilderSupplier(InvalidOperationException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InternalErrorException")
.exceptionBuilderSupplier(InternalErrorException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("LimitExceededException")
.exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidTypeException")
.exceptionBuilderSupplier(InvalidTypeException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidInputException")
.exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build());
}
@Override
public void close() {
clientHandler.close();
}
}