<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/managedidentities/v1beta1/resource.proto

namespace Google\Cloud\ManagedIdentities\V1beta1\Trust;

use UnexpectedValueException;

/**
 * Represents the direction of trust.
 * See
 * [System.DirectoryServices.ActiveDirectory.TrustDirection](https://docs.microsoft.com/en-us/dotnet/api/system.directoryservices.activedirectory.trustdirection?view=netframework-4.7.2)
 * for more information.
 *
 * Protobuf type <code>google.cloud.managedidentities.v1beta1.Trust.TrustDirection</code>
 */
class TrustDirection
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>TRUST_DIRECTION_UNSPECIFIED = 0;</code>
     */
    const TRUST_DIRECTION_UNSPECIFIED = 0;
    /**
     * The inbound direction represents the trusting side.
     *
     * Generated from protobuf enum <code>INBOUND = 1;</code>
     */
    const INBOUND = 1;
    /**
     * The outboud direction represents the trusted side.
     *
     * Generated from protobuf enum <code>OUTBOUND = 2;</code>
     */
    const OUTBOUND = 2;
    /**
     * The bidirectional direction represents the trusted / trusting side.
     *
     * Generated from protobuf enum <code>BIDIRECTIONAL = 3;</code>
     */
    const BIDIRECTIONAL = 3;

    private static $valueToName = [
        self::TRUST_DIRECTION_UNSPECIFIED => 'TRUST_DIRECTION_UNSPECIFIED',
        self::INBOUND => 'INBOUND',
        self::OUTBOUND => 'OUTBOUND',
        self::BIDIRECTIONAL => 'BIDIRECTIONAL',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TrustDirection::class, \Google\Cloud\ManagedIdentities\V1beta1\Trust_TrustDirection::class);

