read method

void read(
  1. TProtocol iprot
)
override

Reads the TObject from the given input protocol.

Implementation

read(TProtocol iprot) {
  TField field;
  iprot.readStructBegin();
  while (true) {
    field = iprot.readFieldBegin();
    if (field.type == TType.STOP) {
      break;
    }
    switch (field.id) {
      case SESSION_ID:
        if (field.type == TType.I64) {
          this.session_id = iprot.readI64();
          this.__isset_session_id = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case CREATE_TIME:
        if (field.type == TType.I64) {
          this.create_time = iprot.readI64();
          this.__isset_create_time = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case UPDATE_TIME:
        if (field.type == TType.I64) {
          this.update_time = iprot.readI64();
          this.__isset_update_time = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case USER_NAME:
        if (field.type == TType.STRING) {
          this.user_name = iprot.readBinary();
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case SPACE_NAME:
        if (field.type == TType.STRING) {
          this.space_name = iprot.readBinary();
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case GRAPH_ADDR:
        if (field.type == TType.STRUCT) {
          this.graph_addr = new t_nebula.HostAddr();
          this.graph_addr?.read(iprot);
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case TIMEZONE:
        if (field.type == TType.I32) {
          this.timezone = iprot.readI32();
          this.__isset_timezone = true;
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case CLIENT_IP:
        if (field.type == TType.STRING) {
          this.client_ip = iprot.readBinary();
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case CONFIGS:
        if (field.type == TType.MAP) {
          {
            TMap _map338 = iprot.readMapBegin();
            this.configs = new Map<Int8List, t_nebula.Value>();
            for (int _i339 = 0; _i339 < _map338.length; ++_i339) {
              Int8List _key340;
              t_nebula.Value _val341;
              _key340 = iprot.readBinary();
              _val341 = new t_nebula.Value();
              _val341.read(iprot);
              this.configs?[_key340] = _val341;
            }
            iprot.readMapEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      case QUERIES:
        if (field.type == TType.MAP) {
          {
            TMap _map342 = iprot.readMapBegin();
            this.queries = new Map<int, QueryDesc>();
            for (int _i343 = 0; _i343 < _map342.length; ++_i343) {
              int _key344;
              QueryDesc _val345;
              _key344 = iprot.readI64();
              _val345 = new QueryDesc();
              _val345.read(iprot);
              this.queries?[_key344] = _val345;
            }
            iprot.readMapEnd();
          }
        } else {
          TProtocolUtil.skip(iprot, field.type);
        }
        break;
      default:
        TProtocolUtil.skip(iprot, field.type);
        break;
    }
    iprot.readFieldEnd();
  }
  iprot.readStructEnd();

  // check for required fields of primitive type, which can't be checked in the validate method
  validate();
}