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

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

    if (other.getDomain() == null ^ this.getDomain() == null) return false;
    if (other.getDomain() != null && other.getDomain().equals(this.getDomain()) == false)
      return false;
    if (other.getWorkflowId() == null ^ this.getWorkflowId() == null) return false;
    if (other.getWorkflowId() != null
        && other.getWorkflowId().equals(this.getWorkflowId()) == false) return false;
    if (other.getRunId() == null ^ this.getRunId() == null) return false;
    if (other.getRunId() != null && other.getRunId().equals(this.getRunId()) == false) return false;
    return true;
  }
  public Request<RequestCancelWorkflowExecutionRequest> marshall(
      RequestCancelWorkflowExecutionRequest requestCancelWorkflowExecutionRequest) {

    if (requestCancelWorkflowExecutionRequest == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    Request<RequestCancelWorkflowExecutionRequest> request =
        new DefaultRequest<RequestCancelWorkflowExecutionRequest>(
            requestCancelWorkflowExecutionRequest, "AmazonSimpleWorkflow");
    request.addHeader("X-Amz-Target", "SimpleWorkflowService.RequestCancelWorkflowExecution");

    request.setHttpMethod(HttpMethodName.POST);

    request.setResourcePath("");

    try {
      final StructuredJsonGenerator jsonGenerator = protocolFactory.createGenerator();

      jsonGenerator.writeStartObject();

      if (requestCancelWorkflowExecutionRequest.getDomain() != null) {
        jsonGenerator
            .writeFieldName("domain")
            .writeValue(requestCancelWorkflowExecutionRequest.getDomain());
      }
      if (requestCancelWorkflowExecutionRequest.getWorkflowId() != null) {
        jsonGenerator
            .writeFieldName("workflowId")
            .writeValue(requestCancelWorkflowExecutionRequest.getWorkflowId());
      }
      if (requestCancelWorkflowExecutionRequest.getRunId() != null) {
        jsonGenerator
            .writeFieldName("runId")
            .writeValue(requestCancelWorkflowExecutionRequest.getRunId());
      }

      jsonGenerator.writeEndObject();

      byte[] content = jsonGenerator.getBytes();
      request.setContent(new ByteArrayInputStream(content));
      request.addHeader("Content-Length", Integer.toString(content.length));
      request.addHeader("Content-Type", protocolFactory.getContentType());
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }

    return request;
  }