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

use UnexpectedValueException;

/**
 * Target [gender](https://support.google.com/merchants/answer/6324479) of the
 * item.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.Gender</code>
 */
class Gender
{
    /**
     * Gender is not specified.
     *
     * Generated from protobuf enum <code>GENDER_UNSPECIFIED = 0;</code>
     */
    const GENDER_UNSPECIFIED = 0;
    /**
     * Male.
     *
     * Generated from protobuf enum <code>MALE = 1;</code>
     */
    const MALE = 1;
    /**
     * Female.
     *
     * Generated from protobuf enum <code>FEMALE = 2;</code>
     */
    const FEMALE = 2;
    /**
     * Unisex.
     *
     * Generated from protobuf enum <code>UNISEX = 3;</code>
     */
    const UNISEX = 3;

    private static $valueToName = [
        self::GENDER_UNSPECIFIED => 'GENDER_UNSPECIFIED',
        self::MALE => 'MALE',
        self::FEMALE => 'FEMALE',
        self::UNISEX => 'UNISEX',
    ];

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

