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

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

@CustomType
public final class TableTimePartitioning {
    /**
     * @return Number of milliseconds for which to keep the
     * storage for a partition.
     * 
     */
    private @Nullable Integer expirationMs;
    /**
     * @return The field used to determine how to create a time-based
     * partition. If time-based partitioning is enabled without this value, the
     * table is partitioned based on the load time.
     * 
     */
    private @Nullable String field;
    /**
     * @return If set to true, queries over this table
     * require a partition filter that can be used for partition elimination to be
     * specified.
     * 
     */
    private @Nullable Boolean requirePartitionFilter;
    /**
     * @return The supported types are DAY, HOUR, MONTH, and YEAR,
     * which will generate one partition per day, hour, month, and year, respectively.
     * 
     */
    private String type;

    private TableTimePartitioning() {}
    /**
     * @return Number of milliseconds for which to keep the
     * storage for a partition.
     * 
     */
    public Optional<Integer> expirationMs() {
        return Optional.ofNullable(this.expirationMs);
    }
    /**
     * @return The field used to determine how to create a time-based
     * partition. If time-based partitioning is enabled without this value, the
     * table is partitioned based on the load time.
     * 
     */
    public Optional<String> field() {
        return Optional.ofNullable(this.field);
    }
    /**
     * @return If set to true, queries over this table
     * require a partition filter that can be used for partition elimination to be
     * specified.
     * 
     */
    public Optional<Boolean> requirePartitionFilter() {
        return Optional.ofNullable(this.requirePartitionFilter);
    }
    /**
     * @return The supported types are DAY, HOUR, MONTH, and YEAR,
     * which will generate one partition per day, hour, month, and year, respectively.
     * 
     */
    public String type() {
        return this.type;
    }

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

    public static Builder builder(TableTimePartitioning defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable Integer expirationMs;
        private @Nullable String field;
        private @Nullable Boolean requirePartitionFilter;
        private String type;
        public Builder() {}
        public Builder(TableTimePartitioning defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.expirationMs = defaults.expirationMs;
    	      this.field = defaults.field;
    	      this.requirePartitionFilter = defaults.requirePartitionFilter;
    	      this.type = defaults.type;
        }

        @CustomType.Setter
        public Builder expirationMs(@Nullable Integer expirationMs) {
            this.expirationMs = expirationMs;
            return this;
        }
        @CustomType.Setter
        public Builder field(@Nullable String field) {
            this.field = field;
            return this;
        }
        @CustomType.Setter
        public Builder requirePartitionFilter(@Nullable Boolean requirePartitionFilter) {
            this.requirePartitionFilter = requirePartitionFilter;
            return this;
        }
        @CustomType.Setter
        public Builder type(String type) {
            this.type = Objects.requireNonNull(type);
            return this;
        }
        public TableTimePartitioning build() {
            final var o = new TableTimePartitioning();
            o.expirationMs = expirationMs;
            o.field = field;
            o.requirePartitionFilter = requirePartitionFilter;
            o.type = type;
            return o;
        }
    }
}
