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

com.pulumi.dockerbuild.inputs.CacheToLocalArgs Maven / Gradle / Ivy

Go to download

A Pulumi provider for building modern Docker images with buildx and BuildKit.

There is a newer version: 0.1.0-alpha.1729468870
Show newest version
// *** WARNING: this file was generated by pulumi. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.dockerbuild.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.core.internal.Codegen;
import com.pulumi.dockerbuild.enums.CacheMode;
import com.pulumi.dockerbuild.enums.CompressionType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final CacheToLocalArgs Empty = new CacheToLocalArgs();

    /**
     * The compression type to use.
     * 
     */
    @Import(name="compression")
    private @Nullable Output compression;

    /**
     * @return The compression type to use.
     * 
     */
    public Optional> compression() {
        return Optional.ofNullable(this.compression);
    }

    /**
     * Compression level from 0 to 22.
     * 
     */
    @Import(name="compressionLevel")
    private @Nullable Output compressionLevel;

    /**
     * @return Compression level from 0 to 22.
     * 
     */
    public Optional> compressionLevel() {
        return Optional.ofNullable(this.compressionLevel);
    }

    /**
     * Path of the local directory to export the cache.
     * 
     */
    @Import(name="dest", required=true)
    private Output dest;

    /**
     * @return Path of the local directory to export the cache.
     * 
     */
    public Output dest() {
        return this.dest;
    }

    /**
     * Forcefully apply compression.
     * 
     */
    @Import(name="forceCompression")
    private @Nullable Output forceCompression;

    /**
     * @return Forcefully apply compression.
     * 
     */
    public Optional> forceCompression() {
        return Optional.ofNullable(this.forceCompression);
    }

    /**
     * Ignore errors caused by failed cache exports.
     * 
     */
    @Import(name="ignoreError")
    private @Nullable Output ignoreError;

    /**
     * @return Ignore errors caused by failed cache exports.
     * 
     */
    public Optional> ignoreError() {
        return Optional.ofNullable(this.ignoreError);
    }

    /**
     * The cache mode to use. Defaults to `min`.
     * 
     */
    @Import(name="mode")
    private @Nullable Output mode;

    /**
     * @return The cache mode to use. Defaults to `min`.
     * 
     */
    public Optional> mode() {
        return Optional.ofNullable(this.mode);
    }

    private CacheToLocalArgs() {}

    private CacheToLocalArgs(CacheToLocalArgs $) {
        this.compression = $.compression;
        this.compressionLevel = $.compressionLevel;
        this.dest = $.dest;
        this.forceCompression = $.forceCompression;
        this.ignoreError = $.ignoreError;
        this.mode = $.mode;
    }

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

    public static final class Builder {
        private CacheToLocalArgs $;

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

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

        /**
         * @param compression The compression type to use.
         * 
         * @return builder
         * 
         */
        public Builder compression(@Nullable Output compression) {
            $.compression = compression;
            return this;
        }

        /**
         * @param compression The compression type to use.
         * 
         * @return builder
         * 
         */
        public Builder compression(CompressionType compression) {
            return compression(Output.of(compression));
        }

        /**
         * @param compressionLevel Compression level from 0 to 22.
         * 
         * @return builder
         * 
         */
        public Builder compressionLevel(@Nullable Output compressionLevel) {
            $.compressionLevel = compressionLevel;
            return this;
        }

        /**
         * @param compressionLevel Compression level from 0 to 22.
         * 
         * @return builder
         * 
         */
        public Builder compressionLevel(Integer compressionLevel) {
            return compressionLevel(Output.of(compressionLevel));
        }

        /**
         * @param dest Path of the local directory to export the cache.
         * 
         * @return builder
         * 
         */
        public Builder dest(Output dest) {
            $.dest = dest;
            return this;
        }

        /**
         * @param dest Path of the local directory to export the cache.
         * 
         * @return builder
         * 
         */
        public Builder dest(String dest) {
            return dest(Output.of(dest));
        }

        /**
         * @param forceCompression Forcefully apply compression.
         * 
         * @return builder
         * 
         */
        public Builder forceCompression(@Nullable Output forceCompression) {
            $.forceCompression = forceCompression;
            return this;
        }

        /**
         * @param forceCompression Forcefully apply compression.
         * 
         * @return builder
         * 
         */
        public Builder forceCompression(Boolean forceCompression) {
            return forceCompression(Output.of(forceCompression));
        }

        /**
         * @param ignoreError Ignore errors caused by failed cache exports.
         * 
         * @return builder
         * 
         */
        public Builder ignoreError(@Nullable Output ignoreError) {
            $.ignoreError = ignoreError;
            return this;
        }

        /**
         * @param ignoreError Ignore errors caused by failed cache exports.
         * 
         * @return builder
         * 
         */
        public Builder ignoreError(Boolean ignoreError) {
            return ignoreError(Output.of(ignoreError));
        }

        /**
         * @param mode The cache mode to use. Defaults to `min`.
         * 
         * @return builder
         * 
         */
        public Builder mode(@Nullable Output mode) {
            $.mode = mode;
            return this;
        }

        /**
         * @param mode The cache mode to use. Defaults to `min`.
         * 
         * @return builder
         * 
         */
        public Builder mode(CacheMode mode) {
            return mode(Output.of(mode));
        }

        public CacheToLocalArgs build() {
            $.compression = Codegen.objectProp("compression", CompressionType.class).output().arg($.compression).def(CompressionType.Gzip).getNullable();
            $.compressionLevel = Codegen.integerProp("compressionLevel").output().arg($.compressionLevel).def(0).getNullable();
            if ($.dest == null) {
                throw new MissingRequiredPropertyException("CacheToLocalArgs", "dest");
            }
            $.forceCompression = Codegen.booleanProp("forceCompression").output().arg($.forceCompression).def(false).getNullable();
            $.ignoreError = Codegen.booleanProp("ignoreError").output().arg($.ignoreError).def(false).getNullable();
            $.mode = Codegen.objectProp("mode", CacheMode.class).output().arg($.mode).def(CacheMode.Min).getNullable();
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy