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

namespace Google\Cloud\PubSub\V1\CloudStorageConfig;

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

/**
 * Configuration for writing message data in Avro format.
 * Message payloads and metadata will be written to files as an Avro binary.
 *
 * Generated from protobuf message <code>google.pubsub.v1.CloudStorageConfig.AvroConfig</code>
 */
class AvroConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. When true, write the subscription name, message_id,
     * publish_time, attributes, and ordering_key as additional fields in the
     * output. The subscription name, message_id, and publish_time fields are
     * put in their own fields while all other message properties other than
     * data (for example, an ordering_key, if present) are added as entries in
     * the attributes map.
     *
     * Generated from protobuf field <code>bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $write_metadata = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $write_metadata
     *           Optional. When true, write the subscription name, message_id,
     *           publish_time, attributes, and ordering_key as additional fields in the
     *           output. The subscription name, message_id, and publish_time fields are
     *           put in their own fields while all other message properties other than
     *           data (for example, an ordering_key, if present) are added as entries in
     *           the attributes map.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Pubsub\V1\Pubsub::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. When true, write the subscription name, message_id,
     * publish_time, attributes, and ordering_key as additional fields in the
     * output. The subscription name, message_id, and publish_time fields are
     * put in their own fields while all other message properties other than
     * data (for example, an ordering_key, if present) are added as entries in
     * the attributes map.
     *
     * Generated from protobuf field <code>bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getWriteMetadata()
    {
        return $this->write_metadata;
    }

    /**
     * Optional. When true, write the subscription name, message_id,
     * publish_time, attributes, and ordering_key as additional fields in the
     * output. The subscription name, message_id, and publish_time fields are
     * put in their own fields while all other message properties other than
     * data (for example, an ordering_key, if present) are added as entries in
     * the attributes map.
     *
     * Generated from protobuf field <code>bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setWriteMetadata($var)
    {
        GPBUtil::checkBool($var);
        $this->write_metadata = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(AvroConfig::class, \Google\Cloud\PubSub\V1\CloudStorageConfig_AvroConfig::class);

