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

namespace Google\Cloud\Batch\V1\LogsPolicy;

use UnexpectedValueException;

/**
 * The destination (if any) for logs.
 *
 * Protobuf type <code>google.cloud.batch.v1.LogsPolicy.Destination</code>
 */
class Destination
{
    /**
     * (Default) Logs are not preserved.
     *
     * Generated from protobuf enum <code>DESTINATION_UNSPECIFIED = 0;</code>
     */
    const DESTINATION_UNSPECIFIED = 0;
    /**
     * Logs are streamed to Cloud Logging. Optionally, you can configure
     * additional settings in the `cloudLoggingOption` field.
     *
     * Generated from protobuf enum <code>CLOUD_LOGGING = 1;</code>
     */
    const CLOUD_LOGGING = 1;
    /**
     * Logs are saved to the file path specified in the `logsPath` field.
     *
     * Generated from protobuf enum <code>PATH = 2;</code>
     */
    const PATH = 2;

    private static $valueToName = [
        self::DESTINATION_UNSPECIFIED => 'DESTINATION_UNSPECIFIED',
        self::CLOUD_LOGGING => 'CLOUD_LOGGING',
        self::PATH => 'PATH',
    ];

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


