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

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

use UnexpectedValueException;

/**
 * The state of a
 * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority],
 * indicating if it can be used.
 *
 * Protobuf type <code>google.cloud.security.privateca.v1.CertificateAuthority.State</code>
 */
class State
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Certificates can be issued from this CA. CRLs will be generated for this
     * CA. The CA will be part of the
     * [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and
     * will be used to issue certificates from the
     * [CaPool][google.cloud.security.privateca.v1.CaPool].
     *
     * Generated from protobuf enum <code>ENABLED = 1;</code>
     */
    const ENABLED = 1;
    /**
     * Certificates cannot be issued from this CA. CRLs will still be generated.
     * The CA will be part of the
     * [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, but
     * will not be used to issue certificates from the
     * [CaPool][google.cloud.security.privateca.v1.CaPool].
     *
     * Generated from protobuf enum <code>DISABLED = 2;</code>
     */
    const DISABLED = 2;
    /**
     * Certificates can be issued from this CA. CRLs will be generated for this
     * CA. The CA will be part of the
     * [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, but
     * will not be used to issue certificates from the
     * [CaPool][google.cloud.security.privateca.v1.CaPool].
     *
     * Generated from protobuf enum <code>STAGED = 3;</code>
     */
    const STAGED = 3;
    /**
     * Certificates cannot be issued from this CA. CRLs will not be generated.
     * The CA will not be part of the
     * [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and
     * will not be used to issue certificates from the
     * [CaPool][google.cloud.security.privateca.v1.CaPool].
     *
     * Generated from protobuf enum <code>AWAITING_USER_ACTIVATION = 4;</code>
     */
    const AWAITING_USER_ACTIVATION = 4;
    /**
     * Certificates cannot be issued from this CA. CRLs will not be generated.
     * The CA may still be recovered by calling
     * [CertificateAuthorityService.UndeleteCertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthorityService.UndeleteCertificateAuthority]
     * before
     * [expire_time][google.cloud.security.privateca.v1.CertificateAuthority.expire_time].
     * The CA will not be part of the
     * [CaPool][google.cloud.security.privateca.v1.CaPool]'s trust anchor, and
     * will not be used to issue certificates from the
     * [CaPool][google.cloud.security.privateca.v1.CaPool].
     *
     * Generated from protobuf enum <code>DELETED = 5;</code>
     */
    const DELETED = 5;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::ENABLED => 'ENABLED',
        self::DISABLED => 'DISABLED',
        self::STAGED => 'STAGED',
        self::AWAITING_USER_ACTIVATION => 'AWAITING_USER_ACTIVATION',
        self::DELETED => 'DELETED',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}


