<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1alpha/resources.proto

namespace Google\Analytics\Admin\V1alpha;

use UnexpectedValueException;

/**
 * An indication of which product the user initiated a link proposal from.
 *
 * Protobuf type <code>google.analytics.admin.v1alpha.LinkProposalInitiatingProduct</code>
 */
class LinkProposalInitiatingProduct
{
    /**
     * Unspecified product.
     *
     * Generated from protobuf enum <code>LINK_PROPOSAL_INITIATING_PRODUCT_UNSPECIFIED = 0;</code>
     */
    const LINK_PROPOSAL_INITIATING_PRODUCT_UNSPECIFIED = 0;
    /**
     * This proposal was created by a user from Google Analytics.
     *
     * Generated from protobuf enum <code>GOOGLE_ANALYTICS = 1;</code>
     */
    const GOOGLE_ANALYTICS = 1;
    /**
     * This proposal was created by a user from a linked product (not Google
     * Analytics).
     *
     * Generated from protobuf enum <code>LINKED_PRODUCT = 2;</code>
     */
    const LINKED_PRODUCT = 2;

    private static $valueToName = [
        self::LINK_PROPOSAL_INITIATING_PRODUCT_UNSPECIFIED => 'LINK_PROPOSAL_INITIATING_PRODUCT_UNSPECIFIED',
        self::GOOGLE_ANALYTICS => 'GOOGLE_ANALYTICS',
        self::LINKED_PRODUCT => 'LINKED_PRODUCT',
    ];

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

