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

namespace Google\Cloud\Security\PrivateCA\V1beta1\ReusableConfigValues;

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

/**
 * Describes values that are relevant in a CA certificate.
 *
 * Generated from protobuf message <code>google.cloud.security.privateca.v1beta1.ReusableConfigValues.CaOptions</code>
 */
class CaOptions extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this
     * value is missing, the extension will be omitted from the CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue is_ca = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $is_ca = null;
    /**
     * Optional. Refers to the path length restriction X.509 extension. For a CA
     * certificate, this value describes the depth of subordinate CA
     * certificates that are allowed.
     * If this value is less than 0, the request will fail.
     * If this value is missing, the max path length will be omitted from the
     * CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value max_issuer_path_length = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $max_issuer_path_length = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\BoolValue $is_ca
     *           Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this
     *           value is missing, the extension will be omitted from the CA certificate.
     *     @type \Google\Protobuf\Int32Value $max_issuer_path_length
     *           Optional. Refers to the path length restriction X.509 extension. For a CA
     *           certificate, this value describes the depth of subordinate CA
     *           certificates that are allowed.
     *           If this value is less than 0, the request will fail.
     *           If this value is missing, the max path length will be omitted from the
     *           CA certificate.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Security\Privateca\V1Beta1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this
     * value is missing, the extension will be omitted from the CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue is_ca = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\BoolValue
     */
    public function getIsCa()
    {
        return isset($this->is_ca) ? $this->is_ca : null;
    }

    public function hasIsCa()
    {
        return isset($this->is_ca);
    }

    public function clearIsCa()
    {
        unset($this->is_ca);
    }

    /**
     * Returns the unboxed value from <code>getIsCa()</code>

     * Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this
     * value is missing, the extension will be omitted from the CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue is_ca = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool|null
     */
    public function getIsCaValue()
    {
        return $this->readWrapperValue("is_ca");
    }

    /**
     * Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this
     * value is missing, the extension will be omitted from the CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue is_ca = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\BoolValue $var
     * @return $this
     */
    public function setIsCa($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class);
        $this->is_ca = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.

     * Optional. Refers to the "CA" X.509 extension, which is a boolean value. When this
     * value is missing, the extension will be omitted from the CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue is_ca = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool|null $var
     * @return $this
     */
    public function setIsCaValue($var)
    {
        $this->writeWrapperValue("is_ca", $var);
        return $this;}

    /**
     * Optional. Refers to the path length restriction X.509 extension. For a CA
     * certificate, this value describes the depth of subordinate CA
     * certificates that are allowed.
     * If this value is less than 0, the request will fail.
     * If this value is missing, the max path length will be omitted from the
     * CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value max_issuer_path_length = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Int32Value
     */
    public function getMaxIssuerPathLength()
    {
        return isset($this->max_issuer_path_length) ? $this->max_issuer_path_length : null;
    }

    public function hasMaxIssuerPathLength()
    {
        return isset($this->max_issuer_path_length);
    }

    public function clearMaxIssuerPathLength()
    {
        unset($this->max_issuer_path_length);
    }

    /**
     * Returns the unboxed value from <code>getMaxIssuerPathLength()</code>

     * Optional. Refers to the path length restriction X.509 extension. For a CA
     * certificate, this value describes the depth of subordinate CA
     * certificates that are allowed.
     * If this value is less than 0, the request will fail.
     * If this value is missing, the max path length will be omitted from the
     * CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value max_issuer_path_length = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int|null
     */
    public function getMaxIssuerPathLengthValue()
    {
        return $this->readWrapperValue("max_issuer_path_length");
    }

    /**
     * Optional. Refers to the path length restriction X.509 extension. For a CA
     * certificate, this value describes the depth of subordinate CA
     * certificates that are allowed.
     * If this value is less than 0, the request will fail.
     * If this value is missing, the max path length will be omitted from the
     * CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value max_issuer_path_length = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setMaxIssuerPathLength($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->max_issuer_path_length = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

     * Optional. Refers to the path length restriction X.509 extension. For a CA
     * certificate, this value describes the depth of subordinate CA
     * certificates that are allowed.
     * If this value is less than 0, the request will fail.
     * If this value is missing, the max path length will be omitted from the
     * CA certificate.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value max_issuer_path_length = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int|null $var
     * @return $this
     */
    public function setMaxIssuerPathLengthValue($var)
    {
        $this->writeWrapperValue("max_issuer_path_length", $var);
        return $this;}

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(CaOptions::class, \Google\Cloud\Security\PrivateCA\V1beta1\ReusableConfigValues_CaOptions::class);

