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

namespace Google\Cloud\ContactCenterInsights\V1\ExportInsightsDataRequest;

use UnexpectedValueException;

/**
 * Specifies the action that occurs if the destination table already exists.
 *
 * Protobuf type <code>google.cloud.contactcenterinsights.v1.ExportInsightsDataRequest.WriteDisposition</code>
 */
class WriteDisposition
{
    /**
     * Write disposition is not specified. Defaults to WRITE_TRUNCATE.
     *
     * Generated from protobuf enum <code>WRITE_DISPOSITION_UNSPECIFIED = 0;</code>
     */
    const WRITE_DISPOSITION_UNSPECIFIED = 0;
    /**
     * If the table already exists, BigQuery will overwrite the table data and
     * use the schema from the load.
     *
     * Generated from protobuf enum <code>WRITE_TRUNCATE = 1;</code>
     */
    const WRITE_TRUNCATE = 1;
    /**
     * If the table already exists, BigQuery will append data to the table.
     *
     * Generated from protobuf enum <code>WRITE_APPEND = 2;</code>
     */
    const WRITE_APPEND = 2;

    private static $valueToName = [
        self::WRITE_DISPOSITION_UNSPECIFIED => 'WRITE_DISPOSITION_UNSPECIFIED',
        self::WRITE_TRUNCATE => 'WRITE_TRUNCATE',
        self::WRITE_APPEND => 'WRITE_APPEND',
    ];

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


