All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pl.wrzasq.commons.aws.cloudformation.macro.MacroHandler Maven / Gradle / Ivy

// Generated by delombok at Tue Apr 06 13:14:34 UTC 2021
/*
 * This file is part of the pl.wrzasq.commons.
 *
 * @license http://mit-license.org/ The MIT license
 * @copyright 2020 © by Rafał Wrzeszcz - Wrzasq.pl.
 */
package pl.wrzasq.commons.aws.cloudformation.macro;

import java.util.Map;
import java.util.function.Function;

/**
 * CloudFormation macro handler.
 */
public class MacroHandler {
    /**
     * CloudFormation template provider.
     */
    private Function, TemplateDefinition> templateFactory;

    /**
     * Handles template processing request.
     *
     * @param event CloudFormation macro event.
     * @return CloudFormation macro response.
     */
    public CloudFormationMacroResponse handleRequest(CloudFormationMacroRequest event) {
        return new CloudFormationMacroResponse(event.getRequestId(), CloudFormationMacroResponse.STATUS_SUCCESS, this.templateFactory.apply(event.getFragment()).getTemplate());
    }

    @SuppressWarnings("all")
    @lombok.Generated
    public MacroHandler(final Function, TemplateDefinition> templateFactory) {
        this.templateFactory = templateFactory;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy