<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/channel/v1/subscriber_event.proto

namespace Google\Cloud\Channel\V1\EntitlementEvent;

use UnexpectedValueException;

/**
 * Type of entitlement event.
 *
 * Protobuf type <code>google.cloud.channel.v1.EntitlementEvent.Type</code>
 */
class Type
{
    /**
     * Default value. This state doesn't show unless an error occurs.
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * A new entitlement was created.
     *
     * Generated from protobuf enum <code>CREATED = 1;</code>
     */
    const CREATED = 1;
    /**
     * The offer type associated with an entitlement was changed.
     * This is not triggered if an entitlement converts from a commit offer to a
     * flexible offer as part of a renewal.
     *
     * Generated from protobuf enum <code>PRICE_PLAN_SWITCHED = 3;</code>
     */
    const PRICE_PLAN_SWITCHED = 3;
    /**
     * Annual commitment for a commit plan was changed.
     *
     * Generated from protobuf enum <code>COMMITMENT_CHANGED = 4;</code>
     */
    const COMMITMENT_CHANGED = 4;
    /**
     * An annual entitlement was renewed.
     *
     * Generated from protobuf enum <code>RENEWED = 5;</code>
     */
    const RENEWED = 5;
    /**
     * Entitlement was suspended.
     *
     * Generated from protobuf enum <code>SUSPENDED = 6;</code>
     */
    const SUSPENDED = 6;
    /**
     * Entitlement was unsuspended.
     *
     * Generated from protobuf enum <code>ACTIVATED = 7;</code>
     */
    const ACTIVATED = 7;
    /**
     * Entitlement was cancelled.
     *
     * Generated from protobuf enum <code>CANCELLED = 8;</code>
     */
    const CANCELLED = 8;
    /**
     * Entitlement was upgraded or downgraded (e.g. from Google Workspace
     * Business Standard to Google Workspace Business Plus).
     *
     * Generated from protobuf enum <code>SKU_CHANGED = 9;</code>
     */
    const SKU_CHANGED = 9;
    /**
     * The renewal settings of an entitlement has changed.
     *
     * Generated from protobuf enum <code>RENEWAL_SETTING_CHANGED = 10;</code>
     */
    const RENEWAL_SETTING_CHANGED = 10;
    /**
     * Paid service has started on trial entitlement.
     *
     * Generated from protobuf enum <code>PAID_SERVICE_STARTED = 11;</code>
     */
    const PAID_SERVICE_STARTED = 11;
    /**
     * License was assigned to or revoked from a user.
     *
     * Generated from protobuf enum <code>LICENSE_ASSIGNMENT_CHANGED = 12;</code>
     */
    const LICENSE_ASSIGNMENT_CHANGED = 12;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::CREATED => 'CREATED',
        self::PRICE_PLAN_SWITCHED => 'PRICE_PLAN_SWITCHED',
        self::COMMITMENT_CHANGED => 'COMMITMENT_CHANGED',
        self::RENEWED => 'RENEWED',
        self::SUSPENDED => 'SUSPENDED',
        self::ACTIVATED => 'ACTIVATED',
        self::CANCELLED => 'CANCELLED',
        self::SKU_CHANGED => 'SKU_CHANGED',
        self::RENEWAL_SETTING_CHANGED => 'RENEWAL_SETTING_CHANGED',
        self::PAID_SERVICE_STARTED => 'PAID_SERVICE_STARTED',
        self::LICENSE_ASSIGNMENT_CHANGED => 'LICENSE_ASSIGNMENT_CHANGED',
    ];

    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(Type::class, \Google\Cloud\Channel\V1\EntitlementEvent_Type::class);

