<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/retail/v2/user_event_service.proto

namespace Google\Cloud\Retail\V2\RejoinUserEventsRequest;

use UnexpectedValueException;

/**
 * The scope of user events to be rejoined with the latest product catalog.
 * If the rejoining aims at reducing number of unjoined events, set
 * `UserEventRejoinScope` to `UNJOINED_EVENTS`.
 * If the rejoining aims at correcting product catalog information in joined
 * events, set `UserEventRejoinScope` to `JOINED_EVENTS`.
 * If all events needs to be rejoined, set `UserEventRejoinScope` to
 * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED`.
 *
 * Protobuf type <code>google.cloud.retail.v2.RejoinUserEventsRequest.UserEventRejoinScope</code>
 */
class UserEventRejoinScope
{
    /**
     * Rejoin all events with the latest product catalog, including both joined
     * events and unjoined events.
     *
     * Generated from protobuf enum <code>USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0;</code>
     */
    const USER_EVENT_REJOIN_SCOPE_UNSPECIFIED = 0;
    /**
     * Only rejoin joined events with the latest product catalog.
     *
     * Generated from protobuf enum <code>JOINED_EVENTS = 1;</code>
     */
    const JOINED_EVENTS = 1;
    /**
     * Only rejoin unjoined events with the latest product catalog.
     *
     * Generated from protobuf enum <code>UNJOINED_EVENTS = 2;</code>
     */
    const UNJOINED_EVENTS = 2;

    private static $valueToName = [
        self::USER_EVENT_REJOIN_SCOPE_UNSPECIFIED => 'USER_EVENT_REJOIN_SCOPE_UNSPECIFIED',
        self::JOINED_EVENTS => 'JOINED_EVENTS',
        self::UNJOINED_EVENTS => 'UNJOINED_EVENTS',
    ];

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


