<?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;

/**
 * Represents a SQL database on the Cloud SQL instance.
 *
 * Generated from protobuf message <code>google.cloud.sql.v1beta4.Database</code>
 */
class Database extends \Google\Protobuf\Internal\Message
{
    /**
     * This is always `sql#database`.
     *
     * Generated from protobuf field <code>string kind = 1;</code>
     */
    private $kind = '';
    /**
     * The Cloud SQL charset value.
     *
     * Generated from protobuf field <code>string charset = 2;</code>
     */
    private $charset = '';
    /**
     * The Cloud SQL collation value.
     *
     * Generated from protobuf field <code>string collation = 3;</code>
     */
    private $collation = '';
    /**
     * This field is deprecated and will be removed from a future version of the
     * API.
     *
     * Generated from protobuf field <code>string etag = 4;</code>
     */
    private $etag = '';
    /**
     * The name of the database in the Cloud SQL instance. This does not include
     * the project ID or instance name.
     *
     * Generated from protobuf field <code>string name = 5;</code>
     */
    private $name = '';
    /**
     * The name of the Cloud SQL instance. This does not include the project ID.
     *
     * Generated from protobuf field <code>string instance = 6;</code>
     */
    private $instance = '';
    /**
     * The URI of this resource.
     *
     * Generated from protobuf field <code>string self_link = 7;</code>
     */
    private $self_link = '';
    /**
     * The project ID of the project containing the Cloud SQL database. The Google
     * apps domain is prefixed if applicable.
     *
     * Generated from protobuf field <code>string project = 8;</code>
     */
    private $project = '';
    protected $database_details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $kind
     *           This is always `sql#database`.
     *     @type string $charset
     *           The Cloud SQL charset value.
     *     @type string $collation
     *           The Cloud SQL collation value.
     *     @type string $etag
     *           This field is deprecated and will be removed from a future version of the
     *           API.
     *     @type string $name
     *           The name of the database in the Cloud SQL instance. This does not include
     *           the project ID or instance name.
     *     @type string $instance
     *           The name of the Cloud SQL instance. This does not include the project ID.
     *     @type string $self_link
     *           The URI of this resource.
     *     @type string $project
     *           The project ID of the project containing the Cloud SQL database. The Google
     *           apps domain is prefixed if applicable.
     *     @type \Google\Cloud\Sql\V1beta4\SqlServerDatabaseDetails $sqlserver_database_details
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce();
        parent::__construct($data);
    }

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

    /**
     * This is always `sql#database`.
     *
     * 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 Cloud SQL charset value.
     *
     * Generated from protobuf field <code>string charset = 2;</code>
     * @return string
     */
    public function getCharset()
    {
        return $this->charset;
    }

    /**
     * The Cloud SQL charset value.
     *
     * Generated from protobuf field <code>string charset = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setCharset($var)
    {
        GPBUtil::checkString($var, True);
        $this->charset = $var;

        return $this;
    }

    /**
     * The Cloud SQL collation value.
     *
     * Generated from protobuf field <code>string collation = 3;</code>
     * @return string
     */
    public function getCollation()
    {
        return $this->collation;
    }

    /**
     * The Cloud SQL collation value.
     *
     * Generated from protobuf field <code>string collation = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setCollation($var)
    {
        GPBUtil::checkString($var, True);
        $this->collation = $var;

        return $this;
    }

    /**
     * This field is deprecated and will be removed from a future version of the
     * API.
     *
     * Generated from protobuf field <code>string etag = 4;</code>
     * @return string
     */
    public function getEtag()
    {
        return $this->etag;
    }

    /**
     * This field is deprecated and will be removed from a future version of the
     * API.
     *
     * Generated from protobuf field <code>string etag = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setEtag($var)
    {
        GPBUtil::checkString($var, True);
        $this->etag = $var;

        return $this;
    }

    /**
     * The name of the database in the Cloud SQL instance. This does not include
     * the project ID or instance name.
     *
     * Generated from protobuf field <code>string name = 5;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The name of the database in the Cloud SQL instance. This does not include
     * the project ID or instance name.
     *
     * Generated from protobuf field <code>string name = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The name of the Cloud SQL instance. This does not include the project ID.
     *
     * Generated from protobuf field <code>string instance = 6;</code>
     * @return string
     */
    public function getInstance()
    {
        return $this->instance;
    }

    /**
     * The name of the Cloud SQL instance. This does not include the project ID.
     *
     * Generated from protobuf field <code>string instance = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setInstance($var)
    {
        GPBUtil::checkString($var, True);
        $this->instance = $var;

        return $this;
    }

    /**
     * The URI of this resource.
     *
     * Generated from protobuf field <code>string self_link = 7;</code>
     * @return string
     */
    public function getSelfLink()
    {
        return $this->self_link;
    }

    /**
     * The URI of this resource.
     *
     * Generated from protobuf field <code>string self_link = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setSelfLink($var)
    {
        GPBUtil::checkString($var, True);
        $this->self_link = $var;

        return $this;
    }

    /**
     * The project ID of the project containing the Cloud SQL database. The Google
     * apps domain is prefixed if applicable.
     *
     * Generated from protobuf field <code>string project = 8;</code>
     * @return string
     */
    public function getProject()
    {
        return $this->project;
    }

    /**
     * The project ID of the project containing the Cloud SQL database. The Google
     * apps domain is prefixed if applicable.
     *
     * Generated from protobuf field <code>string project = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setProject($var)
    {
        GPBUtil::checkString($var, True);
        $this->project = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9;</code>
     * @return \Google\Cloud\Sql\V1beta4\SqlServerDatabaseDetails|null
     */
    public function getSqlserverDatabaseDetails()
    {
        return $this->readOneof(9);
    }

    public function hasSqlserverDatabaseDetails()
    {
        return $this->hasOneof(9);
    }

    /**
     * Generated from protobuf field <code>.google.cloud.sql.v1beta4.SqlServerDatabaseDetails sqlserver_database_details = 9;</code>
     * @param \Google\Cloud\Sql\V1beta4\SqlServerDatabaseDetails $var
     * @return $this
     */
    public function setSqlserverDatabaseDetails($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Sql\V1beta4\SqlServerDatabaseDetails::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getDatabaseDetails()
    {
        return $this->whichOneof("database_details");
    }

}

