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

namespace Google\Cloud\ContactCenterInsights\V1;

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

/**
 * The result of an analysis.
 *
 * Generated from protobuf message <code>google.cloud.contactcenterinsights.v1.AnalysisResult</code>
 */
class AnalysisResult extends \Google\Protobuf\Internal\Message
{
    /**
     * The time at which the analysis ended.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 1;</code>
     */
    private $end_time = null;
    protected $metadata;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ContactCenterInsights\V1\AnalysisResult\CallAnalysisMetadata $call_analysis_metadata
     *           Call-specific metadata created by the analysis.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           The time at which the analysis ended.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Call-specific metadata created by the analysis.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.AnalysisResult.CallAnalysisMetadata call_analysis_metadata = 2;</code>
     * @return \Google\Cloud\ContactCenterInsights\V1\AnalysisResult\CallAnalysisMetadata|null
     */
    public function getCallAnalysisMetadata()
    {
        return $this->readOneof(2);
    }

    public function hasCallAnalysisMetadata()
    {
        return $this->hasOneof(2);
    }

    /**
     * Call-specific metadata created by the analysis.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.AnalysisResult.CallAnalysisMetadata call_analysis_metadata = 2;</code>
     * @param \Google\Cloud\ContactCenterInsights\V1\AnalysisResult\CallAnalysisMetadata $var
     * @return $this
     */
    public function setCallAnalysisMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\AnalysisResult\CallAnalysisMetadata::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The time at which the analysis ended.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 1;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * The time at which the analysis ended.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

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

}

