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

namespace Google\Cloud\StorageTransfer\V1\MetadataOptions;

use UnexpectedValueException;

/**
 * Options for handling Cloud Storage object ACLs.
 *
 * Protobuf type <code>google.storagetransfer.v1.MetadataOptions.Acl</code>
 */
class Acl
{
    /**
     * ACL behavior is unspecified.
     *
     * Generated from protobuf enum <code>ACL_UNSPECIFIED = 0;</code>
     */
    const ACL_UNSPECIFIED = 0;
    /**
     * Use the destination bucket's default object ACLS, if applicable.
     *
     * Generated from protobuf enum <code>ACL_DESTINATION_BUCKET_DEFAULT = 1;</code>
     */
    const ACL_DESTINATION_BUCKET_DEFAULT = 1;
    /**
     * Preserve the object's original ACLs. This requires the service account
     * to have `storage.objects.getIamPolicy` permission for the source object.
     * [Uniform bucket-level
     * access](https://cloud.google.com/storage/docs/uniform-bucket-level-access)
     * must not be enabled on either the source or destination buckets.
     *
     * Generated from protobuf enum <code>ACL_PRESERVE = 2;</code>
     */
    const ACL_PRESERVE = 2;

    private static $valueToName = [
        self::ACL_UNSPECIFIED => 'ACL_UNSPECIFIED',
        self::ACL_DESTINATION_BUCKET_DEFAULT => 'ACL_DESTINATION_BUCKET_DEFAULT',
        self::ACL_PRESERVE => 'ACL_PRESERVE',
    ];

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


