// *** 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.appsync.inputs;

import com.pulumi.aws.appsync.inputs.FunctionRuntimeArgs;
import com.pulumi.aws.appsync.inputs.FunctionSyncConfigArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final FunctionState Empty = new FunctionState();

    /**
     * ID of the associated AppSync API.
     * 
     */
    @Import(name="apiId")
    private @Nullable Output<String> apiId;

    /**
     * @return ID of the associated AppSync API.
     * 
     */
    public Optional<Output<String>> apiId() {
        return Optional.ofNullable(this.apiId);
    }

    /**
     * ARN of the Function object.
     * 
     */
    @Import(name="arn")
    private @Nullable Output<String> arn;

    /**
     * @return ARN of the Function object.
     * 
     */
    public Optional<Output<String>> arn() {
        return Optional.ofNullable(this.arn);
    }

    /**
     * The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
     * 
     */
    @Import(name="code")
    private @Nullable Output<String> code;

    /**
     * @return The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
     * 
     */
    public Optional<Output<String>> code() {
        return Optional.ofNullable(this.code);
    }

    /**
     * Function data source name.
     * 
     */
    @Import(name="dataSource")
    private @Nullable Output<String> dataSource;

    /**
     * @return Function data source name.
     * 
     */
    public Optional<Output<String>> dataSource() {
        return Optional.ofNullable(this.dataSource);
    }

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

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

    /**
     * Unique ID representing the Function object.
     * 
     */
    @Import(name="functionId")
    private @Nullable Output<String> functionId;

    /**
     * @return Unique ID representing the Function object.
     * 
     */
    public Optional<Output<String>> functionId() {
        return Optional.ofNullable(this.functionId);
    }

    /**
     * Version of the request mapping template. Currently the supported value is `2018-05-29`. Does not apply when specifying `code`.
     * 
     */
    @Import(name="functionVersion")
    private @Nullable Output<String> functionVersion;

    /**
     * @return Version of the request mapping template. Currently the supported value is `2018-05-29`. Does not apply when specifying `code`.
     * 
     */
    public Optional<Output<String>> functionVersion() {
        return Optional.ofNullable(this.functionVersion);
    }

    /**
     * Maximum batching size for a resolver. Valid values are between `0` and `2000`.
     * 
     */
    @Import(name="maxBatchSize")
    private @Nullable Output<Integer> maxBatchSize;

    /**
     * @return Maximum batching size for a resolver. Valid values are between `0` and `2000`.
     * 
     */
    public Optional<Output<Integer>> maxBatchSize() {
        return Optional.ofNullable(this.maxBatchSize);
    }

    /**
     * Function name. The function name does not have to be unique.
     * 
     */
    @Import(name="name")
    private @Nullable Output<String> name;

    /**
     * @return Function name. The function name does not have to be unique.
     * 
     */
    public Optional<Output<String>> name() {
        return Optional.ofNullable(this.name);
    }

    /**
     * Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
     * 
     */
    @Import(name="requestMappingTemplate")
    private @Nullable Output<String> requestMappingTemplate;

    /**
     * @return Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
     * 
     */
    public Optional<Output<String>> requestMappingTemplate() {
        return Optional.ofNullable(this.requestMappingTemplate);
    }

    /**
     * Function response mapping template.
     * 
     */
    @Import(name="responseMappingTemplate")
    private @Nullable Output<String> responseMappingTemplate;

    /**
     * @return Function response mapping template.
     * 
     */
    public Optional<Output<String>> responseMappingTemplate() {
        return Optional.ofNullable(this.responseMappingTemplate);
    }

    /**
     * Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See Runtime.
     * 
     */
    @Import(name="runtime")
    private @Nullable Output<FunctionRuntimeArgs> runtime;

    /**
     * @return Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See Runtime.
     * 
     */
    public Optional<Output<FunctionRuntimeArgs>> runtime() {
        return Optional.ofNullable(this.runtime);
    }

    /**
     * Describes a Sync configuration for a resolver. See Sync Config.
     * 
     */
    @Import(name="syncConfig")
    private @Nullable Output<FunctionSyncConfigArgs> syncConfig;

    /**
     * @return Describes a Sync configuration for a resolver. See Sync Config.
     * 
     */
    public Optional<Output<FunctionSyncConfigArgs>> syncConfig() {
        return Optional.ofNullable(this.syncConfig);
    }

    private FunctionState() {}

    private FunctionState(FunctionState $) {
        this.apiId = $.apiId;
        this.arn = $.arn;
        this.code = $.code;
        this.dataSource = $.dataSource;
        this.description = $.description;
        this.functionId = $.functionId;
        this.functionVersion = $.functionVersion;
        this.maxBatchSize = $.maxBatchSize;
        this.name = $.name;
        this.requestMappingTemplate = $.requestMappingTemplate;
        this.responseMappingTemplate = $.responseMappingTemplate;
        this.runtime = $.runtime;
        this.syncConfig = $.syncConfig;
    }

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

    public static final class Builder {
        private FunctionState $;

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

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

        /**
         * @param apiId ID of the associated AppSync API.
         * 
         * @return builder
         * 
         */
        public Builder apiId(@Nullable Output<String> apiId) {
            $.apiId = apiId;
            return this;
        }

        /**
         * @param apiId ID of the associated AppSync API.
         * 
         * @return builder
         * 
         */
        public Builder apiId(String apiId) {
            return apiId(Output.of(apiId));
        }

        /**
         * @param arn ARN of the Function object.
         * 
         * @return builder
         * 
         */
        public Builder arn(@Nullable Output<String> arn) {
            $.arn = arn;
            return this;
        }

        /**
         * @param arn ARN of the Function object.
         * 
         * @return builder
         * 
         */
        public Builder arn(String arn) {
            return arn(Output.of(arn));
        }

        /**
         * @param code The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
         * 
         * @return builder
         * 
         */
        public Builder code(@Nullable Output<String> code) {
            $.code = code;
            return this;
        }

        /**
         * @param code The function code that contains the request and response functions. When code is used, the runtime is required. The runtime value must be APPSYNC_JS.
         * 
         * @return builder
         * 
         */
        public Builder code(String code) {
            return code(Output.of(code));
        }

        /**
         * @param dataSource Function data source name.
         * 
         * @return builder
         * 
         */
        public Builder dataSource(@Nullable Output<String> dataSource) {
            $.dataSource = dataSource;
            return this;
        }

        /**
         * @param dataSource Function data source name.
         * 
         * @return builder
         * 
         */
        public Builder dataSource(String dataSource) {
            return dataSource(Output.of(dataSource));
        }

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

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

        /**
         * @param functionId Unique ID representing the Function object.
         * 
         * @return builder
         * 
         */
        public Builder functionId(@Nullable Output<String> functionId) {
            $.functionId = functionId;
            return this;
        }

        /**
         * @param functionId Unique ID representing the Function object.
         * 
         * @return builder
         * 
         */
        public Builder functionId(String functionId) {
            return functionId(Output.of(functionId));
        }

        /**
         * @param functionVersion Version of the request mapping template. Currently the supported value is `2018-05-29`. Does not apply when specifying `code`.
         * 
         * @return builder
         * 
         */
        public Builder functionVersion(@Nullable Output<String> functionVersion) {
            $.functionVersion = functionVersion;
            return this;
        }

        /**
         * @param functionVersion Version of the request mapping template. Currently the supported value is `2018-05-29`. Does not apply when specifying `code`.
         * 
         * @return builder
         * 
         */
        public Builder functionVersion(String functionVersion) {
            return functionVersion(Output.of(functionVersion));
        }

        /**
         * @param maxBatchSize Maximum batching size for a resolver. Valid values are between `0` and `2000`.
         * 
         * @return builder
         * 
         */
        public Builder maxBatchSize(@Nullable Output<Integer> maxBatchSize) {
            $.maxBatchSize = maxBatchSize;
            return this;
        }

        /**
         * @param maxBatchSize Maximum batching size for a resolver. Valid values are between `0` and `2000`.
         * 
         * @return builder
         * 
         */
        public Builder maxBatchSize(Integer maxBatchSize) {
            return maxBatchSize(Output.of(maxBatchSize));
        }

        /**
         * @param name Function name. The function name does not have to be unique.
         * 
         * @return builder
         * 
         */
        public Builder name(@Nullable Output<String> name) {
            $.name = name;
            return this;
        }

        /**
         * @param name Function name. The function name does not have to be unique.
         * 
         * @return builder
         * 
         */
        public Builder name(String name) {
            return name(Output.of(name));
        }

        /**
         * @param requestMappingTemplate Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
         * 
         * @return builder
         * 
         */
        public Builder requestMappingTemplate(@Nullable Output<String> requestMappingTemplate) {
            $.requestMappingTemplate = requestMappingTemplate;
            return this;
        }

        /**
         * @param requestMappingTemplate Function request mapping template. Functions support only the 2018-05-29 version of the request mapping template.
         * 
         * @return builder
         * 
         */
        public Builder requestMappingTemplate(String requestMappingTemplate) {
            return requestMappingTemplate(Output.of(requestMappingTemplate));
        }

        /**
         * @param responseMappingTemplate Function response mapping template.
         * 
         * @return builder
         * 
         */
        public Builder responseMappingTemplate(@Nullable Output<String> responseMappingTemplate) {
            $.responseMappingTemplate = responseMappingTemplate;
            return this;
        }

        /**
         * @param responseMappingTemplate Function response mapping template.
         * 
         * @return builder
         * 
         */
        public Builder responseMappingTemplate(String responseMappingTemplate) {
            return responseMappingTemplate(Output.of(responseMappingTemplate));
        }

        /**
         * @param runtime Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See Runtime.
         * 
         * @return builder
         * 
         */
        public Builder runtime(@Nullable Output<FunctionRuntimeArgs> runtime) {
            $.runtime = runtime;
            return this;
        }

        /**
         * @param runtime Describes a runtime used by an AWS AppSync pipeline resolver or AWS AppSync function. Specifies the name and version of the runtime to use. Note that if a runtime is specified, code must also be specified. See Runtime.
         * 
         * @return builder
         * 
         */
        public Builder runtime(FunctionRuntimeArgs runtime) {
            return runtime(Output.of(runtime));
        }

        /**
         * @param syncConfig Describes a Sync configuration for a resolver. See Sync Config.
         * 
         * @return builder
         * 
         */
        public Builder syncConfig(@Nullable Output<FunctionSyncConfigArgs> syncConfig) {
            $.syncConfig = syncConfig;
            return this;
        }

        /**
         * @param syncConfig Describes a Sync configuration for a resolver. See Sync Config.
         * 
         * @return builder
         * 
         */
        public Builder syncConfig(FunctionSyncConfigArgs syncConfig) {
            return syncConfig(Output.of(syncConfig));
        }

        public FunctionState build() {
            return $;
        }
    }

}
