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

namespace Google\Cloud\Container\V1\ContainerdConfig\RegistryHostConfig;

use UnexpectedValueException;

/**
 * HostCapability configures capabilities for the registry host.
 *
 * Protobuf type <code>google.container.v1.ContainerdConfig.RegistryHostConfig.HostCapability</code>
 */
class HostCapability
{
    /**
     * UNKNOWN should never be set.
     *
     * Generated from protobuf enum <code>HOST_CAPABILITY_UNSPECIFIED = 0;</code>
     */
    const HOST_CAPABILITY_UNSPECIFIED = 0;
    /**
     * Pull represents the capability to fetch manifests and blobs by digest.
     *
     * Generated from protobuf enum <code>HOST_CAPABILITY_PULL = 1;</code>
     */
    const HOST_CAPABILITY_PULL = 1;
    /**
     * Resolve represents the capability to fetch manifests by name.
     *
     * Generated from protobuf enum <code>HOST_CAPABILITY_RESOLVE = 2;</code>
     */
    const HOST_CAPABILITY_RESOLVE = 2;
    /**
     * Push represents the capability to push blobs and manifests.
     *
     * Generated from protobuf enum <code>HOST_CAPABILITY_PUSH = 3;</code>
     */
    const HOST_CAPABILITY_PUSH = 3;

    private static $valueToName = [
        self::HOST_CAPABILITY_UNSPECIFIED => 'HOST_CAPABILITY_UNSPECIFIED',
        self::HOST_CAPABILITY_PULL => 'HOST_CAPABILITY_PULL',
        self::HOST_CAPABILITY_RESOLVE => 'HOST_CAPABILITY_RESOLVE',
        self::HOST_CAPABILITY_PUSH => 'HOST_CAPABILITY_PUSH',
    ];

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


