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

namespace Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig\BigQueryDestination;

use UnexpectedValueException;

/**
 * This enum determines the partition key column for the bigquery tables.
 * Partitioning can improve query performance and reduce query cost by
 * filtering partitions. Refer to
 * https://cloud.google.com/bigquery/docs/partitioned-tables for details.
 *
 * Protobuf type <code>google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey</code>
 */
class PartitionKey
{
    /**
     * Unspecified partition key. Tables won't be partitioned using this
     * option.
     *
     * Generated from protobuf enum <code>PARTITION_KEY_UNSPECIFIED = 0;</code>
     */
    const PARTITION_KEY_UNSPECIFIED = 0;
    /**
     * The time when the request is received. If specified as partition key,
     * the result table(s) is partitoned by the RequestTime column, an
     * additional timestamp column representing when the request was received.
     *
     * Generated from protobuf enum <code>REQUEST_TIME = 1;</code>
     */
    const REQUEST_TIME = 1;

    private static $valueToName = [
        self::PARTITION_KEY_UNSPECIFIED => 'PARTITION_KEY_UNSPECIFIED',
        self::REQUEST_TIME => 'REQUEST_TIME',
    ];

    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(PartitionKey::class, \Google\Cloud\Asset\V1\IamPolicyAnalysisOutputConfig_BigQueryDestination_PartitionKey::class);

