<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/type/types.proto

namespace Google\Shopping\Type\Destination;

use UnexpectedValueException;

/**
 * Destination values.
 *
 * Protobuf type <code>google.shopping.type.Destination.DestinationEnum</code>
 */
class DestinationEnum
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>DESTINATION_ENUM_UNSPECIFIED = 0;</code>
     */
    const DESTINATION_ENUM_UNSPECIFIED = 0;
    /**
     * [Shopping ads](https://support.google.com/google-ads/answer/2454022).
     *
     * Generated from protobuf enum <code>SHOPPING_ADS = 1;</code>
     */
    const SHOPPING_ADS = 1;
    /**
     * [Display ads](https://support.google.com/merchants/answer/6069387).
     *
     * Generated from protobuf enum <code>DISPLAY_ADS = 2;</code>
     */
    const DISPLAY_ADS = 2;
    /**
     * [Local inventory
     * ads](https://support.google.com/merchants/answer/3057972).
     *
     * Generated from protobuf enum <code>LOCAL_INVENTORY_ADS = 3;</code>
     */
    const LOCAL_INVENTORY_ADS = 3;
    /**
     * [Free listings](https://support.google.com/merchants/answer/9199328).
     *
     * Generated from protobuf enum <code>FREE_LISTINGS = 4;</code>
     */
    const FREE_LISTINGS = 4;
    /**
     * [Free local product
     * listings](https://support.google.com/merchants/answer/9825611).
     *
     * Generated from protobuf enum <code>FREE_LOCAL_LISTINGS = 5;</code>
     */
    const FREE_LOCAL_LISTINGS = 5;
    /**
     * [YouTube Shopping](https://support.google.com/merchants/answer/12362804).
     *
     * Generated from protobuf enum <code>YOUTUBE_SHOPPING = 6;</code>
     */
    const YOUTUBE_SHOPPING = 6;

    private static $valueToName = [
        self::DESTINATION_ENUM_UNSPECIFIED => 'DESTINATION_ENUM_UNSPECIFIED',
        self::SHOPPING_ADS => 'SHOPPING_ADS',
        self::DISPLAY_ADS => 'DISPLAY_ADS',
        self::LOCAL_INVENTORY_ADS => 'LOCAL_INVENTORY_ADS',
        self::FREE_LISTINGS => 'FREE_LISTINGS',
        self::FREE_LOCAL_LISTINGS => 'FREE_LOCAL_LISTINGS',
        self::YOUTUBE_SHOPPING => 'YOUTUBE_SHOPPING',
    ];

    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(DestinationEnum::class, \Google\Shopping\Type\Destination_DestinationEnum::class);

