/** Marshall the given parameter object, and output to a JSONWriter */
  public void marshall(ItemCollectionMetrics itemCollectionMetrics, JSONWriter jsonWriter) {
    if (itemCollectionMetrics == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    try {
      jsonWriter.object();

      java.util.Map<String, AttributeValue> itemCollectionKeyMap =
          itemCollectionMetrics.getItemCollectionKey();
      if (itemCollectionKeyMap != null) {
        jsonWriter.key("ItemCollectionKey");
        jsonWriter.object();

        for (Map.Entry<String, AttributeValue> itemCollectionKeyMapValue :
            itemCollectionKeyMap.entrySet()) {
          if (itemCollectionKeyMapValue.getValue() != null) {
            jsonWriter.key(itemCollectionKeyMapValue.getKey());

            AttributeValueJsonMarshaller.getInstance()
                .marshall(itemCollectionKeyMapValue.getValue(), jsonWriter);
          }
        }
        jsonWriter.endObject();
      }

      java.util.List<Double> sizeEstimateRangeGBList =
          itemCollectionMetrics.getSizeEstimateRangeGB();
      if (sizeEstimateRangeGBList != null) {
        jsonWriter.key("SizeEstimateRangeGB");
        jsonWriter.array();
        for (Double sizeEstimateRangeGBListValue : sizeEstimateRangeGBList) {
          if (sizeEstimateRangeGBListValue != null) {
            jsonWriter.value(sizeEstimateRangeGBListValue);
          }
        }
        jsonWriter.endArray();
      }

      jsonWriter.endObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }
  public ItemCollectionMetrics unmarshall(JsonUnmarshallerContext context) throws Exception {
    ItemCollectionMetrics itemCollectionMetrics = new ItemCollectionMetrics();

    AwsJsonReader reader = context.getReader();
    reader.beginObject();
    while (reader.hasNext()) {
      String name = reader.nextName();

      if (name.equals("ItemCollectionKey")) {
        itemCollectionMetrics.setItemCollectionKey(
            new MapUnmarshaller<AttributeValue>(AttributeValueJsonUnmarshaller.getInstance())
                .unmarshall(context));
      } else if (name.equals("SizeEstimateRangeGB")) {
        itemCollectionMetrics.setSizeEstimateRangeGB(
            new ListUnmarshaller<Double>(DoubleJsonUnmarshaller.getInstance()).unmarshall(context));
      } else {
        reader.skipValue();
      }
    }
    reader.endObject();

    return itemCollectionMetrics;
  }