public ProgressEvent handleRequest()

in aws-sns-subscription/src/main/java/software/amazon/sns/subscription/ListHandler.java [31:67]


    public ProgressEvent<ResourceModel, CallbackContext> handleRequest(
        final AmazonWebServicesClientProxy proxy,
        final ResourceHandlerRequest<ResourceModel> request,
        final CallbackContext callbackContext,
        final ProxyClient<SnsClient> proxyClient,
        final Logger logger) {

        retrieveTopicAttributes(Translator.translateToCheckTopicRequest(request.getDesiredResourceState()), proxyClient);
        final ListSubscriptionsByTopicRequest listSubscriptionsByTopicRequest = Translator.translateToListSubscriptionsByTopicRequest(request);

        final ListSubscriptionsByTopicResponse listSubscriptionsByTopicResponse;
        try {
               listSubscriptionsByTopicResponse = proxy.injectCredentialsAndInvokeV2(listSubscriptionsByTopicRequest, proxyClient.client()::listSubscriptionsByTopic);

        } catch (final SubscriptionLimitExceededException e) {
            throw new CfnServiceLimitExceededException(e);
        } catch (final FilterPolicyLimitExceededException e) {
            throw new CfnServiceLimitExceededException(e);
        } catch (final InvalidParameterException e) {
            throw new CfnInvalidRequestException(e);
        } catch (final InternalErrorException e) {
            throw new CfnInternalFailureException(e);
        } catch (final NotFoundException e) {
            throw new CfnNotFoundException(e);
        } catch (final AuthorizationErrorException e) {
            throw new CfnAccessDeniedException(e);
        } catch (final InvalidSecurityException e) {
            throw new CfnInvalidCredentialsException(e);
        }
        final List<ResourceModel> models = Translator.translateFromListRequest(listSubscriptionsByTopicResponse);

        return ProgressEvent.<ResourceModel, CallbackContext>builder()
                .resourceModels(models)
                .nextToken(listSubscriptionsByTopicResponse.nextToken())
                .status(OperationStatus.SUCCESS)
                .build();
    }