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

namespace Google\Cloud\FinancialServices\V1;

use UnexpectedValueException;

/**
 * Indicate which LineOfBusiness a party belongs to.
 *
 * Protobuf type <code>google.cloud.financialservices.v1.LineOfBusiness</code>
 */
class LineOfBusiness
{
    /**
     * An unspecified LineOfBusiness. Do not use.
     *
     * Generated from protobuf enum <code>LINE_OF_BUSINESS_UNSPECIFIED = 0;</code>
     */
    const LINE_OF_BUSINESS_UNSPECIFIED = 0;
    /**
     * Commercial LineOfBusiness.
     *
     * Generated from protobuf enum <code>COMMERCIAL = 1;</code>
     */
    const COMMERCIAL = 1;
    /**
     * Retail LineOfBusiness.
     *
     * Generated from protobuf enum <code>RETAIL = 2;</code>
     */
    const RETAIL = 2;

    private static $valueToName = [
        self::LINE_OF_BUSINESS_UNSPECIFIED => 'LINE_OF_BUSINESS_UNSPECIFIED',
        self::COMMERCIAL => 'COMMERCIAL',
        self::RETAIL => 'RETAIL',
    ];

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

