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

namespace Google\Cloud\Talent\V4\Location;

use UnexpectedValueException;

/**
 * An enum which represents the type of a location.
 *
 * Protobuf type <code>google.cloud.talent.v4.Location.LocationType</code>
 */
class LocationType
{
    /**
     * Default value if the type isn't specified.
     *
     * Generated from protobuf enum <code>LOCATION_TYPE_UNSPECIFIED = 0;</code>
     */
    const LOCATION_TYPE_UNSPECIFIED = 0;
    /**
     * A country level location.
     *
     * Generated from protobuf enum <code>COUNTRY = 1;</code>
     */
    const COUNTRY = 1;
    /**
     * A state or equivalent level location.
     *
     * Generated from protobuf enum <code>ADMINISTRATIVE_AREA = 2;</code>
     */
    const ADMINISTRATIVE_AREA = 2;
    /**
     * A county or equivalent level location.
     *
     * Generated from protobuf enum <code>SUB_ADMINISTRATIVE_AREA = 3;</code>
     */
    const SUB_ADMINISTRATIVE_AREA = 3;
    /**
     * A city or equivalent level location.
     *
     * Generated from protobuf enum <code>LOCALITY = 4;</code>
     */
    const LOCALITY = 4;
    /**
     * A postal code level location.
     *
     * Generated from protobuf enum <code>POSTAL_CODE = 5;</code>
     */
    const POSTAL_CODE = 5;
    /**
     * A sublocality is a subdivision of a locality, for example a city borough,
     * ward, or arrondissement. Sublocalities are usually recognized by a local
     * political authority. For example, Manhattan and Brooklyn are recognized
     * as boroughs by the City of New York, and are therefore modeled as
     * sublocalities.
     *
     * Generated from protobuf enum <code>SUB_LOCALITY = 6;</code>
     */
    const SUB_LOCALITY = 6;
    /**
     * A district or equivalent level location.
     *
     * Generated from protobuf enum <code>SUB_LOCALITY_1 = 7;</code>
     */
    const SUB_LOCALITY_1 = 7;
    /**
     * A smaller district or equivalent level display.
     *
     * Generated from protobuf enum <code>SUB_LOCALITY_2 = 8;</code>
     */
    const SUB_LOCALITY_2 = 8;
    /**
     * A neighborhood level location.
     *
     * Generated from protobuf enum <code>NEIGHBORHOOD = 9;</code>
     */
    const NEIGHBORHOOD = 9;
    /**
     * A street address level location.
     *
     * Generated from protobuf enum <code>STREET_ADDRESS = 10;</code>
     */
    const STREET_ADDRESS = 10;

    private static $valueToName = [
        self::LOCATION_TYPE_UNSPECIFIED => 'LOCATION_TYPE_UNSPECIFIED',
        self::COUNTRY => 'COUNTRY',
        self::ADMINISTRATIVE_AREA => 'ADMINISTRATIVE_AREA',
        self::SUB_ADMINISTRATIVE_AREA => 'SUB_ADMINISTRATIVE_AREA',
        self::LOCALITY => 'LOCALITY',
        self::POSTAL_CODE => 'POSTAL_CODE',
        self::SUB_LOCALITY => 'SUB_LOCALITY',
        self::SUB_LOCALITY_1 => 'SUB_LOCALITY_1',
        self::SUB_LOCALITY_2 => 'SUB_LOCALITY_2',
        self::NEIGHBORHOOD => 'NEIGHBORHOOD',
        self::STREET_ADDRESS => 'STREET_ADDRESS',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(LocationType::class, \Google\Cloud\Talent\V4\Location_LocationType::class);

