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

namespace Google\Cloud\Compute\V1\FutureReservationCommitmentInfo;

use UnexpectedValueException;

/**
 * Only applicable if FR is delivering to the same reservation. If set, all
 * parent commitments will be extended to match the end date of the plan for
 * this commitment.
 *
 * Protobuf type <code>google.cloud.compute.v1.FutureReservationCommitmentInfo.PreviousCommitmentTerms</code>
 */
class PreviousCommitmentTerms
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_PREVIOUS_COMMITMENT_TERMS = 0;</code>
     */
    const UNDEFINED_PREVIOUS_COMMITMENT_TERMS = 0;
    /**
     * All associated parent Committed Used Discount(s) end-date/term will be
     * extended to the end-time of this future reservation. Default is to
     * extend previous commitment(s) time to the end_time of the reservation.
     *
     * Generated from protobuf enum <code>EXTEND = 448639770;</code>
     */
    const EXTEND = 448639770;
    /**
     * No changes to associated parents Committed Used Discount(s) terms.
     *
     * Generated from protobuf enum <code>PREVIOUSCOMMITMENTTERM_UNSPECIFIED = 98482448;</code>
     */
    const PREVIOUSCOMMITMENTTERM_UNSPECIFIED = 98482448;

    private static $valueToName = [
        self::UNDEFINED_PREVIOUS_COMMITMENT_TERMS => 'UNDEFINED_PREVIOUS_COMMITMENT_TERMS',
        self::EXTEND => 'EXTEND',
        self::PREVIOUSCOMMITMENTTERM_UNSPECIFIED => 'PREVIOUSCOMMITMENTTERM_UNSPECIFIED',
    ];

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


