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

com.pulumi.dockerbuild.outputs.CacheToRegistry 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.outputs;

import com.pulumi.core.annotations.CustomType;
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;

@CustomType
public final class CacheToRegistry {
    /**
     * @return The compression type to use.
     * 
     */
    private @Nullable CompressionType compression;
    /**
     * @return Compression level from 0 to 22.
     * 
     */
    private @Nullable Integer compressionLevel;
    /**
     * @return Forcefully apply compression.
     * 
     */
    private @Nullable Boolean forceCompression;
    /**
     * @return Ignore errors caused by failed cache exports.
     * 
     */
    private @Nullable Boolean ignoreError;
    /**
     * @return Export cache manifest as an OCI-compatible image manifest instead of a
     * manifest list. Requires `ociMediaTypes` to also be `true`.
     * 
     * Some registries like AWS ECR will not work with caching if this is
     * `false`.
     * 
     * Defaults to `false` to match Docker's default behavior.
     * 
     */
    private @Nullable Boolean imageManifest;
    /**
     * @return The cache mode to use. Defaults to `min`.
     * 
     */
    private @Nullable CacheMode mode;
    /**
     * @return Whether to use OCI media types in exported manifests. Defaults to
     * `true`.
     * 
     */
    private @Nullable Boolean ociMediaTypes;
    /**
     * @return Fully qualified name of the cache image to import.
     * 
     */
    private String ref;

    private CacheToRegistry() {}
    /**
     * @return The compression type to use.
     * 
     */
    public Optional compression() {
        return Optional.ofNullable(this.compression);
    }
    /**
     * @return Compression level from 0 to 22.
     * 
     */
    public Optional compressionLevel() {
        return Optional.ofNullable(this.compressionLevel);
    }
    /**
     * @return Forcefully apply compression.
     * 
     */
    public Optional forceCompression() {
        return Optional.ofNullable(this.forceCompression);
    }
    /**
     * @return Ignore errors caused by failed cache exports.
     * 
     */
    public Optional ignoreError() {
        return Optional.ofNullable(this.ignoreError);
    }
    /**
     * @return Export cache manifest as an OCI-compatible image manifest instead of a
     * manifest list. Requires `ociMediaTypes` to also be `true`.
     * 
     * Some registries like AWS ECR will not work with caching if this is
     * `false`.
     * 
     * Defaults to `false` to match Docker's default behavior.
     * 
     */
    public Optional imageManifest() {
        return Optional.ofNullable(this.imageManifest);
    }
    /**
     * @return The cache mode to use. Defaults to `min`.
     * 
     */
    public Optional mode() {
        return Optional.ofNullable(this.mode);
    }
    /**
     * @return Whether to use OCI media types in exported manifests. Defaults to
     * `true`.
     * 
     */
    public Optional ociMediaTypes() {
        return Optional.ofNullable(this.ociMediaTypes);
    }
    /**
     * @return Fully qualified name of the cache image to import.
     * 
     */
    public String ref() {
        return this.ref;
    }

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

    public static Builder builder(CacheToRegistry defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable CompressionType compression;
        private @Nullable Integer compressionLevel;
        private @Nullable Boolean forceCompression;
        private @Nullable Boolean ignoreError;
        private @Nullable Boolean imageManifest;
        private @Nullable CacheMode mode;
        private @Nullable Boolean ociMediaTypes;
        private String ref;
        public Builder() {}
        public Builder(CacheToRegistry defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.compression = defaults.compression;
    	      this.compressionLevel = defaults.compressionLevel;
    	      this.forceCompression = defaults.forceCompression;
    	      this.ignoreError = defaults.ignoreError;
    	      this.imageManifest = defaults.imageManifest;
    	      this.mode = defaults.mode;
    	      this.ociMediaTypes = defaults.ociMediaTypes;
    	      this.ref = defaults.ref;
        }

        @CustomType.Setter
        public Builder compression(@Nullable CompressionType compression) {

            this.compression = compression;
            return this;
        }
        @CustomType.Setter
        public Builder compressionLevel(@Nullable Integer compressionLevel) {

            this.compressionLevel = compressionLevel;
            return this;
        }
        @CustomType.Setter
        public Builder forceCompression(@Nullable Boolean forceCompression) {

            this.forceCompression = forceCompression;
            return this;
        }
        @CustomType.Setter
        public Builder ignoreError(@Nullable Boolean ignoreError) {

            this.ignoreError = ignoreError;
            return this;
        }
        @CustomType.Setter
        public Builder imageManifest(@Nullable Boolean imageManifest) {

            this.imageManifest = imageManifest;
            return this;
        }
        @CustomType.Setter
        public Builder mode(@Nullable CacheMode mode) {

            this.mode = mode;
            return this;
        }
        @CustomType.Setter
        public Builder ociMediaTypes(@Nullable Boolean ociMediaTypes) {

            this.ociMediaTypes = ociMediaTypes;
            return this;
        }
        @CustomType.Setter
        public Builder ref(String ref) {
            if (ref == null) {
              throw new MissingRequiredPropertyException("CacheToRegistry", "ref");
            }
            this.ref = ref;
            return this;
        }
        public CacheToRegistry build() {
            final var _resultValue = new CacheToRegistry();
            _resultValue.compression = compression;
            _resultValue.compressionLevel = compressionLevel;
            _resultValue.forceCompression = forceCompression;
            _resultValue.ignoreError = ignoreError;
            _resultValue.imageManifest = imageManifest;
            _resultValue.mode = mode;
            _resultValue.ociMediaTypes = ociMediaTypes;
            _resultValue.ref = ref;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy