code: public Map<String, Object> getJsonMap() {
          Map<String, Object> map = new LinkedHashMap<>();
          
          map.put("type", gComplex!=null && gComplex.isLeft()? "duration":"period");
          if (gComplex != null) {
              if (gComplex.isLeft()) {
                  map.put("duration", gComplex.left().get());
              } else {
                  map.put("period", gComplex.right().get());
              }
              if (origin != null) {
                  map.put("origin", origin);
              }
              if (timeZone != null) {
                  map.put("timeZone", timeZone);
              }
          }
          return map;
      }
docs: Basic type when granularity is just string is taken care in QueryMeta class.
  For duration and period types we get Json from here.
  @return