in if/py/gen-py/fbnet/command_runner_asyncio/CommandRunner/ttypes.py [0:0]
def write(self, oprot):
if (isinstance(oprot, TBinaryProtocol.TBinaryProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_BINARY_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None:
oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=0))
return
if (isinstance(oprot, TCompactProtocol.TCompactProtocolAccelerated) or (isinstance(oprot, THeaderProtocol.THeaderProtocolAccelerate) and oprot.get_protocol_id() == THeaderProtocol.THeaderProtocol.T_COMPACT_PROTOCOL)) and self.thrift_spec is not None and fastproto is not None:
oprot.trans.write(fastproto.encode(self, [self.__class__, self.thrift_spec, False], utf8strings=UTF8STRINGS, protoid=2))
return
oprot.writeStructBegin('Device')
if self.hostname != None:
oprot.writeFieldBegin('hostname', TType.STRING, 1)
oprot.writeString(self.hostname.encode('utf-8')) if UTF8STRINGS and not isinstance(self.hostname, bytes) else oprot.writeString(self.hostname)
oprot.writeFieldEnd()
if self.username != None:
oprot.writeFieldBegin('username', TType.STRING, 10)
oprot.writeString(self.username.encode('utf-8')) if UTF8STRINGS and not isinstance(self.username, bytes) else oprot.writeString(self.username)
oprot.writeFieldEnd()
if self.password != None:
oprot.writeFieldBegin('password', TType.STRING, 11)
oprot.writeString(self.password.encode('utf-8')) if UTF8STRINGS and not isinstance(self.password, bytes) else oprot.writeString(self.password)
oprot.writeFieldEnd()
if self.console != None and self.console != self.thrift_spec[13][4]:
oprot.writeFieldBegin('console', TType.STRING, 13)
oprot.writeString(self.console.encode('utf-8')) if UTF8STRINGS and not isinstance(self.console, bytes) else oprot.writeString(self.console)
oprot.writeFieldEnd()
if self.mgmt_ip != None and self.mgmt_ip != self.thrift_spec[14][4]:
oprot.writeFieldBegin('mgmt_ip', TType.BOOL, 14)
oprot.writeBool(self.mgmt_ip)
oprot.writeFieldEnd()
if self.command_prompts != None:
oprot.writeFieldBegin('command_prompts', TType.MAP, 15)
oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.command_prompts))
for kiter20,viter21 in self.command_prompts.items():
oprot.writeString(kiter20.encode('utf-8')) if UTF8STRINGS and not isinstance(kiter20, bytes) else oprot.writeString(kiter20)
oprot.writeString(viter21.encode('utf-8')) if UTF8STRINGS and not isinstance(viter21, bytes) else oprot.writeString(viter21)
oprot.writeMapEnd()
oprot.writeFieldEnd()
if self.ip_address != None:
oprot.writeFieldBegin('ip_address', TType.STRING, 16)
oprot.writeString(self.ip_address.encode('utf-8')) if UTF8STRINGS and not isinstance(self.ip_address, bytes) else oprot.writeString(self.ip_address)
oprot.writeFieldEnd()
if self.session_type != None:
oprot.writeFieldBegin('session_type', TType.I32, 17)
oprot.writeI32(self.session_type)
oprot.writeFieldEnd()
if self.session_data != None:
oprot.writeFieldBegin('session_data', TType.STRUCT, 18)
self.session_data.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()