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

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

    if (other.getCheckId() == null ^ this.getCheckId() == null) return false;
    if (other.getCheckId() != null && other.getCheckId().equals(this.getCheckId()) == false)
      return false;
    if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false;
    if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false)
      return false;
    if (other.getStatus() == null ^ this.getStatus() == null) return false;
    if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
      return false;
    if (other.getResourcesSummary() == null ^ this.getResourcesSummary() == null) return false;
    if (other.getResourcesSummary() != null
        && other.getResourcesSummary().equals(this.getResourcesSummary()) == false) return false;
    if (other.getCategorySpecificSummary() == null ^ this.getCategorySpecificSummary() == null)
      return false;
    if (other.getCategorySpecificSummary() != null
        && other.getCategorySpecificSummary().equals(this.getCategorySpecificSummary()) == false)
      return false;
    if (other.getFlaggedResources() == null ^ this.getFlaggedResources() == null) return false;
    if (other.getFlaggedResources() != null
        && other.getFlaggedResources().equals(this.getFlaggedResources()) == false) return false;
    return true;
  }
  /** Marshall the given parameter object, and output to a JSONWriter */
  public void marshall(TrustedAdvisorCheckResult trustedAdvisorCheckResult, JSONWriter jsonWriter) {
    if (trustedAdvisorCheckResult == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    try {
      jsonWriter.object();

      if (trustedAdvisorCheckResult.getCheckId() != null) {
        jsonWriter.key("checkId").value(trustedAdvisorCheckResult.getCheckId());
      }

      if (trustedAdvisorCheckResult.getTimestamp() != null) {
        jsonWriter.key("timestamp").value(trustedAdvisorCheckResult.getTimestamp());
      }

      if (trustedAdvisorCheckResult.getStatus() != null) {
        jsonWriter.key("status").value(trustedAdvisorCheckResult.getStatus());
      }

      if (trustedAdvisorCheckResult.getResourcesSummary() != null) {
        jsonWriter.key("resourcesSummary");
        TrustedAdvisorResourcesSummaryJsonMarshaller.getInstance()
            .marshall(trustedAdvisorCheckResult.getResourcesSummary(), jsonWriter);
      }

      if (trustedAdvisorCheckResult.getCategorySpecificSummary() != null) {
        jsonWriter.key("categorySpecificSummary");
        TrustedAdvisorCategorySpecificSummaryJsonMarshaller.getInstance()
            .marshall(trustedAdvisorCheckResult.getCategorySpecificSummary(), jsonWriter);
      }

      com.amazonaws.internal.SdkInternalList<TrustedAdvisorResourceDetail> flaggedResourcesList =
          (com.amazonaws.internal.SdkInternalList<TrustedAdvisorResourceDetail>)
              trustedAdvisorCheckResult.getFlaggedResources();
      if (!flaggedResourcesList.isEmpty() || !flaggedResourcesList.isAutoConstruct()) {
        jsonWriter.key("flaggedResources");
        jsonWriter.array();
        for (TrustedAdvisorResourceDetail flaggedResourcesListValue : flaggedResourcesList) {
          if (flaggedResourcesListValue != null) {

            TrustedAdvisorResourceDetailJsonMarshaller.getInstance()
                .marshall(flaggedResourcesListValue, jsonWriter);
          }
        }
        jsonWriter.endArray();
      }

      jsonWriter.endObject();
    } catch (Throwable t) {
      throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);
    }
  }