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

import com.pulumi.core.annotations.CustomType;
import com.pulumi.gcp.monitoring.outputs.UptimeCheckConfigHttpCheckAcceptedResponseStatusCode;
import com.pulumi.gcp.monitoring.outputs.UptimeCheckConfigHttpCheckAuthInfo;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class UptimeCheckConfigHttpCheck {
    /**
     * @return If present, the check will only pass if the HTTP response status code is in this set of status codes. If empty, the HTTP status code will only pass if the HTTP status code is 200-299.
     * Structure is documented below.
     * 
     */
    private @Nullable List<UptimeCheckConfigHttpCheckAcceptedResponseStatusCode> acceptedResponseStatusCodes;
    /**
     * @return The authentication information. Optional when creating an HTTP check; defaults to empty.
     * Structure is documented below.
     * 
     */
    private @Nullable UptimeCheckConfigHttpCheckAuthInfo authInfo;
    /**
     * @return The request body associated with the HTTP POST request. If contentType is URL_ENCODED, the body passed in must be URL-encoded. Users can provide a Content-Length header via the headers field or the API will do so. If the requestMethod is GET and body is not empty, the API will return an error. The maximum byte size is 1 megabyte. Note - As with all bytes fields JSON representations are base64 encoded. e.g. &#34;foo=bar&#34; in URL-encoded form is &#34;foo%3Dbar&#34; and in base64 encoding is &#34;Zm9vJTI1M0RiYXI=&#34;.
     * 
     */
    private @Nullable String body;
    /**
     * @return The content type to use for the check.
     * Possible values are: `TYPE_UNSPECIFIED`, `URL_ENCODED`.
     * 
     */
    private @Nullable String contentType;
    /**
     * @return The list of headers to send as part of the uptime check request. If two headers have the same key and different values, they should be entered as a single header, with the value being a comma-separated list of all the desired values as described at https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two separate headers with the same key in a Create call will cause the first to be overwritten by the second. The maximum number of headers allowed is 100.
     * 
     */
    private @Nullable Map<String,String> headers;
    /**
     * @return Boolean specifying whether to encrypt the header information. Encryption should be specified for any headers related to authentication that you do not wish to be seen when retrieving the configuration. The server will be responsible for encrypting the headers. On Get/List calls, if mask_headers is set to True then the headers will be obscured with ******.
     * 
     */
    private @Nullable Boolean maskHeaders;
    /**
     * @return The path to the page to run the check against. Will be combined with the host (specified within the MonitoredResource) and port to construct the full URL. If the provided path does not begin with &#34;/&#34;, a &#34;/&#34; will be prepended automatically. Optional (defaults to &#34;/&#34;).
     * 
     */
    private @Nullable String path;
    /**
     * @return The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) and path to construct the full URL. Optional (defaults to 80 without SSL, or 443 with SSL).
     * 
     */
    private @Nullable Integer port;
    /**
     * @return The HTTP request method to use for the check. If set to METHOD_UNSPECIFIED then requestMethod defaults to GET.
     * Default value is `GET`.
     * Possible values are: `METHOD_UNSPECIFIED`, `GET`, `POST`.
     * 
     */
    private @Nullable String requestMethod;
    /**
     * @return If true, use HTTPS instead of HTTP to run the check.
     * 
     */
    private @Nullable Boolean useSsl;
    /**
     * @return Boolean specifying whether to include SSL certificate validation as a part of the Uptime check. Only applies to checks where monitoredResource is set to uptime_url. If useSsl is false, setting validateSsl to true has no effect.
     * 
     */
    private @Nullable Boolean validateSsl;

    private UptimeCheckConfigHttpCheck() {}
    /**
     * @return If present, the check will only pass if the HTTP response status code is in this set of status codes. If empty, the HTTP status code will only pass if the HTTP status code is 200-299.
     * Structure is documented below.
     * 
     */
    public List<UptimeCheckConfigHttpCheckAcceptedResponseStatusCode> acceptedResponseStatusCodes() {
        return this.acceptedResponseStatusCodes == null ? List.of() : this.acceptedResponseStatusCodes;
    }
    /**
     * @return The authentication information. Optional when creating an HTTP check; defaults to empty.
     * Structure is documented below.
     * 
     */
    public Optional<UptimeCheckConfigHttpCheckAuthInfo> authInfo() {
        return Optional.ofNullable(this.authInfo);
    }
    /**
     * @return The request body associated with the HTTP POST request. If contentType is URL_ENCODED, the body passed in must be URL-encoded. Users can provide a Content-Length header via the headers field or the API will do so. If the requestMethod is GET and body is not empty, the API will return an error. The maximum byte size is 1 megabyte. Note - As with all bytes fields JSON representations are base64 encoded. e.g. &#34;foo=bar&#34; in URL-encoded form is &#34;foo%3Dbar&#34; and in base64 encoding is &#34;Zm9vJTI1M0RiYXI=&#34;.
     * 
     */
    public Optional<String> body() {
        return Optional.ofNullable(this.body);
    }
    /**
     * @return The content type to use for the check.
     * Possible values are: `TYPE_UNSPECIFIED`, `URL_ENCODED`.
     * 
     */
    public Optional<String> contentType() {
        return Optional.ofNullable(this.contentType);
    }
    /**
     * @return The list of headers to send as part of the uptime check request. If two headers have the same key and different values, they should be entered as a single header, with the value being a comma-separated list of all the desired values as described at https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two separate headers with the same key in a Create call will cause the first to be overwritten by the second. The maximum number of headers allowed is 100.
     * 
     */
    public Map<String,String> headers() {
        return this.headers == null ? Map.of() : this.headers;
    }
    /**
     * @return Boolean specifying whether to encrypt the header information. Encryption should be specified for any headers related to authentication that you do not wish to be seen when retrieving the configuration. The server will be responsible for encrypting the headers. On Get/List calls, if mask_headers is set to True then the headers will be obscured with ******.
     * 
     */
    public Optional<Boolean> maskHeaders() {
        return Optional.ofNullable(this.maskHeaders);
    }
    /**
     * @return The path to the page to run the check against. Will be combined with the host (specified within the MonitoredResource) and port to construct the full URL. If the provided path does not begin with &#34;/&#34;, a &#34;/&#34; will be prepended automatically. Optional (defaults to &#34;/&#34;).
     * 
     */
    public Optional<String> path() {
        return Optional.ofNullable(this.path);
    }
    /**
     * @return The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) and path to construct the full URL. Optional (defaults to 80 without SSL, or 443 with SSL).
     * 
     */
    public Optional<Integer> port() {
        return Optional.ofNullable(this.port);
    }
    /**
     * @return The HTTP request method to use for the check. If set to METHOD_UNSPECIFIED then requestMethod defaults to GET.
     * Default value is `GET`.
     * Possible values are: `METHOD_UNSPECIFIED`, `GET`, `POST`.
     * 
     */
    public Optional<String> requestMethod() {
        return Optional.ofNullable(this.requestMethod);
    }
    /**
     * @return If true, use HTTPS instead of HTTP to run the check.
     * 
     */
    public Optional<Boolean> useSsl() {
        return Optional.ofNullable(this.useSsl);
    }
    /**
     * @return Boolean specifying whether to include SSL certificate validation as a part of the Uptime check. Only applies to checks where monitoredResource is set to uptime_url. If useSsl is false, setting validateSsl to true has no effect.
     * 
     */
    public Optional<Boolean> validateSsl() {
        return Optional.ofNullable(this.validateSsl);
    }

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

    public static Builder builder(UptimeCheckConfigHttpCheck defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable List<UptimeCheckConfigHttpCheckAcceptedResponseStatusCode> acceptedResponseStatusCodes;
        private @Nullable UptimeCheckConfigHttpCheckAuthInfo authInfo;
        private @Nullable String body;
        private @Nullable String contentType;
        private @Nullable Map<String,String> headers;
        private @Nullable Boolean maskHeaders;
        private @Nullable String path;
        private @Nullable Integer port;
        private @Nullable String requestMethod;
        private @Nullable Boolean useSsl;
        private @Nullable Boolean validateSsl;
        public Builder() {}
        public Builder(UptimeCheckConfigHttpCheck defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.acceptedResponseStatusCodes = defaults.acceptedResponseStatusCodes;
    	      this.authInfo = defaults.authInfo;
    	      this.body = defaults.body;
    	      this.contentType = defaults.contentType;
    	      this.headers = defaults.headers;
    	      this.maskHeaders = defaults.maskHeaders;
    	      this.path = defaults.path;
    	      this.port = defaults.port;
    	      this.requestMethod = defaults.requestMethod;
    	      this.useSsl = defaults.useSsl;
    	      this.validateSsl = defaults.validateSsl;
        }

        @CustomType.Setter
        public Builder acceptedResponseStatusCodes(@Nullable List<UptimeCheckConfigHttpCheckAcceptedResponseStatusCode> acceptedResponseStatusCodes) {
            this.acceptedResponseStatusCodes = acceptedResponseStatusCodes;
            return this;
        }
        public Builder acceptedResponseStatusCodes(UptimeCheckConfigHttpCheckAcceptedResponseStatusCode... acceptedResponseStatusCodes) {
            return acceptedResponseStatusCodes(List.of(acceptedResponseStatusCodes));
        }
        @CustomType.Setter
        public Builder authInfo(@Nullable UptimeCheckConfigHttpCheckAuthInfo authInfo) {
            this.authInfo = authInfo;
            return this;
        }
        @CustomType.Setter
        public Builder body(@Nullable String body) {
            this.body = body;
            return this;
        }
        @CustomType.Setter
        public Builder contentType(@Nullable String contentType) {
            this.contentType = contentType;
            return this;
        }
        @CustomType.Setter
        public Builder headers(@Nullable Map<String,String> headers) {
            this.headers = headers;
            return this;
        }
        @CustomType.Setter
        public Builder maskHeaders(@Nullable Boolean maskHeaders) {
            this.maskHeaders = maskHeaders;
            return this;
        }
        @CustomType.Setter
        public Builder path(@Nullable String path) {
            this.path = path;
            return this;
        }
        @CustomType.Setter
        public Builder port(@Nullable Integer port) {
            this.port = port;
            return this;
        }
        @CustomType.Setter
        public Builder requestMethod(@Nullable String requestMethod) {
            this.requestMethod = requestMethod;
            return this;
        }
        @CustomType.Setter
        public Builder useSsl(@Nullable Boolean useSsl) {
            this.useSsl = useSsl;
            return this;
        }
        @CustomType.Setter
        public Builder validateSsl(@Nullable Boolean validateSsl) {
            this.validateSsl = validateSsl;
            return this;
        }
        public UptimeCheckConfigHttpCheck build() {
            final var o = new UptimeCheckConfigHttpCheck();
            o.acceptedResponseStatusCodes = acceptedResponseStatusCodes;
            o.authInfo = authInfo;
            o.body = body;
            o.contentType = contentType;
            o.headers = headers;
            o.maskHeaders = maskHeaders;
            o.path = path;
            o.port = port;
            o.requestMethod = requestMethod;
            o.useSsl = useSsl;
            o.validateSsl = validateSsl;
            return o;
        }
    }
}
