<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v25/enums/unit_of_measure.proto

namespace Google\Ads\GoogleAds\V25\Enums\UnitOfMeasureEnum;

use UnexpectedValueException;

/**
 * The possible type of unit of measure.
 *
 * Protobuf type <code>google.ads.googleads.v25.enums.UnitOfMeasureEnum.UnitOfMeasure</code>
 */
class UnitOfMeasure
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * Used for return value only. Represents value unknown in this version.
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * Clicks as unit of measure.
     *
     * Generated from protobuf enum <code>CLICKS = 2;</code>
     */
    const CLICKS = 2;
    /**
     * Impressions as unit of measure.
     *
     * Generated from protobuf enum <code>IMPRESSIONS = 3;</code>
     */
    const IMPRESSIONS = 3;
    /**
     * Acquisitions as unit of measure.
     *
     * Generated from protobuf enum <code>ACQUISITIONS = 4;</code>
     */
    const ACQUISITIONS = 4;
    /**
     * Phone calls as unit of measure.
     *
     * Generated from protobuf enum <code>PHONE_CALLS = 5;</code>
     */
    const PHONE_CALLS = 5;
    /**
     * Video plays as unit of measure.
     *
     * Generated from protobuf enum <code>VIDEO_PLAYS = 6;</code>
     */
    const VIDEO_PLAYS = 6;
    /**
     * Days as unit of measure.
     *
     * Generated from protobuf enum <code>DAYS = 7;</code>
     */
    const DAYS = 7;
    /**
     * Audio plays as unit of measure.
     *
     * Generated from protobuf enum <code>AUDIO_PLAYS = 8;</code>
     */
    const AUDIO_PLAYS = 8;
    /**
     * Engagements as unit of measure.
     *
     * Generated from protobuf enum <code>ENGAGEMENTS = 9;</code>
     */
    const ENGAGEMENTS = 9;
    /**
     * Seconds as unit of measure.
     *
     * Generated from protobuf enum <code>SECONDS = 10;</code>
     */
    const SECONDS = 10;
    /**
     * Leads as unit of measure.
     *
     * Generated from protobuf enum <code>LEADS = 11;</code>
     */
    const LEADS = 11;
    /**
     * Guest stays as unit of measure.
     *
     * Generated from protobuf enum <code>GUEST_STAYS = 12;</code>
     */
    const GUEST_STAYS = 12;
    /**
     * Hours as unit of measure.
     *
     * Generated from protobuf enum <code>HOURS = 13;</code>
     */
    const HOURS = 13;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::CLICKS => 'CLICKS',
        self::IMPRESSIONS => 'IMPRESSIONS',
        self::ACQUISITIONS => 'ACQUISITIONS',
        self::PHONE_CALLS => 'PHONE_CALLS',
        self::VIDEO_PLAYS => 'VIDEO_PLAYS',
        self::DAYS => 'DAYS',
        self::AUDIO_PLAYS => 'AUDIO_PLAYS',
        self::ENGAGEMENTS => 'ENGAGEMENTS',
        self::SECONDS => 'SECONDS',
        self::LEADS => 'LEADS',
        self::GUEST_STAYS => 'GUEST_STAYS',
        self::HOURS => 'HOURS',
    ];

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

