#
# Autogenerated by Thrift Compiler (1.0.0-dev)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
#  options string: py:new_style,utf8strings
#

from thrift.Thrift import TType, TMessageType, TException, TApplicationException

from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
  from thrift.protocol import fastbinary
except:
  fastbinary = None



class TwitterUser(object):
  """
  Information about a Twitter user.

  Attributes:
   - id
   - name
   - screenName
   - lang
   - geoEnabled
   - createdAt
   - friendsCount
   - statusesCount
   - verified
   - listedCount
   - favouritesCount
   - followersCount
   - location
   - timeZone
   - description
   - utcOffset
   - url
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
    None, # 2
    (3, TType.STRING, 'name', None, None, ), # 3
    (4, TType.STRING, 'screenName', None, None, ), # 4
    (5, TType.STRING, 'lang', None, None, ), # 5
    (6, TType.BOOL, 'geoEnabled', None, None, ), # 6
    (7, TType.STRING, 'createdAt', None, None, ), # 7
    (8, TType.I32, 'friendsCount', None, None, ), # 8
    (9, TType.I32, 'statusesCount', None, None, ), # 9
    (10, TType.BOOL, 'verified', None, None, ), # 10
    (11, TType.I32, 'listedCount', None, None, ), # 11
    (12, TType.I32, 'favouritesCount', None, None, ), # 12
    (13, TType.I32, 'followersCount', None, None, ), # 13
    (14, TType.STRING, 'location', None, None, ), # 14
    (15, TType.STRING, 'timeZone', None, None, ), # 15
    (16, TType.STRING, 'description', None, None, ), # 16
    None, # 17
    (18, TType.I32, 'utcOffset', None, None, ), # 18
    (19, TType.STRING, 'url', None, None, ), # 19
  )

  def __init__(self, id=None, name=None, screenName=None, lang=None, geoEnabled=None, createdAt=None, friendsCount=None, statusesCount=None, verified=None, listedCount=None, favouritesCount=None, followersCount=None, location=None, timeZone=None, description=None, utcOffset=None, url=None,):
    self.id = id
    self.name = name
    self.screenName = screenName
    self.lang = lang
    self.geoEnabled = geoEnabled
    self.createdAt = createdAt
    self.friendsCount = friendsCount
    self.statusesCount = statusesCount
    self.verified = verified
    self.listedCount = listedCount
    self.favouritesCount = favouritesCount
    self.followersCount = followersCount
    self.location = location
    self.timeZone = timeZone
    self.description = description
    self.utcOffset = utcOffset
    self.url = url

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.name = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.screenName = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.lang = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.BOOL:
          self.geoEnabled = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.createdAt = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I32:
          self.friendsCount = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I32:
          self.statusesCount = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.BOOL:
          self.verified = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I32:
          self.listedCount = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.I32:
          self.favouritesCount = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.I32:
          self.followersCount = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRING:
          self.location = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRING:
          self.timeZone = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.STRING:
          self.description = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.I32:
          self.utcOffset = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.STRING:
          self.url = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TwitterUser')
    if self.id is not None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    if self.name is not None:
      oprot.writeFieldBegin('name', TType.STRING, 3)
      oprot.writeString(self.name.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.screenName is not None:
      oprot.writeFieldBegin('screenName', TType.STRING, 4)
      oprot.writeString(self.screenName.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.lang is not None:
      oprot.writeFieldBegin('lang', TType.STRING, 5)
      oprot.writeString(self.lang.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.geoEnabled is not None:
      oprot.writeFieldBegin('geoEnabled', TType.BOOL, 6)
      oprot.writeBool(self.geoEnabled)
      oprot.writeFieldEnd()
    if self.createdAt is not None:
      oprot.writeFieldBegin('createdAt', TType.STRING, 7)
      oprot.writeString(self.createdAt.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.friendsCount is not None:
      oprot.writeFieldBegin('friendsCount', TType.I32, 8)
      oprot.writeI32(self.friendsCount)
      oprot.writeFieldEnd()
    if self.statusesCount is not None:
      oprot.writeFieldBegin('statusesCount', TType.I32, 9)
      oprot.writeI32(self.statusesCount)
      oprot.writeFieldEnd()
    if self.verified is not None:
      oprot.writeFieldBegin('verified', TType.BOOL, 10)
      oprot.writeBool(self.verified)
      oprot.writeFieldEnd()
    if self.listedCount is not None:
      oprot.writeFieldBegin('listedCount', TType.I32, 11)
      oprot.writeI32(self.listedCount)
      oprot.writeFieldEnd()
    if self.favouritesCount is not None:
      oprot.writeFieldBegin('favouritesCount', TType.I32, 12)
      oprot.writeI32(self.favouritesCount)
      oprot.writeFieldEnd()
    if self.followersCount is not None:
      oprot.writeFieldBegin('followersCount', TType.I32, 13)
      oprot.writeI32(self.followersCount)
      oprot.writeFieldEnd()
    if self.location is not None:
      oprot.writeFieldBegin('location', TType.STRING, 14)
      oprot.writeString(self.location.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.timeZone is not None:
      oprot.writeFieldBegin('timeZone', TType.STRING, 15)
      oprot.writeString(self.timeZone.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.description is not None:
      oprot.writeFieldBegin('description', TType.STRING, 16)
      oprot.writeString(self.description.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.utcOffset is not None:
      oprot.writeFieldBegin('utcOffset', TType.I32, 18)
      oprot.writeI32(self.utcOffset)
      oprot.writeFieldEnd()
    if self.url is not None:
      oprot.writeFieldBegin('url', TType.STRING, 19)
      oprot.writeString(self.url.encode('utf-8'))
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TwitterLatLong(object):
  """
  A twitter geocoordinate.

  Attributes:
   - latitude
   - longitude
  """

  thrift_spec = (
    None, # 0
    (1, TType.DOUBLE, 'latitude', None, None, ), # 1
    (2, TType.DOUBLE, 'longitude', None, None, ), # 2
  )

  def __init__(self, latitude=None, longitude=None,):
    self.latitude = latitude
    self.longitude = longitude

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.DOUBLE:
          self.latitude = iprot.readDouble();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.longitude = iprot.readDouble();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TwitterLatLong')
    if self.latitude is not None:
      oprot.writeFieldBegin('latitude', TType.DOUBLE, 1)
      oprot.writeDouble(self.latitude)
      oprot.writeFieldEnd()
    if self.longitude is not None:
      oprot.writeFieldBegin('longitude', TType.DOUBLE, 2)
      oprot.writeDouble(self.longitude)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class BoundingBox(object):
  """
  Attributes:
   - type
   - coordinates
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'type', None, None, ), # 1
    (2, TType.LIST, 'coordinates', (TType.STRUCT,(TwitterLatLong, TwitterLatLong.thrift_spec)), None, ), # 2
  )

  def __init__(self, type=None, coordinates=None,):
    self.type = type
    self.coordinates = coordinates

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.type = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.LIST:
          self.coordinates = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in xrange(_size0):
            _elem5 = TwitterLatLong()
            _elem5.read(iprot)
            self.coordinates.append(_elem5)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('BoundingBox')
    if self.type is not None:
      oprot.writeFieldBegin('type', TType.STRING, 1)
      oprot.writeString(self.type.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.coordinates is not None:
      oprot.writeFieldBegin('coordinates', TType.LIST, 2)
      oprot.writeListBegin(TType.STRUCT, len(self.coordinates))
      for iter6 in self.coordinates:
        iter6.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    if self.coordinates is None:
      raise TProtocol.TProtocolException(message='Required field coordinates is unset!')
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class PlaceAttributes(object):
  """
  Attributes:
   - streetAddress
   - region
   - locality
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'streetAddress', None, None, ), # 1
    (2, TType.STRING, 'region', None, None, ), # 2
    (3, TType.STRING, 'locality', None, None, ), # 3
  )

  def __init__(self, streetAddress=None, region=None, locality=None,):
    self.streetAddress = streetAddress
    self.region = region
    self.locality = locality

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.streetAddress = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.region = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.locality = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('PlaceAttributes')
    if self.streetAddress is not None:
      oprot.writeFieldBegin('streetAddress', TType.STRING, 1)
      oprot.writeString(self.streetAddress.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.region is not None:
      oprot.writeFieldBegin('region', TType.STRING, 2)
      oprot.writeString(self.region.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.locality is not None:
      oprot.writeFieldBegin('locality', TType.STRING, 3)
      oprot.writeString(self.locality.encode('utf-8'))
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class UserMention(object):
  """
  Attributes:
   - startOffset
   - endOffset
   - screenName
   - name
   - id
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'startOffset', None, None, ), # 1
    (2, TType.I32, 'endOffset', None, None, ), # 2
    None, # 3
    (4, TType.STRING, 'screenName', None, None, ), # 4
    (5, TType.STRING, 'name', None, None, ), # 5
    (6, TType.I64, 'id', None, None, ), # 6
  )

  def __init__(self, startOffset=None, endOffset=None, screenName=None, name=None, id=None,):
    self.startOffset = startOffset
    self.endOffset = endOffset
    self.screenName = screenName
    self.name = name
    self.id = id

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.startOffset = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.endOffset = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.screenName = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.name = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('UserMention')
    if self.startOffset is not None:
      oprot.writeFieldBegin('startOffset', TType.I32, 1)
      oprot.writeI32(self.startOffset)
      oprot.writeFieldEnd()
    if self.endOffset is not None:
      oprot.writeFieldBegin('endOffset', TType.I32, 2)
      oprot.writeI32(self.endOffset)
      oprot.writeFieldEnd()
    if self.screenName is not None:
      oprot.writeFieldBegin('screenName', TType.STRING, 4)
      oprot.writeString(self.screenName.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.name is not None:
      oprot.writeFieldBegin('name', TType.STRING, 5)
      oprot.writeString(self.name.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.id is not None:
      oprot.writeFieldBegin('id', TType.I64, 6)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class URL(object):
  """
  Attributes:
   - startOffset
   - endOffset
   - expandedUrl
   - url
   - displayUrl
  """

  thrift_spec = (
    None, # 0
    (1, TType.I32, 'startOffset', None, None, ), # 1
    (2, TType.I32, 'endOffset', None, None, ), # 2
    (3, TType.STRING, 'expandedUrl', None, None, ), # 3
    (4, TType.STRING, 'url', None, None, ), # 4
    (5, TType.STRING, 'displayUrl', None, None, ), # 5
  )

  def __init__(self, startOffset=None, endOffset=None, expandedUrl=None, url=None, displayUrl=None,):
    self.startOffset = startOffset
    self.endOffset = endOffset
    self.expandedUrl = expandedUrl
    self.url = url
    self.displayUrl = displayUrl

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.startOffset = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.endOffset = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.expandedUrl = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.url = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.displayUrl = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('URL')
    if self.startOffset is not None:
      oprot.writeFieldBegin('startOffset', TType.I32, 1)
      oprot.writeI32(self.startOffset)
      oprot.writeFieldEnd()
    if self.endOffset is not None:
      oprot.writeFieldBegin('endOffset', TType.I32, 2)
      oprot.writeI32(self.endOffset)
      oprot.writeFieldEnd()
    if self.expandedUrl is not None:
      oprot.writeFieldBegin('expandedUrl', TType.STRING, 3)
      oprot.writeString(self.expandedUrl.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.url is not None:
      oprot.writeFieldBegin('url', TType.STRING, 4)
      oprot.writeString(self.url.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.displayUrl is not None:
      oprot.writeFieldBegin('displayUrl', TType.STRING, 5)
      oprot.writeString(self.displayUrl.encode('utf-8'))
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class HashTag(object):
  """
  Attributes:
   - text
   - startOffset
   - endOffset
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'text', None, None, ), # 1
    (2, TType.I32, 'startOffset', None, None, ), # 2
    (3, TType.I32, 'endOffset', None, None, ), # 3
  )

  def __init__(self, text=None, startOffset=None, endOffset=None,):
    self.text = text
    self.startOffset = startOffset
    self.endOffset = endOffset

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.text = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.startOffset = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I32:
          self.endOffset = iprot.readI32();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('HashTag')
    if self.text is not None:
      oprot.writeFieldBegin('text', TType.STRING, 1)
      oprot.writeString(self.text.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.startOffset is not None:
      oprot.writeFieldBegin('startOffset', TType.I32, 2)
      oprot.writeI32(self.startOffset)
      oprot.writeFieldEnd()
    if self.endOffset is not None:
      oprot.writeFieldBegin('endOffset', TType.I32, 3)
      oprot.writeI32(self.endOffset)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TwitterEntities(object):
  """
  Attributes:
   - hashtags
   - urls
   - userMentions
  """

  thrift_spec = (
    None, # 0
    (1, TType.LIST, 'hashtags', (TType.STRUCT,(HashTag, HashTag.thrift_spec)), None, ), # 1
    (2, TType.LIST, 'urls', (TType.STRUCT,(URL, URL.thrift_spec)), None, ), # 2
    (3, TType.LIST, 'userMentions', (TType.STRUCT,(UserMention, UserMention.thrift_spec)), None, ), # 3
  )

  def __init__(self, hashtags=None, urls=None, userMentions=None,):
    self.hashtags = hashtags
    self.urls = urls
    self.userMentions = userMentions

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.hashtags = []
          (_etype10, _size7) = iprot.readListBegin()
          for _i11 in xrange(_size7):
            _elem12 = HashTag()
            _elem12.read(iprot)
            self.hashtags.append(_elem12)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.LIST:
          self.urls = []
          (_etype16, _size13) = iprot.readListBegin()
          for _i17 in xrange(_size13):
            _elem18 = URL()
            _elem18.read(iprot)
            self.urls.append(_elem18)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.LIST:
          self.userMentions = []
          (_etype22, _size19) = iprot.readListBegin()
          for _i23 in xrange(_size19):
            _elem24 = UserMention()
            _elem24.read(iprot)
            self.userMentions.append(_elem24)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TwitterEntities')
    if self.hashtags is not None:
      oprot.writeFieldBegin('hashtags', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.hashtags))
      for iter25 in self.hashtags:
        iter25.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.urls is not None:
      oprot.writeFieldBegin('urls', TType.LIST, 2)
      oprot.writeListBegin(TType.STRUCT, len(self.urls))
      for iter26 in self.urls:
        iter26.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.userMentions is not None:
      oprot.writeFieldBegin('userMentions', TType.LIST, 3)
      oprot.writeListBegin(TType.STRUCT, len(self.userMentions))
      for iter27 in self.userMentions:
        iter27.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TwitterPlace(object):
  """
  Attributes:
   - placeType
   - countryCode
   - country
   - fullName
   - name
   - id
   - url
   - boundingBox
   - attributes
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'placeType', None, None, ), # 1
    (2, TType.STRING, 'countryCode', None, None, ), # 2
    (3, TType.STRING, 'country', None, None, ), # 3
    (4, TType.STRING, 'fullName', None, None, ), # 4
    (5, TType.STRING, 'name', None, None, ), # 5
    (6, TType.STRING, 'id', None, None, ), # 6
    (7, TType.STRING, 'url', None, None, ), # 7
    (8, TType.STRUCT, 'boundingBox', (BoundingBox, BoundingBox.thrift_spec), None, ), # 8
    (9, TType.STRUCT, 'attributes', (PlaceAttributes, PlaceAttributes.thrift_spec), None, ), # 9
  )

  def __init__(self, placeType=None, countryCode=None, country=None, fullName=None, name=None, id=None, url=None, boundingBox=None, attributes=None,):
    self.placeType = placeType
    self.countryCode = countryCode
    self.country = country
    self.fullName = fullName
    self.name = name
    self.id = id
    self.url = url
    self.boundingBox = boundingBox
    self.attributes = attributes

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.placeType = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.countryCode = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.country = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.fullName = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.name = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.id = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.url = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRUCT:
          self.boundingBox = BoundingBox()
          self.boundingBox.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRUCT:
          self.attributes = PlaceAttributes()
          self.attributes.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TwitterPlace')
    if self.placeType is not None:
      oprot.writeFieldBegin('placeType', TType.STRING, 1)
      oprot.writeString(self.placeType.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.countryCode is not None:
      oprot.writeFieldBegin('countryCode', TType.STRING, 2)
      oprot.writeString(self.countryCode.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.country is not None:
      oprot.writeFieldBegin('country', TType.STRING, 3)
      oprot.writeString(self.country.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.fullName is not None:
      oprot.writeFieldBegin('fullName', TType.STRING, 4)
      oprot.writeString(self.fullName.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.name is not None:
      oprot.writeFieldBegin('name', TType.STRING, 5)
      oprot.writeString(self.name.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.id is not None:
      oprot.writeFieldBegin('id', TType.STRING, 6)
      oprot.writeString(self.id.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.url is not None:
      oprot.writeFieldBegin('url', TType.STRING, 7)
      oprot.writeString(self.url.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.boundingBox is not None:
      oprot.writeFieldBegin('boundingBox', TType.STRUCT, 8)
      self.boundingBox.write(oprot)
      oprot.writeFieldEnd()
    if self.attributes is not None:
      oprot.writeFieldBegin('attributes', TType.STRUCT, 9)
      self.attributes.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TwitterCoordinates(object):
  """
  Attributes:
   - type
   - coordinates
  """

  thrift_spec = (
    None, # 0
    (1, TType.STRING, 'type', None, None, ), # 1
    (2, TType.STRUCT, 'coordinates', (TwitterLatLong, TwitterLatLong.thrift_spec), None, ), # 2
  )

  def __init__(self, type=None, coordinates=None,):
    self.type = type
    self.coordinates = coordinates

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.type = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.coordinates = TwitterLatLong()
          self.coordinates.read(iprot)
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TwitterCoordinates')
    if self.type is not None:
      oprot.writeFieldBegin('type', TType.STRING, 1)
      oprot.writeString(self.type.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.coordinates is not None:
      oprot.writeFieldBegin('coordinates', TType.STRUCT, 2)
      self.coordinates.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

class TweetInfo(object):
  """
  Attributes:
   - id
   - text
   - createdAt
   - user
   - truncated
   - entities
   - source
   - coordinates
   - place
   - favorited
   - retweeted
   - retweetCount
   - inReplyToScreenName
   - inReplyToStatusId
   - inReplyToUserId
  """

  thrift_spec = (
    None, # 0
    (1, TType.I64, 'id', None, None, ), # 1
    None, # 2
    (3, TType.STRING, 'text', None, None, ), # 3
    (4, TType.STRING, 'createdAt', None, None, ), # 4
    (5, TType.STRUCT, 'user', (TwitterUser, TwitterUser.thrift_spec), None, ), # 5
    (6, TType.BOOL, 'truncated', None, None, ), # 6
    (7, TType.STRUCT, 'entities', (TwitterEntities, TwitterEntities.thrift_spec), None, ), # 7
    (8, TType.STRING, 'source', None, None, ), # 8
    (9, TType.STRUCT, 'coordinates', (TwitterCoordinates, TwitterCoordinates.thrift_spec), None, ), # 9
    None, # 10
    (11, TType.STRUCT, 'place', (TwitterPlace, TwitterPlace.thrift_spec), None, ), # 11
    (12, TType.BOOL, 'favorited', None, None, ), # 12
    (13, TType.BOOL, 'retweeted', None, None, ), # 13
    (14, TType.I32, 'retweetCount', None, None, ), # 14
    (15, TType.STRING, 'inReplyToScreenName', None, None, ), # 15
    (16, TType.I64, 'inReplyToStatusId', None, None, ), # 16
    None, # 17
    (18, TType.I64, 'inReplyToUserId', None, None, ), # 18
  )

  def __init__(self, id=None, text=None, createdAt=None, user=None, truncated=None, entities=None, source=None, coordinates=None, place=None, favorited=None, retweeted=None, retweetCount=None, inReplyToScreenName=None, inReplyToStatusId=None, inReplyToUserId=None,):
    self.id = id
    self.text = text
    self.createdAt = createdAt
    self.user = user
    self.truncated = truncated
    self.entities = entities
    self.source = source
    self.coordinates = coordinates
    self.place = place
    self.favorited = favorited
    self.retweeted = retweeted
    self.retweetCount = retweetCount
    self.inReplyToScreenName = inReplyToScreenName
    self.inReplyToStatusId = inReplyToStatusId
    self.inReplyToUserId = inReplyToUserId

  def read(self, iprot):
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.id = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.text = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.createdAt = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRUCT:
          self.user = TwitterUser()
          self.user.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.BOOL:
          self.truncated = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRUCT:
          self.entities = TwitterEntities()
          self.entities.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.STRING:
          self.source = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRUCT:
          self.coordinates = TwitterCoordinates()
          self.coordinates.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRUCT:
          self.place = TwitterPlace()
          self.place.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.BOOL:
          self.favorited = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.BOOL:
          self.retweeted = iprot.readBool();
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.I32:
          self.retweetCount = iprot.readI32();
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRING:
          self.inReplyToScreenName = iprot.readString().decode('utf-8')
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I64:
          self.inReplyToStatusId = iprot.readI64();
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.I64:
          self.inReplyToUserId = iprot.readI64();
        else:
          iprot.skip(ftype)
      else:
        iprot.skip(ftype)
      iprot.readFieldEnd()
    iprot.readStructEnd()

  def write(self, oprot):
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
      return
    oprot.writeStructBegin('TweetInfo')
    if self.id is not None:
      oprot.writeFieldBegin('id', TType.I64, 1)
      oprot.writeI64(self.id)
      oprot.writeFieldEnd()
    if self.text is not None:
      oprot.writeFieldBegin('text', TType.STRING, 3)
      oprot.writeString(self.text.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.createdAt is not None:
      oprot.writeFieldBegin('createdAt', TType.STRING, 4)
      oprot.writeString(self.createdAt.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.user is not None:
      oprot.writeFieldBegin('user', TType.STRUCT, 5)
      self.user.write(oprot)
      oprot.writeFieldEnd()
    if self.truncated is not None:
      oprot.writeFieldBegin('truncated', TType.BOOL, 6)
      oprot.writeBool(self.truncated)
      oprot.writeFieldEnd()
    if self.entities is not None:
      oprot.writeFieldBegin('entities', TType.STRUCT, 7)
      self.entities.write(oprot)
      oprot.writeFieldEnd()
    if self.source is not None:
      oprot.writeFieldBegin('source', TType.STRING, 8)
      oprot.writeString(self.source.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.coordinates is not None:
      oprot.writeFieldBegin('coordinates', TType.STRUCT, 9)
      self.coordinates.write(oprot)
      oprot.writeFieldEnd()
    if self.place is not None:
      oprot.writeFieldBegin('place', TType.STRUCT, 11)
      self.place.write(oprot)
      oprot.writeFieldEnd()
    if self.favorited is not None:
      oprot.writeFieldBegin('favorited', TType.BOOL, 12)
      oprot.writeBool(self.favorited)
      oprot.writeFieldEnd()
    if self.retweeted is not None:
      oprot.writeFieldBegin('retweeted', TType.BOOL, 13)
      oprot.writeBool(self.retweeted)
      oprot.writeFieldEnd()
    if self.retweetCount is not None:
      oprot.writeFieldBegin('retweetCount', TType.I32, 14)
      oprot.writeI32(self.retweetCount)
      oprot.writeFieldEnd()
    if self.inReplyToScreenName is not None:
      oprot.writeFieldBegin('inReplyToScreenName', TType.STRING, 15)
      oprot.writeString(self.inReplyToScreenName.encode('utf-8'))
      oprot.writeFieldEnd()
    if self.inReplyToStatusId is not None:
      oprot.writeFieldBegin('inReplyToStatusId', TType.I64, 16)
      oprot.writeI64(self.inReplyToStatusId)
      oprot.writeFieldEnd()
    if self.inReplyToUserId is not None:
      oprot.writeFieldBegin('inReplyToUserId', TType.I64, 18)
      oprot.writeI64(self.inReplyToUserId)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return


  def __repr__(self):
    L = ['%s=%r' % (key, value)
      for key, value in self.__dict__.iteritems()]
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))

  def __eq__(self, other):
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)
