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

namespace Google\Cloud\Sql\V1;

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

/**
 * Backup Reencryption Config
 *
 * Generated from protobuf message <code>google.cloud.sql.v1.BackupReencryptionConfig</code>
 */
class BackupReencryptionConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Backup re-encryption limit
     *
     * Generated from protobuf field <code>optional int32 backup_limit = 1;</code>
     */
    private $backup_limit = null;
    /**
     * Type of backups users want to re-encrypt.
     *
     * Generated from protobuf field <code>optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2;</code>
     */
    private $backup_type = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $backup_limit
     *           Backup re-encryption limit
     *     @type int $backup_type
     *           Type of backups users want to re-encrypt.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Sql\V1\CloudSqlInstances::initOnce();
        parent::__construct($data);
    }

    /**
     * Backup re-encryption limit
     *
     * Generated from protobuf field <code>optional int32 backup_limit = 1;</code>
     * @return int
     */
    public function getBackupLimit()
    {
        return isset($this->backup_limit) ? $this->backup_limit : 0;
    }

    public function hasBackupLimit()
    {
        return isset($this->backup_limit);
    }

    public function clearBackupLimit()
    {
        unset($this->backup_limit);
    }

    /**
     * Backup re-encryption limit
     *
     * Generated from protobuf field <code>optional int32 backup_limit = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setBackupLimit($var)
    {
        GPBUtil::checkInt32($var);
        $this->backup_limit = $var;

        return $this;
    }

    /**
     * Type of backups users want to re-encrypt.
     *
     * Generated from protobuf field <code>optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2;</code>
     * @return int
     */
    public function getBackupType()
    {
        return isset($this->backup_type) ? $this->backup_type : 0;
    }

    public function hasBackupType()
    {
        return isset($this->backup_type);
    }

    public function clearBackupType()
    {
        unset($this->backup_type);
    }

    /**
     * Type of backups users want to re-encrypt.
     *
     * Generated from protobuf field <code>optional .google.cloud.sql.v1.BackupReencryptionConfig.BackupType backup_type = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setBackupType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1\BackupReencryptionConfig\BackupType::class);
        $this->backup_type = $var;

        return $this;
    }

}

