/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.servicediscovery.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetInstancesHealthStatusRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The ID of the service that the instance is associated with. *
*/ private String serviceId; /** ** An array that contains the IDs of all the instances that you want to get the health status for. *
*
* If you omit Instances
, Cloud Map returns the health status for all the instances that are associated
* with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
*
* The maximum number of instances that you want Cloud Map to return in the response to a
* GetInstancesHealthStatus
request. If you don't specify a value for MaxResults
, Cloud
* Map returns up to 100 instances.
*
* For the first GetInstancesHealthStatus
request, omit this value.
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*
* The ID of the service that the instance is associated with. *
* * @param serviceId * The ID of the service that the instance is associated with. */ public void setServiceId(String serviceId) { this.serviceId = serviceId; } /** ** The ID of the service that the instance is associated with. *
* * @return The ID of the service that the instance is associated with. */ public String getServiceId() { return this.serviceId; } /** ** The ID of the service that the instance is associated with. *
* * @param serviceId * The ID of the service that the instance is associated with. * @return Returns a reference to this object so that method calls can be chained together. */ public GetInstancesHealthStatusRequest withServiceId(String serviceId) { setServiceId(serviceId); return this; } /** ** An array that contains the IDs of all the instances that you want to get the health status for. *
*
* If you omit Instances
, Cloud Map returns the health status for all the instances that are associated
* with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
*
* If you omit Instances
, Cloud Map returns the health status for all the instances that are
* associated with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
*/ public java.util.List* An array that contains the IDs of all the instances that you want to get the health status for. *
*
* If you omit Instances
, Cloud Map returns the health status for all the instances that are associated
* with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
*
* If you omit Instances
, Cloud Map returns the health status for all the instances that are
* associated with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
*/ public void setInstances(java.util.Collection* An array that contains the IDs of all the instances that you want to get the health status for. *
*
* If you omit Instances
, Cloud Map returns the health status for all the instances that are associated
* with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setInstances(java.util.Collection)} or {@link #withInstances(java.util.Collection)} if you want to * override the existing values. *
* * @param instances * An array that contains the IDs of all the instances that you want to get the health status for. *
* If you omit Instances
, Cloud Map returns the health status for all the instances that are
* associated with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
* @return Returns a reference to this object so that method calls can be chained together. */ public GetInstancesHealthStatusRequest withInstances(String... instances) { if (this.instances == null) { setInstances(new java.util.ArrayList* An array that contains the IDs of all the instances that you want to get the health status for. *
*
* If you omit Instances
, Cloud Map returns the health status for all the instances that are associated
* with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
*
* If you omit Instances
, Cloud Map returns the health status for all the instances that are
* associated with the specified service.
*
* To get the IDs for the instances that you've registered by using a specified service, submit a ListInstances request. *
* @return Returns a reference to this object so that method calls can be chained together. */ public GetInstancesHealthStatusRequest withInstances(java.util.Collection
* The maximum number of instances that you want Cloud Map to return in the response to a
* GetInstancesHealthStatus
request. If you don't specify a value for MaxResults
, Cloud
* Map returns up to 100 instances.
*
GetInstancesHealthStatus
request. If you don't specify a value for MaxResults
,
* Cloud Map returns up to 100 instances.
*/
public void setMaxResults(Integer maxResults) {
this.maxResults = maxResults;
}
/**
*
* The maximum number of instances that you want Cloud Map to return in the response to a
* GetInstancesHealthStatus
request. If you don't specify a value for MaxResults
, Cloud
* Map returns up to 100 instances.
*
GetInstancesHealthStatus
request. If you don't specify a value for MaxResults
,
* Cloud Map returns up to 100 instances.
*/
public Integer getMaxResults() {
return this.maxResults;
}
/**
*
* The maximum number of instances that you want Cloud Map to return in the response to a
* GetInstancesHealthStatus
request. If you don't specify a value for MaxResults
, Cloud
* Map returns up to 100 instances.
*
GetInstancesHealthStatus
request. If you don't specify a value for MaxResults
,
* Cloud Map returns up to 100 instances.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetInstancesHealthStatusRequest withMaxResults(Integer maxResults) {
setMaxResults(maxResults);
return this;
}
/**
*
* For the first GetInstancesHealthStatus
request, omit this value.
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*
GetInstancesHealthStatus
request, omit this value.
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* For the first GetInstancesHealthStatus
request, omit this value.
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*
GetInstancesHealthStatus
request, omit this value.
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* For the first GetInstancesHealthStatus
request, omit this value.
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
*
GetInstancesHealthStatus
request, omit this value.
*
* If more than MaxResults
instances match the specified criteria, you can submit another
* GetInstancesHealthStatus
request to get the next group of results. Specify the value of
* NextToken
from the previous response in the next request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetInstancesHealthStatusRequest withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getServiceId() != null)
sb.append("ServiceId: ").append(getServiceId()).append(",");
if (getInstances() != null)
sb.append("Instances: ").append(getInstances()).append(",");
if (getMaxResults() != null)
sb.append("MaxResults: ").append(getMaxResults()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetInstancesHealthStatusRequest == false)
return false;
GetInstancesHealthStatusRequest other = (GetInstancesHealthStatusRequest) obj;
if (other.getServiceId() == null ^ this.getServiceId() == null)
return false;
if (other.getServiceId() != null && other.getServiceId().equals(this.getServiceId()) == false)
return false;
if (other.getInstances() == null ^ this.getInstances() == null)
return false;
if (other.getInstances() != null && other.getInstances().equals(this.getInstances()) == false)
return false;
if (other.getMaxResults() == null ^ this.getMaxResults() == null)
return false;
if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getServiceId() == null) ? 0 : getServiceId().hashCode());
hashCode = prime * hashCode + ((getInstances() == null) ? 0 : getInstances().hashCode());
hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
return hashCode;
}
@Override
public GetInstancesHealthStatusRequest clone() {
return (GetInstancesHealthStatusRequest) super.clone();
}
}