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

namespace Google\Cloud\Compute\V1\InterconnectAttachment;

use UnexpectedValueException;

/**
 * [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: - ACTIVE: The attachment has been turned up and is ready to use. - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. 
 *
 * Protobuf type <code>google.cloud.compute.v1.InterconnectAttachment.State</code>
 */
class State
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_STATE = 0;</code>
     */
    const UNDEFINED_STATE = 0;
    /**
     * Indicates that attachment has been turned up and is ready to use.
     *
     * Generated from protobuf enum <code>ACTIVE = 314733318;</code>
     */
    const ACTIVE = 314733318;
    /**
     * The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was wiped out, or because the other side of a Partner attachment was deleted.
     *
     * Generated from protobuf enum <code>DEFUNCT = 115891759;</code>
     */
    const DEFUNCT = 115891759;
    /**
     * A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it.
     *
     * Generated from protobuf enum <code>PARTNER_REQUEST_RECEIVED = 513587304;</code>
     */
    const PARTNER_REQUEST_RECEIVED = 513587304;
    /**
     * PARTNER or PARTNER_PROVIDER attachment that is waiting for the customer to activate.
     *
     * Generated from protobuf enum <code>PENDING_CUSTOMER = 167494054;</code>
     */
    const PENDING_CUSTOMER = 167494054;
    /**
     * A newly created PARTNER attachment that has not yet been configured on the Partner side.
     *
     * Generated from protobuf enum <code>PENDING_PARTNER = 387890656;</code>
     */
    const PENDING_PARTNER = 387890656;
    /**
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 470755401;</code>
     */
    const STATE_UNSPECIFIED = 470755401;
    /**
     * Indicates that attachment is not ready to use yet, because turnup is not complete.
     *
     * Generated from protobuf enum <code>UNPROVISIONED = 517333979;</code>
     */
    const UNPROVISIONED = 517333979;

    private static $valueToName = [
        self::UNDEFINED_STATE => 'UNDEFINED_STATE',
        self::ACTIVE => 'ACTIVE',
        self::DEFUNCT => 'DEFUNCT',
        self::PARTNER_REQUEST_RECEIVED => 'PARTNER_REQUEST_RECEIVED',
        self::PENDING_CUSTOMER => 'PENDING_CUSTOMER',
        self::PENDING_PARTNER => 'PENDING_PARTNER',
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::UNPROVISIONED => 'UNPROVISIONED',
    ];

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


