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

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.cloudrunv2.outputs.ServiceTemplateContainerLivenessProbeGrpc;
import com.pulumi.gcp.cloudrunv2.outputs.ServiceTemplateContainerLivenessProbeHttpGet;
import com.pulumi.gcp.cloudrunv2.outputs.ServiceTemplateContainerLivenessProbeTcpSocket;
import java.lang.Integer;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class ServiceTemplateContainerLivenessProbe {
    /**
     * @return Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
     * 
     */
    private @Nullable Integer failureThreshold;
    /**
     * @return GRPC specifies an action involving a GRPC port.
     * Structure is documented below.
     * 
     */
    private @Nullable ServiceTemplateContainerLivenessProbeGrpc grpc;
    /**
     * @return HTTPGet specifies the http request to perform.
     * Structure is documented below.
     * 
     */
    private @Nullable ServiceTemplateContainerLivenessProbeHttpGet httpGet;
    /**
     * @return Number of seconds after the container has started before the probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum value for liveness probe is 3600. Maximum value for startup probe is 240. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
     * 
     */
    private @Nullable Integer initialDelaySeconds;
    /**
     * @return How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe is 3600. Maximum value for startup probe is 240. Must be greater or equal than timeoutSeconds
     * 
     */
    private @Nullable Integer periodSeconds;
    /**
     * @return (Optional, Deprecated)
     * TCPSocket specifies an action involving a TCP port. This field is not supported in liveness probe currently.
     * Structure is documented below.
     * 
     * @deprecated
     * Cloud Run does not support tcp socket in liveness probe and `liveness_probe.tcp_socket` field will be removed in a future major release.
     * 
     */
    @Deprecated /* Cloud Run does not support tcp socket in liveness probe and `liveness_probe.tcp_socket` field will be removed in a future major release. */
    private @Nullable ServiceTemplateContainerLivenessProbeTcpSocket tcpSocket;
    /**
     * @return Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 3600. Must be smaller than periodSeconds. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
     * 
     */
    private @Nullable Integer timeoutSeconds;

    private ServiceTemplateContainerLivenessProbe() {}
    /**
     * @return Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.
     * 
     */
    public Optional<Integer> failureThreshold() {
        return Optional.ofNullable(this.failureThreshold);
    }
    /**
     * @return GRPC specifies an action involving a GRPC port.
     * Structure is documented below.
     * 
     */
    public Optional<ServiceTemplateContainerLivenessProbeGrpc> grpc() {
        return Optional.ofNullable(this.grpc);
    }
    /**
     * @return HTTPGet specifies the http request to perform.
     * Structure is documented below.
     * 
     */
    public Optional<ServiceTemplateContainerLivenessProbeHttpGet> httpGet() {
        return Optional.ofNullable(this.httpGet);
    }
    /**
     * @return Number of seconds after the container has started before the probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum value for liveness probe is 3600. Maximum value for startup probe is 240. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
     * 
     */
    public Optional<Integer> initialDelaySeconds() {
        return Optional.ofNullable(this.initialDelaySeconds);
    }
    /**
     * @return How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe is 3600. Maximum value for startup probe is 240. Must be greater or equal than timeoutSeconds
     * 
     */
    public Optional<Integer> periodSeconds() {
        return Optional.ofNullable(this.periodSeconds);
    }
    /**
     * @return (Optional, Deprecated)
     * TCPSocket specifies an action involving a TCP port. This field is not supported in liveness probe currently.
     * Structure is documented below.
     * 
     * @deprecated
     * Cloud Run does not support tcp socket in liveness probe and `liveness_probe.tcp_socket` field will be removed in a future major release.
     * 
     */
    @Deprecated /* Cloud Run does not support tcp socket in liveness probe and `liveness_probe.tcp_socket` field will be removed in a future major release. */
    public Optional<ServiceTemplateContainerLivenessProbeTcpSocket> tcpSocket() {
        return Optional.ofNullable(this.tcpSocket);
    }
    /**
     * @return Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. Maximum value is 3600. Must be smaller than periodSeconds. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
     * 
     */
    public Optional<Integer> timeoutSeconds() {
        return Optional.ofNullable(this.timeoutSeconds);
    }

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

    public static Builder builder(ServiceTemplateContainerLivenessProbe defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable Integer failureThreshold;
        private @Nullable ServiceTemplateContainerLivenessProbeGrpc grpc;
        private @Nullable ServiceTemplateContainerLivenessProbeHttpGet httpGet;
        private @Nullable Integer initialDelaySeconds;
        private @Nullable Integer periodSeconds;
        private @Nullable ServiceTemplateContainerLivenessProbeTcpSocket tcpSocket;
        private @Nullable Integer timeoutSeconds;
        public Builder() {}
        public Builder(ServiceTemplateContainerLivenessProbe defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.failureThreshold = defaults.failureThreshold;
    	      this.grpc = defaults.grpc;
    	      this.httpGet = defaults.httpGet;
    	      this.initialDelaySeconds = defaults.initialDelaySeconds;
    	      this.periodSeconds = defaults.periodSeconds;
    	      this.tcpSocket = defaults.tcpSocket;
    	      this.timeoutSeconds = defaults.timeoutSeconds;
        }

        @CustomType.Setter
        public Builder failureThreshold(@Nullable Integer failureThreshold) {
            this.failureThreshold = failureThreshold;
            return this;
        }
        @CustomType.Setter
        public Builder grpc(@Nullable ServiceTemplateContainerLivenessProbeGrpc grpc) {
            this.grpc = grpc;
            return this;
        }
        @CustomType.Setter
        public Builder httpGet(@Nullable ServiceTemplateContainerLivenessProbeHttpGet httpGet) {
            this.httpGet = httpGet;
            return this;
        }
        @CustomType.Setter
        public Builder initialDelaySeconds(@Nullable Integer initialDelaySeconds) {
            this.initialDelaySeconds = initialDelaySeconds;
            return this;
        }
        @CustomType.Setter
        public Builder periodSeconds(@Nullable Integer periodSeconds) {
            this.periodSeconds = periodSeconds;
            return this;
        }
        @CustomType.Setter
        public Builder tcpSocket(@Nullable ServiceTemplateContainerLivenessProbeTcpSocket tcpSocket) {
            this.tcpSocket = tcpSocket;
            return this;
        }
        @CustomType.Setter
        public Builder timeoutSeconds(@Nullable Integer timeoutSeconds) {
            this.timeoutSeconds = timeoutSeconds;
            return this;
        }
        public ServiceTemplateContainerLivenessProbe build() {
            final var o = new ServiceTemplateContainerLivenessProbe();
            o.failureThreshold = failureThreshold;
            o.grpc = grpc;
            o.httpGet = httpGet;
            o.initialDelaySeconds = initialDelaySeconds;
            o.periodSeconds = periodSeconds;
            o.tcpSocket = tcpSocket;
            o.timeoutSeconds = timeoutSeconds;
            return o;
        }
    }
}
