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

import com.pulumi.core.annotations.CustomType;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class GraphQLApiLambdaAuthorizerConfig {
    /**
     * @return Number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a `ttlOverride` key in its response. A value of 0 disables caching of responses. Minimum value of 0. Maximum value of 3600.
     * 
     */
    private @Nullable Integer authorizerResultTtlInSeconds;
    /**
     * @return ARN of the Lambda function to be called for authorization. Note: This Lambda function must have a resource-based policy assigned to it, to allow `lambda:InvokeFunction` from service principal `appsync.amazonaws.com`.
     * 
     */
    private String authorizerUri;
    /**
     * @return Regular expression for validation of tokens before the Lambda function is called.
     * 
     */
    private @Nullable String identityValidationExpression;

    private GraphQLApiLambdaAuthorizerConfig() {}
    /**
     * @return Number of seconds a response should be cached for. The default is 5 minutes (300 seconds). The Lambda function can override this by returning a `ttlOverride` key in its response. A value of 0 disables caching of responses. Minimum value of 0. Maximum value of 3600.
     * 
     */
    public Optional<Integer> authorizerResultTtlInSeconds() {
        return Optional.ofNullable(this.authorizerResultTtlInSeconds);
    }
    /**
     * @return ARN of the Lambda function to be called for authorization. Note: This Lambda function must have a resource-based policy assigned to it, to allow `lambda:InvokeFunction` from service principal `appsync.amazonaws.com`.
     * 
     */
    public String authorizerUri() {
        return this.authorizerUri;
    }
    /**
     * @return Regular expression for validation of tokens before the Lambda function is called.
     * 
     */
    public Optional<String> identityValidationExpression() {
        return Optional.ofNullable(this.identityValidationExpression);
    }

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

    public static Builder builder(GraphQLApiLambdaAuthorizerConfig defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable Integer authorizerResultTtlInSeconds;
        private String authorizerUri;
        private @Nullable String identityValidationExpression;
        public Builder() {}
        public Builder(GraphQLApiLambdaAuthorizerConfig defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.authorizerResultTtlInSeconds = defaults.authorizerResultTtlInSeconds;
    	      this.authorizerUri = defaults.authorizerUri;
    	      this.identityValidationExpression = defaults.identityValidationExpression;
        }

        @CustomType.Setter
        public Builder authorizerResultTtlInSeconds(@Nullable Integer authorizerResultTtlInSeconds) {
            this.authorizerResultTtlInSeconds = authorizerResultTtlInSeconds;
            return this;
        }
        @CustomType.Setter
        public Builder authorizerUri(String authorizerUri) {
            this.authorizerUri = Objects.requireNonNull(authorizerUri);
            return this;
        }
        @CustomType.Setter
        public Builder identityValidationExpression(@Nullable String identityValidationExpression) {
            this.identityValidationExpression = identityValidationExpression;
            return this;
        }
        public GraphQLApiLambdaAuthorizerConfig build() {
            final var o = new GraphQLApiLambdaAuthorizerConfig();
            o.authorizerResultTtlInSeconds = authorizerResultTtlInSeconds;
            o.authorizerUri = authorizerUri;
            o.identityValidationExpression = identityValidationExpression;
            return o;
        }
    }
}
