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

namespace Google\Cloud\StorageTransfer\V1\S3CompatibleMetadata;

use UnexpectedValueException;

/**
 * The Listing API to use for discovering objects.
 *
 * Protobuf type <code>google.storagetransfer.v1.S3CompatibleMetadata.ListApi</code>
 */
class ListApi
{
    /**
     * ListApi is not specified.
     *
     * Generated from protobuf enum <code>LIST_API_UNSPECIFIED = 0;</code>
     */
    const LIST_API_UNSPECIFIED = 0;
    /**
     * Perform listing using ListObjectsV2 API.
     *
     * Generated from protobuf enum <code>LIST_OBJECTS_V2 = 1;</code>
     */
    const LIST_OBJECTS_V2 = 1;
    /**
     * Legacy ListObjects API.
     *
     * Generated from protobuf enum <code>LIST_OBJECTS = 2;</code>
     */
    const LIST_OBJECTS = 2;

    private static $valueToName = [
        self::LIST_API_UNSPECIFIED => 'LIST_API_UNSPECIFIED',
        self::LIST_OBJECTS_V2 => 'LIST_OBJECTS_V2',
        self::LIST_OBJECTS => 'LIST_OBJECTS',
    ];

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


