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

namespace Google\Cloud\AdvisoryNotifications\V1;

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

/**
 * Attachment with specific information about the issue.
 *
 * Generated from protobuf message <code>google.cloud.advisorynotifications.v1.Attachment</code>
 */
class Attachment extends \Google\Protobuf\Internal\Message
{
    /**
     * The title of the attachment.
     *
     * Generated from protobuf field <code>string display_name = 1;</code>
     */
    protected $display_name = '';
    protected $data;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AdvisoryNotifications\V1\Csv $csv
     *           A CSV file attachment. Max size is 10 MB.
     *     @type string $display_name
     *           The title of the attachment.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * A CSV file attachment. Max size is 10 MB.
     *
     * Generated from protobuf field <code>.google.cloud.advisorynotifications.v1.Csv csv = 2;</code>
     * @return \Google\Cloud\AdvisoryNotifications\V1\Csv|null
     */
    public function getCsv()
    {
        return $this->readOneof(2);
    }

    public function hasCsv()
    {
        return $this->hasOneof(2);
    }

    /**
     * A CSV file attachment. Max size is 10 MB.
     *
     * Generated from protobuf field <code>.google.cloud.advisorynotifications.v1.Csv csv = 2;</code>
     * @param \Google\Cloud\AdvisoryNotifications\V1\Csv $var
     * @return $this
     */
    public function setCsv($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AdvisoryNotifications\V1\Csv::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The title of the attachment.
     *
     * Generated from protobuf field <code>string display_name = 1;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * The title of the attachment.
     *
     * Generated from protobuf field <code>string display_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

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

}

