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

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.osconfig.outputs.PatchDeploymentPatchConfigPostStepLinuxExecStepConfigGcsObject;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class PatchDeploymentPatchConfigPostStepLinuxExecStepConfig {
    /**
     * @return Defaults to [0]. A list of possible return values that the execution can return to indicate a success.
     * 
     */
    private @Nullable List<Integer> allowedSuccessCodes;
    /**
     * @return A Cloud Storage object containing the executable.
     * Structure is documented below.
     * 
     */
    private @Nullable PatchDeploymentPatchConfigPostStepLinuxExecStepConfigGcsObject gcsObject;
    /**
     * @return The script interpreter to use to run the script. If no interpreter is specified the script will
     * be executed directly, which will likely only succeed for scripts with shebang lines.
     * Possible values are: `SHELL`, `POWERSHELL`.
     * 
     */
    private @Nullable String interpreter;
    /**
     * @return An absolute path to the executable on the VM.
     * 
     */
    private @Nullable String localPath;

    private PatchDeploymentPatchConfigPostStepLinuxExecStepConfig() {}
    /**
     * @return Defaults to [0]. A list of possible return values that the execution can return to indicate a success.
     * 
     */
    public List<Integer> allowedSuccessCodes() {
        return this.allowedSuccessCodes == null ? List.of() : this.allowedSuccessCodes;
    }
    /**
     * @return A Cloud Storage object containing the executable.
     * Structure is documented below.
     * 
     */
    public Optional<PatchDeploymentPatchConfigPostStepLinuxExecStepConfigGcsObject> gcsObject() {
        return Optional.ofNullable(this.gcsObject);
    }
    /**
     * @return The script interpreter to use to run the script. If no interpreter is specified the script will
     * be executed directly, which will likely only succeed for scripts with shebang lines.
     * Possible values are: `SHELL`, `POWERSHELL`.
     * 
     */
    public Optional<String> interpreter() {
        return Optional.ofNullable(this.interpreter);
    }
    /**
     * @return An absolute path to the executable on the VM.
     * 
     */
    public Optional<String> localPath() {
        return Optional.ofNullable(this.localPath);
    }

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

    public static Builder builder(PatchDeploymentPatchConfigPostStepLinuxExecStepConfig defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List<Integer> allowedSuccessCodes;
        private @Nullable PatchDeploymentPatchConfigPostStepLinuxExecStepConfigGcsObject gcsObject;
        private @Nullable String interpreter;
        private @Nullable String localPath;
        public Builder() {}
        public Builder(PatchDeploymentPatchConfigPostStepLinuxExecStepConfig defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.allowedSuccessCodes = defaults.allowedSuccessCodes;
    	      this.gcsObject = defaults.gcsObject;
    	      this.interpreter = defaults.interpreter;
    	      this.localPath = defaults.localPath;
        }

        @CustomType.Setter
        public Builder allowedSuccessCodes(@Nullable List<Integer> allowedSuccessCodes) {
            this.allowedSuccessCodes = allowedSuccessCodes;
            return this;
        }
        public Builder allowedSuccessCodes(Integer... allowedSuccessCodes) {
            return allowedSuccessCodes(List.of(allowedSuccessCodes));
        }
        @CustomType.Setter
        public Builder gcsObject(@Nullable PatchDeploymentPatchConfigPostStepLinuxExecStepConfigGcsObject gcsObject) {
            this.gcsObject = gcsObject;
            return this;
        }
        @CustomType.Setter
        public Builder interpreter(@Nullable String interpreter) {
            this.interpreter = interpreter;
            return this;
        }
        @CustomType.Setter
        public Builder localPath(@Nullable String localPath) {
            this.localPath = localPath;
            return this;
        }
        public PatchDeploymentPatchConfigPostStepLinuxExecStepConfig build() {
            final var o = new PatchDeploymentPatchConfigPostStepLinuxExecStepConfig();
            o.allowedSuccessCodes = allowedSuccessCodes;
            o.gcsObject = gcsObject;
            o.interpreter = interpreter;
            o.localPath = localPath;
            return o;
        }
    }
}
