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

namespace Google\Ads\AdManager\V1\OrderStatusEnum;

use UnexpectedValueException;

/**
 * The status of an Order.
 *
 * Protobuf type <code>google.ads.admanager.v1.OrderStatusEnum.OrderStatus</code>
 */
class OrderStatus
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>ORDER_STATUS_UNSPECIFIED = 0;</code>
     */
    const ORDER_STATUS_UNSPECIFIED = 0;
    /**
     * Indicates that the Order has just been created but no approval has been
     * requested yet.
     *
     * Generated from protobuf enum <code>DRAFT = 2;</code>
     */
    const DRAFT = 2;
    /**
     * Indicates that a request for approval for the Order has been made.
     *
     * Generated from protobuf enum <code>PENDING_APPROVAL = 3;</code>
     */
    const PENDING_APPROVAL = 3;
    /**
     * Indicates that the Order has been approved and is ready to serve.
     *
     * Generated from protobuf enum <code>APPROVED = 4;</code>
     */
    const APPROVED = 4;
    /**
     * Indicates that the Order has been disapproved and is not eligible to
     * serve.
     *
     * Generated from protobuf enum <code>DISAPPROVED = 5;</code>
     */
    const DISAPPROVED = 5;
    /**
     * This is a legacy state. Paused status should be checked on LineItems
     * within the order.
     *
     * Generated from protobuf enum <code>PAUSED = 6;</code>
     */
    const PAUSED = 6;
    /**
     * Indicates that the Order has been canceled and cannot serve.
     *
     * Generated from protobuf enum <code>CANCELED = 7;</code>
     */
    const CANCELED = 7;
    /**
     * Indicates that the Order has been deleted.
     *
     * Generated from protobuf enum <code>DELETED = 8;</code>
     */
    const DELETED = 8;

    private static $valueToName = [
        self::ORDER_STATUS_UNSPECIFIED => 'ORDER_STATUS_UNSPECIFIED',
        self::DRAFT => 'DRAFT',
        self::PENDING_APPROVAL => 'PENDING_APPROVAL',
        self::APPROVED => 'APPROVED',
        self::DISAPPROVED => 'DISAPPROVED',
        self::PAUSED => 'PAUSED',
        self::CANCELED => 'CANCELED',
        self::DELETED => 'DELETED',
    ];

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


