public Request<DescribeInstanceAttributeRequest> marshall(
      DescribeInstanceAttributeRequest describeInstanceAttributeRequest) {

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

    Request<DescribeInstanceAttributeRequest> request =
        new DefaultRequest<DescribeInstanceAttributeRequest>(
            describeInstanceAttributeRequest, "AmazonEC2");
    request.addParameter("Action", "DescribeInstanceAttribute");
    request.addParameter("Version", "2015-10-01");
    request.setHttpMethod(HttpMethodName.POST);

    if (describeInstanceAttributeRequest.getInstanceId() != null) {
      request.addParameter(
          "InstanceId", StringUtils.fromString(describeInstanceAttributeRequest.getInstanceId()));
    }

    if (describeInstanceAttributeRequest.getAttribute() != null) {
      request.addParameter(
          "Attribute", StringUtils.fromString(describeInstanceAttributeRequest.getAttribute()));
    }

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

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

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