コード例 #1
0
  public Request<PutIdentityPolicyRequest> marshall(
      PutIdentityPolicyRequest putIdentityPolicyRequest) {

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

    Request<PutIdentityPolicyRequest> request =
        new DefaultRequest<PutIdentityPolicyRequest>(
            putIdentityPolicyRequest, "AmazonSimpleEmailService");
    request.addParameter("Action", "PutIdentityPolicy");
    request.addParameter("Version", "2010-12-01");
    request.setHttpMethod(HttpMethodName.POST);

    if (putIdentityPolicyRequest.getIdentity() != null) {
      request.addParameter(
          "Identity", StringUtils.fromString(putIdentityPolicyRequest.getIdentity()));
    }

    if (putIdentityPolicyRequest.getPolicyName() != null) {
      request.addParameter(
          "PolicyName", StringUtils.fromString(putIdentityPolicyRequest.getPolicyName()));
    }

    if (putIdentityPolicyRequest.getPolicy() != null) {
      request.addParameter("Policy", StringUtils.fromString(putIdentityPolicyRequest.getPolicy()));
    }

    return request;
  }
コード例 #2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof PutIdentityPolicyRequest == false) return false;
    PutIdentityPolicyRequest other = (PutIdentityPolicyRequest) obj;
    if (other.getIdentity() == null ^ this.getIdentity() == null) return false;
    if (other.getIdentity() != null && other.getIdentity().equals(this.getIdentity()) == false)
      return false;
    if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false;
    if (other.getPolicyName() != null
        && other.getPolicyName().equals(this.getPolicyName()) == false) return false;
    if (other.getPolicy() == null ^ this.getPolicy() == null) return false;
    if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == false)
      return false;
    return true;
  }