<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/cloudtrace/v2/trace.proto

namespace Google\Cloud\Trace\V2\Span;

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

/**
 * A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
 * on the span, consisting of either user-supplied key:value pairs, or
 * details of a message sent/received between Spans.
 *
 * Generated from protobuf message <code>google.devtools.cloudtrace.v2.Span.TimeEvents</code>
 */
class TimeEvents extends \Google\Protobuf\Internal\Message
{
    /**
     * A collection of `TimeEvent`s.
     *
     * Generated from protobuf field <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     */
    private $time_event;
    /**
     * The number of dropped annotations in all the included time events.
     * If the value is 0, then no annotations were dropped.
     *
     * Generated from protobuf field <code>int32 dropped_annotations_count = 2;</code>
     */
    private $dropped_annotations_count = 0;
    /**
     * The number of dropped message events in all the included time events.
     * If the value is 0, then no message events were dropped.
     *
     * Generated from protobuf field <code>int32 dropped_message_events_count = 3;</code>
     */
    private $dropped_message_events_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Trace\V2\Span\TimeEvent[]|\Google\Protobuf\Internal\RepeatedField $time_event
     *           A collection of `TimeEvent`s.
     *     @type int $dropped_annotations_count
     *           The number of dropped annotations in all the included time events.
     *           If the value is 0, then no annotations were dropped.
     *     @type int $dropped_message_events_count
     *           The number of dropped message events in all the included time events.
     *           If the value is 0, then no message events were dropped.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Cloudtrace\V2\Trace::initOnce();
        parent::__construct($data);
    }

    /**
     * A collection of `TimeEvent`s.
     *
     * Generated from protobuf field <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTimeEvent()
    {
        return $this->time_event;
    }

    /**
     * A collection of `TimeEvent`s.
     *
     * Generated from protobuf field <code>repeated .google.devtools.cloudtrace.v2.Span.TimeEvent time_event = 1;</code>
     * @param \Google\Cloud\Trace\V2\Span\TimeEvent[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTimeEvent($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Trace\V2\Span\TimeEvent::class);
        $this->time_event = $arr;

        return $this;
    }

    /**
     * The number of dropped annotations in all the included time events.
     * If the value is 0, then no annotations were dropped.
     *
     * Generated from protobuf field <code>int32 dropped_annotations_count = 2;</code>
     * @return int
     */
    public function getDroppedAnnotationsCount()
    {
        return $this->dropped_annotations_count;
    }

    /**
     * The number of dropped annotations in all the included time events.
     * If the value is 0, then no annotations were dropped.
     *
     * Generated from protobuf field <code>int32 dropped_annotations_count = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setDroppedAnnotationsCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->dropped_annotations_count = $var;

        return $this;
    }

    /**
     * The number of dropped message events in all the included time events.
     * If the value is 0, then no message events were dropped.
     *
     * Generated from protobuf field <code>int32 dropped_message_events_count = 3;</code>
     * @return int
     */
    public function getDroppedMessageEventsCount()
    {
        return $this->dropped_message_events_count;
    }

    /**
     * The number of dropped message events in all the included time events.
     * If the value is 0, then no message events were dropped.
     *
     * Generated from protobuf field <code>int32 dropped_message_events_count = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setDroppedMessageEventsCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->dropped_message_events_count = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TimeEvents::class, \Google\Cloud\Trace\V2\Span_TimeEvents::class);

