<?php
namespace Jaeger\Thrift\Agent\Zipkin;

/**
 * Autogenerated by Thrift Compiler (0.11.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;


/**
 * An annotation is similar to a log statement. It includes a host field which
 * allows these events to be attributed properly, and also aggregatable.
 */
class Annotation extends TBase {
  static $isValidate = false;

  static $_TSPEC = array(
    1 => array(
      'var' => 'timestamp',
      'isRequired' => false,
      'type' => TType::I64,
      ),
    2 => array(
      'var' => 'value',
      'isRequired' => false,
      'type' => TType::STRING,
      ),
    3 => array(
      'var' => 'host',
      'isRequired' => false,
      'type' => TType::STRUCT,
      'class' => '\Jaeger\Thrift\Agent\Zipkin\Endpoint',
      ),
    );

  /**
   * Microseconds from epoch.
   * 
   * This value should use the most precise value possible. For example,
   * gettimeofday or syncing nanoTime against a tick of currentTimeMillis.
   * 
   * @var int
   */
  public $timestamp = null;
  /**
   * @var string
   */
  public $value = null;
  /**
   * Always the host that recorded the event. By specifying the host you allow
   * rollup of all events (such as client requests to a service) by IP address.
   * 
   * @var \Jaeger\Thrift\Agent\Zipkin\Endpoint
   */
  public $host = null;

  public function __construct($vals=null) {
    if (is_array($vals)) {
      parent::__construct(self::$_TSPEC, $vals);
    }
  }

  public function getName() {
    return 'Annotation';
  }

  public function read($input)
  {
    return $this->_read('Annotation', self::$_TSPEC, $input);
  }

  public function write($output) {
    return $this->_write('Annotation', self::$_TSPEC, $output);
  }

}

