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

namespace Google\Cloud\Functions\V1\CloudFunction;

use UnexpectedValueException;

/**
 * Docker Registry to use for storing function Docker images.
 *
 * Protobuf type <code>google.cloud.functions.v1.CloudFunction.DockerRegistry</code>
 */
class DockerRegistry
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>DOCKER_REGISTRY_UNSPECIFIED = 0;</code>
     */
    const DOCKER_REGISTRY_UNSPECIFIED = 0;
    /**
     * Docker images will be stored in multi-regional Container Registry
     * repositories named `gcf`.
     *
     * Generated from protobuf enum <code>CONTAINER_REGISTRY = 1;</code>
     */
    const CONTAINER_REGISTRY = 1;
    /**
     * Docker images will be stored in regional Artifact Registry repositories.
     * By default, GCF will create and use repositories named `gcf-artifacts`
     * in every region in which a function is deployed. But the repository to
     * use can also be specified by the user using the `docker_repository`
     * field.
     *
     * Generated from protobuf enum <code>ARTIFACT_REGISTRY = 2;</code>
     */
    const ARTIFACT_REGISTRY = 2;

    private static $valueToName = [
        self::DOCKER_REGISTRY_UNSPECIFIED => 'DOCKER_REGISTRY_UNSPECIFIED',
        self::CONTAINER_REGISTRY => 'CONTAINER_REGISTRY',
        self::ARTIFACT_REGISTRY => 'ARTIFACT_REGISTRY',
    ];

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


