<?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\PetPolicy;

use UnexpectedValueException;

/**
 * The pet types.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.ProductAttributes.PetPolicy.PetType</code>
 */
class PetType
{
    /**
     * Unspecified pet type.
     *
     * Generated from protobuf enum <code>PET_TYPE_UNSPECIFIED = 0;</code>
     */
    const PET_TYPE_UNSPECIFIED = 0;
    /**
     * Cats.
     *
     * Generated from protobuf enum <code>CATS = 1;</code>
     */
    const CATS = 1;
    /**
     * Large dogs.
     *
     * Generated from protobuf enum <code>LARGE_DOGS = 2;</code>
     */
    const LARGE_DOGS = 2;
    /**
     * Small dogs.
     *
     * Generated from protobuf enum <code>SMALL_DOGS = 3;</code>
     */
    const SMALL_DOGS = 3;

    private static $valueToName = [
        self::PET_TYPE_UNSPECIFIED => 'PET_TYPE_UNSPECIFIED',
        self::CATS => 'CATS',
        self::LARGE_DOGS => 'LARGE_DOGS',
        self::SMALL_DOGS => 'SMALL_DOGS',
    ];

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

