private ProgressEvent constructResourceModelFromResponse()

in aws-devopsguru-notificationchannel/src/main/java/software/amazon/devopsguru/notificationchannel/ReadHandler.java [34:44]


    private ProgressEvent<ResourceModel, CallbackContext> constructResourceModelFromResponse(
            final ListNotificationChannelsResponse awsResponse,
            final ResourceModel model) {
        for(NotificationChannel channel: awsResponse.channels()) {
            if(channel.config().sns() != null && channel.id().equals(model.getId())) {
                return ProgressEvent.defaultSuccessHandler((Translator.translateFromReadResponse(channel.config().sns().topicArn(), model.getId())));
            }
        }

        throw new CfnNotFoundException(ResourceModel.TYPE_NAME, model.getId());
    }