<?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;

/**
 * Specifies the location of the finding.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.Location</code>
 */
class Location extends \Google\Protobuf\Internal\Message
{
    /**
     * Zero-based byte offsets delimiting the finding.
     * These are relative to the finding's containing element.
     * Note that when the content is not textual, this references
     * the UTF-8 encoded textual representation of the content.
     * Omitted if content is an image.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Range byte_range = 1;</code>
     */
    private $byte_range = null;
    /**
     * Unicode character offsets delimiting the finding.
     * These are relative to the finding's containing element.
     * Provided when the content is text.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Range codepoint_range = 2;</code>
     */
    private $codepoint_range = null;
    /**
     * List of nested objects pointing to the precise location of the finding
     * within the file or record.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.ContentLocation content_locations = 7;</code>
     */
    private $content_locations;
    /**
     * Information about the container where this finding occurred, if available.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Container container = 8;</code>
     */
    private $container = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\Range $byte_range
     *           Zero-based byte offsets delimiting the finding.
     *           These are relative to the finding's containing element.
     *           Note that when the content is not textual, this references
     *           the UTF-8 encoded textual representation of the content.
     *           Omitted if content is an image.
     *     @type \Google\Cloud\Dlp\V2\Range $codepoint_range
     *           Unicode character offsets delimiting the finding.
     *           These are relative to the finding's containing element.
     *           Provided when the content is text.
     *     @type array<\Google\Cloud\Dlp\V2\ContentLocation>|\Google\Protobuf\Internal\RepeatedField $content_locations
     *           List of nested objects pointing to the precise location of the finding
     *           within the file or record.
     *     @type \Google\Cloud\Dlp\V2\Container $container
     *           Information about the container where this finding occurred, if available.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Zero-based byte offsets delimiting the finding.
     * These are relative to the finding's containing element.
     * Note that when the content is not textual, this references
     * the UTF-8 encoded textual representation of the content.
     * Omitted if content is an image.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Range byte_range = 1;</code>
     * @return \Google\Cloud\Dlp\V2\Range|null
     */
    public function getByteRange()
    {
        return $this->byte_range;
    }

    public function hasByteRange()
    {
        return isset($this->byte_range);
    }

    public function clearByteRange()
    {
        unset($this->byte_range);
    }

    /**
     * Zero-based byte offsets delimiting the finding.
     * These are relative to the finding's containing element.
     * Note that when the content is not textual, this references
     * the UTF-8 encoded textual representation of the content.
     * Omitted if content is an image.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Range byte_range = 1;</code>
     * @param \Google\Cloud\Dlp\V2\Range $var
     * @return $this
     */
    public function setByteRange($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Range::class);
        $this->byte_range = $var;

        return $this;
    }

    /**
     * Unicode character offsets delimiting the finding.
     * These are relative to the finding's containing element.
     * Provided when the content is text.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Range codepoint_range = 2;</code>
     * @return \Google\Cloud\Dlp\V2\Range|null
     */
    public function getCodepointRange()
    {
        return $this->codepoint_range;
    }

    public function hasCodepointRange()
    {
        return isset($this->codepoint_range);
    }

    public function clearCodepointRange()
    {
        unset($this->codepoint_range);
    }

    /**
     * Unicode character offsets delimiting the finding.
     * These are relative to the finding's containing element.
     * Provided when the content is text.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Range codepoint_range = 2;</code>
     * @param \Google\Cloud\Dlp\V2\Range $var
     * @return $this
     */
    public function setCodepointRange($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Range::class);
        $this->codepoint_range = $var;

        return $this;
    }

    /**
     * List of nested objects pointing to the precise location of the finding
     * within the file or record.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.ContentLocation content_locations = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getContentLocations()
    {
        return $this->content_locations;
    }

    /**
     * List of nested objects pointing to the precise location of the finding
     * within the file or record.
     *
     * Generated from protobuf field <code>repeated .google.privacy.dlp.v2.ContentLocation content_locations = 7;</code>
     * @param array<\Google\Cloud\Dlp\V2\ContentLocation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setContentLocations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dlp\V2\ContentLocation::class);
        $this->content_locations = $arr;

        return $this;
    }

    /**
     * Information about the container where this finding occurred, if available.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Container container = 8;</code>
     * @return \Google\Cloud\Dlp\V2\Container|null
     */
    public function getContainer()
    {
        return $this->container;
    }

    public function hasContainer()
    {
        return isset($this->container);
    }

    public function clearContainer()
    {
        unset($this->container);
    }

    /**
     * Information about the container where this finding occurred, if available.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.Container container = 8;</code>
     * @param \Google\Cloud\Dlp\V2\Container $var
     * @return $this
     */
    public function setContainer($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\Container::class);
        $this->container = $var;

        return $this;
    }

}

