<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/talent/v4beta1/event.proto

namespace Google\Cloud\Talent\V4beta1\ProfileEvent;

use UnexpectedValueException;

/**
 * The enum represents types of client events for a candidate profile.
 *
 * Protobuf type <code>google.cloud.talent.v4beta1.ProfileEvent.ProfileEventType</code>
 */
class ProfileEventType
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>PROFILE_EVENT_TYPE_UNSPECIFIED = 0;</code>
     */
    const PROFILE_EVENT_TYPE_UNSPECIFIED = 0;
    /**
     * Send this event when a
     * [ProfileEvent.profiles][google.cloud.talent.v4beta1.ProfileEvent.profiles]
     * was sent as a part of a result set for a CTS API call and was rendered in
     * the end user's UI (that is, the
     * [ProfileEvent.recruiter][google.cloud.talent.v4beta1.ProfileEvent.recruiter]).
     *
     * Generated from protobuf enum <code>IMPRESSION = 1;</code>
     */
    const IMPRESSION = 1;
    /**
     * The VIEW event records the action of a candidate's profile being
     * viewed by an end user. This is critical to tracking product metrics and
     * should be sent for every profile VIEW that happens in your system,
     * whether the event is associated with an API call (for example, a
     * recruiter making a request for a result set and clicking on a profile)
     * or not (a recruiter using the system to view profile details without
     * making a request).
     * For a VIEW events associated with API calls, the
     * [ClientEvent.request_id][google.cloud.talent.v4beta1.ClientEvent.request_id]
     * should be populated.  If the VIEW is not associated with an API call,
     * [request_id][google.cloud.talent.v4beta1.ClientEvent.request_id] should
     * not be populated.
     * This event requires a valid recruiter and one valid ID in profiles.
     *
     * Generated from protobuf enum <code>VIEW = 2;</code>
     */
    const VIEW = 2;
    /**
     * The profile is bookmarked.
     *
     * Generated from protobuf enum <code>BOOKMARK = 3;</code>
     */
    const BOOKMARK = 3;

    private static $valueToName = [
        self::PROFILE_EVENT_TYPE_UNSPECIFIED => 'PROFILE_EVENT_TYPE_UNSPECIFIED',
        self::IMPRESSION => 'IMPRESSION',
        self::VIEW => 'VIEW',
        self::BOOKMARK => 'BOOKMARK',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProfileEventType::class, \Google\Cloud\Talent\V4beta1\ProfileEvent_ProfileEventType::class);

