Subversion Repositories SmartDukaan

Rev

Rev 477 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 477 Rev 483
Line 25... Line 25...
25
 
25
 
26
public class LogisticsService {
26
public class LogisticsService {
27
 
27
 
28
  public interface Iface {
28
  public interface Iface {
29
 
29
 
-
 
30
    public LogisticsInfo getLogisticsInfo(String destination_pincode, String sku_id) throws LogisticsServiceException, TException;
-
 
31
 
30
    public ItemLogistics getLogisticsEstimation(long itemId, String destination_pin, long provider_id) throws LogisticsServiceException, TException;
32
    public ItemLogistics getLogisticsEstimation(long itemId, String destination_pin, long provider_id) throws LogisticsServiceException, TException;
31
 
33
 
32
    public void addDeliveryEstimate(long warahouse_id, String destination_pin, long provider_id, long delivery_time, long reliability) throws TException;
34
    public void addDeliveryEstimate(long warahouse_id, String destination_pin, long provider_id, long delivery_time, long reliability) throws TException;
33
 
35
 
34
    public void addPincodeWarehouseMapping(String pin_code, long warehouse_id, String warehouse_pin) throws TException;
36
    public void addPincodeWarehouseMapping(String pin_code, long warehouse_id, String warehouse_pin) throws TException;
Line 78... Line 80...
78
    public TProtocol getOutputProtocol()
80
    public TProtocol getOutputProtocol()
79
    {
81
    {
80
      return this.oprot_;
82
      return this.oprot_;
81
    }
83
    }
82
 
84
 
-
 
85
    public LogisticsInfo getLogisticsInfo(String destination_pincode, String sku_id) throws LogisticsServiceException, TException
-
 
86
    {
-
 
87
      send_getLogisticsInfo(destination_pincode, sku_id);
-
 
88
      return recv_getLogisticsInfo();
-
 
89
    }
-
 
90
 
-
 
91
    public void send_getLogisticsInfo(String destination_pincode, String sku_id) throws TException
-
 
92
    {
-
 
93
      oprot_.writeMessageBegin(new TMessage("getLogisticsInfo", TMessageType.CALL, seqid_));
-
 
94
      getLogisticsInfo_args args = new getLogisticsInfo_args();
-
 
95
      args.destination_pincode = destination_pincode;
-
 
96
      args.sku_id = sku_id;
-
 
97
      args.write(oprot_);
-
 
98
      oprot_.writeMessageEnd();
-
 
99
      oprot_.getTransport().flush();
-
 
100
    }
-
 
101
 
-
 
102
    public LogisticsInfo recv_getLogisticsInfo() throws LogisticsServiceException, TException
-
 
103
    {
-
 
104
      TMessage msg = iprot_.readMessageBegin();
-
 
105
      if (msg.type == TMessageType.EXCEPTION) {
-
 
106
        TApplicationException x = TApplicationException.read(iprot_);
-
 
107
        iprot_.readMessageEnd();
-
 
108
        throw x;
-
 
109
      }
-
 
110
      getLogisticsInfo_result result = new getLogisticsInfo_result();
-
 
111
      result.read(iprot_);
-
 
112
      iprot_.readMessageEnd();
-
 
113
      if (result.isSetSuccess()) {
-
 
114
        return result.success;
-
 
115
      }
-
 
116
      if (result.se != null) {
-
 
117
        throw result.se;
-
 
118
      }
-
 
119
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getLogisticsInfo failed: unknown result");
-
 
120
    }
-
 
121
 
83
    public ItemLogistics getLogisticsEstimation(long itemId, String destination_pin, long provider_id) throws LogisticsServiceException, TException
122
    public ItemLogistics getLogisticsEstimation(long itemId, String destination_pin, long provider_id) throws LogisticsServiceException, TException
84
    {
123
    {
85
      send_getLogisticsEstimation(itemId, destination_pin, provider_id);
124
      send_getLogisticsEstimation(itemId, destination_pin, provider_id);
86
      return recv_getLogisticsEstimation();
125
      return recv_getLogisticsEstimation();
87
    }
126
    }
Line 481... Line 520...
481
  public static class Processor implements TProcessor {
520
  public static class Processor implements TProcessor {
482
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
521
    private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
483
    public Processor(Iface iface)
522
    public Processor(Iface iface)
484
    {
523
    {
485
      iface_ = iface;
524
      iface_ = iface;
-
 
525
      processMap_.put("getLogisticsInfo", new getLogisticsInfo());
486
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
526
      processMap_.put("getLogisticsEstimation", new getLogisticsEstimation());
487
      processMap_.put("addDeliveryEstimate", new addDeliveryEstimate());
527
      processMap_.put("addDeliveryEstimate", new addDeliveryEstimate());
488
      processMap_.put("addPincodeWarehouseMapping", new addPincodeWarehouseMapping());
528
      processMap_.put("addPincodeWarehouseMapping", new addPincodeWarehouseMapping());
489
      processMap_.put("addEmptyAWBs", new addEmptyAWBs());
529
      processMap_.put("addEmptyAWBs", new addEmptyAWBs());
490
      processMap_.put("getEmptyAWB", new getEmptyAWB());
530
      processMap_.put("getEmptyAWB", new getEmptyAWB());
Line 520... Line 560...
520
      }
560
      }
521
      fn.process(msg.seqid, iprot, oprot);
561
      fn.process(msg.seqid, iprot, oprot);
522
      return true;
562
      return true;
523
    }
563
    }
524
 
564
 
-
 
565
    private class getLogisticsInfo implements ProcessFunction {
-
 
566
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
567
      {
-
 
568
        getLogisticsInfo_args args = new getLogisticsInfo_args();
-
 
569
        args.read(iprot);
-
 
570
        iprot.readMessageEnd();
-
 
571
        getLogisticsInfo_result result = new getLogisticsInfo_result();
-
 
572
        try {
-
 
573
          result.success = iface_.getLogisticsInfo(args.destination_pincode, args.sku_id);
-
 
574
        } catch (LogisticsServiceException se) {
-
 
575
          result.se = se;
-
 
576
        } catch (Throwable th) {
-
 
577
          LOGGER.error("Internal error processing getLogisticsInfo", th);
-
 
578
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getLogisticsInfo");
-
 
579
          oprot.writeMessageBegin(new TMessage("getLogisticsInfo", TMessageType.EXCEPTION, seqid));
-
 
580
          x.write(oprot);
-
 
581
          oprot.writeMessageEnd();
-
 
582
          oprot.getTransport().flush();
-
 
583
          return;
-
 
584
        }
-
 
585
        oprot.writeMessageBegin(new TMessage("getLogisticsInfo", TMessageType.REPLY, seqid));
-
 
586
        result.write(oprot);
-
 
587
        oprot.writeMessageEnd();
-
 
588
        oprot.getTransport().flush();
-
 
589
      }
-
 
590
 
-
 
591
    }
-
 
592
 
525
    private class getLogisticsEstimation implements ProcessFunction {
593
    private class getLogisticsEstimation implements ProcessFunction {
526
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
594
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
527
      {
595
      {
528
        getLogisticsEstimation_args args = new getLogisticsEstimation_args();
596
        getLogisticsEstimation_args args = new getLogisticsEstimation_args();
529
        args.read(iprot);
597
        args.read(iprot);
Line 726... Line 794...
726
 
794
 
727
    }
795
    }
728
 
796
 
729
  }
797
  }
730
 
798
 
-
 
799
  public static class getLogisticsInfo_args implements TBase<getLogisticsInfo_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsInfo_args>   {
-
 
800
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsInfo_args");
-
 
801
 
-
 
802
    private static final TField DESTINATION_PINCODE_FIELD_DESC = new TField("destination_pincode", TType.STRING, (short)1);
-
 
803
    private static final TField SKU_ID_FIELD_DESC = new TField("sku_id", TType.STRING, (short)2);
-
 
804
 
-
 
805
    private String destination_pincode;
-
 
806
    private String sku_id;
-
 
807
 
-
 
808
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
809
    public enum _Fields implements TFieldIdEnum {
-
 
810
      DESTINATION_PINCODE((short)1, "destination_pincode"),
-
 
811
      SKU_ID((short)2, "sku_id");
-
 
812
 
-
 
813
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
814
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
815
 
-
 
816
      static {
-
 
817
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
818
          byId.put((int)field._thriftId, field);
-
 
819
          byName.put(field.getFieldName(), field);
-
 
820
        }
-
 
821
      }
-
 
822
 
-
 
823
      /**
-
 
824
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
825
       */
-
 
826
      public static _Fields findByThriftId(int fieldId) {
-
 
827
        return byId.get(fieldId);
-
 
828
      }
-
 
829
 
-
 
830
      /**
-
 
831
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
832
       * if it is not found.
-
 
833
       */
-
 
834
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
835
        _Fields fields = findByThriftId(fieldId);
-
 
836
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
837
        return fields;
-
 
838
      }
-
 
839
 
-
 
840
      /**
-
 
841
       * Find the _Fields constant that matches name, or null if its not found.
-
 
842
       */
-
 
843
      public static _Fields findByName(String name) {
-
 
844
        return byName.get(name);
-
 
845
      }
-
 
846
 
-
 
847
      private final short _thriftId;
-
 
848
      private final String _fieldName;
-
 
849
 
-
 
850
      _Fields(short thriftId, String fieldName) {
-
 
851
        _thriftId = thriftId;
-
 
852
        _fieldName = fieldName;
-
 
853
      }
-
 
854
 
-
 
855
      public short getThriftFieldId() {
-
 
856
        return _thriftId;
-
 
857
      }
-
 
858
 
-
 
859
      public String getFieldName() {
-
 
860
        return _fieldName;
-
 
861
      }
-
 
862
    }
-
 
863
 
-
 
864
    // isset id assignments
-
 
865
 
-
 
866
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
867
      put(_Fields.DESTINATION_PINCODE, new FieldMetaData("destination_pincode", TFieldRequirementType.DEFAULT, 
-
 
868
          new FieldValueMetaData(TType.STRING)));
-
 
869
      put(_Fields.SKU_ID, new FieldMetaData("sku_id", TFieldRequirementType.DEFAULT, 
-
 
870
          new FieldValueMetaData(TType.STRING)));
-
 
871
    }});
-
 
872
 
-
 
873
    static {
-
 
874
      FieldMetaData.addStructMetaDataMap(getLogisticsInfo_args.class, metaDataMap);
-
 
875
    }
-
 
876
 
-
 
877
    public getLogisticsInfo_args() {
-
 
878
    }
-
 
879
 
-
 
880
    public getLogisticsInfo_args(
-
 
881
      String destination_pincode,
-
 
882
      String sku_id)
-
 
883
    {
-
 
884
      this();
-
 
885
      this.destination_pincode = destination_pincode;
-
 
886
      this.sku_id = sku_id;
-
 
887
    }
-
 
888
 
-
 
889
    /**
-
 
890
     * Performs a deep copy on <i>other</i>.
-
 
891
     */
-
 
892
    public getLogisticsInfo_args(getLogisticsInfo_args other) {
-
 
893
      if (other.isSetDestination_pincode()) {
-
 
894
        this.destination_pincode = other.destination_pincode;
-
 
895
      }
-
 
896
      if (other.isSetSku_id()) {
-
 
897
        this.sku_id = other.sku_id;
-
 
898
      }
-
 
899
    }
-
 
900
 
-
 
901
    public getLogisticsInfo_args deepCopy() {
-
 
902
      return new getLogisticsInfo_args(this);
-
 
903
    }
-
 
904
 
-
 
905
    @Deprecated
-
 
906
    public getLogisticsInfo_args clone() {
-
 
907
      return new getLogisticsInfo_args(this);
-
 
908
    }
-
 
909
 
-
 
910
    public String getDestination_pincode() {
-
 
911
      return this.destination_pincode;
-
 
912
    }
-
 
913
 
-
 
914
    public getLogisticsInfo_args setDestination_pincode(String destination_pincode) {
-
 
915
      this.destination_pincode = destination_pincode;
-
 
916
      return this;
-
 
917
    }
-
 
918
 
-
 
919
    public void unsetDestination_pincode() {
-
 
920
      this.destination_pincode = null;
-
 
921
    }
-
 
922
 
-
 
923
    /** Returns true if field destination_pincode is set (has been asigned a value) and false otherwise */
-
 
924
    public boolean isSetDestination_pincode() {
-
 
925
      return this.destination_pincode != null;
-
 
926
    }
-
 
927
 
-
 
928
    public void setDestination_pincodeIsSet(boolean value) {
-
 
929
      if (!value) {
-
 
930
        this.destination_pincode = null;
-
 
931
      }
-
 
932
    }
-
 
933
 
-
 
934
    public String getSku_id() {
-
 
935
      return this.sku_id;
-
 
936
    }
-
 
937
 
-
 
938
    public getLogisticsInfo_args setSku_id(String sku_id) {
-
 
939
      this.sku_id = sku_id;
-
 
940
      return this;
-
 
941
    }
-
 
942
 
-
 
943
    public void unsetSku_id() {
-
 
944
      this.sku_id = null;
-
 
945
    }
-
 
946
 
-
 
947
    /** Returns true if field sku_id is set (has been asigned a value) and false otherwise */
-
 
948
    public boolean isSetSku_id() {
-
 
949
      return this.sku_id != null;
-
 
950
    }
-
 
951
 
-
 
952
    public void setSku_idIsSet(boolean value) {
-
 
953
      if (!value) {
-
 
954
        this.sku_id = null;
-
 
955
      }
-
 
956
    }
-
 
957
 
-
 
958
    public void setFieldValue(_Fields field, Object value) {
-
 
959
      switch (field) {
-
 
960
      case DESTINATION_PINCODE:
-
 
961
        if (value == null) {
-
 
962
          unsetDestination_pincode();
-
 
963
        } else {
-
 
964
          setDestination_pincode((String)value);
-
 
965
        }
-
 
966
        break;
-
 
967
 
-
 
968
      case SKU_ID:
-
 
969
        if (value == null) {
-
 
970
          unsetSku_id();
-
 
971
        } else {
-
 
972
          setSku_id((String)value);
-
 
973
        }
-
 
974
        break;
-
 
975
 
-
 
976
      }
-
 
977
    }
-
 
978
 
-
 
979
    public void setFieldValue(int fieldID, Object value) {
-
 
980
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
981
    }
-
 
982
 
-
 
983
    public Object getFieldValue(_Fields field) {
-
 
984
      switch (field) {
-
 
985
      case DESTINATION_PINCODE:
-
 
986
        return getDestination_pincode();
-
 
987
 
-
 
988
      case SKU_ID:
-
 
989
        return getSku_id();
-
 
990
 
-
 
991
      }
-
 
992
      throw new IllegalStateException();
-
 
993
    }
-
 
994
 
-
 
995
    public Object getFieldValue(int fieldId) {
-
 
996
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
997
    }
-
 
998
 
-
 
999
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
1000
    public boolean isSet(_Fields field) {
-
 
1001
      switch (field) {
-
 
1002
      case DESTINATION_PINCODE:
-
 
1003
        return isSetDestination_pincode();
-
 
1004
      case SKU_ID:
-
 
1005
        return isSetSku_id();
-
 
1006
      }
-
 
1007
      throw new IllegalStateException();
-
 
1008
    }
-
 
1009
 
-
 
1010
    public boolean isSet(int fieldID) {
-
 
1011
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
1012
    }
-
 
1013
 
-
 
1014
    @Override
-
 
1015
    public boolean equals(Object that) {
-
 
1016
      if (that == null)
-
 
1017
        return false;
-
 
1018
      if (that instanceof getLogisticsInfo_args)
-
 
1019
        return this.equals((getLogisticsInfo_args)that);
-
 
1020
      return false;
-
 
1021
    }
-
 
1022
 
-
 
1023
    public boolean equals(getLogisticsInfo_args that) {
-
 
1024
      if (that == null)
-
 
1025
        return false;
-
 
1026
 
-
 
1027
      boolean this_present_destination_pincode = true && this.isSetDestination_pincode();
-
 
1028
      boolean that_present_destination_pincode = true && that.isSetDestination_pincode();
-
 
1029
      if (this_present_destination_pincode || that_present_destination_pincode) {
-
 
1030
        if (!(this_present_destination_pincode && that_present_destination_pincode))
-
 
1031
          return false;
-
 
1032
        if (!this.destination_pincode.equals(that.destination_pincode))
-
 
1033
          return false;
-
 
1034
      }
-
 
1035
 
-
 
1036
      boolean this_present_sku_id = true && this.isSetSku_id();
-
 
1037
      boolean that_present_sku_id = true && that.isSetSku_id();
-
 
1038
      if (this_present_sku_id || that_present_sku_id) {
-
 
1039
        if (!(this_present_sku_id && that_present_sku_id))
-
 
1040
          return false;
-
 
1041
        if (!this.sku_id.equals(that.sku_id))
-
 
1042
          return false;
-
 
1043
      }
-
 
1044
 
-
 
1045
      return true;
-
 
1046
    }
-
 
1047
 
-
 
1048
    @Override
-
 
1049
    public int hashCode() {
-
 
1050
      return 0;
-
 
1051
    }
-
 
1052
 
-
 
1053
    public int compareTo(getLogisticsInfo_args other) {
-
 
1054
      if (!getClass().equals(other.getClass())) {
-
 
1055
        return getClass().getName().compareTo(other.getClass().getName());
-
 
1056
      }
-
 
1057
 
-
 
1058
      int lastComparison = 0;
-
 
1059
      getLogisticsInfo_args typedOther = (getLogisticsInfo_args)other;
-
 
1060
 
-
 
1061
      lastComparison = Boolean.valueOf(isSetDestination_pincode()).compareTo(isSetDestination_pincode());
-
 
1062
      if (lastComparison != 0) {
-
 
1063
        return lastComparison;
-
 
1064
      }
-
 
1065
      lastComparison = TBaseHelper.compareTo(destination_pincode, typedOther.destination_pincode);
-
 
1066
      if (lastComparison != 0) {
-
 
1067
        return lastComparison;
-
 
1068
      }
-
 
1069
      lastComparison = Boolean.valueOf(isSetSku_id()).compareTo(isSetSku_id());
-
 
1070
      if (lastComparison != 0) {
-
 
1071
        return lastComparison;
-
 
1072
      }
-
 
1073
      lastComparison = TBaseHelper.compareTo(sku_id, typedOther.sku_id);
-
 
1074
      if (lastComparison != 0) {
-
 
1075
        return lastComparison;
-
 
1076
      }
-
 
1077
      return 0;
-
 
1078
    }
-
 
1079
 
-
 
1080
    public void read(TProtocol iprot) throws TException {
-
 
1081
      TField field;
-
 
1082
      iprot.readStructBegin();
-
 
1083
      while (true)
-
 
1084
      {
-
 
1085
        field = iprot.readFieldBegin();
-
 
1086
        if (field.type == TType.STOP) { 
-
 
1087
          break;
-
 
1088
        }
-
 
1089
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
1090
        if (fieldId == null) {
-
 
1091
          TProtocolUtil.skip(iprot, field.type);
-
 
1092
        } else {
-
 
1093
          switch (fieldId) {
-
 
1094
            case DESTINATION_PINCODE:
-
 
1095
              if (field.type == TType.STRING) {
-
 
1096
                this.destination_pincode = iprot.readString();
-
 
1097
              } else { 
-
 
1098
                TProtocolUtil.skip(iprot, field.type);
-
 
1099
              }
-
 
1100
              break;
-
 
1101
            case SKU_ID:
-
 
1102
              if (field.type == TType.STRING) {
-
 
1103
                this.sku_id = iprot.readString();
-
 
1104
              } else { 
-
 
1105
                TProtocolUtil.skip(iprot, field.type);
-
 
1106
              }
-
 
1107
              break;
-
 
1108
          }
-
 
1109
          iprot.readFieldEnd();
-
 
1110
        }
-
 
1111
      }
-
 
1112
      iprot.readStructEnd();
-
 
1113
      validate();
-
 
1114
    }
-
 
1115
 
-
 
1116
    public void write(TProtocol oprot) throws TException {
-
 
1117
      validate();
-
 
1118
 
-
 
1119
      oprot.writeStructBegin(STRUCT_DESC);
-
 
1120
      if (this.destination_pincode != null) {
-
 
1121
        oprot.writeFieldBegin(DESTINATION_PINCODE_FIELD_DESC);
-
 
1122
        oprot.writeString(this.destination_pincode);
-
 
1123
        oprot.writeFieldEnd();
-
 
1124
      }
-
 
1125
      if (this.sku_id != null) {
-
 
1126
        oprot.writeFieldBegin(SKU_ID_FIELD_DESC);
-
 
1127
        oprot.writeString(this.sku_id);
-
 
1128
        oprot.writeFieldEnd();
-
 
1129
      }
-
 
1130
      oprot.writeFieldStop();
-
 
1131
      oprot.writeStructEnd();
-
 
1132
    }
-
 
1133
 
-
 
1134
    @Override
-
 
1135
    public String toString() {
-
 
1136
      StringBuilder sb = new StringBuilder("getLogisticsInfo_args(");
-
 
1137
      boolean first = true;
-
 
1138
 
-
 
1139
      sb.append("destination_pincode:");
-
 
1140
      if (this.destination_pincode == null) {
-
 
1141
        sb.append("null");
-
 
1142
      } else {
-
 
1143
        sb.append(this.destination_pincode);
-
 
1144
      }
-
 
1145
      first = false;
-
 
1146
      if (!first) sb.append(", ");
-
 
1147
      sb.append("sku_id:");
-
 
1148
      if (this.sku_id == null) {
-
 
1149
        sb.append("null");
-
 
1150
      } else {
-
 
1151
        sb.append(this.sku_id);
-
 
1152
      }
-
 
1153
      first = false;
-
 
1154
      sb.append(")");
-
 
1155
      return sb.toString();
-
 
1156
    }
-
 
1157
 
-
 
1158
    public void validate() throws TException {
-
 
1159
      // check for required fields
-
 
1160
    }
-
 
1161
 
-
 
1162
  }
-
 
1163
 
-
 
1164
  public static class getLogisticsInfo_result implements TBase<getLogisticsInfo_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsInfo_result>   {
-
 
1165
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsInfo_result");
-
 
1166
 
-
 
1167
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
-
 
1168
    private static final TField SE_FIELD_DESC = new TField("se", TType.STRUCT, (short)1);
-
 
1169
 
-
 
1170
    private LogisticsInfo success;
-
 
1171
    private LogisticsServiceException se;
-
 
1172
 
-
 
1173
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
1174
    public enum _Fields implements TFieldIdEnum {
-
 
1175
      SUCCESS((short)0, "success"),
-
 
1176
      SE((short)1, "se");
-
 
1177
 
-
 
1178
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
1179
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
1180
 
-
 
1181
      static {
-
 
1182
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
1183
          byId.put((int)field._thriftId, field);
-
 
1184
          byName.put(field.getFieldName(), field);
-
 
1185
        }
-
 
1186
      }
-
 
1187
 
-
 
1188
      /**
-
 
1189
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
1190
       */
-
 
1191
      public static _Fields findByThriftId(int fieldId) {
-
 
1192
        return byId.get(fieldId);
-
 
1193
      }
-
 
1194
 
-
 
1195
      /**
-
 
1196
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
1197
       * if it is not found.
-
 
1198
       */
-
 
1199
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
1200
        _Fields fields = findByThriftId(fieldId);
-
 
1201
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
1202
        return fields;
-
 
1203
      }
-
 
1204
 
-
 
1205
      /**
-
 
1206
       * Find the _Fields constant that matches name, or null if its not found.
-
 
1207
       */
-
 
1208
      public static _Fields findByName(String name) {
-
 
1209
        return byName.get(name);
-
 
1210
      }
-
 
1211
 
-
 
1212
      private final short _thriftId;
-
 
1213
      private final String _fieldName;
-
 
1214
 
-
 
1215
      _Fields(short thriftId, String fieldName) {
-
 
1216
        _thriftId = thriftId;
-
 
1217
        _fieldName = fieldName;
-
 
1218
      }
-
 
1219
 
-
 
1220
      public short getThriftFieldId() {
-
 
1221
        return _thriftId;
-
 
1222
      }
-
 
1223
 
-
 
1224
      public String getFieldName() {
-
 
1225
        return _fieldName;
-
 
1226
      }
-
 
1227
    }
-
 
1228
 
-
 
1229
    // isset id assignments
-
 
1230
 
-
 
1231
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
1232
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
1233
          new StructMetaData(TType.STRUCT, LogisticsInfo.class)));
-
 
1234
      put(_Fields.SE, new FieldMetaData("se", TFieldRequirementType.DEFAULT, 
-
 
1235
          new FieldValueMetaData(TType.STRUCT)));
-
 
1236
    }});
-
 
1237
 
-
 
1238
    static {
-
 
1239
      FieldMetaData.addStructMetaDataMap(getLogisticsInfo_result.class, metaDataMap);
-
 
1240
    }
-
 
1241
 
-
 
1242
    public getLogisticsInfo_result() {
-
 
1243
    }
-
 
1244
 
-
 
1245
    public getLogisticsInfo_result(
-
 
1246
      LogisticsInfo success,
-
 
1247
      LogisticsServiceException se)
-
 
1248
    {
-
 
1249
      this();
-
 
1250
      this.success = success;
-
 
1251
      this.se = se;
-
 
1252
    }
-
 
1253
 
-
 
1254
    /**
-
 
1255
     * Performs a deep copy on <i>other</i>.
-
 
1256
     */
-
 
1257
    public getLogisticsInfo_result(getLogisticsInfo_result other) {
-
 
1258
      if (other.isSetSuccess()) {
-
 
1259
        this.success = new LogisticsInfo(other.success);
-
 
1260
      }
-
 
1261
      if (other.isSetSe()) {
-
 
1262
        this.se = new LogisticsServiceException(other.se);
-
 
1263
      }
-
 
1264
    }
-
 
1265
 
-
 
1266
    public getLogisticsInfo_result deepCopy() {
-
 
1267
      return new getLogisticsInfo_result(this);
-
 
1268
    }
-
 
1269
 
-
 
1270
    @Deprecated
-
 
1271
    public getLogisticsInfo_result clone() {
-
 
1272
      return new getLogisticsInfo_result(this);
-
 
1273
    }
-
 
1274
 
-
 
1275
    public LogisticsInfo getSuccess() {
-
 
1276
      return this.success;
-
 
1277
    }
-
 
1278
 
-
 
1279
    public getLogisticsInfo_result setSuccess(LogisticsInfo success) {
-
 
1280
      this.success = success;
-
 
1281
      return this;
-
 
1282
    }
-
 
1283
 
-
 
1284
    public void unsetSuccess() {
-
 
1285
      this.success = null;
-
 
1286
    }
-
 
1287
 
-
 
1288
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
1289
    public boolean isSetSuccess() {
-
 
1290
      return this.success != null;
-
 
1291
    }
-
 
1292
 
-
 
1293
    public void setSuccessIsSet(boolean value) {
-
 
1294
      if (!value) {
-
 
1295
        this.success = null;
-
 
1296
      }
-
 
1297
    }
-
 
1298
 
-
 
1299
    public LogisticsServiceException getSe() {
-
 
1300
      return this.se;
-
 
1301
    }
-
 
1302
 
-
 
1303
    public getLogisticsInfo_result setSe(LogisticsServiceException se) {
-
 
1304
      this.se = se;
-
 
1305
      return this;
-
 
1306
    }
-
 
1307
 
-
 
1308
    public void unsetSe() {
-
 
1309
      this.se = null;
-
 
1310
    }
-
 
1311
 
-
 
1312
    /** Returns true if field se is set (has been asigned a value) and false otherwise */
-
 
1313
    public boolean isSetSe() {
-
 
1314
      return this.se != null;
-
 
1315
    }
-
 
1316
 
-
 
1317
    public void setSeIsSet(boolean value) {
-
 
1318
      if (!value) {
-
 
1319
        this.se = null;
-
 
1320
      }
-
 
1321
    }
-
 
1322
 
-
 
1323
    public void setFieldValue(_Fields field, Object value) {
-
 
1324
      switch (field) {
-
 
1325
      case SUCCESS:
-
 
1326
        if (value == null) {
-
 
1327
          unsetSuccess();
-
 
1328
        } else {
-
 
1329
          setSuccess((LogisticsInfo)value);
-
 
1330
        }
-
 
1331
        break;
-
 
1332
 
-
 
1333
      case SE:
-
 
1334
        if (value == null) {
-
 
1335
          unsetSe();
-
 
1336
        } else {
-
 
1337
          setSe((LogisticsServiceException)value);
-
 
1338
        }
-
 
1339
        break;
-
 
1340
 
-
 
1341
      }
-
 
1342
    }
-
 
1343
 
-
 
1344
    public void setFieldValue(int fieldID, Object value) {
-
 
1345
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
1346
    }
-
 
1347
 
-
 
1348
    public Object getFieldValue(_Fields field) {
-
 
1349
      switch (field) {
-
 
1350
      case SUCCESS:
-
 
1351
        return getSuccess();
-
 
1352
 
-
 
1353
      case SE:
-
 
1354
        return getSe();
-
 
1355
 
-
 
1356
      }
-
 
1357
      throw new IllegalStateException();
-
 
1358
    }
-
 
1359
 
-
 
1360
    public Object getFieldValue(int fieldId) {
-
 
1361
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
1362
    }
-
 
1363
 
-
 
1364
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
1365
    public boolean isSet(_Fields field) {
-
 
1366
      switch (field) {
-
 
1367
      case SUCCESS:
-
 
1368
        return isSetSuccess();
-
 
1369
      case SE:
-
 
1370
        return isSetSe();
-
 
1371
      }
-
 
1372
      throw new IllegalStateException();
-
 
1373
    }
-
 
1374
 
-
 
1375
    public boolean isSet(int fieldID) {
-
 
1376
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
1377
    }
-
 
1378
 
-
 
1379
    @Override
-
 
1380
    public boolean equals(Object that) {
-
 
1381
      if (that == null)
-
 
1382
        return false;
-
 
1383
      if (that instanceof getLogisticsInfo_result)
-
 
1384
        return this.equals((getLogisticsInfo_result)that);
-
 
1385
      return false;
-
 
1386
    }
-
 
1387
 
-
 
1388
    public boolean equals(getLogisticsInfo_result that) {
-
 
1389
      if (that == null)
-
 
1390
        return false;
-
 
1391
 
-
 
1392
      boolean this_present_success = true && this.isSetSuccess();
-
 
1393
      boolean that_present_success = true && that.isSetSuccess();
-
 
1394
      if (this_present_success || that_present_success) {
-
 
1395
        if (!(this_present_success && that_present_success))
-
 
1396
          return false;
-
 
1397
        if (!this.success.equals(that.success))
-
 
1398
          return false;
-
 
1399
      }
-
 
1400
 
-
 
1401
      boolean this_present_se = true && this.isSetSe();
-
 
1402
      boolean that_present_se = true && that.isSetSe();
-
 
1403
      if (this_present_se || that_present_se) {
-
 
1404
        if (!(this_present_se && that_present_se))
-
 
1405
          return false;
-
 
1406
        if (!this.se.equals(that.se))
-
 
1407
          return false;
-
 
1408
      }
-
 
1409
 
-
 
1410
      return true;
-
 
1411
    }
-
 
1412
 
-
 
1413
    @Override
-
 
1414
    public int hashCode() {
-
 
1415
      return 0;
-
 
1416
    }
-
 
1417
 
-
 
1418
    public int compareTo(getLogisticsInfo_result other) {
-
 
1419
      if (!getClass().equals(other.getClass())) {
-
 
1420
        return getClass().getName().compareTo(other.getClass().getName());
-
 
1421
      }
-
 
1422
 
-
 
1423
      int lastComparison = 0;
-
 
1424
      getLogisticsInfo_result typedOther = (getLogisticsInfo_result)other;
-
 
1425
 
-
 
1426
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
1427
      if (lastComparison != 0) {
-
 
1428
        return lastComparison;
-
 
1429
      }
-
 
1430
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
1431
      if (lastComparison != 0) {
-
 
1432
        return lastComparison;
-
 
1433
      }
-
 
1434
      lastComparison = Boolean.valueOf(isSetSe()).compareTo(isSetSe());
-
 
1435
      if (lastComparison != 0) {
-
 
1436
        return lastComparison;
-
 
1437
      }
-
 
1438
      lastComparison = TBaseHelper.compareTo(se, typedOther.se);
-
 
1439
      if (lastComparison != 0) {
-
 
1440
        return lastComparison;
-
 
1441
      }
-
 
1442
      return 0;
-
 
1443
    }
-
 
1444
 
-
 
1445
    public void read(TProtocol iprot) throws TException {
-
 
1446
      TField field;
-
 
1447
      iprot.readStructBegin();
-
 
1448
      while (true)
-
 
1449
      {
-
 
1450
        field = iprot.readFieldBegin();
-
 
1451
        if (field.type == TType.STOP) { 
-
 
1452
          break;
-
 
1453
        }
-
 
1454
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
1455
        if (fieldId == null) {
-
 
1456
          TProtocolUtil.skip(iprot, field.type);
-
 
1457
        } else {
-
 
1458
          switch (fieldId) {
-
 
1459
            case SUCCESS:
-
 
1460
              if (field.type == TType.STRUCT) {
-
 
1461
                this.success = new LogisticsInfo();
-
 
1462
                this.success.read(iprot);
-
 
1463
              } else { 
-
 
1464
                TProtocolUtil.skip(iprot, field.type);
-
 
1465
              }
-
 
1466
              break;
-
 
1467
            case SE:
-
 
1468
              if (field.type == TType.STRUCT) {
-
 
1469
                this.se = new LogisticsServiceException();
-
 
1470
                this.se.read(iprot);
-
 
1471
              } else { 
-
 
1472
                TProtocolUtil.skip(iprot, field.type);
-
 
1473
              }
-
 
1474
              break;
-
 
1475
          }
-
 
1476
          iprot.readFieldEnd();
-
 
1477
        }
-
 
1478
      }
-
 
1479
      iprot.readStructEnd();
-
 
1480
      validate();
-
 
1481
    }
-
 
1482
 
-
 
1483
    public void write(TProtocol oprot) throws TException {
-
 
1484
      oprot.writeStructBegin(STRUCT_DESC);
-
 
1485
 
-
 
1486
      if (this.isSetSuccess()) {
-
 
1487
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
1488
        this.success.write(oprot);
-
 
1489
        oprot.writeFieldEnd();
-
 
1490
      } else if (this.isSetSe()) {
-
 
1491
        oprot.writeFieldBegin(SE_FIELD_DESC);
-
 
1492
        this.se.write(oprot);
-
 
1493
        oprot.writeFieldEnd();
-
 
1494
      }
-
 
1495
      oprot.writeFieldStop();
-
 
1496
      oprot.writeStructEnd();
-
 
1497
    }
-
 
1498
 
-
 
1499
    @Override
-
 
1500
    public String toString() {
-
 
1501
      StringBuilder sb = new StringBuilder("getLogisticsInfo_result(");
-
 
1502
      boolean first = true;
-
 
1503
 
-
 
1504
      sb.append("success:");
-
 
1505
      if (this.success == null) {
-
 
1506
        sb.append("null");
-
 
1507
      } else {
-
 
1508
        sb.append(this.success);
-
 
1509
      }
-
 
1510
      first = false;
-
 
1511
      if (!first) sb.append(", ");
-
 
1512
      sb.append("se:");
-
 
1513
      if (this.se == null) {
-
 
1514
        sb.append("null");
-
 
1515
      } else {
-
 
1516
        sb.append(this.se);
-
 
1517
      }
-
 
1518
      first = false;
-
 
1519
      sb.append(")");
-
 
1520
      return sb.toString();
-
 
1521
    }
-
 
1522
 
-
 
1523
    public void validate() throws TException {
-
 
1524
      // check for required fields
-
 
1525
    }
-
 
1526
 
-
 
1527
  }
-
 
1528
 
731
  public static class getLogisticsEstimation_args implements TBase<getLogisticsEstimation_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsEstimation_args>   {
1529
  public static class getLogisticsEstimation_args implements TBase<getLogisticsEstimation_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLogisticsEstimation_args>   {
732
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_args");
1530
    private static final TStruct STRUCT_DESC = new TStruct("getLogisticsEstimation_args");
733
 
1531
 
734
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)1);
1532
    private static final TField ITEM_ID_FIELD_DESC = new TField("itemId", TType.I64, (short)1);
735
    private static final TField DESTINATION_PIN_FIELD_DESC = new TField("destination_pin", TType.STRING, (short)2);
1533
    private static final TField DESTINATION_PIN_FIELD_DESC = new TField("destination_pin", TType.STRING, (short)2);