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

namespace Google\Ads\GoogleAds\V22\Enums\PromotionBarcodeTypeEnum;

use UnexpectedValueException;

/**
 * A promotion barcode type.
 *
 * Protobuf type <code>google.ads.googleads.v22.enums.PromotionBarcodeTypeEnum.PromotionBarcodeType</code>
 */
class PromotionBarcodeType
{
    /**
     * 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;
    /**
     * Aztec 2D barcode format.
     * Max 350 characters and no links
     *
     * Generated from protobuf enum <code>AZTEC = 2;</code>
     */
    const AZTEC = 2;
    /**
     * CODABAR 1D format.
     * Max 12 characters and no links. Supported characters include
     * 0123456789-$:/.+ and optional start and end guards from ABCD.
     *
     * Generated from protobuf enum <code>CODABAR = 3;</code>
     */
    const CODABAR = 3;
    /**
     * Code 39 1D format.
     * Max 8 characters and no links. Supported characters include
     * 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%.
     *
     * Generated from protobuf enum <code>CODE39 = 4;</code>
     */
    const CODE39 = 4;
    /**
     * Code 128 1D format.
     * Max 18 ASCII characters only and no links
     *
     * Generated from protobuf enum <code>CODE128 = 5;</code>
     */
    const CODE128 = 5;
    /**
     * Data Matrix 2D barcode format.
     * Max 525 ISO-8859-1 characters only and no links
     *
     * Generated from protobuf enum <code>DATA_MATRIX = 6;</code>
     */
    const DATA_MATRIX = 6;
    /**
     * EAN-8 1D format.
     * The barcode value should be 7 digits (the check digit will be computed
     * automatically) or 8 digits (if you are providing your own check digit).
     *
     * Generated from protobuf enum <code>EAN8 = 7;</code>
     */
    const EAN8 = 7;
    /**
     * EAN-13 1D format.
     * The barcode value should be 12 digits (the check digit will be computed
     * automatically) or 13 digits (if you are providing your own check digit).
     *
     * Generated from protobuf enum <code>EAN13 = 8;</code>
     */
    const EAN13 = 8;
    /**
     * ITF (Interleaved Two of Five) 1D format.
     * Must be 14 digits long
     *
     * Generated from protobuf enum <code>ITF = 9;</code>
     */
    const ITF = 9;
    /**
     * PDF417 format.
     * Max 140 characters and no links
     *
     * Generated from protobuf enum <code>PDF417 = 10;</code>
     */
    const PDF417 = 10;
    /**
     * UPC-A 1D format.
     * The barcode value should be 11 digits (the check digit will be computed
     * automatically) or 12 digits (if you are providing your own check digit).
     *
     * Generated from protobuf enum <code>UPC_A = 11;</code>
     */
    const UPC_A = 11;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::AZTEC => 'AZTEC',
        self::CODABAR => 'CODABAR',
        self::CODE39 => 'CODE39',
        self::CODE128 => 'CODE128',
        self::DATA_MATRIX => 'DATA_MATRIX',
        self::EAN8 => 'EAN8',
        self::EAN13 => 'EAN13',
        self::ITF => 'ITF',
        self::PDF417 => 'PDF417',
        self::UPC_A => 'UPC_A',
    ];

    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(PromotionBarcodeType::class, \Google\Ads\GoogleAds\V22\Enums\PromotionBarcodeTypeEnum_PromotionBarcodeType::class);

