google.cloud.channel.v1.DiscountType */ class DiscountType { /** * Not used. * * Generated from protobuf enum DISCOUNT_TYPE_UNSPECIFIED = 0; */ const DISCOUNT_TYPE_UNSPECIFIED = 0; /** * Regional discount. * * Generated from protobuf enum REGIONAL_DISCOUNT = 1; */ const REGIONAL_DISCOUNT = 1; /** * Promotional discount. * * Generated from protobuf enum PROMOTIONAL_DISCOUNT = 2; */ const PROMOTIONAL_DISCOUNT = 2; /** * Sales-provided discount. * * Generated from protobuf enum SALES_DISCOUNT = 3; */ const SALES_DISCOUNT = 3; /** * Reseller margin. * * Generated from protobuf enum RESELLER_MARGIN = 4; */ const RESELLER_MARGIN = 4; /** * Deal code discount. * * Generated from protobuf enum DEAL_CODE = 5; */ const DEAL_CODE = 5; private static $valueToName = [ self::DISCOUNT_TYPE_UNSPECIFIED => 'DISCOUNT_TYPE_UNSPECIFIED', self::REGIONAL_DISCOUNT => 'REGIONAL_DISCOUNT', self::PROMOTIONAL_DISCOUNT => 'PROMOTIONAL_DISCOUNT', self::SALES_DISCOUNT => 'SALES_DISCOUNT', self::RESELLER_MARGIN => 'RESELLER_MARGIN', self::DEAL_CODE => 'DEAL_CODE', ]; 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); } }