<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v20/errors/data_link_error.proto

namespace Google\Ads\GoogleAds\V20\Errors\DataLinkErrorEnum;

use UnexpectedValueException;

/**
 * Enum describing possible DataLink errors.
 *
 * Protobuf type <code>google.ads.googleads.v20.errors.DataLinkErrorEnum.DataLinkError</code>
 */
class DataLinkError
{
    /**
     * Enum unspecified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * The received error code is not known in this version.
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * The requested YouTube Channel ID is invalid.
     *
     * Generated from protobuf enum <code>YOUTUBE_CHANNEL_ID_INVALID = 2;</code>
     */
    const YOUTUBE_CHANNEL_ID_INVALID = 2;
    /**
     * The requested YouTube Video ID is invalid.
     *
     * Generated from protobuf enum <code>YOUTUBE_VIDEO_ID_INVALID = 3;</code>
     */
    const YOUTUBE_VIDEO_ID_INVALID = 3;
    /**
     * The requested YouTube Video ID doesn't belong to the requested YouTube
     * Channel ID.
     *
     * Generated from protobuf enum <code>YOUTUBE_VIDEO_FROM_DIFFERENT_CHANNEL = 4;</code>
     */
    const YOUTUBE_VIDEO_FROM_DIFFERENT_CHANNEL = 4;
    /**
     * A link cannot be created because the customer doesn't have the
     * permission.
     *
     * Generated from protobuf enum <code>PERMISSION_DENIED = 5;</code>
     */
    const PERMISSION_DENIED = 5;
    /**
     * A link can not be removed or updated because the status is invalid.
     *
     * Generated from protobuf enum <code>INVALID_STATUS = 6;</code>
     */
    const INVALID_STATUS = 6;
    /**
     * The input status in the update request is invalid.
     *
     * Generated from protobuf enum <code>INVALID_UPDATE_STATUS = 7;</code>
     */
    const INVALID_UPDATE_STATUS = 7;
    /**
     * The input resource name is invalid.
     *
     * Generated from protobuf enum <code>INVALID_RESOURCE_NAME = 8;</code>
     */
    const INVALID_RESOURCE_NAME = 8;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::YOUTUBE_CHANNEL_ID_INVALID => 'YOUTUBE_CHANNEL_ID_INVALID',
        self::YOUTUBE_VIDEO_ID_INVALID => 'YOUTUBE_VIDEO_ID_INVALID',
        self::YOUTUBE_VIDEO_FROM_DIFFERENT_CHANNEL => 'YOUTUBE_VIDEO_FROM_DIFFERENT_CHANNEL',
        self::PERMISSION_DENIED => 'PERMISSION_DENIED',
        self::INVALID_STATUS => 'INVALID_STATUS',
        self::INVALID_UPDATE_STATUS => 'INVALID_UPDATE_STATUS',
        self::INVALID_RESOURCE_NAME => 'INVALID_RESOURCE_NAME',
    ];

    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(DataLinkError::class, \Google\Ads\GoogleAds\V20\Errors\DataLinkErrorEnum_DataLinkError::class);

