@Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof ListVolumesRequest == false) return false;
    ListVolumesRequest other = (ListVolumesRequest) obj;

    if (other.getGatewayARN() == null ^ this.getGatewayARN() == null) return false;
    if (other.getGatewayARN() != null
        && other.getGatewayARN().equals(this.getGatewayARN()) == false) return false;
    if (other.getMarker() == null ^ this.getMarker() == null) return false;
    if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false)
      return false;
    if (other.getLimit() == null ^ this.getLimit() == null) return false;
    if (other.getLimit() != null && other.getLimit().equals(this.getLimit()) == false) return false;
    return true;
  }
  public Request<ListVolumesRequest> marshall(ListVolumesRequest listVolumesRequest) {
    if (listVolumesRequest == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    Request<ListVolumesRequest> request =
        new DefaultRequest<ListVolumesRequest>(listVolumesRequest, "AWSStorageGateway");
    String target = "StorageGateway_20130630.ListVolumes";
    request.addHeader("X-Amz-Target", target);

    request.setHttpMethod(HttpMethodName.POST);
    request.setResourcePath("");

    try {
      StringWriter stringWriter = new StringWriter();
      JSONWriter jsonWriter = new JSONWriter(stringWriter);

      jsonWriter.object();

      if (listVolumesRequest.getGatewayARN() != null) {
        jsonWriter.key("GatewayARN").value(listVolumesRequest.getGatewayARN());
      }
      if (listVolumesRequest.getMarker() != null) {
        jsonWriter.key("Marker").value(listVolumesRequest.getMarker());
      }
      if (listVolumesRequest.getLimit() != null) {
        jsonWriter.key("Limit").value(listVolumesRequest.getLimit());
      }

      jsonWriter.endObject();

      String snippet = stringWriter.toString();
      byte[] content = snippet.getBytes(UTF8);
      request.setContent(new StringInputStream(snippet));
      request.addHeader("Content-Length", Integer.toString(content.length));
      request.addHeader("Content-Type", "application/x-amz-json-1.1");
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }