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

namespace Google\Cloud\Dataplex\V1\Action\InvalidDataPartition;

use UnexpectedValueException;

/**
 * The expected partition structure.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.Action.InvalidDataPartition.PartitionStructure</code>
 */
class PartitionStructure
{
    /**
     * PartitionStructure unspecified.
     *
     * Generated from protobuf enum <code>PARTITION_STRUCTURE_UNSPECIFIED = 0;</code>
     */
    const PARTITION_STRUCTURE_UNSPECIFIED = 0;
    /**
     * Consistent hive-style partition definition (both raw and curated zone).
     *
     * Generated from protobuf enum <code>CONSISTENT_KEYS = 1;</code>
     */
    const CONSISTENT_KEYS = 1;
    /**
     * Hive style partition definition (curated zone only).
     *
     * Generated from protobuf enum <code>HIVE_STYLE_KEYS = 2;</code>
     */
    const HIVE_STYLE_KEYS = 2;

    private static $valueToName = [
        self::PARTITION_STRUCTURE_UNSPECIFIED => 'PARTITION_STRUCTURE_UNSPECIFIED',
        self::CONSISTENT_KEYS => 'CONSISTENT_KEYS',
        self::HIVE_STYLE_KEYS => 'HIVE_STYLE_KEYS',
    ];

    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);
    }
}


