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

namespace Google\Apps\Chat\V1\ContextualAddOnMarkup;

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

/**
 * A card is a UI element that can contain UI widgets such as text and
 * images.
 *
 * Generated from protobuf message <code>google.chat.v1.ContextualAddOnMarkup.Card</code>
 */
class Card extends \Google\Protobuf\Internal\Message
{
    /**
     * The header of the card. A header usually contains a title and an image.
     *
     * Generated from protobuf field <code>.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader header = 1;</code>
     */
    protected $header = null;
    /**
     * Sections are separated by a line divider.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.ContextualAddOnMarkup.Card.Section sections = 2;</code>
     */
    private $sections;
    /**
     * The actions of this card.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.ContextualAddOnMarkup.Card.CardAction card_actions = 3;</code>
     */
    private $card_actions;
    /**
     * Name of the card.
     *
     * Generated from protobuf field <code>string name = 4;</code>
     */
    protected $name = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader $header
     *           The header of the card. A header usually contains a title and an image.
     *     @type array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\Section>|\Google\Protobuf\Internal\RepeatedField $sections
     *           Sections are separated by a line divider.
     *     @type array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardAction>|\Google\Protobuf\Internal\RepeatedField $card_actions
     *           The actions of this card.
     *     @type string $name
     *           Name of the card.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\ContextualAddon::initOnce();
        parent::__construct($data);
    }

    /**
     * The header of the card. A header usually contains a title and an image.
     *
     * Generated from protobuf field <code>.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader header = 1;</code>
     * @return \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader|null
     */
    public function getHeader()
    {
        return $this->header;
    }

    public function hasHeader()
    {
        return isset($this->header);
    }

    public function clearHeader()
    {
        unset($this->header);
    }

    /**
     * The header of the card. A header usually contains a title and an image.
     *
     * Generated from protobuf field <code>.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader header = 1;</code>
     * @param \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader $var
     * @return $this
     */
    public function setHeader($var)
    {
        GPBUtil::checkMessage($var, \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardHeader::class);
        $this->header = $var;

        return $this;
    }

    /**
     * Sections are separated by a line divider.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.ContextualAddOnMarkup.Card.Section sections = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSections()
    {
        return $this->sections;
    }

    /**
     * Sections are separated by a line divider.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.ContextualAddOnMarkup.Card.Section sections = 2;</code>
     * @param array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\Section>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSections($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\Section::class);
        $this->sections = $arr;

        return $this;
    }

    /**
     * The actions of this card.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.ContextualAddOnMarkup.Card.CardAction card_actions = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCardActions()
    {
        return $this->card_actions;
    }

    /**
     * The actions of this card.
     *
     * Generated from protobuf field <code>repeated .google.chat.v1.ContextualAddOnMarkup.Card.CardAction card_actions = 3;</code>
     * @param array<\Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardAction>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCardActions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Apps\Chat\V1\ContextualAddOnMarkup\Card\CardAction::class);
        $this->card_actions = $arr;

        return $this;
    }

    /**
     * Name of the card.
     *
     * Generated from protobuf field <code>string name = 4;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Name of the card.
     *
     * Generated from protobuf field <code>string name = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

}


