<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1alpha/resources.proto

namespace Google\Analytics\Admin\V1alpha\SubpropertySyncConfig;

use UnexpectedValueException;

/**
 * Synchronization modes for a Subproperty
 *
 * Protobuf type <code>google.analytics.admin.v1alpha.SubpropertySyncConfig.SynchronizationMode</code>
 */
class SynchronizationMode
{
    /**
     * Synchronization mode unknown or not specified.
     *
     * Generated from protobuf enum <code>SYNCHRONIZATION_MODE_UNSPECIFIED = 0;</code>
     */
    const SYNCHRONIZATION_MODE_UNSPECIFIED = 0;
    /**
     * Entities are not synchronized.
     * Local edits are allowed on the Subproperty.
     *
     * Generated from protobuf enum <code>NONE = 1;</code>
     */
    const NONE = 1;
    /**
     * Entities are synchronized from Parent Property.
     * Local mutations are not allowed on the Subproperty (Create / Update /
     * Delete)
     *
     * Generated from protobuf enum <code>ALL = 2;</code>
     */
    const ALL = 2;

    private static $valueToName = [
        self::SYNCHRONIZATION_MODE_UNSPECIFIED => 'SYNCHRONIZATION_MODE_UNSPECIFIED',
        self::NONE => 'NONE',
        self::ALL => 'ALL',
    ];

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


