<?php
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v24/enums/booking_status.proto

namespace Google\Ads\GoogleAds\V24\Enums\BookingStatusEnum;

use UnexpectedValueException;

/**
 * Booking status.
 *
 * Protobuf type <code>google.ads.googleads.v24.enums.BookingStatusEnum.BookingStatus</code>
 */
class BookingStatus
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * Used for return value only. Represents value unknown in this version.
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * The booking is active and holds inventory for the campaign.
     *
     * Generated from protobuf enum <code>BOOKED = 2;</code>
     */
    const BOOKED = 2;
    /**
     * The campaign is holding inventory, but the booking is not confirmed.
     *
     * Generated from protobuf enum <code>HELD = 3;</code>
     */
    const HELD = 3;
    /**
     * The campaign has ended and is no longer holding inventory.
     *
     * Generated from protobuf enum <code>CAMPAIGN_ENDED = 4;</code>
     */
    const CAMPAIGN_ENDED = 4;
    /**
     * The hold on the inventory has expired.
     *
     * Generated from protobuf enum <code>HOLD_EXPIRED = 5;</code>
     */
    const HOLD_EXPIRED = 5;
    /**
     * The campaign was booked, but was in a non-servable state for too long and
     * the booking was cancelled by the system.
     *
     * Generated from protobuf enum <code>BOOKING_CANCELLED = 6;</code>
     */
    const BOOKING_CANCELLED = 6;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::BOOKED => 'BOOKED',
        self::HELD => 'HELD',
        self::CAMPAIGN_ENDED => 'CAMPAIGN_ENDED',
        self::HOLD_EXPIRED => 'HOLD_EXPIRED',
        self::BOOKING_CANCELLED => 'BOOKING_CANCELLED',
    ];

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

