<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/admanager/v1/company_type_enum.proto

namespace Google\Ads\AdManager\V1\CompanyTypeEnum;

use UnexpectedValueException;

/**
 * The type of a company.
 *
 * Protobuf type <code>google.ads.admanager.v1.CompanyTypeEnum.CompanyType</code>
 */
class CompanyType
{
    /**
     * No value specified
     *
     * Generated from protobuf enum <code>COMPANY_TYPE_UNSPECIFIED = 0;</code>
     */
    const COMPANY_TYPE_UNSPECIFIED = 0;
    /**
     * A business entity that purchases ad inventory.
     *
     * Generated from protobuf enum <code>ADVERTISER = 1;</code>
     */
    const ADVERTISER = 1;
    /**
     * A company representing the publisher's own advertiser for house ads.
     *
     * Generated from protobuf enum <code>HOUSE_ADVERTISER = 2;</code>
     */
    const HOUSE_ADVERTISER = 2;
    /**
     * An organization that manages ad accounts and offers services, such as ad
     * creation, placement, and management to advertisers.
     *
     * Generated from protobuf enum <code>AGENCY = 3;</code>
     */
    const AGENCY = 3;
    /**
     * A company representing the publisher's own agency.
     *
     * Generated from protobuf enum <code>HOUSE_AGENCY = 4;</code>
     */
    const HOUSE_AGENCY = 4;
    /**
     * A company representing multiple advertisers and agencies.
     *
     * Generated from protobuf enum <code>AD_NETWORK = 5;</code>
     */
    const AD_NETWORK = 5;

    private static $valueToName = [
        self::COMPANY_TYPE_UNSPECIFIED => 'COMPANY_TYPE_UNSPECIFIED',
        self::ADVERTISER => 'ADVERTISER',
        self::HOUSE_ADVERTISER => 'HOUSE_ADVERTISER',
        self::AGENCY => 'AGENCY',
        self::HOUSE_AGENCY => 'HOUSE_AGENCY',
        self::AD_NETWORK => 'AD_NETWORK',
    ];

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


