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

namespace Google\Cloud\Sql\V1beta4;

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

/**
 * SQL Server specific audit configuration.
 *
 * Generated from protobuf message <code>google.cloud.sql.v1beta4.SqlServerAuditConfig</code>
 */
class SqlServerAuditConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * This is always sql#sqlServerAuditConfig
     *
     * Generated from protobuf field <code>string kind = 1;</code>
     */
    private $kind = '';
    /**
     * The name of the destination bucket (e.g., gs://mybucket).
     *
     * Generated from protobuf field <code>string bucket = 2;</code>
     */
    private $bucket = '';
    /**
     * How long to keep generated audit files.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration retention_interval = 3;</code>
     */
    private $retention_interval = null;
    /**
     * How often to upload generated audit files.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration upload_interval = 4;</code>
     */
    private $upload_interval = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $kind
     *           This is always sql#sqlServerAuditConfig
     *     @type string $bucket
     *           The name of the destination bucket (e.g., gs://mybucket).
     *     @type \Google\Protobuf\Duration $retention_interval
     *           How long to keep generated audit files.
     *     @type \Google\Protobuf\Duration $upload_interval
     *           How often to upload generated audit files.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce();
        parent::__construct($data);
    }

    /**
     * This is always sql#sqlServerAuditConfig
     *
     * Generated from protobuf field <code>string kind = 1;</code>
     * @return string
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * This is always sql#sqlServerAuditConfig
     *
     * Generated from protobuf field <code>string kind = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->kind = $var;

        return $this;
    }

    /**
     * The name of the destination bucket (e.g., gs://mybucket).
     *
     * Generated from protobuf field <code>string bucket = 2;</code>
     * @return string
     */
    public function getBucket()
    {
        return $this->bucket;
    }

    /**
     * The name of the destination bucket (e.g., gs://mybucket).
     *
     * Generated from protobuf field <code>string bucket = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setBucket($var)
    {
        GPBUtil::checkString($var, True);
        $this->bucket = $var;

        return $this;
    }

    /**
     * How long to keep generated audit files.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration retention_interval = 3;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getRetentionInterval()
    {
        return $this->retention_interval;
    }

    public function hasRetentionInterval()
    {
        return isset($this->retention_interval);
    }

    public function clearRetentionInterval()
    {
        unset($this->retention_interval);
    }

    /**
     * How long to keep generated audit files.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration retention_interval = 3;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setRetentionInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->retention_interval = $var;

        return $this;
    }

    /**
     * How often to upload generated audit files.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration upload_interval = 4;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getUploadInterval()
    {
        return $this->upload_interval;
    }

    public function hasUploadInterval()
    {
        return isset($this->upload_interval);
    }

    public function clearUploadInterval()
    {
        unset($this->upload_interval);
    }

    /**
     * How often to upload generated audit files.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration upload_interval = 4;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setUploadInterval($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->upload_interval = $var;

        return $this;
    }

}

