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

namespace Google\Cloud\StorageTransfer\V1\NotificationConfig;

use UnexpectedValueException;

/**
 * Enum for specifying event types for which notifications are to be
 * published.
 * Additional event types may be added in the future. Clients should either
 * safely ignore unrecognized event types or explicitly specify which event
 * types they are prepared to accept.
 *
 * Protobuf type <code>google.storagetransfer.v1.NotificationConfig.EventType</code>
 */
class EventType
{
    /**
     * Illegal value, to avoid allowing a default.
     *
     * Generated from protobuf enum <code>EVENT_TYPE_UNSPECIFIED = 0;</code>
     */
    const EVENT_TYPE_UNSPECIFIED = 0;
    /**
     * `TransferOperation` completed with status
     * [SUCCESS][google.storagetransfer.v1.TransferOperation.Status.SUCCESS].
     *
     * Generated from protobuf enum <code>TRANSFER_OPERATION_SUCCESS = 1;</code>
     */
    const TRANSFER_OPERATION_SUCCESS = 1;
    /**
     * `TransferOperation` completed with status
     * [FAILED][google.storagetransfer.v1.TransferOperation.Status.FAILED].
     *
     * Generated from protobuf enum <code>TRANSFER_OPERATION_FAILED = 2;</code>
     */
    const TRANSFER_OPERATION_FAILED = 2;
    /**
     * `TransferOperation` completed with status
     * [ABORTED][google.storagetransfer.v1.TransferOperation.Status.ABORTED].
     *
     * Generated from protobuf enum <code>TRANSFER_OPERATION_ABORTED = 3;</code>
     */
    const TRANSFER_OPERATION_ABORTED = 3;

    private static $valueToName = [
        self::EVENT_TYPE_UNSPECIFIED => 'EVENT_TYPE_UNSPECIFIED',
        self::TRANSFER_OPERATION_SUCCESS => 'TRANSFER_OPERATION_SUCCESS',
        self::TRANSFER_OPERATION_FAILED => 'TRANSFER_OPERATION_FAILED',
        self::TRANSFER_OPERATION_ABORTED => 'TRANSFER_OPERATION_ABORTED',
    ];

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


