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

namespace Google\Cloud\Iap\V1\AccessSettings;

use UnexpectedValueException;

/**
 * Types of identity source supported by IAP.
 *
 * Protobuf type <code>google.cloud.iap.v1.AccessSettings.IdentitySource</code>
 */
class IdentitySource
{
    /**
     * IdentitySource Unspecified.
     * When selected, IAP relies on which identity settings are fully configured
     * to redirect the traffic to. The precedence order is
     * WorkforceIdentitySettings > GcipSettings. If none is set, default to use
     * Google identity.
     *
     * Generated from protobuf enum <code>IDENTITY_SOURCE_UNSPECIFIED = 0;</code>
     */
    const IDENTITY_SOURCE_UNSPECIFIED = 0;
    /**
     * Use external identities set up on Google Cloud Workforce Identity
     * Federation.
     *
     * Generated from protobuf enum <code>WORKFORCE_IDENTITY_FEDERATION = 3;</code>
     */
    const WORKFORCE_IDENTITY_FEDERATION = 3;

    private static $valueToName = [
        self::IDENTITY_SOURCE_UNSPECIFIED => 'IDENTITY_SOURCE_UNSPECIFIED',
        self::WORKFORCE_IDENTITY_FEDERATION => 'WORKFORCE_IDENTITY_FEDERATION',
    ];

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


