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

namespace Google\Cloud\Chronicle\V1;

use UnexpectedValueException;

/**
 * RuleView indicates the scope of fields to populate when returning the Rule
 * resource.
 *
 * Protobuf type <code>google.cloud.chronicle.v1.RuleView</code>
 */
class RuleView
{
    /**
     * The default/unset value.
     * The API will default to the BASIC view for ListRules/ListRuleRevisions.
     * The API will default to the FULL view for GetRule.
     *
     * Generated from protobuf enum <code>RULE_VIEW_UNSPECIFIED = 0;</code>
     */
    const RULE_VIEW_UNSPECIFIED = 0;
    /**
     * Include basic metadata about the rule, but not the full contents.
     * Returned fields include: revision_id, revision_create_time, display_name,
     * author, severity, type, allowed_run_frequency,
     * near_real_time_live_rule_eligible, etag, and scope.
     * This is the default value for ListRules and ListRuleRevisions.
     *
     * Generated from protobuf enum <code>BASIC = 1;</code>
     */
    const BASIC = 1;
    /**
     * Include all fields.
     * This is the default value for GetRule.
     *
     * Generated from protobuf enum <code>FULL = 2;</code>
     */
    const FULL = 2;
    /**
     * Include basic metadata about the rule's revision only.
     * Returned fields include: revision_id and revision_create_time.
     *
     * Generated from protobuf enum <code>REVISION_METADATA_ONLY = 3;</code>
     */
    const REVISION_METADATA_ONLY = 3;

    private static $valueToName = [
        self::RULE_VIEW_UNSPECIFIED => 'RULE_VIEW_UNSPECIFIED',
        self::BASIC => 'BASIC',
        self::FULL => 'FULL',
        self::REVISION_METADATA_ONLY => 'REVISION_METADATA_ONLY',
    ];

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

