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

namespace Google\Cloud\Security\PrivateCA\V1\CaPool;

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

/**
 * Options relating to the publication of each
 * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
 * CA certificate and CRLs and their inclusion as extensions in issued
 * [Certificates][google.cloud.security.privateca.v1.Certificate]. The options
 * set here apply to certificates issued by any
 * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
 * in the [CaPool][google.cloud.security.privateca.v1.CaPool].
 *
 * Generated from protobuf message <code>google.cloud.security.privateca.v1.CaPool.PublishingOptions</code>
 */
class PublishingOptions extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. When true, publishes each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
     * CA certificate and includes its URL in the "Authority Information Access"
     * X.509 extension in all issued
     * [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
     * is false, the CA certificate will not be published and the corresponding
     * X.509 extension will not be written in issued certificates.
     *
     * Generated from protobuf field <code>bool publish_ca_cert = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $publish_ca_cert = false;
    /**
     * Optional. When true, publishes each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
     * CRL and includes its URL in the "CRL Distribution Points" X.509 extension
     * in all issued
     * [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
     * is false, CRLs will not be published and the corresponding X.509
     * extension will not be written in issued certificates. CRLs will expire 7
     * days from their creation. However, we will rebuild daily. CRLs are also
     * rebuilt shortly after a certificate is revoked.
     *
     * Generated from protobuf field <code>bool publish_crl = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $publish_crl = false;
    /**
     * Optional. Specifies the encoding format of each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     * resource's CA certificate and CRLs. If this is omitted, CA certificates
     * and CRLs will be published in PEM.
     *
     * Generated from protobuf field <code>.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat encoding_format = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $encoding_format = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $publish_ca_cert
     *           Optional. When true, publishes each
     *           [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
     *           CA certificate and includes its URL in the "Authority Information Access"
     *           X.509 extension in all issued
     *           [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
     *           is false, the CA certificate will not be published and the corresponding
     *           X.509 extension will not be written in issued certificates.
     *     @type bool $publish_crl
     *           Optional. When true, publishes each
     *           [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
     *           CRL and includes its URL in the "CRL Distribution Points" X.509 extension
     *           in all issued
     *           [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
     *           is false, CRLs will not be published and the corresponding X.509
     *           extension will not be written in issued certificates. CRLs will expire 7
     *           days from their creation. However, we will rebuild daily. CRLs are also
     *           rebuilt shortly after a certificate is revoked.
     *     @type int $encoding_format
     *           Optional. Specifies the encoding format of each
     *           [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     *           resource's CA certificate and CRLs. If this is omitted, CA certificates
     *           and CRLs will be published in PEM.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Security\Privateca\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. When true, publishes each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
     * CA certificate and includes its URL in the "Authority Information Access"
     * X.509 extension in all issued
     * [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
     * is false, the CA certificate will not be published and the corresponding
     * X.509 extension will not be written in issued certificates.
     *
     * Generated from protobuf field <code>bool publish_ca_cert = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getPublishCaCert()
    {
        return $this->publish_ca_cert;
    }

    /**
     * Optional. When true, publishes each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
     * CA certificate and includes its URL in the "Authority Information Access"
     * X.509 extension in all issued
     * [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
     * is false, the CA certificate will not be published and the corresponding
     * X.509 extension will not be written in issued certificates.
     *
     * Generated from protobuf field <code>bool publish_ca_cert = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setPublishCaCert($var)
    {
        GPBUtil::checkBool($var);
        $this->publish_ca_cert = $var;

        return $this;
    }

    /**
     * Optional. When true, publishes each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
     * CRL and includes its URL in the "CRL Distribution Points" X.509 extension
     * in all issued
     * [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
     * is false, CRLs will not be published and the corresponding X.509
     * extension will not be written in issued certificates. CRLs will expire 7
     * days from their creation. However, we will rebuild daily. CRLs are also
     * rebuilt shortly after a certificate is revoked.
     *
     * Generated from protobuf field <code>bool publish_crl = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getPublishCrl()
    {
        return $this->publish_crl;
    }

    /**
     * Optional. When true, publishes each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]'s
     * CRL and includes its URL in the "CRL Distribution Points" X.509 extension
     * in all issued
     * [Certificates][google.cloud.security.privateca.v1.Certificate]. If this
     * is false, CRLs will not be published and the corresponding X.509
     * extension will not be written in issued certificates. CRLs will expire 7
     * days from their creation. However, we will rebuild daily. CRLs are also
     * rebuilt shortly after a certificate is revoked.
     *
     * Generated from protobuf field <code>bool publish_crl = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setPublishCrl($var)
    {
        GPBUtil::checkBool($var);
        $this->publish_crl = $var;

        return $this;
    }

    /**
     * Optional. Specifies the encoding format of each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     * resource's CA certificate and CRLs. If this is omitted, CA certificates
     * and CRLs will be published in PEM.
     *
     * Generated from protobuf field <code>.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat encoding_format = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getEncodingFormat()
    {
        return $this->encoding_format;
    }

    /**
     * Optional. Specifies the encoding format of each
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     * resource's CA certificate and CRLs. If this is omitted, CA certificates
     * and CRLs will be published in PEM.
     *
     * Generated from protobuf field <code>.google.cloud.security.privateca.v1.CaPool.PublishingOptions.EncodingFormat encoding_format = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setEncodingFormat($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Security\PrivateCA\V1\CaPool\PublishingOptions\EncodingFormat::class);
        $this->encoding_format = $var;

        return $this;
    }

}


