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

namespace Google\Cloud\AuditManager\V1\AuditReport;

use UnexpectedValueException;

/**
 * The different states of the Audit Manager report generation.
 *
 * Protobuf type <code>google.cloud.auditmanager.v1.AuditReport.ReportGenerationState</code>
 */
class ReportGenerationState
{
    /**
     * Unspecified. Invalid state.
     *
     * Generated from protobuf enum <code>REPORT_GENERATION_STATE_UNSPECIFIED = 0;</code>
     */
    const REPORT_GENERATION_STATE_UNSPECIFIED = 0;
    /**
     * Audit report generation process is in progress, ie. operation state is
     * neither OPERATION_STATE_DONE nor OPERATION_STATE_FAILED.
     *
     * Generated from protobuf enum <code>IN_PROGRESS = 1;</code>
     */
    const IN_PROGRESS = 1;
    /**
     * Audit report generation process is completed. Operation state is
     * OPERATION_STATE_DONE.
     *
     * Generated from protobuf enum <code>COMPLETED = 2;</code>
     */
    const COMPLETED = 2;
    /**
     * Audit report generation process has failed. Operation state is
     * OPERATION_STATE_FAILED.
     *
     * Generated from protobuf enum <code>FAILED = 3;</code>
     */
    const FAILED = 3;
    /**
     * Audit report generation process has completed. But report summary is
     * unknown. This is valid for older reports.
     *
     * Generated from protobuf enum <code>SUMMARY_UNKNOWN = 4;</code>
     */
    const SUMMARY_UNKNOWN = 4;

    private static $valueToName = [
        self::REPORT_GENERATION_STATE_UNSPECIFIED => 'REPORT_GENERATION_STATE_UNSPECIFIED',
        self::IN_PROGRESS => 'IN_PROGRESS',
        self::COMPLETED => 'COMPLETED',
        self::FAILED => 'FAILED',
        self::SUMMARY_UNKNOWN => 'SUMMARY_UNKNOWN',
    ];

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

