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

namespace Google\Cloud\OsConfig\V1\OSPolicy\Resource\RepositoryResource\AptRepository;

use UnexpectedValueException;

/**
 * Type of archive.
 *
 * Protobuf type <code>google.cloud.osconfig.v1.OSPolicy.Resource.RepositoryResource.AptRepository.ArchiveType</code>
 */
class ArchiveType
{
    /**
     * Unspecified is invalid.
     *
     * Generated from protobuf enum <code>ARCHIVE_TYPE_UNSPECIFIED = 0;</code>
     */
    const ARCHIVE_TYPE_UNSPECIFIED = 0;
    /**
     * Deb indicates that the archive contains binary files.
     *
     * Generated from protobuf enum <code>DEB = 1;</code>
     */
    const DEB = 1;
    /**
     * Deb-src indicates that the archive contains source files.
     *
     * Generated from protobuf enum <code>DEB_SRC = 2;</code>
     */
    const DEB_SRC = 2;

    private static $valueToName = [
        self::ARCHIVE_TYPE_UNSPECIFIED => 'ARCHIVE_TYPE_UNSPECIFIED',
        self::DEB => 'DEB',
        self::DEB_SRC => 'DEB_SRC',
    ];

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


