<?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.BackendServiceTlsSettings</code>
 */
class BackendServiceTlsSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Reference to the BackendAuthenticationConfig resource from the
     * networksecurity.googleapis.com namespace. Can be used in authenticating
     * TLS connections to the backend, as specified by the authenticationMode
     * field. Can only be specified if authenticationMode is not NONE.
     *
     * Generated from protobuf field <code>optional string authentication_config = 408053481;</code>
     */
    protected $authentication_config = null;
    /**
     * Server Name Indication - see RFC3546 section 3.1. If set, the load
     * balancer sends this string as the SNI hostname in the TLS connection to
     * the backend, and requires that this string match a Subject Alternative
     * Name (SAN) in the backend's server certificate. With a Regional Internet
     * NEG backend, if the SNI is specified here, the load balancer uses it
     * regardless of whether the Regional Internet NEG is specified with FQDN or
     * IP address and port. When both sni and subjectAltNames[] are specified,
     * the load balancer matches the backend certificate's SAN only to
     * subjectAltNames[].
     *
     * Generated from protobuf field <code>optional string sni = 114030;</code>
     */
    protected $sni = null;
    /**
     * A list of Subject Alternative Names (SANs) that the Load Balancer
     * verifies during a TLS handshake with the backend. When the server
     * presents its X.509 certificate to the Load Balancer, the Load Balancer
     * inspects the certificate's SAN field, and requires that at least one SAN
     * match one of the subjectAltNames in the list. This field is limited to 5
     * entries. When both sni and subjectAltNames[] are specified, the load
     * balancer matches the backend certificate's SAN only to subjectAltNames[].
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.BackendServiceTlsSettingsSubjectAltName subject_alt_names = 330029535;</code>
     */
    private $subject_alt_names;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $authentication_config
     *           Reference to the BackendAuthenticationConfig resource from the
     *           networksecurity.googleapis.com namespace. Can be used in authenticating
     *           TLS connections to the backend, as specified by the authenticationMode
     *           field. Can only be specified if authenticationMode is not NONE.
     *     @type string $sni
     *           Server Name Indication - see RFC3546 section 3.1. If set, the load
     *           balancer sends this string as the SNI hostname in the TLS connection to
     *           the backend, and requires that this string match a Subject Alternative
     *           Name (SAN) in the backend's server certificate. With a Regional Internet
     *           NEG backend, if the SNI is specified here, the load balancer uses it
     *           regardless of whether the Regional Internet NEG is specified with FQDN or
     *           IP address and port. When both sni and subjectAltNames[] are specified,
     *           the load balancer matches the backend certificate's SAN only to
     *           subjectAltNames[].
     *     @type array<\Google\Cloud\Compute\V1\BackendServiceTlsSettingsSubjectAltName>|\Google\Protobuf\Internal\RepeatedField $subject_alt_names
     *           A list of Subject Alternative Names (SANs) that the Load Balancer
     *           verifies during a TLS handshake with the backend. When the server
     *           presents its X.509 certificate to the Load Balancer, the Load Balancer
     *           inspects the certificate's SAN field, and requires that at least one SAN
     *           match one of the subjectAltNames in the list. This field is limited to 5
     *           entries. When both sni and subjectAltNames[] are specified, the load
     *           balancer matches the backend certificate's SAN only to subjectAltNames[].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Reference to the BackendAuthenticationConfig resource from the
     * networksecurity.googleapis.com namespace. Can be used in authenticating
     * TLS connections to the backend, as specified by the authenticationMode
     * field. Can only be specified if authenticationMode is not NONE.
     *
     * Generated from protobuf field <code>optional string authentication_config = 408053481;</code>
     * @return string
     */
    public function getAuthenticationConfig()
    {
        return isset($this->authentication_config) ? $this->authentication_config : '';
    }

    public function hasAuthenticationConfig()
    {
        return isset($this->authentication_config);
    }

    public function clearAuthenticationConfig()
    {
        unset($this->authentication_config);
    }

    /**
     * Reference to the BackendAuthenticationConfig resource from the
     * networksecurity.googleapis.com namespace. Can be used in authenticating
     * TLS connections to the backend, as specified by the authenticationMode
     * field. Can only be specified if authenticationMode is not NONE.
     *
     * Generated from protobuf field <code>optional string authentication_config = 408053481;</code>
     * @param string $var
     * @return $this
     */
    public function setAuthenticationConfig($var)
    {
        GPBUtil::checkString($var, True);
        $this->authentication_config = $var;

        return $this;
    }

    /**
     * Server Name Indication - see RFC3546 section 3.1. If set, the load
     * balancer sends this string as the SNI hostname in the TLS connection to
     * the backend, and requires that this string match a Subject Alternative
     * Name (SAN) in the backend's server certificate. With a Regional Internet
     * NEG backend, if the SNI is specified here, the load balancer uses it
     * regardless of whether the Regional Internet NEG is specified with FQDN or
     * IP address and port. When both sni and subjectAltNames[] are specified,
     * the load balancer matches the backend certificate's SAN only to
     * subjectAltNames[].
     *
     * Generated from protobuf field <code>optional string sni = 114030;</code>
     * @return string
     */
    public function getSni()
    {
        return isset($this->sni) ? $this->sni : '';
    }

    public function hasSni()
    {
        return isset($this->sni);
    }

    public function clearSni()
    {
        unset($this->sni);
    }

    /**
     * Server Name Indication - see RFC3546 section 3.1. If set, the load
     * balancer sends this string as the SNI hostname in the TLS connection to
     * the backend, and requires that this string match a Subject Alternative
     * Name (SAN) in the backend's server certificate. With a Regional Internet
     * NEG backend, if the SNI is specified here, the load balancer uses it
     * regardless of whether the Regional Internet NEG is specified with FQDN or
     * IP address and port. When both sni and subjectAltNames[] are specified,
     * the load balancer matches the backend certificate's SAN only to
     * subjectAltNames[].
     *
     * Generated from protobuf field <code>optional string sni = 114030;</code>
     * @param string $var
     * @return $this
     */
    public function setSni($var)
    {
        GPBUtil::checkString($var, True);
        $this->sni = $var;

        return $this;
    }

    /**
     * A list of Subject Alternative Names (SANs) that the Load Balancer
     * verifies during a TLS handshake with the backend. When the server
     * presents its X.509 certificate to the Load Balancer, the Load Balancer
     * inspects the certificate's SAN field, and requires that at least one SAN
     * match one of the subjectAltNames in the list. This field is limited to 5
     * entries. When both sni and subjectAltNames[] are specified, the load
     * balancer matches the backend certificate's SAN only to subjectAltNames[].
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.BackendServiceTlsSettingsSubjectAltName subject_alt_names = 330029535;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSubjectAltNames()
    {
        return $this->subject_alt_names;
    }

    /**
     * A list of Subject Alternative Names (SANs) that the Load Balancer
     * verifies during a TLS handshake with the backend. When the server
     * presents its X.509 certificate to the Load Balancer, the Load Balancer
     * inspects the certificate's SAN field, and requires that at least one SAN
     * match one of the subjectAltNames in the list. This field is limited to 5
     * entries. When both sni and subjectAltNames[] are specified, the load
     * balancer matches the backend certificate's SAN only to subjectAltNames[].
     *
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.BackendServiceTlsSettingsSubjectAltName subject_alt_names = 330029535;</code>
     * @param array<\Google\Cloud\Compute\V1\BackendServiceTlsSettingsSubjectAltName>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSubjectAltNames($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\BackendServiceTlsSettingsSubjectAltName::class);
        $this->subject_alt_names = $arr;

        return $this;
    }

}

