<?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 the format of a notification message's payload.
 *
 * Protobuf type <code>google.storagetransfer.v1.NotificationConfig.PayloadFormat</code>
 */
class PayloadFormat
{
    /**
     * Illegal value, to avoid allowing a default.
     *
     * Generated from protobuf enum <code>PAYLOAD_FORMAT_UNSPECIFIED = 0;</code>
     */
    const PAYLOAD_FORMAT_UNSPECIFIED = 0;
    /**
     * No payload is included with the notification.
     *
     * Generated from protobuf enum <code>NONE = 1;</code>
     */
    const NONE = 1;
    /**
     * `TransferOperation` is [formatted as a JSON
     * response](https://developers.google.com/protocol-buffers/docs/proto3#json),
     * in application/json.
     *
     * Generated from protobuf enum <code>JSON = 2;</code>
     */
    const JSON = 2;

    private static $valueToName = [
        self::PAYLOAD_FORMAT_UNSPECIFIED => 'PAYLOAD_FORMAT_UNSPECIFIED',
        self::NONE => 'NONE',
        self::JSON => 'JSON',
    ];

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


