// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.cloudfront;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Boolean;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class FunctionArgs extends com.pulumi.resources.ResourceArgs {

    public static final FunctionArgs Empty = new FunctionArgs();

    /**
     * Source code of the function
     * 
     */
    @Import(name="code", required=true)
    private Output<String> code;

    /**
     * @return Source code of the function
     * 
     */
    public Output<String> code() {
        return this.code;
    }

    /**
     * Comment.
     * 
     */
    @Import(name="comment")
    private @Nullable Output<String> comment;

    /**
     * @return Comment.
     * 
     */
    public Optional<Output<String>> comment() {
        return Optional.ofNullable(this.comment);
    }

    /**
     * Unique name for your CloudFront Function.
     * 
     */
    @Import(name="name")
    private @Nullable Output<String> name;

    /**
     * @return Unique name for your CloudFront Function.
     * 
     */
    public Optional<Output<String>> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`.
     * 
     */
    @Import(name="publish")
    private @Nullable Output<Boolean> publish;

    /**
     * @return Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`.
     * 
     */
    public Optional<Output<Boolean>> publish() {
        return Optional.ofNullable(this.publish);
    }

    /**
     * Identifier of the function&#39;s runtime. Currently only `cloudfront-js-1.0` is valid.
     * 
     * The following arguments are optional:
     * 
     */
    @Import(name="runtime", required=true)
    private Output<String> runtime;

    /**
     * @return Identifier of the function&#39;s runtime. Currently only `cloudfront-js-1.0` is valid.
     * 
     * The following arguments are optional:
     * 
     */
    public Output<String> runtime() {
        return this.runtime;
    }

    private FunctionArgs() {}

    private FunctionArgs(FunctionArgs $) {
        this.code = $.code;
        this.comment = $.comment;
        this.name = $.name;
        this.publish = $.publish;
        this.runtime = $.runtime;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(FunctionArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private FunctionArgs $;

        public Builder() {
            $ = new FunctionArgs();
        }

        public Builder(FunctionArgs defaults) {
            $ = new FunctionArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param code Source code of the function
         * 
         * @return builder
         * 
         */
        public Builder code(Output<String> code) {
            $.code = code;
            return this;
        }

        /**
         * @param code Source code of the function
         * 
         * @return builder
         * 
         */
        public Builder code(String code) {
            return code(Output.of(code));
        }

        /**
         * @param comment Comment.
         * 
         * @return builder
         * 
         */
        public Builder comment(@Nullable Output<String> comment) {
            $.comment = comment;
            return this;
        }

        /**
         * @param comment Comment.
         * 
         * @return builder
         * 
         */
        public Builder comment(String comment) {
            return comment(Output.of(comment));
        }

        /**
         * @param name Unique name for your CloudFront Function.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output<String> name) {
            $.name = name;
            return this;
        }

        /**
         * @param name Unique name for your CloudFront Function.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param publish Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`.
         * 
         * @return builder
         * 
         */
        public Builder publish(@Nullable Output<Boolean> publish) {
            $.publish = publish;
            return this;
        }

        /**
         * @param publish Whether to publish creation/change as Live CloudFront Function Version. Defaults to `true`.
         * 
         * @return builder
         * 
         */
        public Builder publish(Boolean publish) {
            return publish(Output.of(publish));
        }

        /**
         * @param runtime Identifier of the function&#39;s runtime. Currently only `cloudfront-js-1.0` is valid.
         * 
         * The following arguments are optional:
         * 
         * @return builder
         * 
         */
        public Builder runtime(Output<String> runtime) {
            $.runtime = runtime;
            return this;
        }

        /**
         * @param runtime Identifier of the function&#39;s runtime. Currently only `cloudfront-js-1.0` is valid.
         * 
         * The following arguments are optional:
         * 
         * @return builder
         * 
         */
        public Builder runtime(String runtime) {
            return runtime(Output.of(runtime));
        }

        public FunctionArgs build() {
            $.code = Objects.requireNonNull($.code, "expected parameter 'code' to be non-null");
            $.runtime = Objects.requireNonNull($.runtime, "expected parameter 'runtime' to be non-null");
            return $;
        }
    }

}
