OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ttypes.py
Go to the documentation of this file.
1 #
2 # Autogenerated by Thrift Compiler (0.16.0)
3 #
4 # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 #
6 # options string: py
7 #
8 
9 from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
10 from thrift.protocol.TProtocol import TProtocolException
11 from thrift.TRecursive import fix_spec
12 
13 import sys
14 
15 from thrift.transport import TTransport
16 all_structs = []
17 
18 
19 class TCompletionHintType(object):
20  COLUMN = 0
21  TABLE = 1
22  VIEW = 2
23  SCHEMA = 3
24  CATALOG = 4
25  REPOSITORY = 5
26  FUNCTION = 6
27  KEYWORD = 7
28 
29  _VALUES_TO_NAMES = {
30  0: "COLUMN",
31  1: "TABLE",
32  2: "VIEW",
33  3: "SCHEMA",
34  4: "CATALOG",
35  5: "REPOSITORY",
36  6: "FUNCTION",
37  7: "KEYWORD",
38  }
39 
40  _NAMES_TO_VALUES = {
41  "COLUMN": 0,
42  "TABLE": 1,
43  "VIEW": 2,
44  "SCHEMA": 3,
45  "CATALOG": 4,
46  "REPOSITORY": 5,
47  "FUNCTION": 6,
48  "KEYWORD": 7,
49  }
50 
51 
52 class TCompletionHint(object):
53  """
54  Attributes:
55  - type
56  - hints
57  - replaced
58 
59  """
60 
61 
62  def __init__(self, type=None, hints=None, replaced=None,):
63  self.type = type
64  self.hints = hints
65  self.replaced = replaced
66 
67  def read(self, iprot):
68  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
69  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
70  return
71  iprot.readStructBegin()
72  while True:
73  (fname, ftype, fid) = iprot.readFieldBegin()
74  if ftype == TType.STOP:
75  break
76  if fid == 1:
77  if ftype == TType.I32:
78  self.type = iprot.readI32()
79  else:
80  iprot.skip(ftype)
81  elif fid == 2:
82  if ftype == TType.LIST:
83  self.hints = []
84  (_etype3, _size0) = iprot.readListBegin()
85  for _i4 in range(_size0):
86  _elem5 = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
87  self.hints.append(_elem5)
88  iprot.readListEnd()
89  else:
90  iprot.skip(ftype)
91  elif fid == 3:
92  if ftype == TType.STRING:
93  self.replaced = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
94  else:
95  iprot.skip(ftype)
96  else:
97  iprot.skip(ftype)
98  iprot.readFieldEnd()
99  iprot.readStructEnd()
100 
101  def write(self, oprot):
102  if oprot._fast_encode is not None and self.thrift_spec is not None:
103  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
104  return
105  oprot.writeStructBegin('TCompletionHint')
106  if self.type is not None:
107  oprot.writeFieldBegin('type', TType.I32, 1)
108  oprot.writeI32(self.type)
109  oprot.writeFieldEnd()
110  if self.hints is not None:
111  oprot.writeFieldBegin('hints', TType.LIST, 2)
112  oprot.writeListBegin(TType.STRING, len(self.hints))
113  for iter6 in self.hints:
114  oprot.writeString(iter6.encode('utf-8') if sys.version_info[0] == 2 else iter6)
115  oprot.writeListEnd()
116  oprot.writeFieldEnd()
117  if self.replaced is not None:
118  oprot.writeFieldBegin('replaced', TType.STRING, 3)
119  oprot.writeString(self.replaced.encode('utf-8') if sys.version_info[0] == 2 else self.replaced)
120  oprot.writeFieldEnd()
121  oprot.writeFieldStop()
122  oprot.writeStructEnd()
123 
124  def validate(self):
125  return
126 
127  def __repr__(self):
128  L = ['%s=%r' % (key, value)
129  for key, value in self.__dict__.items()]
130  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
131 
132  def __eq__(self, other):
133  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
134 
135  def __ne__(self, other):
136  return not (self == other)
137 all_structs.append(TCompletionHint)
138 TCompletionHint.thrift_spec = (
139  None, # 0
140  (1, TType.I32, 'type', None, None, ), # 1
141  (2, TType.LIST, 'hints', (TType.STRING, 'UTF8', False), None, ), # 2
142  (3, TType.STRING, 'replaced', 'UTF8', None, ), # 3
143 )
144 fix_spec(all_structs)
145 del all_structs
std::string join(T const &container, std::string const &delim)