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

namespace Google\Cloud\PolicySimulator\V1;

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

/**
 * A resource describing a `Replay`, or simulation.
 *
 * Generated from protobuf message <code>google.cloud.policysimulator.v1.Replay</code>
 */
class Replay extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The resource name of the `Replay`, which has the following
     * format:
     * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`,
     * where `{resource-id}` is the ID of the project, folder, or organization
     * that owns the Replay.
     * Example:
     * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $name = '';
    /**
     * Output only. The current state of the `Replay`.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = 0;
    /**
     * Required. The configuration used for the `Replay`.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $config = null;
    /**
     * Output only. Summary statistics about the replayed log entries.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $results_summary = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The resource name of the `Replay`, which has the following
     *           format:
     *           `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`,
     *           where `{resource-id}` is the ID of the project, folder, or organization
     *           that owns the Replay.
     *           Example:
     *           `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36`
     *     @type int $state
     *           Output only. The current state of the `Replay`.
     *     @type \Google\Cloud\PolicySimulator\V1\ReplayConfig $config
     *           Required. The configuration used for the `Replay`.
     *     @type \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary $results_summary
     *           Output only. Summary statistics about the replayed log entries.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Policysimulator\V1\Simulator::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The resource name of the `Replay`, which has the following
     * format:
     * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`,
     * where `{resource-id}` is the ID of the project, folder, or organization
     * that owns the Replay.
     * Example:
     * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The resource name of the `Replay`, which has the following
     * format:
     * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`,
     * where `{resource-id}` is the ID of the project, folder, or organization
     * that owns the Replay.
     * Example:
     * `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The current state of the `Replay`.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. The current state of the `Replay`.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.Replay.State state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\PolicySimulator\V1\Replay\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Required. The configuration used for the `Replay`.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\PolicySimulator\V1\ReplayConfig|null
     */
    public function getConfig()
    {
        return $this->config;
    }

    public function hasConfig()
    {
        return isset($this->config);
    }

    public function clearConfig()
    {
        unset($this->config);
    }

    /**
     * Required. The configuration used for the `Replay`.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.ReplayConfig config = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\PolicySimulator\V1\ReplayConfig $var
     * @return $this
     */
    public function setConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\ReplayConfig::class);
        $this->config = $var;

        return $this;
    }

    /**
     * Output only. Summary statistics about the replayed log entries.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary|null
     */
    public function getResultsSummary()
    {
        return $this->results_summary;
    }

    public function hasResultsSummary()
    {
        return isset($this->results_summary);
    }

    public function clearResultsSummary()
    {
        unset($this->results_summary);
    }

    /**
     * Output only. Summary statistics about the replayed log entries.
     *
     * Generated from protobuf field <code>.google.cloud.policysimulator.v1.Replay.ResultsSummary results_summary = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary $var
     * @return $this
     */
    public function setResultsSummary($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\PolicySimulator\V1\Replay\ResultsSummary::class);
        $this->results_summary = $var;

        return $this;
    }

}

