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

namespace Google\Cloud\Compute\V1\ShareSettings;

use UnexpectedValueException;

/**
 * Type of sharing for this shared-reservation
 *
 * Protobuf type <code>google.cloud.compute.v1.ShareSettings.ShareType</code>
 */
class ShareType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_SHARE_TYPE = 0;</code>
     */
    const UNDEFINED_SHARE_TYPE = 0;
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>LOCAL = 72607563;</code>
     */
    const LOCAL = 72607563;
    /**
     * Shared-reservation is open to entire Organization
     *
     * Generated from protobuf enum <code>ORGANIZATION = 274978099;</code>
     */
    const ORGANIZATION = 274978099;
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>SHARE_TYPE_UNSPECIFIED = 494771730;</code>
     */
    const SHARE_TYPE_UNSPECIFIED = 494771730;
    /**
     * Shared-reservation is open to specific projects
     *
     * Generated from protobuf enum <code>SPECIFIC_PROJECTS = 347838695;</code>
     */
    const SPECIFIC_PROJECTS = 347838695;

    private static $valueToName = [
        self::UNDEFINED_SHARE_TYPE => 'UNDEFINED_SHARE_TYPE',
        self::LOCAL => 'LOCAL',
        self::ORGANIZATION => 'ORGANIZATION',
        self::SHARE_TYPE_UNSPECIFIED => 'SHARE_TYPE_UNSPECIFIED',
        self::SPECIFIC_PROJECTS => 'SPECIFIC_PROJECTS',
    ];

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


