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

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

use UnexpectedValueException;

/**
 * The state of a [CertificateAuthority][google.cloud.security.privateca.v1beta1.CertificateAuthority], indicating if it can be used.
 *
 * Protobuf type <code>google.cloud.security.privateca.v1beta1.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.
     *
     * Generated from protobuf enum <code>ENABLED = 1;</code>
     */
    const ENABLED = 1;
    /**
     * Certificates cannot be issued from this CA. CRLs will still be generated.
     *
     * Generated from protobuf enum <code>DISABLED = 2;</code>
     */
    const DISABLED = 2;
    /**
     * Certificates cannot be issued from this CA. CRLs will not be generated.
     *
     * Generated from protobuf enum <code>PENDING_ACTIVATION = 3;</code>
     */
    const PENDING_ACTIVATION = 3;
    /**
     * Certificates cannot be issued from this CA. CRLs will not be generated.
     *
     * Generated from protobuf enum <code>PENDING_DELETION = 4;</code>
     */
    const PENDING_DELETION = 4;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::ENABLED => 'ENABLED',
        self::DISABLED => 'DISABLED',
        self::PENDING_ACTIVATION => 'PENDING_ACTIVATION',
        self::PENDING_DELETION => 'PENDING_DELETION',
    ];

    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);
    }
}


