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

namespace Google\Cloud\Channel\V1;

use UnexpectedValueException;

/**
 * Represents the type for a monetizable resource(any entity on which billing
 * happens). For example, this could be MINUTES for Google Voice and GB for
 * Google Drive. One SKU can map to multiple monetizable resources.
 *
 * Protobuf type <code>google.cloud.channel.v1.ResourceType</code>
 */
class ResourceType
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>RESOURCE_TYPE_UNSPECIFIED = 0;</code>
     */
    const RESOURCE_TYPE_UNSPECIFIED = 0;
    /**
     * Seat.
     *
     * Generated from protobuf enum <code>SEAT = 1;</code>
     */
    const SEAT = 1;
    /**
     * Monthly active user.
     *
     * Generated from protobuf enum <code>MAU = 2;</code>
     */
    const MAU = 2;
    /**
     * GB (used for storage SKUs).
     *
     * Generated from protobuf enum <code>GB = 3;</code>
     */
    const GB = 3;
    /**
     * Active licensed users(for Voice SKUs).
     *
     * Generated from protobuf enum <code>LICENSED_USER = 4;</code>
     */
    const LICENSED_USER = 4;
    /**
     * Voice usage.
     *
     * Generated from protobuf enum <code>MINUTES = 5;</code>
     */
    const MINUTES = 5;
    /**
     * For IaaS SKUs like Google Cloud Platform, monetization is based on usage
     * accrued on your billing account irrespective of the type of monetizable
     * resource. This enum represents an aggregated resource/container for all
     * usage SKUs on a billing account. Currently, only applicable to Google Cloud
     * Platform.
     *
     * Generated from protobuf enum <code>IAAS_USAGE = 6;</code>
     */
    const IAAS_USAGE = 6;
    /**
     * For Google Cloud Platform subscriptions like Anthos or SAP.
     *
     * Generated from protobuf enum <code>SUBSCRIPTION = 7;</code>
     */
    const SUBSCRIPTION = 7;

    private static $valueToName = [
        self::RESOURCE_TYPE_UNSPECIFIED => 'RESOURCE_TYPE_UNSPECIFIED',
        self::SEAT => 'SEAT',
        self::MAU => 'MAU',
        self::GB => 'GB',
        self::LICENSED_USER => 'LICENSED_USER',
        self::MINUTES => 'MINUTES',
        self::IAAS_USAGE => 'IAAS_USAGE',
        self::SUBSCRIPTION => 'SUBSCRIPTION',
    ];

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

