<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/products/v1/products_common.proto

namespace Google\Shopping\Merchant\Products\V1\ProductAttributes;

use UnexpectedValueException;

/**
 * The property type.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.ProductAttributes.PropertyType</code>
 */
class PropertyType
{
    /**
     * Unspecified property type.
     *
     * Generated from protobuf enum <code>PROPERTY_TYPE_UNSPECIFIED = 0;</code>
     */
    const PROPERTY_TYPE_UNSPECIFIED = 0;
    /**
     * Apartment.
     *
     * Generated from protobuf enum <code>APARTMENT = 1;</code>
     */
    const APARTMENT = 1;
    /**
     * Condo.
     *
     * Generated from protobuf enum <code>CONDO = 2;</code>
     */
    const CONDO = 2;
    /**
     * Loft.
     *
     * Generated from protobuf enum <code>LOFT = 3;</code>
     */
    const LOFT = 3;
    /**
     * Multi-family home.
     *
     * Generated from protobuf enum <code>MULTI_FAMILY_HOME = 4;</code>
     */
    const MULTI_FAMILY_HOME = 4;
    /**
     * Penthouse.
     *
     * Generated from protobuf enum <code>PENTHOUSE = 5;</code>
     */
    const PENTHOUSE = 5;
    /**
     * Room.
     *
     * Generated from protobuf enum <code>ROOM = 6;</code>
     */
    const ROOM = 6;
    /**
     * Single-family home.
     *
     * Generated from protobuf enum <code>SINGLE_FAMILY_HOME = 7;</code>
     */
    const SINGLE_FAMILY_HOME = 7;
    /**
     * Studio.
     *
     * Generated from protobuf enum <code>STUDIO = 8;</code>
     */
    const STUDIO = 8;
    /**
     * Townhouse.
     *
     * Generated from protobuf enum <code>TOWNHOUSE = 9;</code>
     */
    const TOWNHOUSE = 9;

    private static $valueToName = [
        self::PROPERTY_TYPE_UNSPECIFIED => 'PROPERTY_TYPE_UNSPECIFIED',
        self::APARTMENT => 'APARTMENT',
        self::CONDO => 'CONDO',
        self::LOFT => 'LOFT',
        self::MULTI_FAMILY_HOME => 'MULTI_FAMILY_HOME',
        self::PENTHOUSE => 'PENTHOUSE',
        self::ROOM => 'ROOM',
        self::SINGLE_FAMILY_HOME => 'SINGLE_FAMILY_HOME',
        self::STUDIO => 'STUDIO',
        self::TOWNHOUSE => 'TOWNHOUSE',
    ];

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

