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

namespace Google\Apps\Chat\V1\Space;

use UnexpectedValueException;

/**
 * Predefined permission settings that you can only specify when creating a
 * named space. More settings might be added in the future.
 * For details about permission settings for named spaces, see [Learn about
 * spaces](https://support.google.com/chat/answer/7659784).
 *
 * Protobuf type <code>google.chat.v1.Space.PredefinedPermissionSettings</code>
 */
class PredefinedPermissionSettings
{
    /**
     * Unspecified. Don't use.
     *
     * Generated from protobuf enum <code>PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED = 0;</code>
     */
    const PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED = 0;
    /**
     * Setting to make the space a collaboration space where all members can
     * post messages.
     *
     * Generated from protobuf enum <code>COLLABORATION_SPACE = 1;</code>
     */
    const COLLABORATION_SPACE = 1;
    /**
     * Setting to make the space an announcement space where only space managers
     * can post messages.
     *
     * Generated from protobuf enum <code>ANNOUNCEMENT_SPACE = 2;</code>
     */
    const ANNOUNCEMENT_SPACE = 2;

    private static $valueToName = [
        self::PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED => 'PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED',
        self::COLLABORATION_SPACE => 'COLLABORATION_SPACE',
        self::ANNOUNCEMENT_SPACE => 'ANNOUNCEMENT_SPACE',
    ];

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


