<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/compute/v1/compute.proto

namespace Google\Cloud\Compute\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.TCPHealthCheck</code>
 */
class TCPHealthCheck extends \Google\Protobuf\Internal\Message
{
    /**
     * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535.
     *
     * Generated from protobuf field <code>optional int32 port = 3446913;</code>
     */
    private $port = null;
    /**
     * Not supported.
     *
     * Generated from protobuf field <code>optional string port_name = 41534345;</code>
     */
    private $port_name = null;
    /**
     * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports.
     * Check the PortSpecification enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string port_specification = 51590597;</code>
     */
    private $port_specification = null;
    /**
     * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.
     * Check the ProxyHeader enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string proxy_header = 160374142;</code>
     */
    private $proxy_header = null;
    /**
     * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection.
     *
     * Generated from protobuf field <code>optional string request = 21951119;</code>
     */
    private $request = null;
    /**
     * Creates a content-based TCP health check. In addition to establishing a TCP connection, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp
     *
     * Generated from protobuf field <code>optional string response = 196547649;</code>
     */
    private $response = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $port
     *           The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535.
     *     @type string $port_name
     *           Not supported.
     *     @type string $port_specification
     *           Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports.
     *           Check the PortSpecification enum for the list of possible values.
     *     @type string $proxy_header
     *           Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.
     *           Check the ProxyHeader enum for the list of possible values.
     *     @type string $request
     *           Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection.
     *     @type string $response
     *           Creates a content-based TCP health check. In addition to establishing a TCP connection, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535.
     *
     * Generated from protobuf field <code>optional int32 port = 3446913;</code>
     * @return int
     */
    public function getPort()
    {
        return isset($this->port) ? $this->port : 0;
    }

    public function hasPort()
    {
        return isset($this->port);
    }

    public function clearPort()
    {
        unset($this->port);
    }

    /**
     * The TCP port number to which the health check prober sends packets. The default value is 80. Valid values are 1 through 65535.
     *
     * Generated from protobuf field <code>optional int32 port = 3446913;</code>
     * @param int $var
     * @return $this
     */
    public function setPort($var)
    {
        GPBUtil::checkInt32($var);
        $this->port = $var;

        return $this;
    }

    /**
     * Not supported.
     *
     * Generated from protobuf field <code>optional string port_name = 41534345;</code>
     * @return string
     */
    public function getPortName()
    {
        return isset($this->port_name) ? $this->port_name : '';
    }

    public function hasPortName()
    {
        return isset($this->port_name);
    }

    public function clearPortName()
    {
        unset($this->port_name);
    }

    /**
     * Not supported.
     *
     * Generated from protobuf field <code>optional string port_name = 41534345;</code>
     * @param string $var
     * @return $this
     */
    public function setPortName($var)
    {
        GPBUtil::checkString($var, True);
        $this->port_name = $var;

        return $this;
    }

    /**
     * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports.
     * Check the PortSpecification enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string port_specification = 51590597;</code>
     * @return string
     */
    public function getPortSpecification()
    {
        return isset($this->port_specification) ? $this->port_specification : '';
    }

    public function hasPortSpecification()
    {
        return isset($this->port_specification);
    }

    public function clearPortSpecification()
    {
        unset($this->port_specification);
    }

    /**
     * Specifies how a port is selected for health checking. Can be one of the following values: USE_FIXED_PORT: Specifies a port number explicitly using the port field in the health check. Supported by backend services for passthrough load balancers and backend services for proxy load balancers. Not supported by target pools. The health check supports all backends supported by the backend service provided the backend can be health checked. For example, GCE_VM_IP network endpoint groups, GCE_VM_IP_PORT network endpoint groups, and instance group backends. USE_NAMED_PORT: Not supported. USE_SERVING_PORT: Provides an indirect method of specifying the health check port by referring to the backend service. Only supported by backend services for proxy load balancers. Not supported by target pools. Not supported by backend services for passthrough load balancers. Supports all backends that can be health checked; for example, GCE_VM_IP_PORT network endpoint groups and instance group backends. For GCE_VM_IP_PORT network endpoint group backends, the health check uses the port number specified for each endpoint in the network endpoint group. For instance group backends, the health check uses the port number determined by looking up the backend service's named port in the instance group's list of named ports.
     * Check the PortSpecification enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string port_specification = 51590597;</code>
     * @param string $var
     * @return $this
     */
    public function setPortSpecification($var)
    {
        GPBUtil::checkString($var, True);
        $this->port_specification = $var;

        return $this;
    }

    /**
     * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.
     * Check the ProxyHeader enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string proxy_header = 160374142;</code>
     * @return string
     */
    public function getProxyHeader()
    {
        return isset($this->proxy_header) ? $this->proxy_header : '';
    }

    public function hasProxyHeader()
    {
        return isset($this->proxy_header);
    }

    public function clearProxyHeader()
    {
        unset($this->proxy_header);
    }

    /**
     * Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE.
     * Check the ProxyHeader enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string proxy_header = 160374142;</code>
     * @param string $var
     * @return $this
     */
    public function setProxyHeader($var)
    {
        GPBUtil::checkString($var, True);
        $this->proxy_header = $var;

        return $this;
    }

    /**
     * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection.
     *
     * Generated from protobuf field <code>optional string request = 21951119;</code>
     * @return string
     */
    public function getRequest()
    {
        return isset($this->request) ? $this->request : '';
    }

    public function hasRequest()
    {
        return isset($this->request);
    }

    public function clearRequest()
    {
        unset($this->request);
    }

    /**
     * Instructs the health check prober to send this exact ASCII string, up to 1024 bytes in length, after establishing the TCP connection.
     *
     * Generated from protobuf field <code>optional string request = 21951119;</code>
     * @param string $var
     * @return $this
     */
    public function setRequest($var)
    {
        GPBUtil::checkString($var, True);
        $this->request = $var;

        return $this;
    }

    /**
     * Creates a content-based TCP health check. In addition to establishing a TCP connection, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp
     *
     * Generated from protobuf field <code>optional string response = 196547649;</code>
     * @return string
     */
    public function getResponse()
    {
        return isset($this->response) ? $this->response : '';
    }

    public function hasResponse()
    {
        return isset($this->response);
    }

    public function clearResponse()
    {
        unset($this->response);
    }

    /**
     * Creates a content-based TCP health check. In addition to establishing a TCP connection, you can configure the health check to pass only when the backend sends this exact response ASCII string, up to 1024 bytes in length. For details, see: https://cloud.google.com/load-balancing/docs/health-check-concepts#criteria-protocol-ssl-tcp
     *
     * Generated from protobuf field <code>optional string response = 196547649;</code>
     * @param string $var
     * @return $this
     */
    public function setResponse($var)
    {
        GPBUtil::checkString($var, True);
        $this->response = $var;

        return $this;
    }

}

