<gh_stars>0
#
# 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_style1
#

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

import sys

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


class CallError(object):
  NO_ERROR = 0
  EXTERNAL_TRANSLATOR_REJECT = 1
  BODY_LESS_INVITE = 2
  ACCOUNT_EXPIRED = 3
  CONNECTION_CAPACITY_EXCEEDED = 4
  MALFORMED_SDP = 5
  UNSUPPORTED_CONTENT_TYPE = 6
  UNACCEPTABLE_CODEC = 7
  INVALID_AUTH_CLD_TRANS_RULE = 8
  INVALID_AUTH_CLI_TRANS_RULE = 9
  INVALID_ACNT_CLD_TRANS_RULE = 10
  INVALID_ACNT_CLI_TRANS_RULE = 11
  CANNOT_BIND_SESSION = 12
  INVALID_DID_CLI_TRANS_RULE = 13
  NO_RATE_FOUND = 14
  CALL_LOOP_DETECTED = 15
  TOO_MANY_SESSIONS = 16
  ACCOUNT_IN_USE = 17
  HIGH_CALL_RATE_PER_ACCOUNT = 18
  HIGH_CALL_RATE = 19
  INSUFFICIENT_BALANCE = 20
  FORBIDDEN_DESTINATION = 21
  NO_CUSTOMER_RATES = 22
  LOSS_PROTECTION = 23
  ADDRESS_INCOMPLETE = 24
  NO_ROUTES = 25
  HIGH_CALL_RATE_PER_CONNECTION = 26
  INVALID_ASSRT_ID_CLI_TRANS_RULE = 27
  DNCL_BLOCKED = 28

  _VALUES_TO_NAMES = {
    0: "NO_ERROR",
    1: "EXTERNAL_TRANSLATOR_REJECT",
    2: "BODY_LESS_INVITE",
    3: "ACCOUNT_EXPIRED",
    4: "CONNECTION_CAPACITY_EXCEEDED",
    5: "MALFORMED_SDP",
    6: "UNSUPPORTED_CONTENT_TYPE",
    7: "UNACCEPTABLE_CODEC",
    8: "INVALID_AUTH_CLD_TRANS_RULE",
    9: "INVALID_AUTH_CLI_TRANS_RULE",
    10: "INVALID_ACNT_CLD_TRANS_RULE",
    11: "INVALID_ACNT_CLI_TRANS_RULE",
    12: "CANNOT_BIND_SESSION",
    13: "INVALID_DID_CLI_TRANS_RULE",
    14: "NO_RATE_FOUND",
    15: "CALL_LOOP_DETECTED",
    16: "TOO_MANY_SESSIONS",
    17: "ACCOUNT_IN_USE",
    18: "HIGH_CALL_RATE_PER_ACCOUNT",
    19: "HIGH_CALL_RATE",
    20: "INSUFFICIENT_BALANCE",
    21: "FORBIDDEN_DESTINATION",
    22: "NO_CUSTOMER_RATES",
    23: "LOSS_PROTECTION",
    24: "ADDRESS_INCOMPLETE",
    25: "NO_ROUTES",
    26: "HIGH_CALL_RATE_PER_CONNECTION",
    27: "INVALID_ASSRT_ID_CLI_TRANS_RULE",
    28: "DNCL_BLOCKED",
  }

  _NAMES_TO_VALUES = {
    "NO_ERROR": 0,
    "EXTERNAL_TRANSLATOR_REJECT": 1,
    "BODY_LESS_INVITE": 2,
    "ACCOUNT_EXPIRED": 3,
    "CONNECTION_CAPACITY_EXCEEDED": 4,
    "MALFORMED_SDP": 5,
    "UNSUPPORTED_CONTENT_TYPE": 6,
    "UNACCEPTABLE_CODEC": 7,
    "INVALID_AUTH_CLD_TRANS_RULE": 8,
    "INVALID_AUTH_CLI_TRANS_RULE": 9,
    "INVALID_ACNT_CLD_TRANS_RULE": 10,
    "INVALID_ACNT_CLI_TRANS_RULE": 11,
    "CANNOT_BIND_SESSION": 12,
    "INVALID_DID_CLI_TRANS_RULE": 13,
    "NO_RATE_FOUND": 14,
    "CALL_LOOP_DETECTED": 15,
    "TOO_MANY_SESSIONS": 16,
    "ACCOUNT_IN_USE": 17,
    "HIGH_CALL_RATE_PER_ACCOUNT": 18,
    "HIGH_CALL_RATE": 19,
    "INSUFFICIENT_BALANCE": 20,
    "FORBIDDEN_DESTINATION": 21,
    "NO_CUSTOMER_RATES": 22,
    "LOSS_PROTECTION": 23,
    "ADDRESS_INCOMPLETE": 24,
    "NO_ROUTES": 25,
    "HIGH_CALL_RATE_PER_CONNECTION": 26,
    "INVALID_ASSRT_ID_CLI_TRANS_RULE": 27,
    "DNCL_BLOCKED": 28,
  }


class TransactionRecordType(object):
  CALLS = 1
  CDRS = 2
  CDRS_CONNECTIONS = 3
  CDRS_CUSTOMERS = 4
  CDRS_DIDS = 5
  CDRS_CONNECTIONS_DIDS = 6
  SURCHARGES = 7
  COMMISSIONS = 8
  UPDATE_ACCOUNT_BALANCE = 9
  UPDATE_CUSTOMER_BALANCE = 10
  UPDATE_VENDOR_BALANCE = 11
  UPDATE_PLAN_MINUTES = 12
  QUALITY_STATS = 13
  CALLS_SDP = 14
  CDRS_CUSTOMERS_DIDS = 15

  _VALUES_TO_NAMES = {
    1: "CALLS",
    2: "CDRS",
    3: "CDRS_CONNECTIONS",
    4: "CDRS_CUSTOMERS",
    5: "CDRS_DIDS",
    6: "CDRS_CONNECTIONS_DIDS",
    7: "SURCHARGES",
    8: "COMMISSIONS",
    9: "UPDATE_ACCOUNT_BALANCE",
    10: "UPDATE_CUSTOMER_BALANCE",
    11: "UPDATE_VENDOR_BALANCE",
    12: "UPDATE_PLAN_MINUTES",
    13: "QUALITY_STATS",
    14: "CALLS_SDP",
    15: "CDRS_CUSTOMERS_DIDS",
  }

  _NAMES_TO_VALUES = {
    "CALLS": 1,
    "CDRS": 2,
    "CDRS_CONNECTIONS": 3,
    "CDRS_CUSTOMERS": 4,
    "CDRS_DIDS": 5,
    "CDRS_CONNECTIONS_DIDS": 6,
    "SURCHARGES": 7,
    "COMMISSIONS": 8,
    "UPDATE_ACCOUNT_BALANCE": 9,
    "UPDATE_CUSTOMER_BALANCE": 10,
    "UPDATE_VENDOR_BALANCE": 11,
    "UPDATE_PLAN_MINUTES": 12,
    "QUALITY_STATS": 13,
    "CALLS_SDP": 14,
    "CDRS_CUSTOMERS_DIDS": 15,
  }


class NullInt64(object):
  """
  Attributes:
   - v
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'v', None, None, ),  # 1
  )

  def __init__(self, v=None,):
    self.v = v

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.v = 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('NullInt64')
    if self.v is not None:
      oprot.writeFieldBegin('v', TType.I64, 1)
      oprot.writeI64(self.v)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 NullString(object):
  """
  Attributes:
   - s
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRING, 's', 'UTF8', None, ),  # 1
  )

  def __init__(self, s=None,):
    self.s = s

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.s = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('NullString')
    if self.s is not None:
      oprot.writeFieldBegin('s', TType.STRING, 1)
      oprot.writeString(self.s.encode('utf-8') if sys.version_info[0] == 2 else self.s)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UnixTime(object):
  """
  Attributes:
   - seconds
   - nanoseconds
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'seconds', None, None, ),  # 1
    (2, TType.I64, 'nanoseconds', None, None, ),  # 2
  )

  def __init__(self, seconds=None, nanoseconds=None,):
    self.seconds = seconds
    self.nanoseconds = nanoseconds

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.seconds = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.nanoseconds = 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('UnixTime')
    if self.seconds is not None:
      oprot.writeFieldBegin('seconds', TType.I64, 1)
      oprot.writeI64(self.seconds)
      oprot.writeFieldEnd()
    if self.nanoseconds is not None:
      oprot.writeFieldBegin('nanoseconds', TType.I64, 2)
      oprot.writeI64(self.nanoseconds)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 MonoTime(object):
  """
  Attributes:
   - monot
   - realt
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'monot', (UnixTime, UnixTime.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'realt', (UnixTime, UnixTime.thrift_spec), None, ),  # 2
  )

  def __init__(self, monot=None, realt=None,):
    self.monot = monot
    self.realt = realt

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.monot = UnixTime()
          self.monot.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.realt = UnixTime()
          self.realt.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('MonoTime')
    if self.monot is not None:
      oprot.writeFieldBegin('monot', TType.STRUCT, 1)
      self.monot.write(oprot)
      oprot.writeFieldEnd()
    if self.realt is not None:
      oprot.writeFieldBegin('realt', TType.STRUCT, 2)
      self.realt.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__.items()]
    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 TransactionRecord(object):
  """
  Attributes:
   - type
   - data
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I32, 'type', None, None, ),  # 1
    (2, TType.STRING, 'data', 'UTF8', None, ),  # 2
  )

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

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.type = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.data = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('TransactionRecord')
    if self.type is not None:
      oprot.writeFieldBegin('type', TType.I32, 1)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.data is not None:
      oprot.writeFieldBegin('data', TType.STRING, 2)
      oprot.writeString(self.data.encode('utf-8') if sys.version_info[0] == 2 else self.data)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Transaction(object):
  """
  Attributes:
   - records
  """

  thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'records', (TType.STRUCT, (TransactionRecord, TransactionRecord.thrift_spec), False), None, ),  # 1
  )

  def __init__(self, records=None,):
    self.records = records

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.records = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in range(_size0):
            _elem5 = TransactionRecord()
            _elem5.read(iprot)
            self.records.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('Transaction')
    if self.records is not None:
      oprot.writeFieldBegin('records', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.records))
      for iter6 in self.records:
        iter6.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__.items()]
    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 Calls(object):
  """
  Attributes:
   - i_call
   - call_id
   - cld
   - cli
   - setup_time
   - parent_i_call
   - i_call_type
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_call', None, None, ),  # 1
    (2, TType.STRING, 'call_id', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'cld', 'UTF8', None, ),  # 3
    (4, TType.STRING, 'cli', 'UTF8', None, ),  # 4
    (5, TType.I64, 'setup_time', None, None, ),  # 5
    (6, TType.STRUCT, 'parent_i_call', (NullInt64, NullInt64.thrift_spec), None, ),  # 6
    (7, TType.STRUCT, 'i_call_type', (NullInt64, NullInt64.thrift_spec), None, ),  # 7
  )

  def __init__(self, i_call=None, call_id=None, cld=None, cli=None, setup_time=None, parent_i_call=None, i_call_type=None,):
    self.i_call = i_call
    self.call_id = call_id
    self.cld = cld
    self.cli = cli
    self.setup_time = setup_time
    self.parent_i_call = parent_i_call
    self.i_call_type = i_call_type

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.call_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.cld = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.cli = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRUCT:
          self.parent_i_call = NullInt64()
          self.parent_i_call.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRUCT:
          self.i_call_type = NullInt64()
          self.i_call_type.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('Calls')
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 1)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.call_id is not None:
      oprot.writeFieldBegin('call_id', TType.STRING, 2)
      oprot.writeString(self.call_id.encode('utf-8') if sys.version_info[0] == 2 else self.call_id)
      oprot.writeFieldEnd()
    if self.cld is not None:
      oprot.writeFieldBegin('cld', TType.STRING, 3)
      oprot.writeString(self.cld.encode('utf-8') if sys.version_info[0] == 2 else self.cld)
      oprot.writeFieldEnd()
    if self.cli is not None:
      oprot.writeFieldBegin('cli', TType.STRING, 4)
      oprot.writeString(self.cli.encode('utf-8') if sys.version_info[0] == 2 else self.cli)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 5)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.parent_i_call is not None:
      oprot.writeFieldBegin('parent_i_call', TType.STRUCT, 6)
      self.parent_i_call.write(oprot)
      oprot.writeFieldEnd()
    if self.i_call_type is not None:
      oprot.writeFieldBegin('i_call_type', TType.STRUCT, 7)
      self.i_call_type.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__.items()]
    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 Cdrs(object):
  """
  Attributes:
   - i_cdr
   - i_call
   - i_account
   - result
   - cost
   - delay
   - duration
   - billed_duration
   - connect_time
   - disconnect_time
   - cld_in
   - cli_in
   - prefix
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - remote_ip
   - grace_period
   - user_agent
   - pdd1xx
   - i_protocol
   - release_source
   - plan_duration
   - accessibility_cost
   - lrn_cld
   - lrn_cld_in
   - area_name
   - p_asserted_id
   - remote_party_id
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdr', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_account', None, None, ),  # 3
    (4, TType.I64, 'result', None, None, ),  # 4
    (5, TType.DOUBLE, 'cost', None, None, ),  # 5
    (6, TType.DOUBLE, 'delay', None, None, ),  # 6
    (7, TType.DOUBLE, 'duration', None, None, ),  # 7
    (8, TType.DOUBLE, 'billed_duration', None, None, ),  # 8
    (9, TType.I64, 'connect_time', None, None, ),  # 9
    (10, TType.I64, 'disconnect_time', None, None, ),  # 10
    (11, TType.STRING, 'cld_in', 'UTF8', None, ),  # 11
    (12, TType.STRING, 'cli_in', 'UTF8', None, ),  # 12
    (13, TType.STRING, 'prefix', 'UTF8', None, ),  # 13
    (14, TType.DOUBLE, 'price_1', None, None, ),  # 14
    (15, TType.DOUBLE, 'price_n', None, None, ),  # 15
    (16, TType.I32, 'interval_1', None, None, ),  # 16
    (17, TType.I32, 'interval_n', None, None, ),  # 17
    (18, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 18
    (19, TType.DOUBLE, 'connect_fee', None, None, ),  # 19
    (20, TType.I64, 'free_seconds', None, None, ),  # 20
    (21, TType.STRING, 'remote_ip', 'UTF8', None, ),  # 21
    (22, TType.I32, 'grace_period', None, None, ),  # 22
    (23, TType.STRING, 'user_agent', 'UTF8', None, ),  # 23
    (24, TType.DOUBLE, 'pdd1xx', None, None, ),  # 24
    (25, TType.I16, 'i_protocol', None, None, ),  # 25
    (26, TType.STRING, 'release_source', 'UTF8', None, ),  # 26
    (27, TType.DOUBLE, 'plan_duration', None, None, ),  # 27
    (28, TType.DOUBLE, 'accessibility_cost', None, None, ),  # 28
    (29, TType.STRUCT, 'lrn_cld', (NullString, NullString.thrift_spec), None, ),  # 29
    (30, TType.STRUCT, 'lrn_cld_in', (NullString, NullString.thrift_spec), None, ),  # 30
    (31, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 31
    (32, TType.STRUCT, 'p_asserted_id', (NullString, NullString.thrift_spec), None, ),  # 32
    (33, TType.STRUCT, 'remote_party_id', (NullString, NullString.thrift_spec), None, ),  # 33
  )

  def __init__(self, i_cdr=None, i_call=None, i_account=None, result=None, cost=None, delay=None, duration=None, billed_duration=None, connect_time=None, disconnect_time=None, cld_in=None, cli_in=None, prefix=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, remote_ip=None, grace_period=None, user_agent=None, pdd1xx=None, i_protocol=None, release_source=None, plan_duration=None, accessibility_cost=None, lrn_cld=None, lrn_cld_in=None, area_name=None, p_asserted_id=None, remote_party_id=None,):
    self.i_cdr = i_cdr
    self.i_call = i_call
    self.i_account = i_account
    self.result = result
    self.cost = cost
    self.delay = delay
    self.duration = duration
    self.billed_duration = billed_duration
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.cld_in = cld_in
    self.cli_in = cli_in
    self.prefix = prefix
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.remote_ip = remote_ip
    self.grace_period = grace_period
    self.user_agent = user_agent
    self.pdd1xx = pdd1xx
    self.i_protocol = i_protocol
    self.release_source = release_source
    self.plan_duration = plan_duration
    self.accessibility_cost = accessibility_cost
    self.lrn_cld = lrn_cld
    self.lrn_cld_in = lrn_cld_in
    self.area_name = area_name
    self.p_asserted_id = p_asserted_id
    self.remote_party_id = remote_party_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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdr = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_account = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.result = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.DOUBLE:
          self.delay = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRING:
          self.cld_in = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.STRING:
          self.cli_in = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.I64:
          self.free_seconds = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 21:
        if ftype == TType.STRING:
          self.remote_ip = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 22:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 23:
        if ftype == TType.STRING:
          self.user_agent = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 24:
        if ftype == TType.DOUBLE:
          self.pdd1xx = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 25:
        if ftype == TType.I16:
          self.i_protocol = iprot.readI16()
        else:
          iprot.skip(ftype)
      elif fid == 26:
        if ftype == TType.STRING:
          self.release_source = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 27:
        if ftype == TType.DOUBLE:
          self.plan_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 28:
        if ftype == TType.DOUBLE:
          self.accessibility_cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 29:
        if ftype == TType.STRUCT:
          self.lrn_cld = NullString()
          self.lrn_cld.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 30:
        if ftype == TType.STRUCT:
          self.lrn_cld_in = NullString()
          self.lrn_cld_in.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 31:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 32:
        if ftype == TType.STRUCT:
          self.p_asserted_id = NullString()
          self.p_asserted_id.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 33:
        if ftype == TType.STRUCT:
          self.remote_party_id = NullString()
          self.remote_party_id.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('Cdrs')
    if self.i_cdr is not None:
      oprot.writeFieldBegin('i_cdr', TType.I64, 1)
      oprot.writeI64(self.i_cdr)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_account is not None:
      oprot.writeFieldBegin('i_account', TType.I64, 3)
      oprot.writeI64(self.i_account)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I64, 4)
      oprot.writeI64(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 5)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.delay is not None:
      oprot.writeFieldBegin('delay', TType.DOUBLE, 6)
      oprot.writeDouble(self.delay)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 7)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 8)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 9)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 10)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.cld_in is not None:
      oprot.writeFieldBegin('cld_in', TType.STRING, 11)
      oprot.writeString(self.cld_in.encode('utf-8') if sys.version_info[0] == 2 else self.cld_in)
      oprot.writeFieldEnd()
    if self.cli_in is not None:
      oprot.writeFieldBegin('cli_in', TType.STRING, 12)
      oprot.writeString(self.cli_in.encode('utf-8') if sys.version_info[0] == 2 else self.cli_in)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 13)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 14)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 15)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 16)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 17)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 18)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 19)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I64, 20)
      oprot.writeI64(self.free_seconds)
      oprot.writeFieldEnd()
    if self.remote_ip is not None:
      oprot.writeFieldBegin('remote_ip', TType.STRING, 21)
      oprot.writeString(self.remote_ip.encode('utf-8') if sys.version_info[0] == 2 else self.remote_ip)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 22)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.user_agent is not None:
      oprot.writeFieldBegin('user_agent', TType.STRING, 23)
      oprot.writeString(self.user_agent.encode('utf-8') if sys.version_info[0] == 2 else self.user_agent)
      oprot.writeFieldEnd()
    if self.pdd1xx is not None:
      oprot.writeFieldBegin('pdd1xx', TType.DOUBLE, 24)
      oprot.writeDouble(self.pdd1xx)
      oprot.writeFieldEnd()
    if self.i_protocol is not None:
      oprot.writeFieldBegin('i_protocol', TType.I16, 25)
      oprot.writeI16(self.i_protocol)
      oprot.writeFieldEnd()
    if self.release_source is not None:
      oprot.writeFieldBegin('release_source', TType.STRING, 26)
      oprot.writeString(self.release_source.encode('utf-8') if sys.version_info[0] == 2 else self.release_source)
      oprot.writeFieldEnd()
    if self.plan_duration is not None:
      oprot.writeFieldBegin('plan_duration', TType.DOUBLE, 27)
      oprot.writeDouble(self.plan_duration)
      oprot.writeFieldEnd()
    if self.accessibility_cost is not None:
      oprot.writeFieldBegin('accessibility_cost', TType.DOUBLE, 28)
      oprot.writeDouble(self.accessibility_cost)
      oprot.writeFieldEnd()
    if self.lrn_cld is not None:
      oprot.writeFieldBegin('lrn_cld', TType.STRUCT, 29)
      self.lrn_cld.write(oprot)
      oprot.writeFieldEnd()
    if self.lrn_cld_in is not None:
      oprot.writeFieldBegin('lrn_cld_in', TType.STRUCT, 30)
      self.lrn_cld_in.write(oprot)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 31)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.p_asserted_id is not None:
      oprot.writeFieldBegin('p_asserted_id', TType.STRUCT, 32)
      self.p_asserted_id.write(oprot)
      oprot.writeFieldEnd()
    if self.remote_party_id is not None:
      oprot.writeFieldBegin('remote_party_id', TType.STRUCT, 33)
      self.remote_party_id.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__.items()]
    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 CdrsConnections(object):
  """
  Attributes:
   - i_cdrs_connection
   - i_call
   - i_connection
   - result
   - cost
   - delay
   - duration
   - billed_duration
   - setup_time
   - connect_time
   - disconnect_time
   - cld_out
   - cli_out
   - prefix
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
   - user_agent
   - pdd100
   - pdd1xx
   - i_account_debug
   - i_protocol
   - release_source
   - call_setup_time
   - lrn_cld
   - area_name
   - i_media_relay
   - remote_ip
   - vendor_name
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_connection', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_connection', None, None, ),  # 3
    (4, TType.I32, 'result', None, None, ),  # 4
    (5, TType.DOUBLE, 'cost', None, None, ),  # 5
    (6, TType.DOUBLE, 'delay', None, None, ),  # 6
    (7, TType.DOUBLE, 'duration', None, None, ),  # 7
    (8, TType.DOUBLE, 'billed_duration', None, None, ),  # 8
    (9, TType.I64, 'setup_time', None, None, ),  # 9
    (10, TType.I64, 'connect_time', None, None, ),  # 10
    (11, TType.I64, 'disconnect_time', None, None, ),  # 11
    (12, TType.STRING, 'cld_out', 'UTF8', None, ),  # 12
    (13, TType.STRING, 'cli_out', 'UTF8', None, ),  # 13
    (14, TType.STRING, 'prefix', 'UTF8', None, ),  # 14
    (15, TType.DOUBLE, 'price_1', None, None, ),  # 15
    (16, TType.DOUBLE, 'price_n', None, None, ),  # 16
    (17, TType.I32, 'interval_1', None, None, ),  # 17
    (18, TType.I32, 'interval_n', None, None, ),  # 18
    (19, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 19
    (20, TType.DOUBLE, 'connect_fee', None, None, ),  # 20
    (21, TType.I32, 'free_seconds', None, None, ),  # 21
    (22, TType.I32, 'grace_period', None, None, ),  # 22
    (23, TType.STRING, 'user_agent', 'UTF8', None, ),  # 23
    (24, TType.DOUBLE, 'pdd100', None, None, ),  # 24
    (25, TType.DOUBLE, 'pdd1xx', None, None, ),  # 25
    (26, TType.I64, 'i_account_debug', None, None, ),  # 26
    (27, TType.I32, 'i_protocol', None, None, ),  # 27
    (28, TType.STRING, 'release_source', 'UTF8', None, ),  # 28
    (29, TType.I64, 'call_setup_time', None, None, ),  # 29
    (30, TType.STRUCT, 'lrn_cld', (NullString, NullString.thrift_spec), None, ),  # 30
    (31, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 31
    (32, TType.STRUCT, 'i_media_relay', (NullInt64, NullInt64.thrift_spec), None, ),  # 32
    (33, TType.STRUCT, 'remote_ip', (NullString, NullString.thrift_spec), None, ),  # 33
    (34, TType.STRUCT, 'vendor_name', (NullString, NullString.thrift_spec), None, ),  # 34
  )

  def __init__(self, i_cdrs_connection=None, i_call=None, i_connection=None, result=None, cost=None, delay=None, duration=None, billed_duration=None, setup_time=None, connect_time=None, disconnect_time=None, cld_out=None, cli_out=None, prefix=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None, user_agent=None, pdd100=None, pdd1xx=None, i_account_debug=None, i_protocol=None, release_source=None, call_setup_time=None, lrn_cld=None, area_name=None, i_media_relay=None, remote_ip=None, vendor_name=None,):
    self.i_cdrs_connection = i_cdrs_connection
    self.i_call = i_call
    self.i_connection = i_connection
    self.result = result
    self.cost = cost
    self.delay = delay
    self.duration = duration
    self.billed_duration = billed_duration
    self.setup_time = setup_time
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.cld_out = cld_out
    self.cli_out = cli_out
    self.prefix = prefix
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period
    self.user_agent = user_agent
    self.pdd100 = pdd100
    self.pdd1xx = pdd1xx
    self.i_account_debug = i_account_debug
    self.i_protocol = i_protocol
    self.release_source = release_source
    self.call_setup_time = call_setup_time
    self.lrn_cld = lrn_cld
    self.area_name = area_name
    self.i_media_relay = i_media_relay
    self.remote_ip = remote_ip
    self.vendor_name = vendor_name

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.result = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.DOUBLE:
          self.delay = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.STRING:
          self.cld_out = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.cli_out = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 21:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 22:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 23:
        if ftype == TType.STRING:
          self.user_agent = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 24:
        if ftype == TType.DOUBLE:
          self.pdd100 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 25:
        if ftype == TType.DOUBLE:
          self.pdd1xx = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 26:
        if ftype == TType.I64:
          self.i_account_debug = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 27:
        if ftype == TType.I32:
          self.i_protocol = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 28:
        if ftype == TType.STRING:
          self.release_source = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 29:
        if ftype == TType.I64:
          self.call_setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 30:
        if ftype == TType.STRUCT:
          self.lrn_cld = NullString()
          self.lrn_cld.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 31:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 32:
        if ftype == TType.STRUCT:
          self.i_media_relay = NullInt64()
          self.i_media_relay.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 33:
        if ftype == TType.STRUCT:
          self.remote_ip = NullString()
          self.remote_ip.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 34:
        if ftype == TType.STRUCT:
          self.vendor_name = NullString()
          self.vendor_name.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('CdrsConnections')
    if self.i_cdrs_connection is not None:
      oprot.writeFieldBegin('i_cdrs_connection', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_connection)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 3)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I32, 4)
      oprot.writeI32(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 5)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.delay is not None:
      oprot.writeFieldBegin('delay', TType.DOUBLE, 6)
      oprot.writeDouble(self.delay)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 7)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 8)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 9)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 10)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 11)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.cld_out is not None:
      oprot.writeFieldBegin('cld_out', TType.STRING, 12)
      oprot.writeString(self.cld_out.encode('utf-8') if sys.version_info[0] == 2 else self.cld_out)
      oprot.writeFieldEnd()
    if self.cli_out is not None:
      oprot.writeFieldBegin('cli_out', TType.STRING, 13)
      oprot.writeString(self.cli_out.encode('utf-8') if sys.version_info[0] == 2 else self.cli_out)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 14)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 15)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 16)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 17)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 18)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 19)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 20)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 21)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 22)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.user_agent is not None:
      oprot.writeFieldBegin('user_agent', TType.STRING, 23)
      oprot.writeString(self.user_agent.encode('utf-8') if sys.version_info[0] == 2 else self.user_agent)
      oprot.writeFieldEnd()
    if self.pdd100 is not None:
      oprot.writeFieldBegin('pdd100', TType.DOUBLE, 24)
      oprot.writeDouble(self.pdd100)
      oprot.writeFieldEnd()
    if self.pdd1xx is not None:
      oprot.writeFieldBegin('pdd1xx', TType.DOUBLE, 25)
      oprot.writeDouble(self.pdd1xx)
      oprot.writeFieldEnd()
    if self.i_account_debug is not None:
      oprot.writeFieldBegin('i_account_debug', TType.I64, 26)
      oprot.writeI64(self.i_account_debug)
      oprot.writeFieldEnd()
    if self.i_protocol is not None:
      oprot.writeFieldBegin('i_protocol', TType.I32, 27)
      oprot.writeI32(self.i_protocol)
      oprot.writeFieldEnd()
    if self.release_source is not None:
      oprot.writeFieldBegin('release_source', TType.STRING, 28)
      oprot.writeString(self.release_source.encode('utf-8') if sys.version_info[0] == 2 else self.release_source)
      oprot.writeFieldEnd()
    if self.call_setup_time is not None:
      oprot.writeFieldBegin('call_setup_time', TType.I64, 29)
      oprot.writeI64(self.call_setup_time)
      oprot.writeFieldEnd()
    if self.lrn_cld is not None:
      oprot.writeFieldBegin('lrn_cld', TType.STRUCT, 30)
      self.lrn_cld.write(oprot)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 31)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.i_media_relay is not None:
      oprot.writeFieldBegin('i_media_relay', TType.STRUCT, 32)
      self.i_media_relay.write(oprot)
      oprot.writeFieldEnd()
    if self.remote_ip is not None:
      oprot.writeFieldBegin('remote_ip', TType.STRUCT, 33)
      self.remote_ip.write(oprot)
      oprot.writeFieldEnd()
    if self.vendor_name is not None:
      oprot.writeFieldBegin('vendor_name', TType.STRUCT, 34)
      self.vendor_name.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__.items()]
    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 CdrsCustomers(object):
  """
  Attributes:
   - i_cdrs_customer
   - i_cdr
   - i_customer
   - cost
   - billed_duration
   - prefix
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
   - i_call
   - i_wholesaler
   - setup_time
   - duration
   - area_name
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_customer', None, None, ),  # 1
    (2, TType.I64, 'i_cdr', None, None, ),  # 2
    (3, TType.I64, 'i_customer', None, None, ),  # 3
    (4, TType.DOUBLE, 'cost', None, None, ),  # 4
    (5, TType.DOUBLE, 'billed_duration', None, None, ),  # 5
    (6, TType.STRING, 'prefix', 'UTF8', None, ),  # 6
    (7, TType.DOUBLE, 'price_1', None, None, ),  # 7
    (8, TType.DOUBLE, 'price_n', None, None, ),  # 8
    (9, TType.I32, 'interval_1', None, None, ),  # 9
    (10, TType.I32, 'interval_n', None, None, ),  # 10
    (11, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 11
    (12, TType.DOUBLE, 'connect_fee', None, None, ),  # 12
    (13, TType.I32, 'free_seconds', None, None, ),  # 13
    (14, TType.I32, 'grace_period', None, None, ),  # 14
    (15, TType.I64, 'i_call', None, None, ),  # 15
    (16, TType.I64, 'i_wholesaler', None, None, ),  # 16
    (17, TType.I64, 'setup_time', None, None, ),  # 17
    (18, TType.DOUBLE, 'duration', None, None, ),  # 18
    (19, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 19
  )

  def __init__(self, i_cdrs_customer=None, i_cdr=None, i_customer=None, cost=None, billed_duration=None, prefix=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None, i_call=None, i_wholesaler=None, setup_time=None, duration=None, area_name=None,):
    self.i_cdrs_customer = i_cdrs_customer
    self.i_cdr = i_cdr
    self.i_customer = i_customer
    self.cost = cost
    self.billed_duration = billed_duration
    self.prefix = prefix
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period
    self.i_call = i_call
    self.i_wholesaler = i_wholesaler
    self.setup_time = setup_time
    self.duration = duration
    self.area_name = area_name

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_cdr = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I64:
          self.i_wholesaler = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.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('CdrsCustomers')
    if self.i_cdrs_customer is not None:
      oprot.writeFieldBegin('i_cdrs_customer', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_customer)
      oprot.writeFieldEnd()
    if self.i_cdr is not None:
      oprot.writeFieldBegin('i_cdr', TType.I64, 2)
      oprot.writeI64(self.i_cdr)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 3)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 4)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 5)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 6)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 7)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 8)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 9)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 10)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 11)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 12)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 13)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 14)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 15)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_wholesaler is not None:
      oprot.writeFieldBegin('i_wholesaler', TType.I64, 16)
      oprot.writeI64(self.i_wholesaler)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 17)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 18)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 19)
      self.area_name.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__.items()]
    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 CdrsDids(object):
  """
  Attributes:
   - i_cdrs_did
   - i_call
   - i_did
   - did
   - result
   - cost
   - duration
   - billed_duration
   - setup_time
   - connect_time
   - disconnect_time
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_did', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_did', None, None, ),  # 3
    (4, TType.STRING, 'did', 'UTF8', None, ),  # 4
    (5, TType.I32, 'result', None, None, ),  # 5
    (6, TType.DOUBLE, 'cost', None, None, ),  # 6
    (7, TType.DOUBLE, 'duration', None, None, ),  # 7
    (8, TType.DOUBLE, 'billed_duration', None, None, ),  # 8
    (9, TType.I64, 'setup_time', None, None, ),  # 9
    (10, TType.I64, 'connect_time', None, None, ),  # 10
    (11, TType.I64, 'disconnect_time', None, None, ),  # 11
    (12, TType.DOUBLE, 'price_1', None, None, ),  # 12
    (13, TType.DOUBLE, 'price_n', None, None, ),  # 13
    (14, TType.I32, 'interval_1', None, None, ),  # 14
    (15, TType.I32, 'interval_n', None, None, ),  # 15
    (16, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 16
    (17, TType.DOUBLE, 'connect_fee', None, None, ),  # 17
    (18, TType.I32, 'free_seconds', None, None, ),  # 18
    (19, TType.I32, 'grace_period', None, None, ),  # 19
  )

  def __init__(self, i_cdrs_did=None, i_call=None, i_did=None, did=None, result=None, cost=None, duration=None, billed_duration=None, setup_time=None, connect_time=None, disconnect_time=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None,):
    self.i_cdrs_did = i_cdrs_did
    self.i_call = i_call
    self.i_did = i_did
    self.did = did
    self.result = result
    self.cost = cost
    self.duration = duration
    self.billed_duration = billed_duration
    self.setup_time = setup_time
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.result = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.I32:
          self.grace_period = 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('CdrsDids')
    if self.i_cdrs_did is not None:
      oprot.writeFieldBegin('i_cdrs_did', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_did)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_did is not None:
      oprot.writeFieldBegin('i_did', TType.I64, 3)
      oprot.writeI64(self.i_did)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 4)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I32, 5)
      oprot.writeI32(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 6)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 7)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 8)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 9)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 10)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 11)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 12)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 13)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 14)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 15)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 16)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 17)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 18)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 19)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CdrsConnectionsDids(object):
  """
  Attributes:
   - i_cdrs_connections_did
   - i_call
   - i_did_authorization
   - did
   - incoming_did
   - i_connection
   - result
   - cost
   - duration
   - billed_duration
   - setup_time
   - connect_time
   - disconnect_time
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_connections_did', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_did_authorization', None, None, ),  # 3
    (4, TType.STRING, 'did', 'UTF8', None, ),  # 4
    (5, TType.STRING, 'incoming_did', 'UTF8', None, ),  # 5
    (6, TType.I64, 'i_connection', None, None, ),  # 6
    (7, TType.I32, 'result', None, None, ),  # 7
    (8, TType.DOUBLE, 'cost', None, None, ),  # 8
    (9, TType.DOUBLE, 'duration', None, None, ),  # 9
    (10, TType.DOUBLE, 'billed_duration', None, None, ),  # 10
    (11, TType.I64, 'setup_time', None, None, ),  # 11
    (12, TType.I64, 'connect_time', None, None, ),  # 12
    (13, TType.I64, 'disconnect_time', None, None, ),  # 13
    (14, TType.DOUBLE, 'price_1', None, None, ),  # 14
    (15, TType.DOUBLE, 'price_n', None, None, ),  # 15
    (16, TType.I32, 'interval_1', None, None, ),  # 16
    (17, TType.I32, 'interval_n', None, None, ),  # 17
    (18, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 18
    (19, TType.DOUBLE, 'connect_fee', None, None, ),  # 19
    (20, TType.I32, 'free_seconds', None, None, ),  # 20
    (21, TType.I32, 'grace_period', None, None, ),  # 21
  )

  def __init__(self, i_cdrs_connections_did=None, i_call=None, i_did_authorization=None, did=None, incoming_did=None, i_connection=None, result=None, cost=None, duration=None, billed_duration=None, setup_time=None, connect_time=None, disconnect_time=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None,):
    self.i_cdrs_connections_did = i_cdrs_connections_did
    self.i_call = i_call
    self.i_did_authorization = i_did_authorization
    self.did = did
    self.incoming_did = incoming_did
    self.i_connection = i_connection
    self.result = result
    self.cost = cost
    self.duration = duration
    self.billed_duration = billed_duration
    self.setup_time = setup_time
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_connections_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_did_authorization = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.incoming_did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.i_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I32:
          self.result = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 21:
        if ftype == TType.I32:
          self.grace_period = 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('CdrsConnectionsDids')
    if self.i_cdrs_connections_did is not None:
      oprot.writeFieldBegin('i_cdrs_connections_did', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_connections_did)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_did_authorization is not None:
      oprot.writeFieldBegin('i_did_authorization', TType.I64, 3)
      oprot.writeI64(self.i_did_authorization)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 4)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.incoming_did is not None:
      oprot.writeFieldBegin('incoming_did', TType.STRING, 5)
      oprot.writeString(self.incoming_did.encode('utf-8') if sys.version_info[0] == 2 else self.incoming_did)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 6)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I32, 7)
      oprot.writeI32(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 8)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 9)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 10)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 11)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 12)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 13)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 14)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 15)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 16)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 17)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 18)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 19)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 20)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 21)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Surcharges(object):
  """
  Attributes:
   - i_surcharge
   - i_call
   - cost
   - i_surcharge_type
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_surcharge', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.DOUBLE, 'cost', None, None, ),  # 3
    (4, TType.I64, 'i_surcharge_type', None, None, ),  # 4
  )

  def __init__(self, i_surcharge=None, i_call=None, cost=None, i_surcharge_type=None,):
    self.i_surcharge = i_surcharge
    self.i_call = i_call
    self.cost = cost
    self.i_surcharge_type = i_surcharge_type

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_surcharge = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_surcharge_type = 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('Surcharges')
    if self.i_surcharge is not None:
      oprot.writeFieldBegin('i_surcharge', TType.I64, 1)
      oprot.writeI64(self.i_surcharge)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 3)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.i_surcharge_type is not None:
      oprot.writeFieldBegin('i_surcharge_type', TType.I64, 4)
      oprot.writeI64(self.i_surcharge_type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Commissions(object):
  """
  Attributes:
   - i_commission
   - i_account
   - i_customer
   - i_cdrs_customer
   - commission_size
   - setup_time
   - i_call
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_commission', None, None, ),  # 1
    (2, TType.STRUCT, 'i_account', (NullInt64, NullInt64.thrift_spec), None, ),  # 2
    (3, TType.STRUCT, 'i_customer', (NullInt64, NullInt64.thrift_spec), None, ),  # 3
    (4, TType.I64, 'i_cdrs_customer', None, None, ),  # 4
    (5, TType.DOUBLE, 'commission_size', None, None, ),  # 5
    (6, TType.I64, 'setup_time', None, None, ),  # 6
    (7, TType.I64, 'i_call', None, None, ),  # 7
  )

  def __init__(self, i_commission=None, i_account=None, i_customer=None, i_cdrs_customer=None, commission_size=None, setup_time=None, i_call=None,):
    self.i_commission = i_commission
    self.i_account = i_account
    self.i_customer = i_customer
    self.i_cdrs_customer = i_cdrs_customer
    self.commission_size = commission_size
    self.setup_time = setup_time
    self.i_call = i_call

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_commission = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.i_account = NullInt64()
          self.i_account.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.i_customer = NullInt64()
          self.i_customer.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_cdrs_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.commission_size = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.i_call = 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('Commissions')
    if self.i_commission is not None:
      oprot.writeFieldBegin('i_commission', TType.I64, 1)
      oprot.writeI64(self.i_commission)
      oprot.writeFieldEnd()
    if self.i_account is not None:
      oprot.writeFieldBegin('i_account', TType.STRUCT, 2)
      self.i_account.write(oprot)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.STRUCT, 3)
      self.i_customer.write(oprot)
      oprot.writeFieldEnd()
    if self.i_cdrs_customer is not None:
      oprot.writeFieldBegin('i_cdrs_customer', TType.I64, 4)
      oprot.writeI64(self.i_cdrs_customer)
      oprot.writeFieldEnd()
    if self.commission_size is not None:
      oprot.writeFieldBegin('commission_size', TType.DOUBLE, 5)
      oprot.writeDouble(self.commission_size)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 6)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 7)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CallsSdp(object):
  """
  Attributes:
   - i_calls_sdp
   - i_call
   - i_cdrs_connection
   - time_stamp
   - sdp
   - sip_msg_type
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_calls_sdp', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.STRUCT, 'i_cdrs_connection', (NullInt64, NullInt64.thrift_spec), None, ),  # 3
    (4, TType.STRUCT, 'time_stamp', (UnixTime, UnixTime.thrift_spec), None, ),  # 4
    (5, TType.STRING, 'sdp', 'UTF8', None, ),  # 5
    (6, TType.STRING, 'sip_msg_type', 'UTF8', None, ),  # 6
  )

  def __init__(self, i_calls_sdp=None, i_call=None, i_cdrs_connection=None, time_stamp=None, sdp=None, sip_msg_type=None,):
    self.i_calls_sdp = i_calls_sdp
    self.i_call = i_call
    self.i_cdrs_connection = i_cdrs_connection
    self.time_stamp = time_stamp
    self.sdp = sdp
    self.sip_msg_type = sip_msg_type

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_calls_sdp = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.i_cdrs_connection = NullInt64()
          self.i_cdrs_connection.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.time_stamp = UnixTime()
          self.time_stamp.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.sdp = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.sip_msg_type = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('CallsSdp')
    if self.i_calls_sdp is not None:
      oprot.writeFieldBegin('i_calls_sdp', TType.I64, 1)
      oprot.writeI64(self.i_calls_sdp)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_cdrs_connection is not None:
      oprot.writeFieldBegin('i_cdrs_connection', TType.STRUCT, 3)
      self.i_cdrs_connection.write(oprot)
      oprot.writeFieldEnd()
    if self.time_stamp is not None:
      oprot.writeFieldBegin('time_stamp', TType.STRUCT, 4)
      self.time_stamp.write(oprot)
      oprot.writeFieldEnd()
    if self.sdp is not None:
      oprot.writeFieldBegin('sdp', TType.STRING, 5)
      oprot.writeString(self.sdp.encode('utf-8') if sys.version_info[0] == 2 else self.sdp)
      oprot.writeFieldEnd()
    if self.sip_msg_type is not None:
      oprot.writeFieldBegin('sip_msg_type', TType.STRING, 6)
      oprot.writeString(self.sip_msg_type.encode('utf-8') if sys.version_info[0] == 2 else self.sip_msg_type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CdrsCustomersDids(object):
  """
  Attributes:
   - i_cdrs_customers_did
   - i_call
   - i_customer
   - i_did
   - did
   - result
   - cost
   - duration
   - billed_duration
   - setup_time
   - connect_time
   - disconnect_time
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_customers_did', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_customer', None, None, ),  # 3
    (4, TType.I64, 'i_did', None, None, ),  # 4
    (5, TType.STRING, 'did', 'UTF8', None, ),  # 5
    (6, TType.I32, 'result', None, None, ),  # 6
    (7, TType.DOUBLE, 'cost', None, None, ),  # 7
    (8, TType.DOUBLE, 'duration', None, None, ),  # 8
    (9, TType.DOUBLE, 'billed_duration', None, None, ),  # 9
    (10, TType.I64, 'setup_time', None, None, ),  # 10
    (11, TType.I64, 'connect_time', None, None, ),  # 11
    (12, TType.I64, 'disconnect_time', None, None, ),  # 12
    (13, TType.DOUBLE, 'price_1', None, None, ),  # 13
    (14, TType.DOUBLE, 'price_n', None, None, ),  # 14
    (15, TType.I32, 'interval_1', None, None, ),  # 15
    (16, TType.I32, 'interval_n', None, None, ),  # 16
    (17, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 17
    (18, TType.DOUBLE, 'connect_fee', None, None, ),  # 18
    (19, TType.I32, 'free_seconds', None, None, ),  # 19
    (20, TType.I32, 'grace_period', None, None, ),  # 20
  )

  def __init__(self, i_cdrs_customers_did=None, i_call=None, i_customer=None, i_did=None, did=None, result=None, cost=None, duration=None, billed_duration=None, setup_time=None, connect_time=None, disconnect_time=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None,):
    self.i_cdrs_customers_did = i_cdrs_customers_did
    self.i_call = i_call
    self.i_customer = i_customer
    self.i_did = i_did
    self.did = did
    self.result = result
    self.cost = cost
    self.duration = duration
    self.billed_duration = billed_duration
    self.setup_time = setup_time
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_customers_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.result = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.I32:
          self.grace_period = 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('CdrsCustomersDids')
    if self.i_cdrs_customers_did is not None:
      oprot.writeFieldBegin('i_cdrs_customers_did', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_customers_did)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 3)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.i_did is not None:
      oprot.writeFieldBegin('i_did', TType.I64, 4)
      oprot.writeI64(self.i_did)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 5)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I32, 6)
      oprot.writeI32(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 7)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 8)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 9)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 10)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 11)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 12)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 13)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 14)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 15)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 16)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 17)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 18)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 19)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 20)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UpdateAccountBalanceMessage(object):
  """
  Attributes:
   - i_account
   - delta
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_account', None, None, ),  # 1
    (2, TType.DOUBLE, 'delta', None, None, ),  # 2
  )

  def __init__(self, i_account=None, delta=None,):
    self.i_account = i_account
    self.delta = delta

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_account = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.delta = 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('UpdateAccountBalanceMessage')
    if self.i_account is not None:
      oprot.writeFieldBegin('i_account', TType.I64, 1)
      oprot.writeI64(self.i_account)
      oprot.writeFieldEnd()
    if self.delta is not None:
      oprot.writeFieldBegin('delta', TType.DOUBLE, 2)
      oprot.writeDouble(self.delta)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UpdateCustomerBalanceMessage(object):
  """
  Attributes:
   - i_customer
   - delta
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_customer', None, None, ),  # 1
    (2, TType.DOUBLE, 'delta', None, None, ),  # 2
  )

  def __init__(self, i_customer=None, delta=None,):
    self.i_customer = i_customer
    self.delta = delta

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.delta = 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('UpdateCustomerBalanceMessage')
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 1)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.delta is not None:
      oprot.writeFieldBegin('delta', TType.DOUBLE, 2)
      oprot.writeDouble(self.delta)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UpdateVendorBalanceMessage(object):
  """
  Attributes:
   - i_vendor
   - delta
   - i_connection
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_vendor', None, None, ),  # 1
    (2, TType.DOUBLE, 'delta', None, None, ),  # 2
    (3, TType.I64, 'i_connection', None, None, ),  # 3
  )

  def __init__(self, i_vendor=None, delta=None, i_connection=None,):
    self.i_vendor = i_vendor
    self.delta = delta
    self.i_connection = i_connection

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_vendor = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.delta = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_connection = 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('UpdateVendorBalanceMessage')
    if self.i_vendor is not None:
      oprot.writeFieldBegin('i_vendor', TType.I64, 1)
      oprot.writeI64(self.i_vendor)
      oprot.writeFieldEnd()
    if self.delta is not None:
      oprot.writeFieldBegin('delta', TType.DOUBLE, 2)
      oprot.writeDouble(self.delta)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 3)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UpdatePlanMinutesMessage(object):
  """
  Attributes:
   - i_account
   - i_service_plan
   - delta
   - chargeable_seconds
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_account', None, None, ),  # 1
    (2, TType.I64, 'i_service_plan', None, None, ),  # 2
    (3, TType.DOUBLE, 'delta', None, None, ),  # 3
    (4, TType.DOUBLE, 'chargeable_seconds', None, None, ),  # 4
  )

  def __init__(self, i_account=None, i_service_plan=None, delta=None, chargeable_seconds=None,):
    self.i_account = i_account
    self.i_service_plan = i_service_plan
    self.delta = delta
    self.chargeable_seconds = chargeable_seconds

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_account = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_service_plan = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.delta = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.chargeable_seconds = 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('UpdatePlanMinutesMessage')
    if self.i_account is not None:
      oprot.writeFieldBegin('i_account', TType.I64, 1)
      oprot.writeI64(self.i_account)
      oprot.writeFieldEnd()
    if self.i_service_plan is not None:
      oprot.writeFieldBegin('i_service_plan', TType.I64, 2)
      oprot.writeI64(self.i_service_plan)
      oprot.writeFieldEnd()
    if self.delta is not None:
      oprot.writeFieldBegin('delta', TType.DOUBLE, 3)
      oprot.writeDouble(self.delta)
      oprot.writeFieldEnd()
    if self.chargeable_seconds is not None:
      oprot.writeFieldBegin('chargeable_seconds', TType.DOUBLE, 4)
      oprot.writeDouble(self.chargeable_seconds)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 ConnectionQualityStats(object):
  """
  Attributes:
   - i_connection_quality_stats
   - i_connection
   - tstamp
   - asr
   - acd
   - action
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_connection_quality_stats', None, None, ),  # 1
    (2, TType.I64, 'i_connection', None, None, ),  # 2
    (3, TType.I64, 'tstamp', None, None, ),  # 3
    (4, TType.DOUBLE, 'asr', None, None, ),  # 4
    (5, TType.I32, 'acd', None, None, ),  # 5
    (6, TType.STRING, 'action', 'UTF8', None, ),  # 6
  )

  def __init__(self, i_connection_quality_stats=None, i_connection=None, tstamp=None, asr=None, acd=None, action=None,):
    self.i_connection_quality_stats = i_connection_quality_stats
    self.i_connection = i_connection
    self.tstamp = tstamp
    self.asr = asr
    self.acd = acd
    self.action = action

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_connection_quality_stats = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.tstamp = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.asr = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.acd = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.action = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('ConnectionQualityStats')
    if self.i_connection_quality_stats is not None:
      oprot.writeFieldBegin('i_connection_quality_stats', TType.I64, 1)
      oprot.writeI64(self.i_connection_quality_stats)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 2)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    if self.tstamp is not None:
      oprot.writeFieldBegin('tstamp', TType.I64, 3)
      oprot.writeI64(self.tstamp)
      oprot.writeFieldEnd()
    if self.asr is not None:
      oprot.writeFieldBegin('asr', TType.DOUBLE, 4)
      oprot.writeDouble(self.asr)
      oprot.writeFieldEnd()
    if self.acd is not None:
      oprot.writeFieldBegin('acd', TType.I32, 5)
      oprot.writeI32(self.acd)
      oprot.writeFieldEnd()
    if self.action is not None:
      oprot.writeFieldBegin('action', TType.STRING, 6)
      oprot.writeString(self.action.encode('utf-8') if sys.version_info[0] == 2 else self.action)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 RegisterError(TException):
  """
  Attributes:
   - cause
   - i_call
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I32, 'cause', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
  )

  def __init__(self, cause=None, i_call=None,):
    self.cause = cause
    self.i_call = i_call

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.cause = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = 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('RegisterError')
    if self.cause is not None:
      oprot.writeFieldBegin('cause', TType.I32, 1)
      oprot.writeI32(self.cause)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 TryBackupError(TException):

  thrift_spec = (
  )

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      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('TryBackupError')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 EagainError(TException):

  thrift_spec = (
  )

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      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('EagainError')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Billables(object):
  """
  Attributes:
   - free_seconds
   - connect_fee
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - grace_period
   - prefix
   - decimal_precision
   - cost_round_up
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'free_seconds', None, None, ),  # 1
    (2, TType.DOUBLE, 'connect_fee', None, None, ),  # 2
    (3, TType.DOUBLE, 'price_1', None, None, ),  # 3
    (4, TType.DOUBLE, 'price_n', None, None, ),  # 4
    (5, TType.I32, 'interval_1', None, None, ),  # 5
    (6, TType.I32, 'interval_n', None, None, ),  # 6
    (7, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 7
    (8, TType.I32, 'grace_period', None, None, ),  # 8
    (9, TType.STRING, 'prefix', 'UTF8', None, ),  # 9
    (10, TType.I32, 'decimal_precision', None, None, ),  # 10
    (11, TType.BOOL, 'cost_round_up', None, None, ),  # 11
  )

  def __init__(self, free_seconds=None, connect_fee=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, grace_period=None, prefix=None, decimal_precision=None, cost_round_up=None,):
    self.free_seconds = free_seconds
    self.connect_fee = connect_fee
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.grace_period = grace_period
    self.prefix = prefix
    self.decimal_precision = decimal_precision
    self.cost_round_up = cost_round_up

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.free_seconds = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.decimal_precision = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.BOOL:
          self.cost_round_up = iprot.readBool()
        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('Billables')
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I64, 1)
      oprot.writeI64(self.free_seconds)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 2)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 3)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 4)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 5)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 6)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 7)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 8)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 9)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.decimal_precision is not None:
      oprot.writeFieldBegin('decimal_precision', TType.I32, 10)
      oprot.writeI32(self.decimal_precision)
      oprot.writeFieldEnd()
    if self.cost_round_up is not None:
      oprot.writeFieldBegin('cost_round_up', TType.BOOL, 11)
      oprot.writeBool(self.cost_round_up)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 AccountBillables(object):
  """
  Attributes:
   - bparams
   - area_name
   - i_commission_agent
   - commission_size
   - i_wholesaler
   - fresh_balance
   - plan_only
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 2
    (3, TType.STRUCT, 'i_commission_agent', (NullInt64, NullInt64.thrift_spec), None, ),  # 3
    (4, TType.DOUBLE, 'commission_size', None, None, ),  # 4
    (5, TType.I64, 'i_wholesaler', None, None, ),  # 5
    (6, TType.DOUBLE, 'fresh_balance', None, None, ),  # 6
    (7, TType.BOOL, 'plan_only', None, None, ),  # 7
  )

  def __init__(self, bparams=None, area_name=None, i_commission_agent=None, commission_size=None, i_wholesaler=None, fresh_balance=None, plan_only=None,):
    self.bparams = bparams
    self.area_name = area_name
    self.i_commission_agent = i_commission_agent
    self.commission_size = commission_size
    self.i_wholesaler = i_wholesaler
    self.fresh_balance = fresh_balance
    self.plan_only = plan_only

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.i_commission_agent = NullInt64()
          self.i_commission_agent.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.commission_size = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.i_wholesaler = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.DOUBLE:
          self.fresh_balance = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.BOOL:
          self.plan_only = iprot.readBool()
        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('AccountBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 2)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.i_commission_agent is not None:
      oprot.writeFieldBegin('i_commission_agent', TType.STRUCT, 3)
      self.i_commission_agent.write(oprot)
      oprot.writeFieldEnd()
    if self.commission_size is not None:
      oprot.writeFieldBegin('commission_size', TType.DOUBLE, 4)
      oprot.writeDouble(self.commission_size)
      oprot.writeFieldEnd()
    if self.i_wholesaler is not None:
      oprot.writeFieldBegin('i_wholesaler', TType.I64, 5)
      oprot.writeI64(self.i_wholesaler)
      oprot.writeFieldEnd()
    if self.fresh_balance is not None:
      oprot.writeFieldBegin('fresh_balance', TType.DOUBLE, 6)
      oprot.writeDouble(self.fresh_balance)
      oprot.writeFieldEnd()
    if self.plan_only is not None:
      oprot.writeFieldBegin('plan_only', TType.BOOL, 7)
      oprot.writeBool(self.plan_only)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CustomerBillables(object):
  """
  Attributes:
   - bparams
   - area_name
   - i_commission_agent
   - commission_size
   - i_customer
   - i_wholesaler
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 2
    (3, TType.STRUCT, 'i_commission_agent', (NullInt64, NullInt64.thrift_spec), None, ),  # 3
    (4, TType.DOUBLE, 'commission_size', None, None, ),  # 4
    (5, TType.I64, 'i_customer', None, None, ),  # 5
    (6, TType.I64, 'i_wholesaler', None, None, ),  # 6
  )

  def __init__(self, bparams=None, area_name=None, i_commission_agent=None, commission_size=None, i_customer=None, i_wholesaler=None,):
    self.bparams = bparams
    self.area_name = area_name
    self.i_commission_agent = i_commission_agent
    self.commission_size = commission_size
    self.i_customer = i_customer
    self.i_wholesaler = i_wholesaler

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.i_commission_agent = NullInt64()
          self.i_commission_agent.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.commission_size = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.i_wholesaler = 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('CustomerBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 2)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.i_commission_agent is not None:
      oprot.writeFieldBegin('i_commission_agent', TType.STRUCT, 3)
      self.i_commission_agent.write(oprot)
      oprot.writeFieldEnd()
    if self.commission_size is not None:
      oprot.writeFieldBegin('commission_size', TType.DOUBLE, 4)
      oprot.writeDouble(self.commission_size)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 5)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.i_wholesaler is not None:
      oprot.writeFieldBegin('i_wholesaler', TType.I64, 6)
      oprot.writeI64(self.i_wholesaler)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 DidBillables(object):
  """
  Attributes:
   - bparams
   - i_did
   - did
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.I64, 'i_did', None, None, ),  # 2
    (3, TType.STRING, 'did', 'UTF8', None, ),  # 3
  )

  def __init__(self, bparams=None, i_did=None, did=None,):
    self.bparams = bparams
    self.i_did = i_did
    self.did = did

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('DidBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.i_did is not None:
      oprot.writeFieldBegin('i_did', TType.I64, 2)
      oprot.writeI64(self.i_did)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 3)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 BuyingDidBillables(object):
  """
  Attributes:
   - bparams
   - did
   - i_connection
   - i_did_authorization
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.STRING, 'did', 'UTF8', None, ),  # 2
    (3, TType.I64, 'i_connection', None, None, ),  # 3
    (4, TType.I64, 'i_did_authorization', None, None, ),  # 4
  )

  def __init__(self, bparams=None, did=None, i_connection=None, i_did_authorization=None,):
    self.bparams = bparams
    self.did = did
    self.i_connection = i_connection
    self.i_did_authorization = i_did_authorization

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_did_authorization = 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('BuyingDidBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 2)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 3)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    if self.i_did_authorization is not None:
      oprot.writeFieldBegin('i_did_authorization', TType.I64, 4)
      oprot.writeI64(self.i_did_authorization)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CustomerDidBillables(object):
  """
  Attributes:
   - bparams
   - did
   - i_customer
   - i_did
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.STRING, 'did', 'UTF8', None, ),  # 2
    (3, TType.I64, 'i_customer', None, None, ),  # 3
    (4, TType.I64, 'i_did', None, None, ),  # 4
  )

  def __init__(self, bparams=None, did=None, i_customer=None, i_did=None,):
    self.bparams = bparams
    self.did = did
    self.i_customer = i_customer
    self.i_did = i_did

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_did = 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('CustomerDidBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 2)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 3)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.i_did is not None:
      oprot.writeFieldBegin('i_did', TType.I64, 4)
      oprot.writeI64(self.i_did)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CreditTimes(object):
  """
  Attributes:
   - crtime_acct
   - crtime_ext
   - rtime
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'crtime_acct', (MonoTime, MonoTime.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'crtime_ext', (MonoTime, MonoTime.thrift_spec), None, ),  # 2
    (3, TType.STRUCT, 'rtime', (MonoTime, MonoTime.thrift_spec), None, ),  # 3
  )

  def __init__(self, crtime_acct=None, crtime_ext=None, rtime=None,):
    self.crtime_acct = crtime_acct
    self.crtime_ext = crtime_ext
    self.rtime = rtime

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.crtime_acct = MonoTime()
          self.crtime_acct.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.crtime_ext = MonoTime()
          self.crtime_ext.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.rtime = MonoTime()
          self.rtime.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('CreditTimes')
    if self.crtime_acct is not None:
      oprot.writeFieldBegin('crtime_acct', TType.STRUCT, 1)
      self.crtime_acct.write(oprot)
      oprot.writeFieldEnd()
    if self.crtime_ext is not None:
      oprot.writeFieldBegin('crtime_ext', TType.STRUCT, 2)
      self.crtime_ext.write(oprot)
      oprot.writeFieldEnd()
    if self.rtime is not None:
      oprot.writeFieldBegin('rtime', TType.STRUCT, 3)
      self.rtime.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__.items()]
    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 Duration(object):
  """
  Attributes:
   - nanoseconds
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'nanoseconds', None, None, ),  # 1
  )

  def __init__(self, nanoseconds=None,):
    self.nanoseconds = nanoseconds

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.nanoseconds = 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('Duration')
    if self.nanoseconds is not None:
      oprot.writeFieldBegin('nanoseconds', TType.I64, 1)
      oprot.writeI64(self.nanoseconds)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Tariff(object):
  """
  Attributes:
   - post_call_surcharge
   - connect_fee
   - name
   - i_tariff
   - free_seconds
   - i_owner
   - iso_4217
   - grace_period
   - max_loss
   - average_duration
   - loss_protection
   - local_calling
   - local_calling_cli_validation_rule
   - last_change_count
   - local_id
   - remote_id
   - is_remote
   - is_exportable
   - decimal_precision
   - cost_round_up
  """

  thrift_spec = (
    None,  # 0
    (1, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 1
    (2, TType.DOUBLE, 'connect_fee', None, None, ),  # 2
    (3, TType.STRUCT, 'name', (NullString, NullString.thrift_spec), None, ),  # 3
    (4, TType.I64, 'i_tariff', None, None, ),  # 4
    (5, TType.I32, 'free_seconds', None, None, ),  # 5
    (6, TType.I64, 'i_owner', None, None, ),  # 6
    (7, TType.STRING, 'iso_4217', 'UTF8', None, ),  # 7
    (8, TType.I32, 'grace_period', None, None, ),  # 8
    (9, TType.DOUBLE, 'max_loss', None, None, ),  # 9
    (10, TType.I32, 'average_duration', None, None, ),  # 10
    (11, TType.BOOL, 'loss_protection', None, None, ),  # 11
    (12, TType.BOOL, 'local_calling', None, None, ),  # 12
    (13, TType.STRING, 'local_calling_cli_validation_rule', 'UTF8', None, ),  # 13
    (14, TType.I64, 'last_change_count', None, None, ),  # 14
    (15, TType.STRUCT, 'local_id', (NullString, NullString.thrift_spec), None, ),  # 15
    (16, TType.STRUCT, 'remote_id', (NullString, NullString.thrift_spec), None, ),  # 16
    (17, TType.BOOL, 'is_remote', None, None, ),  # 17
    (18, TType.BOOL, 'is_exportable', None, None, ),  # 18
    (19, TType.I32, 'decimal_precision', None, None, ),  # 19
    (20, TType.BOOL, 'cost_round_up', None, None, ),  # 20
  )

  def __init__(self, post_call_surcharge=None, connect_fee=None, name=None, i_tariff=None, free_seconds=None, i_owner=None, iso_4217=None, grace_period=None, max_loss=None, average_duration=None, loss_protection=None, local_calling=None, local_calling_cli_validation_rule=None, last_change_count=None, local_id=None, remote_id=None, is_remote=None, is_exportable=None, decimal_precision=None, cost_round_up=None,):
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.name = name
    self.i_tariff = i_tariff
    self.free_seconds = free_seconds
    self.i_owner = i_owner
    self.iso_4217 = iso_4217
    self.grace_period = grace_period
    self.max_loss = max_loss
    self.average_duration = average_duration
    self.loss_protection = loss_protection
    self.local_calling = local_calling
    self.local_calling_cli_validation_rule = local_calling_cli_validation_rule
    self.last_change_count = last_change_count
    self.local_id = local_id
    self.remote_id = remote_id
    self.is_remote = is_remote
    self.is_exportable = is_exportable
    self.decimal_precision = decimal_precision
    self.cost_round_up = cost_round_up

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.name = NullString()
          self.name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_tariff = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.i_owner = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.iso_4217 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.DOUBLE:
          self.max_loss = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.average_duration = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.BOOL:
          self.loss_protection = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.BOOL:
          self.local_calling = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.local_calling_cli_validation_rule = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.I64:
          self.last_change_count = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRUCT:
          self.local_id = NullString()
          self.local_id.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.STRUCT:
          self.remote_id = NullString()
          self.remote_id.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.BOOL:
          self.is_remote = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.BOOL:
          self.is_exportable = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.I32:
          self.decimal_precision = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.BOOL:
          self.cost_round_up = iprot.readBool()
        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('Tariff')
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 1)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 2)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.name is not None:
      oprot.writeFieldBegin('name', TType.STRUCT, 3)
      self.name.write(oprot)
      oprot.writeFieldEnd()
    if self.i_tariff is not None:
      oprot.writeFieldBegin('i_tariff', TType.I64, 4)
      oprot.writeI64(self.i_tariff)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 5)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.i_owner is not None:
      oprot.writeFieldBegin('i_owner', TType.I64, 6)
      oprot.writeI64(self.i_owner)
      oprot.writeFieldEnd()
    if self.iso_4217 is not None:
      oprot.writeFieldBegin('iso_4217', TType.STRING, 7)
      oprot.writeString(self.iso_4217.encode('utf-8') if sys.version_info[0] == 2 else self.iso_4217)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 8)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.max_loss is not None:
      oprot.writeFieldBegin('max_loss', TType.DOUBLE, 9)
      oprot.writeDouble(self.max_loss)
      oprot.writeFieldEnd()
    if self.average_duration is not None:
      oprot.writeFieldBegin('average_duration', TType.I32, 10)
      oprot.writeI32(self.average_duration)
      oprot.writeFieldEnd()
    if self.loss_protection is not None:
      oprot.writeFieldBegin('loss_protection', TType.BOOL, 11)
      oprot.writeBool(self.loss_protection)
      oprot.writeFieldEnd()
    if self.local_calling is not None:
      oprot.writeFieldBegin('local_calling', TType.BOOL, 12)
      oprot.writeBool(self.local_calling)
      oprot.writeFieldEnd()
    if self.local_calling_cli_validation_rule is not None:
      oprot.writeFieldBegin('local_calling_cli_validation_rule', TType.STRING, 13)
      oprot.writeString(self.local_calling_cli_validation_rule.encode('utf-8') if sys.version_info[0] == 2 else self.local_calling_cli_validation_rule)
      oprot.writeFieldEnd()
    if self.last_change_count is not None:
      oprot.writeFieldBegin('last_change_count', TType.I64, 14)
      oprot.writeI64(self.last_change_count)
      oprot.writeFieldEnd()
    if self.local_id is not None:
      oprot.writeFieldBegin('local_id', TType.STRUCT, 15)
      self.local_id.write(oprot)
      oprot.writeFieldEnd()
    if self.remote_id is not None:
      oprot.writeFieldBegin('remote_id', TType.STRUCT, 16)
      self.remote_id.write(oprot)
      oprot.writeFieldEnd()
    if self.is_remote is not None:
      oprot.writeFieldBegin('is_remote', TType.BOOL, 17)
      oprot.writeBool(self.is_remote)
      oprot.writeFieldEnd()
    if self.is_exportable is not None:
      oprot.writeFieldBegin('is_exportable', TType.BOOL, 18)
      oprot.writeBool(self.is_exportable)
      oprot.writeFieldEnd()
    if self.decimal_precision is not None:
      oprot.writeFieldBegin('decimal_precision', TType.I32, 19)
      oprot.writeI32(self.decimal_precision)
      oprot.writeFieldEnd()
    if self.cost_round_up is not None:
      oprot.writeFieldBegin('cost_round_up', TType.BOOL, 20)
      oprot.writeBool(self.cost_round_up)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 TariffRate(object):
  """
  Attributes:
   - i_rate
   - prefix
   - i_tariff
   - price_1
   - price_n
   - interval_1
   - interval_n
   - forbidden
   - grace_period_enable
   - local_price_1
   - local_price_n
   - local_interval_1
   - local_interval_n
   - area_name
   - activation_date
   - expiration_date
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_rate', None, None, ),  # 1
    (2, TType.STRING, 'prefix', 'UTF8', None, ),  # 2
    (3, TType.I64, 'i_tariff', None, None, ),  # 3
    (4, TType.DOUBLE, 'price_1', None, None, ),  # 4
    (5, TType.DOUBLE, 'price_n', None, None, ),  # 5
    (6, TType.I32, 'interval_1', None, None, ),  # 6
    (7, TType.I32, 'interval_n', None, None, ),  # 7
    (8, TType.BOOL, 'forbidden', None, None, ),  # 8
    (9, TType.BOOL, 'grace_period_enable', None, None, ),  # 9
    (10, TType.DOUBLE, 'local_price_1', None, None, ),  # 10
    (11, TType.DOUBLE, 'local_price_n', None, None, ),  # 11
    (12, TType.I32, 'local_interval_1', None, None, ),  # 12
    (13, TType.I32, 'local_interval_n', None, None, ),  # 13
    (14, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 14
    (15, TType.STRUCT, 'activation_date', (UnixTime, UnixTime.thrift_spec), None, ),  # 15
    (16, TType.STRUCT, 'expiration_date', (UnixTime, UnixTime.thrift_spec), None, ),  # 16
  )

  def __init__(self, i_rate=None, prefix=None, i_tariff=None, price_1=None, price_n=None, interval_1=None, interval_n=None, forbidden=None, grace_period_enable=None, local_price_1=None, local_price_n=None, local_interval_1=None, local_interval_n=None, area_name=None, activation_date=None, expiration_date=None,):
    self.i_rate = i_rate
    self.prefix = prefix
    self.i_tariff = i_tariff
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.forbidden = forbidden
    self.grace_period_enable = grace_period_enable
    self.local_price_1 = local_price_1
    self.local_price_n = local_price_n
    self.local_interval_1 = local_interval_1
    self.local_interval_n = local_interval_n
    self.area_name = area_name
    self.activation_date = activation_date
    self.expiration_date = expiration_date

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_rate = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_tariff = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.BOOL:
          self.forbidden = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.BOOL:
          self.grace_period_enable = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.DOUBLE:
          self.local_price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.DOUBLE:
          self.local_price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.I32:
          self.local_interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.I32:
          self.local_interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRUCT:
          self.activation_date = UnixTime()
          self.activation_date.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.STRUCT:
          self.expiration_date = UnixTime()
          self.expiration_date.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('TariffRate')
    if self.i_rate is not None:
      oprot.writeFieldBegin('i_rate', TType.I64, 1)
      oprot.writeI64(self.i_rate)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 2)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.i_tariff is not None:
      oprot.writeFieldBegin('i_tariff', TType.I64, 3)
      oprot.writeI64(self.i_tariff)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 4)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 5)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 6)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 7)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.forbidden is not None:
      oprot.writeFieldBegin('forbidden', TType.BOOL, 8)
      oprot.writeBool(self.forbidden)
      oprot.writeFieldEnd()
    if self.grace_period_enable is not None:
      oprot.writeFieldBegin('grace_period_enable', TType.BOOL, 9)
      oprot.writeBool(self.grace_period_enable)
      oprot.writeFieldEnd()
    if self.local_price_1 is not None:
      oprot.writeFieldBegin('local_price_1', TType.DOUBLE, 10)
      oprot.writeDouble(self.local_price_1)
      oprot.writeFieldEnd()
    if self.local_price_n is not None:
      oprot.writeFieldBegin('local_price_n', TType.DOUBLE, 11)
      oprot.writeDouble(self.local_price_n)
      oprot.writeFieldEnd()
    if self.local_interval_1 is not None:
      oprot.writeFieldBegin('local_interval_1', TType.I32, 12)
      oprot.writeI32(self.local_interval_1)
      oprot.writeFieldEnd()
    if self.local_interval_n is not None:
      oprot.writeFieldBegin('local_interval_n', TType.I32, 13)
      oprot.writeI32(self.local_interval_n)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 14)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.activation_date is not None:
      oprot.writeFieldBegin('activation_date', TType.STRUCT, 15)
      self.activation_date.write(oprot)
      oprot.writeFieldEnd()
    if self.expiration_date is not None:
      oprot.writeFieldBegin('expiration_date', TType.STRUCT, 16)
      self.expiration_date.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__.items()]
    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 TariffRateList(object):
  """
  Attributes:
   - arr
  """

  thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'arr', (TType.STRUCT, (TariffRate, TariffRate.thrift_spec), False), None, ),  # 1
  )

  def __init__(self, arr=None,):
    self.arr = arr

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.arr = []
          (_etype10, _size7) = iprot.readListBegin()
          for _i11 in range(_size7):
            _elem12 = TariffRate()
            _elem12.read(iprot)
            self.arr.append(_elem12)
          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('TariffRateList')
    if self.arr is not None:
      oprot.writeFieldBegin('arr', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.arr))
      for iter13 in self.arr:
        iter13.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__.items()]
    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 LocalTariffRate(object):
  """
  Attributes:
   - activation_date
   - expiration_date
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'activation_date', (UnixTime, UnixTime.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'expiration_date', (UnixTime, UnixTime.thrift_spec), None, ),  # 2
  )

  def __init__(self, activation_date=None, expiration_date=None,):
    self.activation_date = activation_date
    self.expiration_date = expiration_date

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.activation_date = UnixTime()
          self.activation_date.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.expiration_date = UnixTime()
          self.expiration_date.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('LocalTariffRate')
    if self.activation_date is not None:
      oprot.writeFieldBegin('activation_date', TType.STRUCT, 1)
      self.activation_date.write(oprot)
      oprot.writeFieldEnd()
    if self.expiration_date is not None:
      oprot.writeFieldBegin('expiration_date', TType.STRUCT, 2)
      self.expiration_date.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__.items()]
    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 LocalTariffRateList(object):
  """
  Attributes:
   - arr
  """

  thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'arr', (TType.STRUCT, (LocalTariffRate, LocalTariffRate.thrift_spec), False), None, ),  # 1
  )

  def __init__(self, arr=None,):
    self.arr = arr

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.arr = []
          (_etype17, _size14) = iprot.readListBegin()
          for _i18 in range(_size14):
            _elem19 = LocalTariffRate()
            _elem19.read(iprot)
            self.arr.append(_elem19)
          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('LocalTariffRateList')
    if self.arr is not None:
      oprot.writeFieldBegin('arr', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.arr))
      for iter20 in self.arr:
        iter20.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__.items()]
    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 LookupbparamResultEntry(object):
  """
  Attributes:
   - free_seconds
   - connect_fee
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - grace_period
   - forbidden
   - average_duration
   - loss_protection
   - max_loss
   - prefix
   - plan_only
   - area_name
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I32, 'free_seconds', None, None, ),  # 1
    (2, TType.DOUBLE, 'connect_fee', None, None, ),  # 2
    (3, TType.DOUBLE, 'price_1', None, None, ),  # 3
    (4, TType.DOUBLE, 'price_n', None, None, ),  # 4
    (5, TType.I32, 'interval_1', None, None, ),  # 5
    (6, TType.I32, 'interval_n', None, None, ),  # 6
    (7, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 7
    (8, TType.I32, 'grace_period', None, None, ),  # 8
    (9, TType.BOOL, 'forbidden', None, None, ),  # 9
    (10, TType.I32, 'average_duration', None, None, ),  # 10
    (11, TType.BOOL, 'loss_protection', None, None, ),  # 11
    (12, TType.DOUBLE, 'max_loss', None, None, ),  # 12
    (13, TType.STRING, 'prefix', 'UTF8', None, ),  # 13
    (14, TType.BOOL, 'plan_only', None, None, ),  # 14
    (15, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 15
  )

  def __init__(self, free_seconds=None, connect_fee=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, grace_period=None, forbidden=None, average_duration=None, loss_protection=None, max_loss=None, prefix=None, plan_only=None, area_name=None,):
    self.free_seconds = free_seconds
    self.connect_fee = connect_fee
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.grace_period = grace_period
    self.forbidden = forbidden
    self.average_duration = average_duration
    self.loss_protection = loss_protection
    self.max_loss = max_loss
    self.prefix = prefix
    self.plan_only = plan_only
    self.area_name = area_name

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.BOOL:
          self.forbidden = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.average_duration = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.BOOL:
          self.loss_protection = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.DOUBLE:
          self.max_loss = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.BOOL:
          self.plan_only = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.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('LookupbparamResultEntry')
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 1)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 2)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 3)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 4)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 5)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 6)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 7)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 8)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.forbidden is not None:
      oprot.writeFieldBegin('forbidden', TType.BOOL, 9)
      oprot.writeBool(self.forbidden)
      oprot.writeFieldEnd()
    if self.average_duration is not None:
      oprot.writeFieldBegin('average_duration', TType.I32, 10)
      oprot.writeI32(self.average_duration)
      oprot.writeFieldEnd()
    if self.loss_protection is not None:
      oprot.writeFieldBegin('loss_protection', TType.BOOL, 11)
      oprot.writeBool(self.loss_protection)
      oprot.writeFieldEnd()
    if self.max_loss is not None:
      oprot.writeFieldBegin('max_loss', TType.DOUBLE, 12)
      oprot.writeDouble(self.max_loss)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 13)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.plan_only is not None:
      oprot.writeFieldBegin('plan_only', TType.BOOL, 14)
      oprot.writeBool(self.plan_only)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 15)
      self.area_name.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__.items()]
    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 LookupbparamResult(object):
  """
  Attributes:
   - bparams
   - decimal_precision
   - cost_round_up
  """

  thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'bparams', (TType.STRUCT, (LookupbparamResultEntry, LookupbparamResultEntry.thrift_spec), False), None, ),  # 1
    (2, TType.I32, 'decimal_precision', None, None, ),  # 2
    (3, TType.BOOL, 'cost_round_up', None, None, ),  # 3
  )

  def __init__(self, bparams=None, decimal_precision=None, cost_round_up=None,):
    self.bparams = bparams
    self.decimal_precision = decimal_precision
    self.cost_round_up = cost_round_up

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.bparams = []
          (_etype24, _size21) = iprot.readListBegin()
          for _i25 in range(_size21):
            _elem26 = LookupbparamResultEntry()
            _elem26.read(iprot)
            self.bparams.append(_elem26)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.decimal_precision = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.cost_round_up = iprot.readBool()
        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('LookupbparamResult')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.bparams))
      for iter27 in self.bparams:
        iter27.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.decimal_precision is not None:
      oprot.writeFieldBegin('decimal_precision', TType.I32, 2)
      oprot.writeI32(self.decimal_precision)
      oprot.writeFieldEnd()
    if self.cost_round_up is not None:
      oprot.writeFieldBegin('cost_round_up', TType.BOOL, 3)
      oprot.writeBool(self.cost_round_up)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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)

#
# 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_style1
#

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

import sys

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


class CallError(object):
  NO_ERROR = 0
  EXTERNAL_TRANSLATOR_REJECT = 1
  BODY_LESS_INVITE = 2
  ACCOUNT_EXPIRED = 3
  CONNECTION_CAPACITY_EXCEEDED = 4
  MALFORMED_SDP = 5
  UNSUPPORTED_CONTENT_TYPE = 6
  UNACCEPTABLE_CODEC = 7
  INVALID_AUTH_CLD_TRANS_RULE = 8
  INVALID_AUTH_CLI_TRANS_RULE = 9
  INVALID_ACNT_CLD_TRANS_RULE = 10
  INVALID_ACNT_CLI_TRANS_RULE = 11
  CANNOT_BIND_SESSION = 12
  INVALID_DID_CLI_TRANS_RULE = 13
  NO_RATE_FOUND = 14
  CALL_LOOP_DETECTED = 15
  TOO_MANY_SESSIONS = 16
  ACCOUNT_IN_USE = 17
  HIGH_CALL_RATE_PER_ACCOUNT = 18
  HIGH_CALL_RATE = 19
  INSUFFICIENT_BALANCE = 20
  FORBIDDEN_DESTINATION = 21
  NO_CUSTOMER_RATES = 22
  LOSS_PROTECTION = 23
  ADDRESS_INCOMPLETE = 24
  NO_ROUTES = 25
  HIGH_CALL_RATE_PER_CONNECTION = 26
  INVALID_ASSRT_ID_CLI_TRANS_RULE = 27
  DNCL_BLOCKED = 28

  _VALUES_TO_NAMES = {
    0: "NO_ERROR",
    1: "EXTERNAL_TRANSLATOR_REJECT",
    2: "BODY_LESS_INVITE",
    3: "ACCOUNT_EXPIRED",
    4: "CONNECTION_CAPACITY_EXCEEDED",
    5: "MALFORMED_SDP",
    6: "UNSUPPORTED_CONTENT_TYPE",
    7: "UNACCEPTABLE_CODEC",
    8: "INVALID_AUTH_CLD_TRANS_RULE",
    9: "INVALID_AUTH_CLI_TRANS_RULE",
    10: "INVALID_ACNT_CLD_TRANS_RULE",
    11: "INVALID_ACNT_CLI_TRANS_RULE",
    12: "CANNOT_BIND_SESSION",
    13: "INVALID_DID_CLI_TRANS_RULE",
    14: "NO_RATE_FOUND",
    15: "CALL_LOOP_DETECTED",
    16: "TOO_MANY_SESSIONS",
    17: "ACCOUNT_IN_USE",
    18: "HIGH_CALL_RATE_PER_ACCOUNT",
    19: "HIGH_CALL_RATE",
    20: "INSUFFICIENT_BALANCE",
    21: "FORBIDDEN_DESTINATION",
    22: "NO_CUSTOMER_RATES",
    23: "LOSS_PROTECTION",
    24: "ADDRESS_INCOMPLETE",
    25: "NO_ROUTES",
    26: "HIGH_CALL_RATE_PER_CONNECTION",
    27: "INVALID_ASSRT_ID_CLI_TRANS_RULE",
    28: "DNCL_BLOCKED",
  }

  _NAMES_TO_VALUES = {
    "NO_ERROR": 0,
    "EXTERNAL_TRANSLATOR_REJECT": 1,
    "BODY_LESS_INVITE": 2,
    "ACCOUNT_EXPIRED": 3,
    "CONNECTION_CAPACITY_EXCEEDED": 4,
    "MALFORMED_SDP": 5,
    "UNSUPPORTED_CONTENT_TYPE": 6,
    "UNACCEPTABLE_CODEC": 7,
    "INVALID_AUTH_CLD_TRANS_RULE": 8,
    "INVALID_AUTH_CLI_TRANS_RULE": 9,
    "INVALID_ACNT_CLD_TRANS_RULE": 10,
    "INVALID_ACNT_CLI_TRANS_RULE": 11,
    "CANNOT_BIND_SESSION": 12,
    "INVALID_DID_CLI_TRANS_RULE": 13,
    "NO_RATE_FOUND": 14,
    "CALL_LOOP_DETECTED": 15,
    "TOO_MANY_SESSIONS": 16,
    "ACCOUNT_IN_USE": 17,
    "HIGH_CALL_RATE_PER_ACCOUNT": 18,
    "HIGH_CALL_RATE": 19,
    "INSUFFICIENT_BALANCE": 20,
    "FORBIDDEN_DESTINATION": 21,
    "NO_CUSTOMER_RATES": 22,
    "LOSS_PROTECTION": 23,
    "ADDRESS_INCOMPLETE": 24,
    "NO_ROUTES": 25,
    "HIGH_CALL_RATE_PER_CONNECTION": 26,
    "INVALID_ASSRT_ID_CLI_TRANS_RULE": 27,
    "DNCL_BLOCKED": 28,
  }


class TransactionRecordType(object):
  CALLS = 1
  CDRS = 2
  CDRS_CONNECTIONS = 3
  CDRS_CUSTOMERS = 4
  CDRS_DIDS = 5
  CDRS_CONNECTIONS_DIDS = 6
  SURCHARGES = 7
  COMMISSIONS = 8
  UPDATE_ACCOUNT_BALANCE = 9
  UPDATE_CUSTOMER_BALANCE = 10
  UPDATE_VENDOR_BALANCE = 11
  UPDATE_PLAN_MINUTES = 12
  QUALITY_STATS = 13
  CALLS_SDP = 14
  CDRS_CUSTOMERS_DIDS = 15

  _VALUES_TO_NAMES = {
    1: "CALLS",
    2: "CDRS",
    3: "CDRS_CONNECTIONS",
    4: "CDRS_CUSTOMERS",
    5: "CDRS_DIDS",
    6: "CDRS_CONNECTIONS_DIDS",
    7: "SURCHARGES",
    8: "COMMISSIONS",
    9: "UPDATE_ACCOUNT_BALANCE",
    10: "UPDATE_CUSTOMER_BALANCE",
    11: "UPDATE_VENDOR_BALANCE",
    12: "UPDATE_PLAN_MINUTES",
    13: "QUALITY_STATS",
    14: "CALLS_SDP",
    15: "CDRS_CUSTOMERS_DIDS",
  }

  _NAMES_TO_VALUES = {
    "CALLS": 1,
    "CDRS": 2,
    "CDRS_CONNECTIONS": 3,
    "CDRS_CUSTOMERS": 4,
    "CDRS_DIDS": 5,
    "CDRS_CONNECTIONS_DIDS": 6,
    "SURCHARGES": 7,
    "COMMISSIONS": 8,
    "UPDATE_ACCOUNT_BALANCE": 9,
    "UPDATE_CUSTOMER_BALANCE": 10,
    "UPDATE_VENDOR_BALANCE": 11,
    "UPDATE_PLAN_MINUTES": 12,
    "QUALITY_STATS": 13,
    "CALLS_SDP": 14,
    "CDRS_CUSTOMERS_DIDS": 15,
  }


class NullInt64(object):
  """
  Attributes:
   - v
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'v', None, None, ),  # 1
  )

  def __init__(self, v=None,):
    self.v = v

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.v = 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('NullInt64')
    if self.v is not None:
      oprot.writeFieldBegin('v', TType.I64, 1)
      oprot.writeI64(self.v)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 NullString(object):
  """
  Attributes:
   - s
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRING, 's', 'UTF8', None, ),  # 1
  )

  def __init__(self, s=None,):
    self.s = s

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRING:
          self.s = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('NullString')
    if self.s is not None:
      oprot.writeFieldBegin('s', TType.STRING, 1)
      oprot.writeString(self.s.encode('utf-8') if sys.version_info[0] == 2 else self.s)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UnixTime(object):
  """
  Attributes:
   - seconds
   - nanoseconds
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'seconds', None, None, ),  # 1
    (2, TType.I64, 'nanoseconds', None, None, ),  # 2
  )

  def __init__(self, seconds=None, nanoseconds=None,):
    self.seconds = seconds
    self.nanoseconds = nanoseconds

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.seconds = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.nanoseconds = 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('UnixTime')
    if self.seconds is not None:
      oprot.writeFieldBegin('seconds', TType.I64, 1)
      oprot.writeI64(self.seconds)
      oprot.writeFieldEnd()
    if self.nanoseconds is not None:
      oprot.writeFieldBegin('nanoseconds', TType.I64, 2)
      oprot.writeI64(self.nanoseconds)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 MonoTime(object):
  """
  Attributes:
   - monot
   - realt
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'monot', (UnixTime, UnixTime.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'realt', (UnixTime, UnixTime.thrift_spec), None, ),  # 2
  )

  def __init__(self, monot=None, realt=None,):
    self.monot = monot
    self.realt = realt

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.monot = UnixTime()
          self.monot.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.realt = UnixTime()
          self.realt.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('MonoTime')
    if self.monot is not None:
      oprot.writeFieldBegin('monot', TType.STRUCT, 1)
      self.monot.write(oprot)
      oprot.writeFieldEnd()
    if self.realt is not None:
      oprot.writeFieldBegin('realt', TType.STRUCT, 2)
      self.realt.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__.items()]
    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 TransactionRecord(object):
  """
  Attributes:
   - type
   - data
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I32, 'type', None, None, ),  # 1
    (2, TType.STRING, 'data', 'UTF8', None, ),  # 2
  )

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

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.type = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.data = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('TransactionRecord')
    if self.type is not None:
      oprot.writeFieldBegin('type', TType.I32, 1)
      oprot.writeI32(self.type)
      oprot.writeFieldEnd()
    if self.data is not None:
      oprot.writeFieldBegin('data', TType.STRING, 2)
      oprot.writeString(self.data.encode('utf-8') if sys.version_info[0] == 2 else self.data)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Transaction(object):
  """
  Attributes:
   - records
  """

  thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'records', (TType.STRUCT, (TransactionRecord, TransactionRecord.thrift_spec), False), None, ),  # 1
  )

  def __init__(self, records=None,):
    self.records = records

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.records = []
          (_etype3, _size0) = iprot.readListBegin()
          for _i4 in range(_size0):
            _elem5 = TransactionRecord()
            _elem5.read(iprot)
            self.records.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('Transaction')
    if self.records is not None:
      oprot.writeFieldBegin('records', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.records))
      for iter6 in self.records:
        iter6.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__.items()]
    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 Calls(object):
  """
  Attributes:
   - i_call
   - call_id
   - cld
   - cli
   - setup_time
   - parent_i_call
   - i_call_type
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_call', None, None, ),  # 1
    (2, TType.STRING, 'call_id', 'UTF8', None, ),  # 2
    (3, TType.STRING, 'cld', 'UTF8', None, ),  # 3
    (4, TType.STRING, 'cli', 'UTF8', None, ),  # 4
    (5, TType.I64, 'setup_time', None, None, ),  # 5
    (6, TType.STRUCT, 'parent_i_call', (NullInt64, NullInt64.thrift_spec), None, ),  # 6
    (7, TType.STRUCT, 'i_call_type', (NullInt64, NullInt64.thrift_spec), None, ),  # 7
  )

  def __init__(self, i_call=None, call_id=None, cld=None, cli=None, setup_time=None, parent_i_call=None, i_call_type=None,):
    self.i_call = i_call
    self.call_id = call_id
    self.cld = cld
    self.cli = cli
    self.setup_time = setup_time
    self.parent_i_call = parent_i_call
    self.i_call_type = i_call_type

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.call_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.cld = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.cli = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRUCT:
          self.parent_i_call = NullInt64()
          self.parent_i_call.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRUCT:
          self.i_call_type = NullInt64()
          self.i_call_type.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('Calls')
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 1)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.call_id is not None:
      oprot.writeFieldBegin('call_id', TType.STRING, 2)
      oprot.writeString(self.call_id.encode('utf-8') if sys.version_info[0] == 2 else self.call_id)
      oprot.writeFieldEnd()
    if self.cld is not None:
      oprot.writeFieldBegin('cld', TType.STRING, 3)
      oprot.writeString(self.cld.encode('utf-8') if sys.version_info[0] == 2 else self.cld)
      oprot.writeFieldEnd()
    if self.cli is not None:
      oprot.writeFieldBegin('cli', TType.STRING, 4)
      oprot.writeString(self.cli.encode('utf-8') if sys.version_info[0] == 2 else self.cli)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 5)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.parent_i_call is not None:
      oprot.writeFieldBegin('parent_i_call', TType.STRUCT, 6)
      self.parent_i_call.write(oprot)
      oprot.writeFieldEnd()
    if self.i_call_type is not None:
      oprot.writeFieldBegin('i_call_type', TType.STRUCT, 7)
      self.i_call_type.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__.items()]
    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 Cdrs(object):
  """
  Attributes:
   - i_cdr
   - i_call
   - i_account
   - result
   - cost
   - delay
   - duration
   - billed_duration
   - connect_time
   - disconnect_time
   - cld_in
   - cli_in
   - prefix
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - remote_ip
   - grace_period
   - user_agent
   - pdd1xx
   - i_protocol
   - release_source
   - plan_duration
   - accessibility_cost
   - lrn_cld
   - lrn_cld_in
   - area_name
   - p_asserted_id
   - remote_party_id
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdr', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_account', None, None, ),  # 3
    (4, TType.I64, 'result', None, None, ),  # 4
    (5, TType.DOUBLE, 'cost', None, None, ),  # 5
    (6, TType.DOUBLE, 'delay', None, None, ),  # 6
    (7, TType.DOUBLE, 'duration', None, None, ),  # 7
    (8, TType.DOUBLE, 'billed_duration', None, None, ),  # 8
    (9, TType.I64, 'connect_time', None, None, ),  # 9
    (10, TType.I64, 'disconnect_time', None, None, ),  # 10
    (11, TType.STRING, 'cld_in', 'UTF8', None, ),  # 11
    (12, TType.STRING, 'cli_in', 'UTF8', None, ),  # 12
    (13, TType.STRING, 'prefix', 'UTF8', None, ),  # 13
    (14, TType.DOUBLE, 'price_1', None, None, ),  # 14
    (15, TType.DOUBLE, 'price_n', None, None, ),  # 15
    (16, TType.I32, 'interval_1', None, None, ),  # 16
    (17, TType.I32, 'interval_n', None, None, ),  # 17
    (18, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 18
    (19, TType.DOUBLE, 'connect_fee', None, None, ),  # 19
    (20, TType.I64, 'free_seconds', None, None, ),  # 20
    (21, TType.STRING, 'remote_ip', 'UTF8', None, ),  # 21
    (22, TType.I32, 'grace_period', None, None, ),  # 22
    (23, TType.STRING, 'user_agent', 'UTF8', None, ),  # 23
    (24, TType.DOUBLE, 'pdd1xx', None, None, ),  # 24
    (25, TType.I16, 'i_protocol', None, None, ),  # 25
    (26, TType.STRING, 'release_source', 'UTF8', None, ),  # 26
    (27, TType.DOUBLE, 'plan_duration', None, None, ),  # 27
    (28, TType.DOUBLE, 'accessibility_cost', None, None, ),  # 28
    (29, TType.STRUCT, 'lrn_cld', (NullString, NullString.thrift_spec), None, ),  # 29
    (30, TType.STRUCT, 'lrn_cld_in', (NullString, NullString.thrift_spec), None, ),  # 30
    (31, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 31
    (32, TType.STRUCT, 'p_asserted_id', (NullString, NullString.thrift_spec), None, ),  # 32
    (33, TType.STRUCT, 'remote_party_id', (NullString, NullString.thrift_spec), None, ),  # 33
  )

  def __init__(self, i_cdr=None, i_call=None, i_account=None, result=None, cost=None, delay=None, duration=None, billed_duration=None, connect_time=None, disconnect_time=None, cld_in=None, cli_in=None, prefix=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, remote_ip=None, grace_period=None, user_agent=None, pdd1xx=None, i_protocol=None, release_source=None, plan_duration=None, accessibility_cost=None, lrn_cld=None, lrn_cld_in=None, area_name=None, p_asserted_id=None, remote_party_id=None,):
    self.i_cdr = i_cdr
    self.i_call = i_call
    self.i_account = i_account
    self.result = result
    self.cost = cost
    self.delay = delay
    self.duration = duration
    self.billed_duration = billed_duration
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.cld_in = cld_in
    self.cli_in = cli_in
    self.prefix = prefix
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.remote_ip = remote_ip
    self.grace_period = grace_period
    self.user_agent = user_agent
    self.pdd1xx = pdd1xx
    self.i_protocol = i_protocol
    self.release_source = release_source
    self.plan_duration = plan_duration
    self.accessibility_cost = accessibility_cost
    self.lrn_cld = lrn_cld
    self.lrn_cld_in = lrn_cld_in
    self.area_name = area_name
    self.p_asserted_id = p_asserted_id
    self.remote_party_id = remote_party_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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdr = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_account = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.result = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.DOUBLE:
          self.delay = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.STRING:
          self.cld_in = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.STRING:
          self.cli_in = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.I64:
          self.free_seconds = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 21:
        if ftype == TType.STRING:
          self.remote_ip = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 22:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 23:
        if ftype == TType.STRING:
          self.user_agent = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 24:
        if ftype == TType.DOUBLE:
          self.pdd1xx = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 25:
        if ftype == TType.I16:
          self.i_protocol = iprot.readI16()
        else:
          iprot.skip(ftype)
      elif fid == 26:
        if ftype == TType.STRING:
          self.release_source = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 27:
        if ftype == TType.DOUBLE:
          self.plan_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 28:
        if ftype == TType.DOUBLE:
          self.accessibility_cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 29:
        if ftype == TType.STRUCT:
          self.lrn_cld = NullString()
          self.lrn_cld.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 30:
        if ftype == TType.STRUCT:
          self.lrn_cld_in = NullString()
          self.lrn_cld_in.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 31:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 32:
        if ftype == TType.STRUCT:
          self.p_asserted_id = NullString()
          self.p_asserted_id.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 33:
        if ftype == TType.STRUCT:
          self.remote_party_id = NullString()
          self.remote_party_id.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('Cdrs')
    if self.i_cdr is not None:
      oprot.writeFieldBegin('i_cdr', TType.I64, 1)
      oprot.writeI64(self.i_cdr)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_account is not None:
      oprot.writeFieldBegin('i_account', TType.I64, 3)
      oprot.writeI64(self.i_account)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I64, 4)
      oprot.writeI64(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 5)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.delay is not None:
      oprot.writeFieldBegin('delay', TType.DOUBLE, 6)
      oprot.writeDouble(self.delay)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 7)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 8)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 9)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 10)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.cld_in is not None:
      oprot.writeFieldBegin('cld_in', TType.STRING, 11)
      oprot.writeString(self.cld_in.encode('utf-8') if sys.version_info[0] == 2 else self.cld_in)
      oprot.writeFieldEnd()
    if self.cli_in is not None:
      oprot.writeFieldBegin('cli_in', TType.STRING, 12)
      oprot.writeString(self.cli_in.encode('utf-8') if sys.version_info[0] == 2 else self.cli_in)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 13)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 14)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 15)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 16)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 17)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 18)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 19)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I64, 20)
      oprot.writeI64(self.free_seconds)
      oprot.writeFieldEnd()
    if self.remote_ip is not None:
      oprot.writeFieldBegin('remote_ip', TType.STRING, 21)
      oprot.writeString(self.remote_ip.encode('utf-8') if sys.version_info[0] == 2 else self.remote_ip)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 22)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.user_agent is not None:
      oprot.writeFieldBegin('user_agent', TType.STRING, 23)
      oprot.writeString(self.user_agent.encode('utf-8') if sys.version_info[0] == 2 else self.user_agent)
      oprot.writeFieldEnd()
    if self.pdd1xx is not None:
      oprot.writeFieldBegin('pdd1xx', TType.DOUBLE, 24)
      oprot.writeDouble(self.pdd1xx)
      oprot.writeFieldEnd()
    if self.i_protocol is not None:
      oprot.writeFieldBegin('i_protocol', TType.I16, 25)
      oprot.writeI16(self.i_protocol)
      oprot.writeFieldEnd()
    if self.release_source is not None:
      oprot.writeFieldBegin('release_source', TType.STRING, 26)
      oprot.writeString(self.release_source.encode('utf-8') if sys.version_info[0] == 2 else self.release_source)
      oprot.writeFieldEnd()
    if self.plan_duration is not None:
      oprot.writeFieldBegin('plan_duration', TType.DOUBLE, 27)
      oprot.writeDouble(self.plan_duration)
      oprot.writeFieldEnd()
    if self.accessibility_cost is not None:
      oprot.writeFieldBegin('accessibility_cost', TType.DOUBLE, 28)
      oprot.writeDouble(self.accessibility_cost)
      oprot.writeFieldEnd()
    if self.lrn_cld is not None:
      oprot.writeFieldBegin('lrn_cld', TType.STRUCT, 29)
      self.lrn_cld.write(oprot)
      oprot.writeFieldEnd()
    if self.lrn_cld_in is not None:
      oprot.writeFieldBegin('lrn_cld_in', TType.STRUCT, 30)
      self.lrn_cld_in.write(oprot)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 31)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.p_asserted_id is not None:
      oprot.writeFieldBegin('p_asserted_id', TType.STRUCT, 32)
      self.p_asserted_id.write(oprot)
      oprot.writeFieldEnd()
    if self.remote_party_id is not None:
      oprot.writeFieldBegin('remote_party_id', TType.STRUCT, 33)
      self.remote_party_id.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__.items()]
    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 CdrsConnections(object):
  """
  Attributes:
   - i_cdrs_connection
   - i_call
   - i_connection
   - result
   - cost
   - delay
   - duration
   - billed_duration
   - setup_time
   - connect_time
   - disconnect_time
   - cld_out
   - cli_out
   - prefix
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
   - user_agent
   - pdd100
   - pdd1xx
   - i_account_debug
   - i_protocol
   - release_source
   - call_setup_time
   - lrn_cld
   - area_name
   - i_media_relay
   - remote_ip
   - vendor_name
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_connection', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_connection', None, None, ),  # 3
    (4, TType.I32, 'result', None, None, ),  # 4
    (5, TType.DOUBLE, 'cost', None, None, ),  # 5
    (6, TType.DOUBLE, 'delay', None, None, ),  # 6
    (7, TType.DOUBLE, 'duration', None, None, ),  # 7
    (8, TType.DOUBLE, 'billed_duration', None, None, ),  # 8
    (9, TType.I64, 'setup_time', None, None, ),  # 9
    (10, TType.I64, 'connect_time', None, None, ),  # 10
    (11, TType.I64, 'disconnect_time', None, None, ),  # 11
    (12, TType.STRING, 'cld_out', 'UTF8', None, ),  # 12
    (13, TType.STRING, 'cli_out', 'UTF8', None, ),  # 13
    (14, TType.STRING, 'prefix', 'UTF8', None, ),  # 14
    (15, TType.DOUBLE, 'price_1', None, None, ),  # 15
    (16, TType.DOUBLE, 'price_n', None, None, ),  # 16
    (17, TType.I32, 'interval_1', None, None, ),  # 17
    (18, TType.I32, 'interval_n', None, None, ),  # 18
    (19, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 19
    (20, TType.DOUBLE, 'connect_fee', None, None, ),  # 20
    (21, TType.I32, 'free_seconds', None, None, ),  # 21
    (22, TType.I32, 'grace_period', None, None, ),  # 22
    (23, TType.STRING, 'user_agent', 'UTF8', None, ),  # 23
    (24, TType.DOUBLE, 'pdd100', None, None, ),  # 24
    (25, TType.DOUBLE, 'pdd1xx', None, None, ),  # 25
    (26, TType.I64, 'i_account_debug', None, None, ),  # 26
    (27, TType.I32, 'i_protocol', None, None, ),  # 27
    (28, TType.STRING, 'release_source', 'UTF8', None, ),  # 28
    (29, TType.I64, 'call_setup_time', None, None, ),  # 29
    (30, TType.STRUCT, 'lrn_cld', (NullString, NullString.thrift_spec), None, ),  # 30
    (31, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 31
    (32, TType.STRUCT, 'i_media_relay', (NullInt64, NullInt64.thrift_spec), None, ),  # 32
    (33, TType.STRUCT, 'remote_ip', (NullString, NullString.thrift_spec), None, ),  # 33
    (34, TType.STRUCT, 'vendor_name', (NullString, NullString.thrift_spec), None, ),  # 34
  )

  def __init__(self, i_cdrs_connection=None, i_call=None, i_connection=None, result=None, cost=None, delay=None, duration=None, billed_duration=None, setup_time=None, connect_time=None, disconnect_time=None, cld_out=None, cli_out=None, prefix=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None, user_agent=None, pdd100=None, pdd1xx=None, i_account_debug=None, i_protocol=None, release_source=None, call_setup_time=None, lrn_cld=None, area_name=None, i_media_relay=None, remote_ip=None, vendor_name=None,):
    self.i_cdrs_connection = i_cdrs_connection
    self.i_call = i_call
    self.i_connection = i_connection
    self.result = result
    self.cost = cost
    self.delay = delay
    self.duration = duration
    self.billed_duration = billed_duration
    self.setup_time = setup_time
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.cld_out = cld_out
    self.cli_out = cli_out
    self.prefix = prefix
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period
    self.user_agent = user_agent
    self.pdd100 = pdd100
    self.pdd1xx = pdd1xx
    self.i_account_debug = i_account_debug
    self.i_protocol = i_protocol
    self.release_source = release_source
    self.call_setup_time = call_setup_time
    self.lrn_cld = lrn_cld
    self.area_name = area_name
    self.i_media_relay = i_media_relay
    self.remote_ip = remote_ip
    self.vendor_name = vendor_name

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I32:
          self.result = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.DOUBLE:
          self.delay = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.STRING:
          self.cld_out = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.cli_out = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 21:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 22:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 23:
        if ftype == TType.STRING:
          self.user_agent = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 24:
        if ftype == TType.DOUBLE:
          self.pdd100 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 25:
        if ftype == TType.DOUBLE:
          self.pdd1xx = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 26:
        if ftype == TType.I64:
          self.i_account_debug = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 27:
        if ftype == TType.I32:
          self.i_protocol = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 28:
        if ftype == TType.STRING:
          self.release_source = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 29:
        if ftype == TType.I64:
          self.call_setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 30:
        if ftype == TType.STRUCT:
          self.lrn_cld = NullString()
          self.lrn_cld.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 31:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 32:
        if ftype == TType.STRUCT:
          self.i_media_relay = NullInt64()
          self.i_media_relay.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 33:
        if ftype == TType.STRUCT:
          self.remote_ip = NullString()
          self.remote_ip.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 34:
        if ftype == TType.STRUCT:
          self.vendor_name = NullString()
          self.vendor_name.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('CdrsConnections')
    if self.i_cdrs_connection is not None:
      oprot.writeFieldBegin('i_cdrs_connection', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_connection)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 3)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I32, 4)
      oprot.writeI32(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 5)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.delay is not None:
      oprot.writeFieldBegin('delay', TType.DOUBLE, 6)
      oprot.writeDouble(self.delay)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 7)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 8)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 9)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 10)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 11)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.cld_out is not None:
      oprot.writeFieldBegin('cld_out', TType.STRING, 12)
      oprot.writeString(self.cld_out.encode('utf-8') if sys.version_info[0] == 2 else self.cld_out)
      oprot.writeFieldEnd()
    if self.cli_out is not None:
      oprot.writeFieldBegin('cli_out', TType.STRING, 13)
      oprot.writeString(self.cli_out.encode('utf-8') if sys.version_info[0] == 2 else self.cli_out)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 14)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 15)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 16)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 17)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 18)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 19)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 20)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 21)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 22)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.user_agent is not None:
      oprot.writeFieldBegin('user_agent', TType.STRING, 23)
      oprot.writeString(self.user_agent.encode('utf-8') if sys.version_info[0] == 2 else self.user_agent)
      oprot.writeFieldEnd()
    if self.pdd100 is not None:
      oprot.writeFieldBegin('pdd100', TType.DOUBLE, 24)
      oprot.writeDouble(self.pdd100)
      oprot.writeFieldEnd()
    if self.pdd1xx is not None:
      oprot.writeFieldBegin('pdd1xx', TType.DOUBLE, 25)
      oprot.writeDouble(self.pdd1xx)
      oprot.writeFieldEnd()
    if self.i_account_debug is not None:
      oprot.writeFieldBegin('i_account_debug', TType.I64, 26)
      oprot.writeI64(self.i_account_debug)
      oprot.writeFieldEnd()
    if self.i_protocol is not None:
      oprot.writeFieldBegin('i_protocol', TType.I32, 27)
      oprot.writeI32(self.i_protocol)
      oprot.writeFieldEnd()
    if self.release_source is not None:
      oprot.writeFieldBegin('release_source', TType.STRING, 28)
      oprot.writeString(self.release_source.encode('utf-8') if sys.version_info[0] == 2 else self.release_source)
      oprot.writeFieldEnd()
    if self.call_setup_time is not None:
      oprot.writeFieldBegin('call_setup_time', TType.I64, 29)
      oprot.writeI64(self.call_setup_time)
      oprot.writeFieldEnd()
    if self.lrn_cld is not None:
      oprot.writeFieldBegin('lrn_cld', TType.STRUCT, 30)
      self.lrn_cld.write(oprot)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 31)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.i_media_relay is not None:
      oprot.writeFieldBegin('i_media_relay', TType.STRUCT, 32)
      self.i_media_relay.write(oprot)
      oprot.writeFieldEnd()
    if self.remote_ip is not None:
      oprot.writeFieldBegin('remote_ip', TType.STRUCT, 33)
      self.remote_ip.write(oprot)
      oprot.writeFieldEnd()
    if self.vendor_name is not None:
      oprot.writeFieldBegin('vendor_name', TType.STRUCT, 34)
      self.vendor_name.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__.items()]
    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 CdrsCustomers(object):
  """
  Attributes:
   - i_cdrs_customer
   - i_cdr
   - i_customer
   - cost
   - billed_duration
   - prefix
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
   - i_call
   - i_wholesaler
   - setup_time
   - duration
   - area_name
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_customer', None, None, ),  # 1
    (2, TType.I64, 'i_cdr', None, None, ),  # 2
    (3, TType.I64, 'i_customer', None, None, ),  # 3
    (4, TType.DOUBLE, 'cost', None, None, ),  # 4
    (5, TType.DOUBLE, 'billed_duration', None, None, ),  # 5
    (6, TType.STRING, 'prefix', 'UTF8', None, ),  # 6
    (7, TType.DOUBLE, 'price_1', None, None, ),  # 7
    (8, TType.DOUBLE, 'price_n', None, None, ),  # 8
    (9, TType.I32, 'interval_1', None, None, ),  # 9
    (10, TType.I32, 'interval_n', None, None, ),  # 10
    (11, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 11
    (12, TType.DOUBLE, 'connect_fee', None, None, ),  # 12
    (13, TType.I32, 'free_seconds', None, None, ),  # 13
    (14, TType.I32, 'grace_period', None, None, ),  # 14
    (15, TType.I64, 'i_call', None, None, ),  # 15
    (16, TType.I64, 'i_wholesaler', None, None, ),  # 16
    (17, TType.I64, 'setup_time', None, None, ),  # 17
    (18, TType.DOUBLE, 'duration', None, None, ),  # 18
    (19, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 19
  )

  def __init__(self, i_cdrs_customer=None, i_cdr=None, i_customer=None, cost=None, billed_duration=None, prefix=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None, i_call=None, i_wholesaler=None, setup_time=None, duration=None, area_name=None,):
    self.i_cdrs_customer = i_cdrs_customer
    self.i_cdr = i_cdr
    self.i_customer = i_customer
    self.cost = cost
    self.billed_duration = billed_duration
    self.prefix = prefix
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period
    self.i_call = i_call
    self.i_wholesaler = i_wholesaler
    self.setup_time = setup_time
    self.duration = duration
    self.area_name = area_name

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_cdr = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I64:
          self.i_wholesaler = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.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('CdrsCustomers')
    if self.i_cdrs_customer is not None:
      oprot.writeFieldBegin('i_cdrs_customer', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_customer)
      oprot.writeFieldEnd()
    if self.i_cdr is not None:
      oprot.writeFieldBegin('i_cdr', TType.I64, 2)
      oprot.writeI64(self.i_cdr)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 3)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 4)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 5)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 6)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 7)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 8)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 9)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 10)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 11)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 12)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 13)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 14)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 15)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_wholesaler is not None:
      oprot.writeFieldBegin('i_wholesaler', TType.I64, 16)
      oprot.writeI64(self.i_wholesaler)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 17)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 18)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 19)
      self.area_name.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__.items()]
    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 CdrsDids(object):
  """
  Attributes:
   - i_cdrs_did
   - i_call
   - i_did
   - did
   - result
   - cost
   - duration
   - billed_duration
   - setup_time
   - connect_time
   - disconnect_time
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_did', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_did', None, None, ),  # 3
    (4, TType.STRING, 'did', 'UTF8', None, ),  # 4
    (5, TType.I32, 'result', None, None, ),  # 5
    (6, TType.DOUBLE, 'cost', None, None, ),  # 6
    (7, TType.DOUBLE, 'duration', None, None, ),  # 7
    (8, TType.DOUBLE, 'billed_duration', None, None, ),  # 8
    (9, TType.I64, 'setup_time', None, None, ),  # 9
    (10, TType.I64, 'connect_time', None, None, ),  # 10
    (11, TType.I64, 'disconnect_time', None, None, ),  # 11
    (12, TType.DOUBLE, 'price_1', None, None, ),  # 12
    (13, TType.DOUBLE, 'price_n', None, None, ),  # 13
    (14, TType.I32, 'interval_1', None, None, ),  # 14
    (15, TType.I32, 'interval_n', None, None, ),  # 15
    (16, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 16
    (17, TType.DOUBLE, 'connect_fee', None, None, ),  # 17
    (18, TType.I32, 'free_seconds', None, None, ),  # 18
    (19, TType.I32, 'grace_period', None, None, ),  # 19
  )

  def __init__(self, i_cdrs_did=None, i_call=None, i_did=None, did=None, result=None, cost=None, duration=None, billed_duration=None, setup_time=None, connect_time=None, disconnect_time=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None,):
    self.i_cdrs_did = i_cdrs_did
    self.i_call = i_call
    self.i_did = i_did
    self.did = did
    self.result = result
    self.cost = cost
    self.duration = duration
    self.billed_duration = billed_duration
    self.setup_time = setup_time
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.result = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.I32:
          self.grace_period = 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('CdrsDids')
    if self.i_cdrs_did is not None:
      oprot.writeFieldBegin('i_cdrs_did', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_did)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_did is not None:
      oprot.writeFieldBegin('i_did', TType.I64, 3)
      oprot.writeI64(self.i_did)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 4)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I32, 5)
      oprot.writeI32(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 6)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 7)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 8)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 9)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 10)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 11)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 12)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 13)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 14)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 15)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 16)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 17)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 18)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 19)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CdrsConnectionsDids(object):
  """
  Attributes:
   - i_cdrs_connections_did
   - i_call
   - i_did_authorization
   - did
   - incoming_did
   - i_connection
   - result
   - cost
   - duration
   - billed_duration
   - setup_time
   - connect_time
   - disconnect_time
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_connections_did', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_did_authorization', None, None, ),  # 3
    (4, TType.STRING, 'did', 'UTF8', None, ),  # 4
    (5, TType.STRING, 'incoming_did', 'UTF8', None, ),  # 5
    (6, TType.I64, 'i_connection', None, None, ),  # 6
    (7, TType.I32, 'result', None, None, ),  # 7
    (8, TType.DOUBLE, 'cost', None, None, ),  # 8
    (9, TType.DOUBLE, 'duration', None, None, ),  # 9
    (10, TType.DOUBLE, 'billed_duration', None, None, ),  # 10
    (11, TType.I64, 'setup_time', None, None, ),  # 11
    (12, TType.I64, 'connect_time', None, None, ),  # 12
    (13, TType.I64, 'disconnect_time', None, None, ),  # 13
    (14, TType.DOUBLE, 'price_1', None, None, ),  # 14
    (15, TType.DOUBLE, 'price_n', None, None, ),  # 15
    (16, TType.I32, 'interval_1', None, None, ),  # 16
    (17, TType.I32, 'interval_n', None, None, ),  # 17
    (18, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 18
    (19, TType.DOUBLE, 'connect_fee', None, None, ),  # 19
    (20, TType.I32, 'free_seconds', None, None, ),  # 20
    (21, TType.I32, 'grace_period', None, None, ),  # 21
  )

  def __init__(self, i_cdrs_connections_did=None, i_call=None, i_did_authorization=None, did=None, incoming_did=None, i_connection=None, result=None, cost=None, duration=None, billed_duration=None, setup_time=None, connect_time=None, disconnect_time=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None,):
    self.i_cdrs_connections_did = i_cdrs_connections_did
    self.i_call = i_call
    self.i_did_authorization = i_did_authorization
    self.did = did
    self.incoming_did = incoming_did
    self.i_connection = i_connection
    self.result = result
    self.cost = cost
    self.duration = duration
    self.billed_duration = billed_duration
    self.setup_time = setup_time
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_connections_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_did_authorization = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.incoming_did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.i_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I32:
          self.result = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 21:
        if ftype == TType.I32:
          self.grace_period = 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('CdrsConnectionsDids')
    if self.i_cdrs_connections_did is not None:
      oprot.writeFieldBegin('i_cdrs_connections_did', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_connections_did)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_did_authorization is not None:
      oprot.writeFieldBegin('i_did_authorization', TType.I64, 3)
      oprot.writeI64(self.i_did_authorization)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 4)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.incoming_did is not None:
      oprot.writeFieldBegin('incoming_did', TType.STRING, 5)
      oprot.writeString(self.incoming_did.encode('utf-8') if sys.version_info[0] == 2 else self.incoming_did)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 6)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I32, 7)
      oprot.writeI32(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 8)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 9)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 10)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 11)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 12)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 13)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 14)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 15)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 16)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 17)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 18)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 19)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 20)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 21)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Surcharges(object):
  """
  Attributes:
   - i_surcharge
   - i_call
   - cost
   - i_surcharge_type
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_surcharge', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.DOUBLE, 'cost', None, None, ),  # 3
    (4, TType.I64, 'i_surcharge_type', None, None, ),  # 4
  )

  def __init__(self, i_surcharge=None, i_call=None, cost=None, i_surcharge_type=None,):
    self.i_surcharge = i_surcharge
    self.i_call = i_call
    self.cost = cost
    self.i_surcharge_type = i_surcharge_type

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_surcharge = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_surcharge_type = 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('Surcharges')
    if self.i_surcharge is not None:
      oprot.writeFieldBegin('i_surcharge', TType.I64, 1)
      oprot.writeI64(self.i_surcharge)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 3)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.i_surcharge_type is not None:
      oprot.writeFieldBegin('i_surcharge_type', TType.I64, 4)
      oprot.writeI64(self.i_surcharge_type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Commissions(object):
  """
  Attributes:
   - i_commission
   - i_account
   - i_customer
   - i_cdrs_customer
   - commission_size
   - setup_time
   - i_call
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_commission', None, None, ),  # 1
    (2, TType.STRUCT, 'i_account', (NullInt64, NullInt64.thrift_spec), None, ),  # 2
    (3, TType.STRUCT, 'i_customer', (NullInt64, NullInt64.thrift_spec), None, ),  # 3
    (4, TType.I64, 'i_cdrs_customer', None, None, ),  # 4
    (5, TType.DOUBLE, 'commission_size', None, None, ),  # 5
    (6, TType.I64, 'setup_time', None, None, ),  # 6
    (7, TType.I64, 'i_call', None, None, ),  # 7
  )

  def __init__(self, i_commission=None, i_account=None, i_customer=None, i_cdrs_customer=None, commission_size=None, setup_time=None, i_call=None,):
    self.i_commission = i_commission
    self.i_account = i_account
    self.i_customer = i_customer
    self.i_cdrs_customer = i_cdrs_customer
    self.commission_size = commission_size
    self.setup_time = setup_time
    self.i_call = i_call

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_commission = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.i_account = NullInt64()
          self.i_account.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.i_customer = NullInt64()
          self.i_customer.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_cdrs_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.commission_size = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I64:
          self.i_call = 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('Commissions')
    if self.i_commission is not None:
      oprot.writeFieldBegin('i_commission', TType.I64, 1)
      oprot.writeI64(self.i_commission)
      oprot.writeFieldEnd()
    if self.i_account is not None:
      oprot.writeFieldBegin('i_account', TType.STRUCT, 2)
      self.i_account.write(oprot)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.STRUCT, 3)
      self.i_customer.write(oprot)
      oprot.writeFieldEnd()
    if self.i_cdrs_customer is not None:
      oprot.writeFieldBegin('i_cdrs_customer', TType.I64, 4)
      oprot.writeI64(self.i_cdrs_customer)
      oprot.writeFieldEnd()
    if self.commission_size is not None:
      oprot.writeFieldBegin('commission_size', TType.DOUBLE, 5)
      oprot.writeDouble(self.commission_size)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 6)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 7)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CallsSdp(object):
  """
  Attributes:
   - i_calls_sdp
   - i_call
   - i_cdrs_connection
   - time_stamp
   - sdp
   - sip_msg_type
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_calls_sdp', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.STRUCT, 'i_cdrs_connection', (NullInt64, NullInt64.thrift_spec), None, ),  # 3
    (4, TType.STRUCT, 'time_stamp', (UnixTime, UnixTime.thrift_spec), None, ),  # 4
    (5, TType.STRING, 'sdp', 'UTF8', None, ),  # 5
    (6, TType.STRING, 'sip_msg_type', 'UTF8', None, ),  # 6
  )

  def __init__(self, i_calls_sdp=None, i_call=None, i_cdrs_connection=None, time_stamp=None, sdp=None, sip_msg_type=None,):
    self.i_calls_sdp = i_calls_sdp
    self.i_call = i_call
    self.i_cdrs_connection = i_cdrs_connection
    self.time_stamp = time_stamp
    self.sdp = sdp
    self.sip_msg_type = sip_msg_type

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_calls_sdp = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.i_cdrs_connection = NullInt64()
          self.i_cdrs_connection.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.STRUCT:
          self.time_stamp = UnixTime()
          self.time_stamp.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.sdp = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.sip_msg_type = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('CallsSdp')
    if self.i_calls_sdp is not None:
      oprot.writeFieldBegin('i_calls_sdp', TType.I64, 1)
      oprot.writeI64(self.i_calls_sdp)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_cdrs_connection is not None:
      oprot.writeFieldBegin('i_cdrs_connection', TType.STRUCT, 3)
      self.i_cdrs_connection.write(oprot)
      oprot.writeFieldEnd()
    if self.time_stamp is not None:
      oprot.writeFieldBegin('time_stamp', TType.STRUCT, 4)
      self.time_stamp.write(oprot)
      oprot.writeFieldEnd()
    if self.sdp is not None:
      oprot.writeFieldBegin('sdp', TType.STRING, 5)
      oprot.writeString(self.sdp.encode('utf-8') if sys.version_info[0] == 2 else self.sdp)
      oprot.writeFieldEnd()
    if self.sip_msg_type is not None:
      oprot.writeFieldBegin('sip_msg_type', TType.STRING, 6)
      oprot.writeString(self.sip_msg_type.encode('utf-8') if sys.version_info[0] == 2 else self.sip_msg_type)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CdrsCustomersDids(object):
  """
  Attributes:
   - i_cdrs_customers_did
   - i_call
   - i_customer
   - i_did
   - did
   - result
   - cost
   - duration
   - billed_duration
   - setup_time
   - connect_time
   - disconnect_time
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - connect_fee
   - free_seconds
   - grace_period
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_cdrs_customers_did', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
    (3, TType.I64, 'i_customer', None, None, ),  # 3
    (4, TType.I64, 'i_did', None, None, ),  # 4
    (5, TType.STRING, 'did', 'UTF8', None, ),  # 5
    (6, TType.I32, 'result', None, None, ),  # 6
    (7, TType.DOUBLE, 'cost', None, None, ),  # 7
    (8, TType.DOUBLE, 'duration', None, None, ),  # 8
    (9, TType.DOUBLE, 'billed_duration', None, None, ),  # 9
    (10, TType.I64, 'setup_time', None, None, ),  # 10
    (11, TType.I64, 'connect_time', None, None, ),  # 11
    (12, TType.I64, 'disconnect_time', None, None, ),  # 12
    (13, TType.DOUBLE, 'price_1', None, None, ),  # 13
    (14, TType.DOUBLE, 'price_n', None, None, ),  # 14
    (15, TType.I32, 'interval_1', None, None, ),  # 15
    (16, TType.I32, 'interval_n', None, None, ),  # 16
    (17, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 17
    (18, TType.DOUBLE, 'connect_fee', None, None, ),  # 18
    (19, TType.I32, 'free_seconds', None, None, ),  # 19
    (20, TType.I32, 'grace_period', None, None, ),  # 20
  )

  def __init__(self, i_cdrs_customers_did=None, i_call=None, i_customer=None, i_did=None, did=None, result=None, cost=None, duration=None, billed_duration=None, setup_time=None, connect_time=None, disconnect_time=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, connect_fee=None, free_seconds=None, grace_period=None,):
    self.i_cdrs_customers_did = i_cdrs_customers_did
    self.i_call = i_call
    self.i_customer = i_customer
    self.i_did = i_did
    self.did = did
    self.result = result
    self.cost = cost
    self.duration = duration
    self.billed_duration = billed_duration
    self.setup_time = setup_time
    self.connect_time = connect_time
    self.disconnect_time = disconnect_time
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.free_seconds = free_seconds
    self.grace_period = grace_period

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_cdrs_customers_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.result = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.cost = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.DOUBLE:
          self.duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.DOUBLE:
          self.billed_duration = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I64:
          self.setup_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.I64:
          self.connect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.I64:
          self.disconnect_time = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.I32:
          self.grace_period = 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('CdrsCustomersDids')
    if self.i_cdrs_customers_did is not None:
      oprot.writeFieldBegin('i_cdrs_customers_did', TType.I64, 1)
      oprot.writeI64(self.i_cdrs_customers_did)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 3)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.i_did is not None:
      oprot.writeFieldBegin('i_did', TType.I64, 4)
      oprot.writeI64(self.i_did)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 5)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.result is not None:
      oprot.writeFieldBegin('result', TType.I32, 6)
      oprot.writeI32(self.result)
      oprot.writeFieldEnd()
    if self.cost is not None:
      oprot.writeFieldBegin('cost', TType.DOUBLE, 7)
      oprot.writeDouble(self.cost)
      oprot.writeFieldEnd()
    if self.duration is not None:
      oprot.writeFieldBegin('duration', TType.DOUBLE, 8)
      oprot.writeDouble(self.duration)
      oprot.writeFieldEnd()
    if self.billed_duration is not None:
      oprot.writeFieldBegin('billed_duration', TType.DOUBLE, 9)
      oprot.writeDouble(self.billed_duration)
      oprot.writeFieldEnd()
    if self.setup_time is not None:
      oprot.writeFieldBegin('setup_time', TType.I64, 10)
      oprot.writeI64(self.setup_time)
      oprot.writeFieldEnd()
    if self.connect_time is not None:
      oprot.writeFieldBegin('connect_time', TType.I64, 11)
      oprot.writeI64(self.connect_time)
      oprot.writeFieldEnd()
    if self.disconnect_time is not None:
      oprot.writeFieldBegin('disconnect_time', TType.I64, 12)
      oprot.writeI64(self.disconnect_time)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 13)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 14)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 15)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 16)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 17)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 18)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 19)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 20)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UpdateAccountBalanceMessage(object):
  """
  Attributes:
   - i_account
   - delta
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_account', None, None, ),  # 1
    (2, TType.DOUBLE, 'delta', None, None, ),  # 2
  )

  def __init__(self, i_account=None, delta=None,):
    self.i_account = i_account
    self.delta = delta

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_account = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.delta = 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('UpdateAccountBalanceMessage')
    if self.i_account is not None:
      oprot.writeFieldBegin('i_account', TType.I64, 1)
      oprot.writeI64(self.i_account)
      oprot.writeFieldEnd()
    if self.delta is not None:
      oprot.writeFieldBegin('delta', TType.DOUBLE, 2)
      oprot.writeDouble(self.delta)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UpdateCustomerBalanceMessage(object):
  """
  Attributes:
   - i_customer
   - delta
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_customer', None, None, ),  # 1
    (2, TType.DOUBLE, 'delta', None, None, ),  # 2
  )

  def __init__(self, i_customer=None, delta=None,):
    self.i_customer = i_customer
    self.delta = delta

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.delta = 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('UpdateCustomerBalanceMessage')
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 1)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.delta is not None:
      oprot.writeFieldBegin('delta', TType.DOUBLE, 2)
      oprot.writeDouble(self.delta)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UpdateVendorBalanceMessage(object):
  """
  Attributes:
   - i_vendor
   - delta
   - i_connection
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_vendor', None, None, ),  # 1
    (2, TType.DOUBLE, 'delta', None, None, ),  # 2
    (3, TType.I64, 'i_connection', None, None, ),  # 3
  )

  def __init__(self, i_vendor=None, delta=None, i_connection=None,):
    self.i_vendor = i_vendor
    self.delta = delta
    self.i_connection = i_connection

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_vendor = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.delta = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_connection = 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('UpdateVendorBalanceMessage')
    if self.i_vendor is not None:
      oprot.writeFieldBegin('i_vendor', TType.I64, 1)
      oprot.writeI64(self.i_vendor)
      oprot.writeFieldEnd()
    if self.delta is not None:
      oprot.writeFieldBegin('delta', TType.DOUBLE, 2)
      oprot.writeDouble(self.delta)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 3)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 UpdatePlanMinutesMessage(object):
  """
  Attributes:
   - i_account
   - i_service_plan
   - delta
   - chargeable_seconds
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_account', None, None, ),  # 1
    (2, TType.I64, 'i_service_plan', None, None, ),  # 2
    (3, TType.DOUBLE, 'delta', None, None, ),  # 3
    (4, TType.DOUBLE, 'chargeable_seconds', None, None, ),  # 4
  )

  def __init__(self, i_account=None, i_service_plan=None, delta=None, chargeable_seconds=None,):
    self.i_account = i_account
    self.i_service_plan = i_service_plan
    self.delta = delta
    self.chargeable_seconds = chargeable_seconds

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_account = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_service_plan = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.delta = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.chargeable_seconds = 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('UpdatePlanMinutesMessage')
    if self.i_account is not None:
      oprot.writeFieldBegin('i_account', TType.I64, 1)
      oprot.writeI64(self.i_account)
      oprot.writeFieldEnd()
    if self.i_service_plan is not None:
      oprot.writeFieldBegin('i_service_plan', TType.I64, 2)
      oprot.writeI64(self.i_service_plan)
      oprot.writeFieldEnd()
    if self.delta is not None:
      oprot.writeFieldBegin('delta', TType.DOUBLE, 3)
      oprot.writeDouble(self.delta)
      oprot.writeFieldEnd()
    if self.chargeable_seconds is not None:
      oprot.writeFieldBegin('chargeable_seconds', TType.DOUBLE, 4)
      oprot.writeDouble(self.chargeable_seconds)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 ConnectionQualityStats(object):
  """
  Attributes:
   - i_connection_quality_stats
   - i_connection
   - tstamp
   - asr
   - acd
   - action
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_connection_quality_stats', None, None, ),  # 1
    (2, TType.I64, 'i_connection', None, None, ),  # 2
    (3, TType.I64, 'tstamp', None, None, ),  # 3
    (4, TType.DOUBLE, 'asr', None, None, ),  # 4
    (5, TType.I32, 'acd', None, None, ),  # 5
    (6, TType.STRING, 'action', 'UTF8', None, ),  # 6
  )

  def __init__(self, i_connection_quality_stats=None, i_connection=None, tstamp=None, asr=None, acd=None, action=None,):
    self.i_connection_quality_stats = i_connection_quality_stats
    self.i_connection = i_connection
    self.tstamp = tstamp
    self.asr = asr
    self.acd = acd
    self.action = action

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_connection_quality_stats = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.tstamp = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.asr = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.acd = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.STRING:
          self.action = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('ConnectionQualityStats')
    if self.i_connection_quality_stats is not None:
      oprot.writeFieldBegin('i_connection_quality_stats', TType.I64, 1)
      oprot.writeI64(self.i_connection_quality_stats)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 2)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    if self.tstamp is not None:
      oprot.writeFieldBegin('tstamp', TType.I64, 3)
      oprot.writeI64(self.tstamp)
      oprot.writeFieldEnd()
    if self.asr is not None:
      oprot.writeFieldBegin('asr', TType.DOUBLE, 4)
      oprot.writeDouble(self.asr)
      oprot.writeFieldEnd()
    if self.acd is not None:
      oprot.writeFieldBegin('acd', TType.I32, 5)
      oprot.writeI32(self.acd)
      oprot.writeFieldEnd()
    if self.action is not None:
      oprot.writeFieldBegin('action', TType.STRING, 6)
      oprot.writeString(self.action.encode('utf-8') if sys.version_info[0] == 2 else self.action)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 RegisterError(TException):
  """
  Attributes:
   - cause
   - i_call
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I32, 'cause', None, None, ),  # 1
    (2, TType.I64, 'i_call', None, None, ),  # 2
  )

  def __init__(self, cause=None, i_call=None,):
    self.cause = cause
    self.i_call = i_call

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.cause = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_call = 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('RegisterError')
    if self.cause is not None:
      oprot.writeFieldBegin('cause', TType.I32, 1)
      oprot.writeI32(self.cause)
      oprot.writeFieldEnd()
    if self.i_call is not None:
      oprot.writeFieldBegin('i_call', TType.I64, 2)
      oprot.writeI64(self.i_call)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 TryBackupError(TException):

  thrift_spec = (
  )

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      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('TryBackupError')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 EagainError(TException):

  thrift_spec = (
  )

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      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('EagainError')
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __str__(self):
    return repr(self)

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Billables(object):
  """
  Attributes:
   - free_seconds
   - connect_fee
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - grace_period
   - prefix
   - decimal_precision
   - cost_round_up
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'free_seconds', None, None, ),  # 1
    (2, TType.DOUBLE, 'connect_fee', None, None, ),  # 2
    (3, TType.DOUBLE, 'price_1', None, None, ),  # 3
    (4, TType.DOUBLE, 'price_n', None, None, ),  # 4
    (5, TType.I32, 'interval_1', None, None, ),  # 5
    (6, TType.I32, 'interval_n', None, None, ),  # 6
    (7, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 7
    (8, TType.I32, 'grace_period', None, None, ),  # 8
    (9, TType.STRING, 'prefix', 'UTF8', None, ),  # 9
    (10, TType.I32, 'decimal_precision', None, None, ),  # 10
    (11, TType.BOOL, 'cost_round_up', None, None, ),  # 11
  )

  def __init__(self, free_seconds=None, connect_fee=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, grace_period=None, prefix=None, decimal_precision=None, cost_round_up=None,):
    self.free_seconds = free_seconds
    self.connect_fee = connect_fee
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.grace_period = grace_period
    self.prefix = prefix
    self.decimal_precision = decimal_precision
    self.cost_round_up = cost_round_up

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.free_seconds = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.decimal_precision = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.BOOL:
          self.cost_round_up = iprot.readBool()
        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('Billables')
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I64, 1)
      oprot.writeI64(self.free_seconds)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 2)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 3)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 4)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 5)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 6)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 7)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 8)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 9)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.decimal_precision is not None:
      oprot.writeFieldBegin('decimal_precision', TType.I32, 10)
      oprot.writeI32(self.decimal_precision)
      oprot.writeFieldEnd()
    if self.cost_round_up is not None:
      oprot.writeFieldBegin('cost_round_up', TType.BOOL, 11)
      oprot.writeBool(self.cost_round_up)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 AccountBillables(object):
  """
  Attributes:
   - bparams
   - area_name
   - i_commission_agent
   - commission_size
   - i_wholesaler
   - fresh_balance
   - plan_only
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 2
    (3, TType.STRUCT, 'i_commission_agent', (NullInt64, NullInt64.thrift_spec), None, ),  # 3
    (4, TType.DOUBLE, 'commission_size', None, None, ),  # 4
    (5, TType.I64, 'i_wholesaler', None, None, ),  # 5
    (6, TType.DOUBLE, 'fresh_balance', None, None, ),  # 6
    (7, TType.BOOL, 'plan_only', None, None, ),  # 7
  )

  def __init__(self, bparams=None, area_name=None, i_commission_agent=None, commission_size=None, i_wholesaler=None, fresh_balance=None, plan_only=None,):
    self.bparams = bparams
    self.area_name = area_name
    self.i_commission_agent = i_commission_agent
    self.commission_size = commission_size
    self.i_wholesaler = i_wholesaler
    self.fresh_balance = fresh_balance
    self.plan_only = plan_only

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.i_commission_agent = NullInt64()
          self.i_commission_agent.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.commission_size = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.i_wholesaler = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.DOUBLE:
          self.fresh_balance = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.BOOL:
          self.plan_only = iprot.readBool()
        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('AccountBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 2)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.i_commission_agent is not None:
      oprot.writeFieldBegin('i_commission_agent', TType.STRUCT, 3)
      self.i_commission_agent.write(oprot)
      oprot.writeFieldEnd()
    if self.commission_size is not None:
      oprot.writeFieldBegin('commission_size', TType.DOUBLE, 4)
      oprot.writeDouble(self.commission_size)
      oprot.writeFieldEnd()
    if self.i_wholesaler is not None:
      oprot.writeFieldBegin('i_wholesaler', TType.I64, 5)
      oprot.writeI64(self.i_wholesaler)
      oprot.writeFieldEnd()
    if self.fresh_balance is not None:
      oprot.writeFieldBegin('fresh_balance', TType.DOUBLE, 6)
      oprot.writeDouble(self.fresh_balance)
      oprot.writeFieldEnd()
    if self.plan_only is not None:
      oprot.writeFieldBegin('plan_only', TType.BOOL, 7)
      oprot.writeBool(self.plan_only)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CustomerBillables(object):
  """
  Attributes:
   - bparams
   - area_name
   - i_commission_agent
   - commission_size
   - i_customer
   - i_wholesaler
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 2
    (3, TType.STRUCT, 'i_commission_agent', (NullInt64, NullInt64.thrift_spec), None, ),  # 3
    (4, TType.DOUBLE, 'commission_size', None, None, ),  # 4
    (5, TType.I64, 'i_customer', None, None, ),  # 5
    (6, TType.I64, 'i_wholesaler', None, None, ),  # 6
  )

  def __init__(self, bparams=None, area_name=None, i_commission_agent=None, commission_size=None, i_customer=None, i_wholesaler=None,):
    self.bparams = bparams
    self.area_name = area_name
    self.i_commission_agent = i_commission_agent
    self.commission_size = commission_size
    self.i_customer = i_customer
    self.i_wholesaler = i_wholesaler

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.i_commission_agent = NullInt64()
          self.i_commission_agent.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.commission_size = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.i_wholesaler = 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('CustomerBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 2)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.i_commission_agent is not None:
      oprot.writeFieldBegin('i_commission_agent', TType.STRUCT, 3)
      self.i_commission_agent.write(oprot)
      oprot.writeFieldEnd()
    if self.commission_size is not None:
      oprot.writeFieldBegin('commission_size', TType.DOUBLE, 4)
      oprot.writeDouble(self.commission_size)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 5)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.i_wholesaler is not None:
      oprot.writeFieldBegin('i_wholesaler', TType.I64, 6)
      oprot.writeI64(self.i_wholesaler)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 DidBillables(object):
  """
  Attributes:
   - bparams
   - i_did
   - did
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.I64, 'i_did', None, None, ),  # 2
    (3, TType.STRING, 'did', 'UTF8', None, ),  # 3
  )

  def __init__(self, bparams=None, i_did=None, did=None,):
    self.bparams = bparams
    self.i_did = i_did
    self.did = did

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I64:
          self.i_did = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        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('DidBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.i_did is not None:
      oprot.writeFieldBegin('i_did', TType.I64, 2)
      oprot.writeI64(self.i_did)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 3)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 BuyingDidBillables(object):
  """
  Attributes:
   - bparams
   - did
   - i_connection
   - i_did_authorization
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.STRING, 'did', 'UTF8', None, ),  # 2
    (3, TType.I64, 'i_connection', None, None, ),  # 3
    (4, TType.I64, 'i_did_authorization', None, None, ),  # 4
  )

  def __init__(self, bparams=None, did=None, i_connection=None, i_did_authorization=None,):
    self.bparams = bparams
    self.did = did
    self.i_connection = i_connection
    self.i_did_authorization = i_did_authorization

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_connection = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_did_authorization = 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('BuyingDidBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 2)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.i_connection is not None:
      oprot.writeFieldBegin('i_connection', TType.I64, 3)
      oprot.writeI64(self.i_connection)
      oprot.writeFieldEnd()
    if self.i_did_authorization is not None:
      oprot.writeFieldBegin('i_did_authorization', TType.I64, 4)
      oprot.writeI64(self.i_did_authorization)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CustomerDidBillables(object):
  """
  Attributes:
   - bparams
   - did
   - i_customer
   - i_did
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'bparams', (Billables, Billables.thrift_spec), None, ),  # 1
    (2, TType.STRING, 'did', 'UTF8', None, ),  # 2
    (3, TType.I64, 'i_customer', None, None, ),  # 3
    (4, TType.I64, 'i_did', None, None, ),  # 4
  )

  def __init__(self, bparams=None, did=None, i_customer=None, i_did=None,):
    self.bparams = bparams
    self.did = did
    self.i_customer = i_customer
    self.i_did = i_did

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.bparams = Billables()
          self.bparams.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.did = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_customer = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_did = 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('CustomerDidBillables')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.STRUCT, 1)
      self.bparams.write(oprot)
      oprot.writeFieldEnd()
    if self.did is not None:
      oprot.writeFieldBegin('did', TType.STRING, 2)
      oprot.writeString(self.did.encode('utf-8') if sys.version_info[0] == 2 else self.did)
      oprot.writeFieldEnd()
    if self.i_customer is not None:
      oprot.writeFieldBegin('i_customer', TType.I64, 3)
      oprot.writeI64(self.i_customer)
      oprot.writeFieldEnd()
    if self.i_did is not None:
      oprot.writeFieldBegin('i_did', TType.I64, 4)
      oprot.writeI64(self.i_did)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 CreditTimes(object):
  """
  Attributes:
   - crtime_acct
   - crtime_ext
   - rtime
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'crtime_acct', (MonoTime, MonoTime.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'crtime_ext', (MonoTime, MonoTime.thrift_spec), None, ),  # 2
    (3, TType.STRUCT, 'rtime', (MonoTime, MonoTime.thrift_spec), None, ),  # 3
  )

  def __init__(self, crtime_acct=None, crtime_ext=None, rtime=None,):
    self.crtime_acct = crtime_acct
    self.crtime_ext = crtime_ext
    self.rtime = rtime

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.crtime_acct = MonoTime()
          self.crtime_acct.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.crtime_ext = MonoTime()
          self.crtime_ext.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.rtime = MonoTime()
          self.rtime.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('CreditTimes')
    if self.crtime_acct is not None:
      oprot.writeFieldBegin('crtime_acct', TType.STRUCT, 1)
      self.crtime_acct.write(oprot)
      oprot.writeFieldEnd()
    if self.crtime_ext is not None:
      oprot.writeFieldBegin('crtime_ext', TType.STRUCT, 2)
      self.crtime_ext.write(oprot)
      oprot.writeFieldEnd()
    if self.rtime is not None:
      oprot.writeFieldBegin('rtime', TType.STRUCT, 3)
      self.rtime.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__.items()]
    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 Duration(object):
  """
  Attributes:
   - nanoseconds
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'nanoseconds', None, None, ),  # 1
  )

  def __init__(self, nanoseconds=None,):
    self.nanoseconds = nanoseconds

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.nanoseconds = 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('Duration')
    if self.nanoseconds is not None:
      oprot.writeFieldBegin('nanoseconds', TType.I64, 1)
      oprot.writeI64(self.nanoseconds)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 Tariff(object):
  """
  Attributes:
   - post_call_surcharge
   - connect_fee
   - name
   - i_tariff
   - free_seconds
   - i_owner
   - iso_4217
   - grace_period
   - max_loss
   - average_duration
   - loss_protection
   - local_calling
   - local_calling_cli_validation_rule
   - last_change_count
   - local_id
   - remote_id
   - is_remote
   - is_exportable
   - decimal_precision
   - cost_round_up
  """

  thrift_spec = (
    None,  # 0
    (1, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 1
    (2, TType.DOUBLE, 'connect_fee', None, None, ),  # 2
    (3, TType.STRUCT, 'name', (NullString, NullString.thrift_spec), None, ),  # 3
    (4, TType.I64, 'i_tariff', None, None, ),  # 4
    (5, TType.I32, 'free_seconds', None, None, ),  # 5
    (6, TType.I64, 'i_owner', None, None, ),  # 6
    (7, TType.STRING, 'iso_4217', 'UTF8', None, ),  # 7
    (8, TType.I32, 'grace_period', None, None, ),  # 8
    (9, TType.DOUBLE, 'max_loss', None, None, ),  # 9
    (10, TType.I32, 'average_duration', None, None, ),  # 10
    (11, TType.BOOL, 'loss_protection', None, None, ),  # 11
    (12, TType.BOOL, 'local_calling', None, None, ),  # 12
    (13, TType.STRING, 'local_calling_cli_validation_rule', 'UTF8', None, ),  # 13
    (14, TType.I64, 'last_change_count', None, None, ),  # 14
    (15, TType.STRUCT, 'local_id', (NullString, NullString.thrift_spec), None, ),  # 15
    (16, TType.STRUCT, 'remote_id', (NullString, NullString.thrift_spec), None, ),  # 16
    (17, TType.BOOL, 'is_remote', None, None, ),  # 17
    (18, TType.BOOL, 'is_exportable', None, None, ),  # 18
    (19, TType.I32, 'decimal_precision', None, None, ),  # 19
    (20, TType.BOOL, 'cost_round_up', None, None, ),  # 20
  )

  def __init__(self, post_call_surcharge=None, connect_fee=None, name=None, i_tariff=None, free_seconds=None, i_owner=None, iso_4217=None, grace_period=None, max_loss=None, average_duration=None, loss_protection=None, local_calling=None, local_calling_cli_validation_rule=None, last_change_count=None, local_id=None, remote_id=None, is_remote=None, is_exportable=None, decimal_precision=None, cost_round_up=None,):
    self.post_call_surcharge = post_call_surcharge
    self.connect_fee = connect_fee
    self.name = name
    self.i_tariff = i_tariff
    self.free_seconds = free_seconds
    self.i_owner = i_owner
    self.iso_4217 = iso_4217
    self.grace_period = grace_period
    self.max_loss = max_loss
    self.average_duration = average_duration
    self.loss_protection = loss_protection
    self.local_calling = local_calling
    self.local_calling_cli_validation_rule = local_calling_cli_validation_rule
    self.last_change_count = last_change_count
    self.local_id = local_id
    self.remote_id = remote_id
    self.is_remote = is_remote
    self.is_exportable = is_exportable
    self.decimal_precision = decimal_precision
    self.cost_round_up = cost_round_up

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.STRUCT:
          self.name = NullString()
          self.name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.I64:
          self.i_tariff = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I64:
          self.i_owner = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.STRING:
          self.iso_4217 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.DOUBLE:
          self.max_loss = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.average_duration = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.BOOL:
          self.loss_protection = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.BOOL:
          self.local_calling = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.local_calling_cli_validation_rule = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.I64:
          self.last_change_count = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRUCT:
          self.local_id = NullString()
          self.local_id.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.STRUCT:
          self.remote_id = NullString()
          self.remote_id.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 17:
        if ftype == TType.BOOL:
          self.is_remote = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 18:
        if ftype == TType.BOOL:
          self.is_exportable = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 19:
        if ftype == TType.I32:
          self.decimal_precision = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 20:
        if ftype == TType.BOOL:
          self.cost_round_up = iprot.readBool()
        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('Tariff')
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 1)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 2)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.name is not None:
      oprot.writeFieldBegin('name', TType.STRUCT, 3)
      self.name.write(oprot)
      oprot.writeFieldEnd()
    if self.i_tariff is not None:
      oprot.writeFieldBegin('i_tariff', TType.I64, 4)
      oprot.writeI64(self.i_tariff)
      oprot.writeFieldEnd()
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 5)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.i_owner is not None:
      oprot.writeFieldBegin('i_owner', TType.I64, 6)
      oprot.writeI64(self.i_owner)
      oprot.writeFieldEnd()
    if self.iso_4217 is not None:
      oprot.writeFieldBegin('iso_4217', TType.STRING, 7)
      oprot.writeString(self.iso_4217.encode('utf-8') if sys.version_info[0] == 2 else self.iso_4217)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 8)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.max_loss is not None:
      oprot.writeFieldBegin('max_loss', TType.DOUBLE, 9)
      oprot.writeDouble(self.max_loss)
      oprot.writeFieldEnd()
    if self.average_duration is not None:
      oprot.writeFieldBegin('average_duration', TType.I32, 10)
      oprot.writeI32(self.average_duration)
      oprot.writeFieldEnd()
    if self.loss_protection is not None:
      oprot.writeFieldBegin('loss_protection', TType.BOOL, 11)
      oprot.writeBool(self.loss_protection)
      oprot.writeFieldEnd()
    if self.local_calling is not None:
      oprot.writeFieldBegin('local_calling', TType.BOOL, 12)
      oprot.writeBool(self.local_calling)
      oprot.writeFieldEnd()
    if self.local_calling_cli_validation_rule is not None:
      oprot.writeFieldBegin('local_calling_cli_validation_rule', TType.STRING, 13)
      oprot.writeString(self.local_calling_cli_validation_rule.encode('utf-8') if sys.version_info[0] == 2 else self.local_calling_cli_validation_rule)
      oprot.writeFieldEnd()
    if self.last_change_count is not None:
      oprot.writeFieldBegin('last_change_count', TType.I64, 14)
      oprot.writeI64(self.last_change_count)
      oprot.writeFieldEnd()
    if self.local_id is not None:
      oprot.writeFieldBegin('local_id', TType.STRUCT, 15)
      self.local_id.write(oprot)
      oprot.writeFieldEnd()
    if self.remote_id is not None:
      oprot.writeFieldBegin('remote_id', TType.STRUCT, 16)
      self.remote_id.write(oprot)
      oprot.writeFieldEnd()
    if self.is_remote is not None:
      oprot.writeFieldBegin('is_remote', TType.BOOL, 17)
      oprot.writeBool(self.is_remote)
      oprot.writeFieldEnd()
    if self.is_exportable is not None:
      oprot.writeFieldBegin('is_exportable', TType.BOOL, 18)
      oprot.writeBool(self.is_exportable)
      oprot.writeFieldEnd()
    if self.decimal_precision is not None:
      oprot.writeFieldBegin('decimal_precision', TType.I32, 19)
      oprot.writeI32(self.decimal_precision)
      oprot.writeFieldEnd()
    if self.cost_round_up is not None:
      oprot.writeFieldBegin('cost_round_up', TType.BOOL, 20)
      oprot.writeBool(self.cost_round_up)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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 TariffRate(object):
  """
  Attributes:
   - i_rate
   - prefix
   - i_tariff
   - price_1
   - price_n
   - interval_1
   - interval_n
   - forbidden
   - grace_period_enable
   - local_price_1
   - local_price_n
   - local_interval_1
   - local_interval_n
   - area_name
   - activation_date
   - expiration_date
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I64, 'i_rate', None, None, ),  # 1
    (2, TType.STRING, 'prefix', 'UTF8', None, ),  # 2
    (3, TType.I64, 'i_tariff', None, None, ),  # 3
    (4, TType.DOUBLE, 'price_1', None, None, ),  # 4
    (5, TType.DOUBLE, 'price_n', None, None, ),  # 5
    (6, TType.I32, 'interval_1', None, None, ),  # 6
    (7, TType.I32, 'interval_n', None, None, ),  # 7
    (8, TType.BOOL, 'forbidden', None, None, ),  # 8
    (9, TType.BOOL, 'grace_period_enable', None, None, ),  # 9
    (10, TType.DOUBLE, 'local_price_1', None, None, ),  # 10
    (11, TType.DOUBLE, 'local_price_n', None, None, ),  # 11
    (12, TType.I32, 'local_interval_1', None, None, ),  # 12
    (13, TType.I32, 'local_interval_n', None, None, ),  # 13
    (14, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 14
    (15, TType.STRUCT, 'activation_date', (UnixTime, UnixTime.thrift_spec), None, ),  # 15
    (16, TType.STRUCT, 'expiration_date', (UnixTime, UnixTime.thrift_spec), None, ),  # 16
  )

  def __init__(self, i_rate=None, prefix=None, i_tariff=None, price_1=None, price_n=None, interval_1=None, interval_n=None, forbidden=None, grace_period_enable=None, local_price_1=None, local_price_n=None, local_interval_1=None, local_interval_n=None, area_name=None, activation_date=None, expiration_date=None,):
    self.i_rate = i_rate
    self.prefix = prefix
    self.i_tariff = i_tariff
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.forbidden = forbidden
    self.grace_period_enable = grace_period_enable
    self.local_price_1 = local_price_1
    self.local_price_n = local_price_n
    self.local_interval_1 = local_interval_1
    self.local_interval_n = local_interval_n
    self.area_name = area_name
    self.activation_date = activation_date
    self.expiration_date = expiration_date

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I64:
          self.i_rate = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.I64:
          self.i_tariff = iprot.readI64()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.BOOL:
          self.forbidden = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.BOOL:
          self.grace_period_enable = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.DOUBLE:
          self.local_price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.DOUBLE:
          self.local_price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.I32:
          self.local_interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.I32:
          self.local_interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRUCT:
          self.activation_date = UnixTime()
          self.activation_date.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 16:
        if ftype == TType.STRUCT:
          self.expiration_date = UnixTime()
          self.expiration_date.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('TariffRate')
    if self.i_rate is not None:
      oprot.writeFieldBegin('i_rate', TType.I64, 1)
      oprot.writeI64(self.i_rate)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 2)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.i_tariff is not None:
      oprot.writeFieldBegin('i_tariff', TType.I64, 3)
      oprot.writeI64(self.i_tariff)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 4)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 5)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 6)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 7)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.forbidden is not None:
      oprot.writeFieldBegin('forbidden', TType.BOOL, 8)
      oprot.writeBool(self.forbidden)
      oprot.writeFieldEnd()
    if self.grace_period_enable is not None:
      oprot.writeFieldBegin('grace_period_enable', TType.BOOL, 9)
      oprot.writeBool(self.grace_period_enable)
      oprot.writeFieldEnd()
    if self.local_price_1 is not None:
      oprot.writeFieldBegin('local_price_1', TType.DOUBLE, 10)
      oprot.writeDouble(self.local_price_1)
      oprot.writeFieldEnd()
    if self.local_price_n is not None:
      oprot.writeFieldBegin('local_price_n', TType.DOUBLE, 11)
      oprot.writeDouble(self.local_price_n)
      oprot.writeFieldEnd()
    if self.local_interval_1 is not None:
      oprot.writeFieldBegin('local_interval_1', TType.I32, 12)
      oprot.writeI32(self.local_interval_1)
      oprot.writeFieldEnd()
    if self.local_interval_n is not None:
      oprot.writeFieldBegin('local_interval_n', TType.I32, 13)
      oprot.writeI32(self.local_interval_n)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 14)
      self.area_name.write(oprot)
      oprot.writeFieldEnd()
    if self.activation_date is not None:
      oprot.writeFieldBegin('activation_date', TType.STRUCT, 15)
      self.activation_date.write(oprot)
      oprot.writeFieldEnd()
    if self.expiration_date is not None:
      oprot.writeFieldBegin('expiration_date', TType.STRUCT, 16)
      self.expiration_date.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__.items()]
    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 TariffRateList(object):
  """
  Attributes:
   - arr
  """

  thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'arr', (TType.STRUCT, (TariffRate, TariffRate.thrift_spec), False), None, ),  # 1
  )

  def __init__(self, arr=None,):
    self.arr = arr

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.arr = []
          (_etype10, _size7) = iprot.readListBegin()
          for _i11 in range(_size7):
            _elem12 = TariffRate()
            _elem12.read(iprot)
            self.arr.append(_elem12)
          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('TariffRateList')
    if self.arr is not None:
      oprot.writeFieldBegin('arr', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.arr))
      for iter13 in self.arr:
        iter13.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__.items()]
    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 LocalTariffRate(object):
  """
  Attributes:
   - activation_date
   - expiration_date
  """

  thrift_spec = (
    None,  # 0
    (1, TType.STRUCT, 'activation_date', (UnixTime, UnixTime.thrift_spec), None, ),  # 1
    (2, TType.STRUCT, 'expiration_date', (UnixTime, UnixTime.thrift_spec), None, ),  # 2
  )

  def __init__(self, activation_date=None, expiration_date=None,):
    self.activation_date = activation_date
    self.expiration_date = expiration_date

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.STRUCT:
          self.activation_date = UnixTime()
          self.activation_date.read(iprot)
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.STRUCT:
          self.expiration_date = UnixTime()
          self.expiration_date.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('LocalTariffRate')
    if self.activation_date is not None:
      oprot.writeFieldBegin('activation_date', TType.STRUCT, 1)
      self.activation_date.write(oprot)
      oprot.writeFieldEnd()
    if self.expiration_date is not None:
      oprot.writeFieldBegin('expiration_date', TType.STRUCT, 2)
      self.expiration_date.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__.items()]
    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 LocalTariffRateList(object):
  """
  Attributes:
   - arr
  """

  thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'arr', (TType.STRUCT, (LocalTariffRate, LocalTariffRate.thrift_spec), False), None, ),  # 1
  )

  def __init__(self, arr=None,):
    self.arr = arr

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.arr = []
          (_etype17, _size14) = iprot.readListBegin()
          for _i18 in range(_size14):
            _elem19 = LocalTariffRate()
            _elem19.read(iprot)
            self.arr.append(_elem19)
          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('LocalTariffRateList')
    if self.arr is not None:
      oprot.writeFieldBegin('arr', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.arr))
      for iter20 in self.arr:
        iter20.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__.items()]
    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 LookupbparamResultEntry(object):
  """
  Attributes:
   - free_seconds
   - connect_fee
   - price_1
   - price_n
   - interval_1
   - interval_n
   - post_call_surcharge
   - grace_period
   - forbidden
   - average_duration
   - loss_protection
   - max_loss
   - prefix
   - plan_only
   - area_name
  """

  thrift_spec = (
    None,  # 0
    (1, TType.I32, 'free_seconds', None, None, ),  # 1
    (2, TType.DOUBLE, 'connect_fee', None, None, ),  # 2
    (3, TType.DOUBLE, 'price_1', None, None, ),  # 3
    (4, TType.DOUBLE, 'price_n', None, None, ),  # 4
    (5, TType.I32, 'interval_1', None, None, ),  # 5
    (6, TType.I32, 'interval_n', None, None, ),  # 6
    (7, TType.DOUBLE, 'post_call_surcharge', None, None, ),  # 7
    (8, TType.I32, 'grace_period', None, None, ),  # 8
    (9, TType.BOOL, 'forbidden', None, None, ),  # 9
    (10, TType.I32, 'average_duration', None, None, ),  # 10
    (11, TType.BOOL, 'loss_protection', None, None, ),  # 11
    (12, TType.DOUBLE, 'max_loss', None, None, ),  # 12
    (13, TType.STRING, 'prefix', 'UTF8', None, ),  # 13
    (14, TType.BOOL, 'plan_only', None, None, ),  # 14
    (15, TType.STRUCT, 'area_name', (NullString, NullString.thrift_spec), None, ),  # 15
  )

  def __init__(self, free_seconds=None, connect_fee=None, price_1=None, price_n=None, interval_1=None, interval_n=None, post_call_surcharge=None, grace_period=None, forbidden=None, average_duration=None, loss_protection=None, max_loss=None, prefix=None, plan_only=None, area_name=None,):
    self.free_seconds = free_seconds
    self.connect_fee = connect_fee
    self.price_1 = price_1
    self.price_n = price_n
    self.interval_1 = interval_1
    self.interval_n = interval_n
    self.post_call_surcharge = post_call_surcharge
    self.grace_period = grace_period
    self.forbidden = forbidden
    self.average_duration = average_duration
    self.loss_protection = loss_protection
    self.max_loss = max_loss
    self.prefix = prefix
    self.plan_only = plan_only
    self.area_name = area_name

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.I32:
          self.free_seconds = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.DOUBLE:
          self.connect_fee = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.DOUBLE:
          self.price_1 = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 4:
        if ftype == TType.DOUBLE:
          self.price_n = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 5:
        if ftype == TType.I32:
          self.interval_1 = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 6:
        if ftype == TType.I32:
          self.interval_n = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 7:
        if ftype == TType.DOUBLE:
          self.post_call_surcharge = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 8:
        if ftype == TType.I32:
          self.grace_period = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 9:
        if ftype == TType.BOOL:
          self.forbidden = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 10:
        if ftype == TType.I32:
          self.average_duration = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 11:
        if ftype == TType.BOOL:
          self.loss_protection = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 12:
        if ftype == TType.DOUBLE:
          self.max_loss = iprot.readDouble()
        else:
          iprot.skip(ftype)
      elif fid == 13:
        if ftype == TType.STRING:
          self.prefix = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
        else:
          iprot.skip(ftype)
      elif fid == 14:
        if ftype == TType.BOOL:
          self.plan_only = iprot.readBool()
        else:
          iprot.skip(ftype)
      elif fid == 15:
        if ftype == TType.STRUCT:
          self.area_name = NullString()
          self.area_name.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('LookupbparamResultEntry')
    if self.free_seconds is not None:
      oprot.writeFieldBegin('free_seconds', TType.I32, 1)
      oprot.writeI32(self.free_seconds)
      oprot.writeFieldEnd()
    if self.connect_fee is not None:
      oprot.writeFieldBegin('connect_fee', TType.DOUBLE, 2)
      oprot.writeDouble(self.connect_fee)
      oprot.writeFieldEnd()
    if self.price_1 is not None:
      oprot.writeFieldBegin('price_1', TType.DOUBLE, 3)
      oprot.writeDouble(self.price_1)
      oprot.writeFieldEnd()
    if self.price_n is not None:
      oprot.writeFieldBegin('price_n', TType.DOUBLE, 4)
      oprot.writeDouble(self.price_n)
      oprot.writeFieldEnd()
    if self.interval_1 is not None:
      oprot.writeFieldBegin('interval_1', TType.I32, 5)
      oprot.writeI32(self.interval_1)
      oprot.writeFieldEnd()
    if self.interval_n is not None:
      oprot.writeFieldBegin('interval_n', TType.I32, 6)
      oprot.writeI32(self.interval_n)
      oprot.writeFieldEnd()
    if self.post_call_surcharge is not None:
      oprot.writeFieldBegin('post_call_surcharge', TType.DOUBLE, 7)
      oprot.writeDouble(self.post_call_surcharge)
      oprot.writeFieldEnd()
    if self.grace_period is not None:
      oprot.writeFieldBegin('grace_period', TType.I32, 8)
      oprot.writeI32(self.grace_period)
      oprot.writeFieldEnd()
    if self.forbidden is not None:
      oprot.writeFieldBegin('forbidden', TType.BOOL, 9)
      oprot.writeBool(self.forbidden)
      oprot.writeFieldEnd()
    if self.average_duration is not None:
      oprot.writeFieldBegin('average_duration', TType.I32, 10)
      oprot.writeI32(self.average_duration)
      oprot.writeFieldEnd()
    if self.loss_protection is not None:
      oprot.writeFieldBegin('loss_protection', TType.BOOL, 11)
      oprot.writeBool(self.loss_protection)
      oprot.writeFieldEnd()
    if self.max_loss is not None:
      oprot.writeFieldBegin('max_loss', TType.DOUBLE, 12)
      oprot.writeDouble(self.max_loss)
      oprot.writeFieldEnd()
    if self.prefix is not None:
      oprot.writeFieldBegin('prefix', TType.STRING, 13)
      oprot.writeString(self.prefix.encode('utf-8') if sys.version_info[0] == 2 else self.prefix)
      oprot.writeFieldEnd()
    if self.plan_only is not None:
      oprot.writeFieldBegin('plan_only', TType.BOOL, 14)
      oprot.writeBool(self.plan_only)
      oprot.writeFieldEnd()
    if self.area_name is not None:
      oprot.writeFieldBegin('area_name', TType.STRUCT, 15)
      self.area_name.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__.items()]
    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 LookupbparamResult(object):
  """
  Attributes:
   - bparams
   - decimal_precision
   - cost_round_up
  """

  thrift_spec = (
    None,  # 0
    (1, TType.LIST, 'bparams', (TType.STRUCT, (LookupbparamResultEntry, LookupbparamResultEntry.thrift_spec), False), None, ),  # 1
    (2, TType.I32, 'decimal_precision', None, None, ),  # 2
    (3, TType.BOOL, 'cost_round_up', None, None, ),  # 3
  )

  def __init__(self, bparams=None, decimal_precision=None, cost_round_up=None,):
    self.bparams = bparams
    self.decimal_precision = decimal_precision
    self.cost_round_up = cost_round_up

  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), iprot.string_length_limit, iprot.container_length_limit)
      return
    iprot.readStructBegin()
    while True:
      (fname, ftype, fid) = iprot.readFieldBegin()
      if ftype == TType.STOP:
        break
      if fid == 1:
        if ftype == TType.LIST:
          self.bparams = []
          (_etype24, _size21) = iprot.readListBegin()
          for _i25 in range(_size21):
            _elem26 = LookupbparamResultEntry()
            _elem26.read(iprot)
            self.bparams.append(_elem26)
          iprot.readListEnd()
        else:
          iprot.skip(ftype)
      elif fid == 2:
        if ftype == TType.I32:
          self.decimal_precision = iprot.readI32()
        else:
          iprot.skip(ftype)
      elif fid == 3:
        if ftype == TType.BOOL:
          self.cost_round_up = iprot.readBool()
        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('LookupbparamResult')
    if self.bparams is not None:
      oprot.writeFieldBegin('bparams', TType.LIST, 1)
      oprot.writeListBegin(TType.STRUCT, len(self.bparams))
      for iter27 in self.bparams:
        iter27.write(oprot)
      oprot.writeListEnd()
      oprot.writeFieldEnd()
    if self.decimal_precision is not None:
      oprot.writeFieldBegin('decimal_precision', TType.I32, 2)
      oprot.writeI32(self.decimal_precision)
      oprot.writeFieldEnd()
    if self.cost_round_up is not None:
      oprot.writeFieldBegin('cost_round_up', TType.BOOL, 3)
      oprot.writeBool(self.cost_round_up)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeStructEnd()

  def validate(self):
    return

  def __repr__(self):
    L = ['%s=%r' % (key, value)
         for key, value in self.__dict__.items()]
    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)
# # 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_style1 # #from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException Attributes:    - v # 0 # 1 Attributes:    - s # 0 # 1 Attributes:    - seconds    - nanoseconds # 0 # 1 # 2 Attributes:    - monot    - realt # 0 # 1 # 2 Attributes:    - type    - data # 0 # 1 # 2 Attributes:    - records # 0 # 1 Attributes:    - i_call    - call_id    - cld    - cli    - setup_time    - parent_i_call    - i_call_type # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 Attributes:    - i_cdr    - i_call    - i_account    - result    - cost    - delay    - duration    - billed_duration    - connect_time    - disconnect_time    - cld_in    - cli_in    - prefix    - price_1    - price_n    - interval_1    - interval_n    - post_call_surcharge    - connect_fee    - free_seconds    - remote_ip    - grace_period    - user_agent    - pdd1xx    - i_protocol    - release_source    - plan_duration    - accessibility_cost    - lrn_cld    - lrn_cld_in    - area_name    - p_asserted_id    - remote_party_id # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 # 20 # 21 # 22 # 23 # 24 # 25 # 26 # 27 # 28 # 29 # 30 # 31 # 32 # 33 Attributes:    - i_cdrs_connection    - i_call    - i_connection    - result    - cost    - delay    - duration    - billed_duration    - setup_time    - connect_time    - disconnect_time    - cld_out    - cli_out    - prefix    - price_1    - price_n    - interval_1    - interval_n    - post_call_surcharge    - connect_fee    - free_seconds    - grace_period    - user_agent    - pdd100    - pdd1xx    - i_account_debug    - i_protocol    - release_source    - call_setup_time    - lrn_cld    - area_name    - i_media_relay    - remote_ip    - vendor_name # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 # 20 # 21 # 22 # 23 # 24 # 25 # 26 # 27 # 28 # 29 # 30 # 31 # 32 # 33 # 34 Attributes:    - i_cdrs_customer    - i_cdr    - i_customer    - cost    - billed_duration    - prefix    - price_1    - price_n    - interval_1    - interval_n    - post_call_surcharge    - connect_fee    - free_seconds    - grace_period    - i_call    - i_wholesaler    - setup_time    - duration    - area_name # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 Attributes:    - i_cdrs_did    - i_call    - i_did    - did    - result    - cost    - duration    - billed_duration    - setup_time    - connect_time    - disconnect_time    - price_1    - price_n    - interval_1    - interval_n    - post_call_surcharge    - connect_fee    - free_seconds    - grace_period # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 Attributes:    - i_cdrs_connections_did    - i_call    - i_did_authorization    - did    - incoming_did    - i_connection    - result    - cost    - duration    - billed_duration    - setup_time    - connect_time    - disconnect_time    - price_1    - price_n    - interval_1    - interval_n    - post_call_surcharge    - connect_fee    - free_seconds    - grace_period # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 # 20 # 21 Attributes:    - i_surcharge    - i_call    - cost    - i_surcharge_type # 0 # 1 # 2 # 3 # 4 Attributes:    - i_commission    - i_account    - i_customer    - i_cdrs_customer    - commission_size    - setup_time    - i_call # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 Attributes:    - i_calls_sdp    - i_call    - i_cdrs_connection    - time_stamp    - sdp    - sip_msg_type # 0 # 1 # 2 # 3 # 4 # 5 # 6 Attributes:    - i_cdrs_customers_did    - i_call    - i_customer    - i_did    - did    - result    - cost    - duration    - billed_duration    - setup_time    - connect_time    - disconnect_time    - price_1    - price_n    - interval_1    - interval_n    - post_call_surcharge    - connect_fee    - free_seconds    - grace_period # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 # 20 Attributes:    - i_account    - delta # 0 # 1 # 2 Attributes:    - i_customer    - delta # 0 # 1 # 2 Attributes:    - i_vendor    - delta    - i_connection # 0 # 1 # 2 # 3 Attributes:    - i_account    - i_service_plan    - delta    - chargeable_seconds # 0 # 1 # 2 # 3 # 4 Attributes:    - i_connection_quality_stats    - i_connection    - tstamp    - asr    - acd    - action # 0 # 1 # 2 # 3 # 4 # 5 # 6 Attributes:    - cause    - i_call # 0 # 1 # 2 Attributes:    - free_seconds    - connect_fee    - price_1    - price_n    - interval_1    - interval_n    - post_call_surcharge    - grace_period    - prefix    - decimal_precision    - cost_round_up # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 Attributes:    - bparams    - area_name    - i_commission_agent    - commission_size    - i_wholesaler    - fresh_balance    - plan_only # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 Attributes:    - bparams    - area_name    - i_commission_agent    - commission_size    - i_customer    - i_wholesaler # 0 # 1 # 2 # 3 # 4 # 5 # 6 Attributes:    - bparams    - i_did    - did # 0 # 1 # 2 # 3 Attributes:    - bparams    - did    - i_connection    - i_did_authorization # 0 # 1 # 2 # 3 # 4 Attributes:    - bparams    - did    - i_customer    - i_did # 0 # 1 # 2 # 3 # 4 Attributes:    - crtime_acct    - crtime_ext    - rtime # 0 # 1 # 2 # 3 Attributes:    - nanoseconds # 0 # 1 Attributes:    - post_call_surcharge    - connect_fee    - name    - i_tariff    - free_seconds    - i_owner    - iso_4217    - grace_period    - max_loss    - average_duration    - loss_protection    - local_calling    - local_calling_cli_validation_rule    - last_change_count    - local_id    - remote_id    - is_remote    - is_exportable    - decimal_precision    - cost_round_up # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 # 17 # 18 # 19 # 20 Attributes:    - i_rate    - prefix    - i_tariff    - price_1    - price_n    - interval_1    - interval_n    - forbidden    - grace_period_enable    - local_price_1    - local_price_n    - local_interval_1    - local_interval_n    - area_name    - activation_date    - expiration_date # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 # 16 Attributes:    - arr # 0 # 1 Attributes:    - activation_date    - expiration_date # 0 # 1 # 2 Attributes:    - arr # 0 # 1 Attributes:    - free_seconds    - connect_fee    - price_1    - price_n    - interval_1    - interval_n    - post_call_surcharge    - grace_period    - forbidden    - average_duration    - loss_protection    - max_loss    - prefix    - plan_only    - area_name # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 14 # 15 Attributes:    - bparams    - decimal_precision    - cost_round_up # 0 # 1 # 2 # 3