public UpdateCloudFrontOriginAccessIdentityResult unmarshall(StaxUnmarshallerContext context)
      throws Exception {
    UpdateCloudFrontOriginAccessIdentityResult updateCloudFrontOriginAccessIdentityResult =
        new UpdateCloudFrontOriginAccessIdentityResult();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) {
      updateCloudFrontOriginAccessIdentityResult.setETag(context.getHeader("ETag"));
    }

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return updateCloudFrontOriginAccessIdentityResult;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("CloudFrontOriginAccessIdentity", targetDepth)) {
          updateCloudFrontOriginAccessIdentityResult.setCloudFrontOriginAccessIdentity(
              CloudFrontOriginAccessIdentityStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return updateCloudFrontOriginAccessIdentityResult;
        }
      }
    }
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

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

    if (other.getCloudFrontOriginAccessIdentity() == null
        ^ this.getCloudFrontOriginAccessIdentity() == null) return false;
    if (other.getCloudFrontOriginAccessIdentity() != null
        && other
                .getCloudFrontOriginAccessIdentity()
                .equals(this.getCloudFrontOriginAccessIdentity())
            == false) return false;
    if (other.getETag() == null ^ this.getETag() == null) return false;
    if (other.getETag() != null && other.getETag().equals(this.getETag()) == false) return false;
    return true;
  }