public void Write(TProtocol oprot) { var struc = new TStruct("RestResponse"); oprot.WriteStructBegin(struc); var field = new TField(); if (__isset.status) { field.Name = "status"; field.Type = TType.I32; field.ID = 1; oprot.WriteFieldBegin(field); oprot.WriteI32((int) status); oprot.WriteFieldEnd(); } if (headers != null && __isset.headers) { field.Name = "headers"; field.Type = TType.Map; field.ID = 2; oprot.WriteFieldBegin(field); { oprot.WriteMapBegin(new TMap(TType.String, TType.String, headers.Count)); foreach (string _iter14 in headers.Keys) { oprot.WriteString(_iter14); oprot.WriteString(headers[_iter14]); oprot.WriteMapEnd(); } } oprot.WriteFieldEnd(); } if (body != null && __isset.body) { field.Name = "body"; field.Type = TType.String; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteBinary(body); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); }
public void Write(TProtocol oprot) { var struc = new TStruct("RestRequest"); oprot.WriteStructBegin(struc); var field = new TField(); if (__isset.method) { field.Name = "method"; field.Type = TType.I32; field.ID = 1; oprot.WriteFieldBegin(field); oprot.WriteI32((int) method); oprot.WriteFieldEnd(); } if (uri != null && __isset.uri) { field.Name = "uri"; field.Type = TType.String; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteString(uri.PathAndQuery); oprot.WriteFieldEnd(); } if (parameters != null && __isset.parameters) { field.Name = "parameters"; field.Type = TType.Map; field.ID = 3; oprot.WriteFieldBegin(field); { oprot.WriteMapBegin(new TMap(TType.String, TType.String, parameters.Count)); foreach (string _iter8 in parameters.Keys) { oprot.WriteString(_iter8); oprot.WriteString(parameters[_iter8]); oprot.WriteMapEnd(); } } oprot.WriteFieldEnd(); } if (headers != null && __isset.headers) { field.Name = "headers"; field.Type = TType.Map; field.ID = 4; oprot.WriteFieldBegin(field); { oprot.WriteMapBegin(new TMap(TType.String, TType.String, headers.Count)); foreach (string _iter9 in headers.Keys) { oprot.WriteString(_iter9); oprot.WriteString(headers[_iter9]); oprot.WriteMapEnd(); } } oprot.WriteFieldEnd(); } if (body != null && __isset.body) { field.Name = "body"; field.Type = TType.String; field.ID = 5; oprot.WriteFieldBegin(field); oprot.WriteBinary(body); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); }