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

namespace Google\Cloud\AlloyDb\V1;

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

/**
 * Message describing Database object.
 *
 * Generated from protobuf message <code>google.cloud.alloydb.v1.Database</code>
 */
class Database extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. Name of the resource in the form of
     * `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Optional. Immutable. Charset for the database.
     * This field can contain any PostgreSQL supported charset name.
     * Example values include "UTF8", "SQL_ASCII", etc.
     *
     * Generated from protobuf field <code>string charset = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $charset = '';
    /**
     * Optional. Immutable. lc_collate for the database.
     * String sort order.
     * Example values include "C", "POSIX", etc.
     *
     * Generated from protobuf field <code>string collation = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $collation = '';
    /**
     * Optional. Immutable. lc_ctype for the database.
     * Character classification (What is a letter? The upper-case equivalent?).
     * Example values include "C", "POSIX", etc.
     *
     * Generated from protobuf field <code>string character_type = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $character_type = '';
    /**
     * Input only. Immutable. Template of the database to be used for creating a
     * new database.
     *
     * Generated from protobuf field <code>string database_template = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $database_template = '';
    /**
     * Optional. Whether the database is a template database.
     *
     * Generated from protobuf field <code>optional bool is_template_database = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $is_template_database = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. Name of the resource in the form of
     *           `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`.
     *     @type string $charset
     *           Optional. Immutable. Charset for the database.
     *           This field can contain any PostgreSQL supported charset name.
     *           Example values include "UTF8", "SQL_ASCII", etc.
     *     @type string $collation
     *           Optional. Immutable. lc_collate for the database.
     *           String sort order.
     *           Example values include "C", "POSIX", etc.
     *     @type string $character_type
     *           Optional. Immutable. lc_ctype for the database.
     *           Character classification (What is a letter? The upper-case equivalent?).
     *           Example values include "C", "POSIX", etc.
     *     @type string $database_template
     *           Input only. Immutable. Template of the database to be used for creating a
     *           new database.
     *     @type bool $is_template_database
     *           Optional. Whether the database is a template database.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Alloydb\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. Name of the resource in the form of
     * `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. Name of the resource in the form of
     * `projects/{project}/locations/{location}/clusters/{cluster}/databases/{database}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. Immutable. Charset for the database.
     * This field can contain any PostgreSQL supported charset name.
     * Example values include "UTF8", "SQL_ASCII", etc.
     *
     * Generated from protobuf field <code>string charset = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getCharset()
    {
        return $this->charset;
    }

    /**
     * Optional. Immutable. Charset for the database.
     * This field can contain any PostgreSQL supported charset name.
     * Example values include "UTF8", "SQL_ASCII", etc.
     *
     * Generated from protobuf field <code>string charset = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setCharset($var)
    {
        GPBUtil::checkString($var, True);
        $this->charset = $var;

        return $this;
    }

    /**
     * Optional. Immutable. lc_collate for the database.
     * String sort order.
     * Example values include "C", "POSIX", etc.
     *
     * Generated from protobuf field <code>string collation = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getCollation()
    {
        return $this->collation;
    }

    /**
     * Optional. Immutable. lc_collate for the database.
     * String sort order.
     * Example values include "C", "POSIX", etc.
     *
     * Generated from protobuf field <code>string collation = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setCollation($var)
    {
        GPBUtil::checkString($var, True);
        $this->collation = $var;

        return $this;
    }

    /**
     * Optional. Immutable. lc_ctype for the database.
     * Character classification (What is a letter? The upper-case equivalent?).
     * Example values include "C", "POSIX", etc.
     *
     * Generated from protobuf field <code>string character_type = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getCharacterType()
    {
        return $this->character_type;
    }

    /**
     * Optional. Immutable. lc_ctype for the database.
     * Character classification (What is a letter? The upper-case equivalent?).
     * Example values include "C", "POSIX", etc.
     *
     * Generated from protobuf field <code>string character_type = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setCharacterType($var)
    {
        GPBUtil::checkString($var, True);
        $this->character_type = $var;

        return $this;
    }

    /**
     * Input only. Immutable. Template of the database to be used for creating a
     * new database.
     *
     * Generated from protobuf field <code>string database_template = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getDatabaseTemplate()
    {
        return $this->database_template;
    }

    /**
     * Input only. Immutable. Template of the database to be used for creating a
     * new database.
     *
     * Generated from protobuf field <code>string database_template = 6 [(.google.api.field_behavior) = INPUT_ONLY, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setDatabaseTemplate($var)
    {
        GPBUtil::checkString($var, True);
        $this->database_template = $var;

        return $this;
    }

    /**
     * Optional. Whether the database is a template database.
     *
     * Generated from protobuf field <code>optional bool is_template_database = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getIsTemplateDatabase()
    {
        return isset($this->is_template_database) ? $this->is_template_database : false;
    }

    public function hasIsTemplateDatabase()
    {
        return isset($this->is_template_database);
    }

    public function clearIsTemplateDatabase()
    {
        unset($this->is_template_database);
    }

    /**
     * Optional. Whether the database is a template database.
     *
     * Generated from protobuf field <code>optional bool is_template_database = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setIsTemplateDatabase($var)
    {
        GPBUtil::checkBool($var);
        $this->is_template_database = $var;

        return $this;
    }

}

