<?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 analysis resource.
 *
 * Generated from protobuf message <code>google.cloud.contactcenterinsights.v1.Analysis</code>
 */
class Analysis extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. The resource name of the analysis.
     * Format:
     * projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    private $name = '';
    /**
     * Output only. The time at which the analysis was requested.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp request_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $request_time = null;
    /**
     * Output only. The time at which the analysis was created, which occurs when the
     * long-running operation completes.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. The result of the analysis, which is populated when the analysis
     * finishes.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.AnalysisResult analysis_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $analysis_result = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Immutable. The resource name of the analysis.
     *           Format:
     *           projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}
     *     @type \Google\Protobuf\Timestamp $request_time
     *           Output only. The time at which the analysis was requested.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time at which the analysis was created, which occurs when the
     *           long-running operation completes.
     *     @type \Google\Cloud\ContactCenterInsights\V1\AnalysisResult $analysis_result
     *           Output only. The result of the analysis, which is populated when the analysis
     *           finishes.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Contactcenterinsights\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. The resource name of the analysis.
     * Format:
     * projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Immutable. The resource name of the analysis.
     * Format:
     * projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The time at which the analysis was requested.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp request_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRequestTime()
    {
        return $this->request_time;
    }

    public function hasRequestTime()
    {
        return isset($this->request_time);
    }

    public function clearRequestTime()
    {
        unset($this->request_time);
    }

    /**
     * Output only. The time at which the analysis was requested.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp request_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRequestTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->request_time = $var;

        return $this;
    }

    /**
     * Output only. The time at which the analysis was created, which occurs when the
     * long-running operation completes.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The time at which the analysis was created, which occurs when the
     * long-running operation completes.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The result of the analysis, which is populated when the analysis
     * finishes.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.AnalysisResult analysis_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\ContactCenterInsights\V1\AnalysisResult|null
     */
    public function getAnalysisResult()
    {
        return $this->analysis_result;
    }

    public function hasAnalysisResult()
    {
        return isset($this->analysis_result);
    }

    public function clearAnalysisResult()
    {
        unset($this->analysis_result);
    }

    /**
     * Output only. The result of the analysis, which is populated when the analysis
     * finishes.
     *
     * Generated from protobuf field <code>.google.cloud.contactcenterinsights.v1.AnalysisResult analysis_result = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\ContactCenterInsights\V1\AnalysisResult $var
     * @return $this
     */
    public function setAnalysisResult($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ContactCenterInsights\V1\AnalysisResult::class);
        $this->analysis_result = $var;

        return $this;
    }

}

