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

namespace Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\CommercialInfo\GoogleCloudMarketplaceInfo;

use UnexpectedValueException;

/**
 * Indicates whether this commercial access is currently active.
 *
 * Protobuf type <code>google.cloud.bigquery.analyticshub.v1.Listing.CommercialInfo.GoogleCloudMarketplaceInfo.CommercialState</code>
 */
class CommercialState
{
    /**
     * Commercialization is incomplete and cannot be used.
     *
     * Generated from protobuf enum <code>COMMERCIAL_STATE_UNSPECIFIED = 0;</code>
     */
    const COMMERCIAL_STATE_UNSPECIFIED = 0;
    /**
     * Commercialization has been initialized.
     *
     * Generated from protobuf enum <code>ONBOARDING = 1;</code>
     */
    const ONBOARDING = 1;
    /**
     * Commercialization is complete and available for use.
     *
     * Generated from protobuf enum <code>ACTIVE = 2;</code>
     */
    const ACTIVE = 2;

    private static $valueToName = [
        self::COMMERCIAL_STATE_UNSPECIFIED => 'COMMERCIAL_STATE_UNSPECIFIED',
        self::ONBOARDING => 'ONBOARDING',
        self::ACTIVE => 'ACTIVE',
    ];

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

