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

namespace Google\Ads\DataManager\V1;

use UnexpectedValueException;

/**
 * The type of demographic genders (for example, female).
 *
 * Protobuf type <code>google.ads.datamanager.v1.Gender</code>
 */
class Gender
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>GENDER_UNSPECIFIED = 0;</code>
     */
    const GENDER_UNSPECIFIED = 0;
    /**
     * Unknown.
     *
     * Generated from protobuf enum <code>GENDER_UNKNOWN = 1;</code>
     */
    const GENDER_UNKNOWN = 1;
    /**
     * Male.
     *
     * Generated from protobuf enum <code>GENDER_MALE = 2;</code>
     */
    const GENDER_MALE = 2;
    /**
     * Female.
     *
     * Generated from protobuf enum <code>GENDER_FEMALE = 3;</code>
     */
    const GENDER_FEMALE = 3;

    private static $valueToName = [
        self::GENDER_UNSPECIFIED => 'GENDER_UNSPECIFIED',
        self::GENDER_UNKNOWN => 'GENDER_UNKNOWN',
        self::GENDER_MALE => 'GENDER_MALE',
        self::GENDER_FEMALE => 'GENDER_FEMALE',
    ];

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

