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

namespace Google\Cloud\Channel\V1;

use UnexpectedValueException;

/**
 * Specifies the different costs that the modified bill can be based on.
 *
 * Protobuf type <code>google.cloud.channel.v1.RebillingBasis</code>
 */
class RebillingBasis
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>REBILLING_BASIS_UNSPECIFIED = 0;</code>
     */
    const REBILLING_BASIS_UNSPECIFIED = 0;
    /**
     * Use the list cost, also known as the MSRP.
     *
     * Generated from protobuf enum <code>COST_AT_LIST = 1;</code>
     */
    const COST_AT_LIST = 1;
    /**
     * Pass through all discounts except the Reseller Program Discount. If this is
     * the default cost base and no adjustments are specified, the output cost
     * will be exactly what the customer would see if they viewed the bill in the
     * Google Cloud Console.
     *
     * Generated from protobuf enum <code>DIRECT_CUSTOMER_COST = 2;</code>
     */
    const DIRECT_CUSTOMER_COST = 2;

    private static $valueToName = [
        self::REBILLING_BASIS_UNSPECIFIED => 'REBILLING_BASIS_UNSPECIFIED',
        self::COST_AT_LIST => 'COST_AT_LIST',
        self::DIRECT_CUSTOMER_COST => 'DIRECT_CUSTOMER_COST',
    ];

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

