<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/redis/v1beta1/cloud_redis.proto

namespace Google\Cloud\Redis\V1beta1;

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

/**
 * Configuration of the persistence functionality.
 *
 * Generated from protobuf message <code>google.cloud.redis.v1beta1.PersistenceConfig</code>
 */
class PersistenceConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Controls whether Persistence features are enabled.
     * If not provided, the existing value will be used.
     *
     * Generated from protobuf field <code>.google.cloud.redis.v1beta1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $persistence_mode = 0;
    /**
     * Optional. Period between RDB snapshots. Snapshots will be attempted every period
     * starting from the provided snapshot start time. For example, a start time
     * of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing until
     * 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, 18:45,
     * and 00:45 the next day, and so on.
     * If not provided, TWENTY_FOUR_HOURS will be used as default.
     *
     * Generated from protobuf field <code>.google.cloud.redis.v1beta1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $rdb_snapshot_period = 0;
    /**
     * Output only. The next time that a snapshot attempt is scheduled to occur.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $rdb_next_snapshot_time = null;
    /**
     * Optional. Date and time that the first snapshot was/will be attempted, and to which
     * future snapshots will be aligned.
     * If not provided, the current time will be used.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $rdb_snapshot_start_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $persistence_mode
     *           Optional. Controls whether Persistence features are enabled.
     *           If not provided, the existing value will be used.
     *     @type int $rdb_snapshot_period
     *           Optional. Period between RDB snapshots. Snapshots will be attempted every period
     *           starting from the provided snapshot start time. For example, a start time
     *           of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing until
     *           01/01/2033, and then trigger snapshots every day at 06:45, 12:45, 18:45,
     *           and 00:45 the next day, and so on.
     *           If not provided, TWENTY_FOUR_HOURS will be used as default.
     *     @type \Google\Protobuf\Timestamp $rdb_next_snapshot_time
     *           Output only. The next time that a snapshot attempt is scheduled to occur.
     *     @type \Google\Protobuf\Timestamp $rdb_snapshot_start_time
     *           Optional. Date and time that the first snapshot was/will be attempted, and to which
     *           future snapshots will be aligned.
     *           If not provided, the current time will be used.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Redis\V1Beta1\CloudRedis::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Controls whether Persistence features are enabled.
     * If not provided, the existing value will be used.
     *
     * Generated from protobuf field <code>.google.cloud.redis.v1beta1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getPersistenceMode()
    {
        return $this->persistence_mode;
    }

    /**
     * Optional. Controls whether Persistence features are enabled.
     * If not provided, the existing value will be used.
     *
     * Generated from protobuf field <code>.google.cloud.redis.v1beta1.PersistenceConfig.PersistenceMode persistence_mode = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setPersistenceMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1beta1\PersistenceConfig\PersistenceMode::class);
        $this->persistence_mode = $var;

        return $this;
    }

    /**
     * Optional. Period between RDB snapshots. Snapshots will be attempted every period
     * starting from the provided snapshot start time. For example, a start time
     * of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing until
     * 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, 18:45,
     * and 00:45 the next day, and so on.
     * If not provided, TWENTY_FOUR_HOURS will be used as default.
     *
     * Generated from protobuf field <code>.google.cloud.redis.v1beta1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getRdbSnapshotPeriod()
    {
        return $this->rdb_snapshot_period;
    }

    /**
     * Optional. Period between RDB snapshots. Snapshots will be attempted every period
     * starting from the provided snapshot start time. For example, a start time
     * of 01/01/2033 06:45 and SIX_HOURS snapshot period will do nothing until
     * 01/01/2033, and then trigger snapshots every day at 06:45, 12:45, 18:45,
     * and 00:45 the next day, and so on.
     * If not provided, TWENTY_FOUR_HOURS will be used as default.
     *
     * Generated from protobuf field <code>.google.cloud.redis.v1beta1.PersistenceConfig.SnapshotPeriod rdb_snapshot_period = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setRdbSnapshotPeriod($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Redis\V1beta1\PersistenceConfig\SnapshotPeriod::class);
        $this->rdb_snapshot_period = $var;

        return $this;
    }

    /**
     * Output only. The next time that a snapshot attempt is scheduled to occur.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRdbNextSnapshotTime()
    {
        return $this->rdb_next_snapshot_time;
    }

    public function hasRdbNextSnapshotTime()
    {
        return isset($this->rdb_next_snapshot_time);
    }

    public function clearRdbNextSnapshotTime()
    {
        unset($this->rdb_next_snapshot_time);
    }

    /**
     * Output only. The next time that a snapshot attempt is scheduled to occur.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp rdb_next_snapshot_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRdbNextSnapshotTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->rdb_next_snapshot_time = $var;

        return $this;
    }

    /**
     * Optional. Date and time that the first snapshot was/will be attempted, and to which
     * future snapshots will be aligned.
     * If not provided, the current time will be used.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getRdbSnapshotStartTime()
    {
        return $this->rdb_snapshot_start_time;
    }

    public function hasRdbSnapshotStartTime()
    {
        return isset($this->rdb_snapshot_start_time);
    }

    public function clearRdbSnapshotStartTime()
    {
        unset($this->rdb_snapshot_start_time);
    }

    /**
     * Optional. Date and time that the first snapshot was/will be attempted, and to which
     * future snapshots will be aligned.
     * If not provided, the current time will be used.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp rdb_snapshot_start_time = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setRdbSnapshotStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->rdb_snapshot_start_time = $var;

        return $this;
    }

}

