<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto

namespace Google\Cloud\BigQuery\DataTransfer\V1\DataSource;

use UnexpectedValueException;

/**
 * Represents how the data source supports data auto refresh.
 *
 * Protobuf type <code>google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType</code>
 */
class DataRefreshType
{
    /**
     * The data source won't support data auto refresh, which is default value.
     *
     * Generated from protobuf enum <code>DATA_REFRESH_TYPE_UNSPECIFIED = 0;</code>
     */
    const DATA_REFRESH_TYPE_UNSPECIFIED = 0;
    /**
     * The data source supports data auto refresh, and runs will be scheduled
     * for the past few days. Does not allow custom values to be set for each
     * transfer config.
     *
     * Generated from protobuf enum <code>SLIDING_WINDOW = 1;</code>
     */
    const SLIDING_WINDOW = 1;
    /**
     * The data source supports data auto refresh, and runs will be scheduled
     * for the past few days. Allows custom values to be set for each transfer
     * config.
     *
     * Generated from protobuf enum <code>CUSTOM_SLIDING_WINDOW = 2;</code>
     */
    const CUSTOM_SLIDING_WINDOW = 2;

    private static $valueToName = [
        self::DATA_REFRESH_TYPE_UNSPECIFIED => 'DATA_REFRESH_TYPE_UNSPECIFIED',
        self::SLIDING_WINDOW => 'SLIDING_WINDOW',
        self::CUSTOM_SLIDING_WINDOW => 'CUSTOM_SLIDING_WINDOW',
    ];

    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(DataRefreshType::class, \Google\Cloud\BigQuery\DataTransfer\V1\DataSource_DataRefreshType::class);

