in aws-networkfirewall-loggingconfiguration/src/main/java/software/amazon/networkfirewall/loggingconfiguration/ListHandler.java [30:63]
public ProgressEvent<ResourceModel, CallbackContext> handleRequest(
final AmazonWebServicesClientProxy proxy,
final ResourceHandlerRequest<ResourceModel> request,
final CallbackContext callbackContext,
final ProxyClient<NetworkFirewallClient> proxyClient,
final Logger logger) {
this.logger = logger;
final ResourceModel model = request.getDesiredResourceState();
Utils.describeLoggingConfigurationCall(Translator.translateToReadRequest(model), proxyClient);
final DescribeLoggingConfigurationRequest describeLoggingConfigurationRequest = Translator.translateToReadRequest(model);
DescribeLoggingConfigurationResponse describeLoggingConfigurationResponse;
try {
describeLoggingConfigurationResponse = proxyClient.injectCredentialsAndInvokeV2(
describeLoggingConfigurationRequest, proxyClient.client()::describeLoggingConfiguration);
} catch (ResourceNotFoundException e) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, e.toString());
} catch (InvalidRequestException e) {
throw new CfnInvalidRequestException(describeLoggingConfigurationRequest.toString(), e);
} catch (InternalServerErrorException e) {
throw new CfnServiceInternalErrorException(ResourceModel.TYPE_NAME, e);
} catch (ThrottlingException e) {
throw new CfnThrottlingException(ResourceModel.TYPE_NAME, e);
}
if (describeLoggingConfigurationResponse.loggingConfiguration() == null ||
CollectionUtils.isNullOrEmpty(describeLoggingConfigurationResponse.loggingConfiguration().logDestinationConfigs())) {
return constructResourceModelFromResponse();
}
return constructResourceModelFromResponse(describeLoggingConfigurationResponse);
}