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

namespace Google\Cloud\Security\PrivateCA\V1;

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

/**
 * Describes constraints on a [Certificate][google.cloud.security.privateca.v1.Certificate]'s [Subject][google.cloud.security.privateca.v1.Subject] and
 * [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames].
 *
 * Generated from protobuf message <code>google.cloud.security.privateca.v1.CertificateIdentityConstraints</code>
 */
class CertificateIdentityConstraints extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. A CEL expression that may be used to validate the resolved X.509 Subject
     * and/or Subject Alternative Name before a certificate is signed.
     * To see the full allowed syntax and some examples, see
     * https://cloud.google.com/certificate-authority-service/docs/using-cel
     *
     * Generated from protobuf field <code>.google.type.Expr cel_expression = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $cel_expression = null;
    /**
     * Required. If this is true, the [Subject][google.cloud.security.privateca.v1.Subject] field may be copied from a certificate
     * request into the signed certificate. Otherwise, the requested [Subject][google.cloud.security.privateca.v1.Subject]
     * will be discarded.
     *
     * Generated from protobuf field <code>optional bool allow_subject_passthrough = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $allow_subject_passthrough = null;
    /**
     * Required. If this is true, the [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] extension may be copied from a
     * certificate request into the signed certificate. Otherwise, the requested
     * [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will be discarded.
     *
     * Generated from protobuf field <code>optional bool allow_subject_alt_names_passthrough = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $allow_subject_alt_names_passthrough = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Type\Expr $cel_expression
     *           Optional. A CEL expression that may be used to validate the resolved X.509 Subject
     *           and/or Subject Alternative Name before a certificate is signed.
     *           To see the full allowed syntax and some examples, see
     *           https://cloud.google.com/certificate-authority-service/docs/using-cel
     *     @type bool $allow_subject_passthrough
     *           Required. If this is true, the [Subject][google.cloud.security.privateca.v1.Subject] field may be copied from a certificate
     *           request into the signed certificate. Otherwise, the requested [Subject][google.cloud.security.privateca.v1.Subject]
     *           will be discarded.
     *     @type bool $allow_subject_alt_names_passthrough
     *           Required. If this is true, the [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] extension may be copied from a
     *           certificate request into the signed certificate. Otherwise, the requested
     *           [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will be discarded.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Security\Privateca\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. A CEL expression that may be used to validate the resolved X.509 Subject
     * and/or Subject Alternative Name before a certificate is signed.
     * To see the full allowed syntax and some examples, see
     * https://cloud.google.com/certificate-authority-service/docs/using-cel
     *
     * Generated from protobuf field <code>.google.type.Expr cel_expression = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Type\Expr|null
     */
    public function getCelExpression()
    {
        return $this->cel_expression;
    }

    public function hasCelExpression()
    {
        return isset($this->cel_expression);
    }

    public function clearCelExpression()
    {
        unset($this->cel_expression);
    }

    /**
     * Optional. A CEL expression that may be used to validate the resolved X.509 Subject
     * and/or Subject Alternative Name before a certificate is signed.
     * To see the full allowed syntax and some examples, see
     * https://cloud.google.com/certificate-authority-service/docs/using-cel
     *
     * Generated from protobuf field <code>.google.type.Expr cel_expression = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Type\Expr $var
     * @return $this
     */
    public function setCelExpression($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Expr::class);
        $this->cel_expression = $var;

        return $this;
    }

    /**
     * Required. If this is true, the [Subject][google.cloud.security.privateca.v1.Subject] field may be copied from a certificate
     * request into the signed certificate. Otherwise, the requested [Subject][google.cloud.security.privateca.v1.Subject]
     * will be discarded.
     *
     * Generated from protobuf field <code>optional bool allow_subject_passthrough = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return bool
     */
    public function getAllowSubjectPassthrough()
    {
        return isset($this->allow_subject_passthrough) ? $this->allow_subject_passthrough : false;
    }

    public function hasAllowSubjectPassthrough()
    {
        return isset($this->allow_subject_passthrough);
    }

    public function clearAllowSubjectPassthrough()
    {
        unset($this->allow_subject_passthrough);
    }

    /**
     * Required. If this is true, the [Subject][google.cloud.security.privateca.v1.Subject] field may be copied from a certificate
     * request into the signed certificate. Otherwise, the requested [Subject][google.cloud.security.privateca.v1.Subject]
     * will be discarded.
     *
     * Generated from protobuf field <code>optional bool allow_subject_passthrough = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param bool $var
     * @return $this
     */
    public function setAllowSubjectPassthrough($var)
    {
        GPBUtil::checkBool($var);
        $this->allow_subject_passthrough = $var;

        return $this;
    }

    /**
     * Required. If this is true, the [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] extension may be copied from a
     * certificate request into the signed certificate. Otherwise, the requested
     * [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will be discarded.
     *
     * Generated from protobuf field <code>optional bool allow_subject_alt_names_passthrough = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return bool
     */
    public function getAllowSubjectAltNamesPassthrough()
    {
        return isset($this->allow_subject_alt_names_passthrough) ? $this->allow_subject_alt_names_passthrough : false;
    }

    public function hasAllowSubjectAltNamesPassthrough()
    {
        return isset($this->allow_subject_alt_names_passthrough);
    }

    public function clearAllowSubjectAltNamesPassthrough()
    {
        unset($this->allow_subject_alt_names_passthrough);
    }

    /**
     * Required. If this is true, the [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] extension may be copied from a
     * certificate request into the signed certificate. Otherwise, the requested
     * [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] will be discarded.
     *
     * Generated from protobuf field <code>optional bool allow_subject_alt_names_passthrough = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param bool $var
     * @return $this
     */
    public function setAllowSubjectAltNamesPassthrough($var)
    {
        GPBUtil::checkBool($var);
        $this->allow_subject_alt_names_passthrough = $var;

        return $this;
    }

}

