<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Container structure for the content to inspect.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.ContentItem</code>
 */
class ContentItem extends \Google\Protobuf\Internal\Message
{
    protected $data_item;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $value
     *           String data to inspect or redact.
     *     @type \Google\Cloud\Dlp\V2\Table $table
     *           Structured content for inspection. See
     *           https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
     *           learn more.
     *     @type \Google\Cloud\Dlp\V2\ByteContentItem $byte_item
     *           Content data to inspect or redact. Replaces `type` and `data`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * String data to inspect or redact.
     *
     * Generated from protobuf field <code>string value = 3;</code>
     * @return string
     */
    public function getValue()
    {
        return $this->readOneof(3);
    }

    /**
     * String data to inspect or redact.
     *
     * Generated from protobuf field <code>string value = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Structured content for inspection. See
     * https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
     * learn more.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Table table = 4;</code>
     * @return \Google\Cloud\Dlp\V2\Table
     */
    public function getTable()
    {
        return $this->readOneof(4);
    }

    /**
     * Structured content for inspection. See
     * https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
     * learn more.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Table table = 4;</code>
     * @param \Google\Cloud\Dlp\V2\Table $var
     * @return $this
     */
    public function setTable($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Table::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Content data to inspect or redact. Replaces `type` and `data`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ByteContentItem byte_item = 5;</code>
     * @return \Google\Cloud\Dlp\V2\ByteContentItem
     */
    public function getByteItem()
    {
        return $this->readOneof(5);
    }

    /**
     * Content data to inspect or redact. Replaces `type` and `data`.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.ByteContentItem byte_item = 5;</code>
     * @param \Google\Cloud\Dlp\V2\ByteContentItem $var
     * @return $this
     */
    public function setByteItem($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\ByteContentItem::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getDataItem()
    {
        return $this->whichOneof("data_item");
    }

}

