private AssociateRepositoryResponse createResource()

in aws-codegurureviewer-repositoryassociation/src/main/java/software/amazon/codegurureviewer/repositoryassociation/CreateHandler.java [64:93]


    private AssociateRepositoryResponse createResource(
            final AssociateRepositoryRequest associateRepositoryRequest,
            final ProxyClient<CodeGuruReviewerClient> proxyClient,
            final ResourceModel model,
            final CallbackContext callbackContext) {
        AssociateRepositoryResponse awsResponse = null;

        try {
            awsResponse = proxyClient.injectCredentialsAndInvokeV2(associateRepositoryRequest,
                    proxyClient.client()::associateRepository);
            logger.log(String.format("AssociateRepository response: %s", awsResponse.toString()));
            model.setAssociationArn(awsResponse.repositoryAssociation().associationArn());
            callbackContext.setCreateWorkflow(true);
        } catch (final InternalServerException e) {
            throw new CfnServiceInternalErrorException(ResourceModel.TYPE_NAME, e);
        } catch (final ValidationException e) {
            throw new CfnInvalidRequestException(ResourceModel.TYPE_NAME, e);
        } catch (final AccessDeniedException e) {
            throw new CfnAccessDeniedException(ResourceModel.TYPE_NAME, e);
        } catch (final ConflictException e) {
            throw new CfnAlreadyExistsException(ResourceModel.TYPE_NAME, model.getName(), e);
        } catch (final ThrottlingException e) {
            throw new CfnThrottlingException(ResourceModel.TYPE_NAME, e);
        } catch (final Exception e) {
            throw new CfnInternalFailureException(e);
        }

        logger.log(String.format("%s successfully created.", ResourceModel.TYPE_NAME));
        return awsResponse;
    }